|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////5 V& a o- [/ _
// Theme Option
- X. O) s( s+ ^( U9 a: ]////////////////////////////////////////////////////////////////////////////////
$ A6 M) d5 g' E; y# P( B+ M! j' c
$themename = "Zenx";* b1 u, X S$ }& n" Q. `1 f
$shortname = str_replace(' ', '_', strtolower($themename));' ~& E# i" T5 h2 W) O+ Z3 Y) f/ R( e
+ a4 q' Y1 }8 g5 {1 o6 r+ V0 S
function get_theme_option($option)6 J& s0 j9 M- M& F, N4 |/ |
{' ]8 f- x6 L& ^3 f
global $shortname;
; ?9 m. w2 w4 \0 E5 t1 R' z* o return stripslashes(get_option($shortname . '_' . $option));9 u( d Q' y* W7 p6 Z* g( y
}, ~9 n1 F, w: Z% c: s
! ]' M4 K. X$ u M7 F6 n* }
function get_theme_settings($option)
% [; g6 U+ A6 ~; c3 x$ ]{8 f# v+ v8 |0 }% ~( l4 `; |- H/ G
return stripslashes(get_option($option)); g1 i% w; r1 w' @7 p
}; F+ P1 J* B) |1 R. G: @
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
' g- H. O# _6 p$wp_getcat = array();5 q- l/ r7 B# Z7 r
foreach ($wp_dropdown_rd_admin as $category_list) {
' n8 l; R) W- W5 p3 K3 @$wp_getcat[$category_list->term_id] = $category_list->name;4 L3 N4 v* N$ F
}9 W! i0 Y o7 M3 }: h+ L# \" J
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");8 h% g& y+ w: _2 C
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
" m: `0 X! v' M+ f; p# b) {# k2 U2 }$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
6 V- |* E$ a, ]. y7 N- R& z) G8 {" Z! ^
$options = array (
1 ~3 [( G& B, {* i, D5 z: }. ?9 p- ^, n8 P, e
' D( P, T# x3 V m/ h$ {: _+ Q array( "name" => "Blog Header Settings",3 N0 M9 M& \( K5 w5 w
"type" => "heading",
2 ?0 y9 q: N1 D& V2 v H# v ),2 w. I, I& L( I* e* a% P3 s; I4 T
: o: f9 J, y! m. q- p& u1 I array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& F( C2 S3 n3 M( x) m "id" => $shortname."_header_logo_activate",
4 Y% Z( O0 h: V6 ^ "type" => "select",
s- ]. P p6 F) _' j "std" => "No",
: d( Q2 ?7 F$ J! d" Y* \4 t5 T "options" => array("No", "Yes")),
o5 U% F, `6 S% K& o/ i1 `
% @! o2 q! L6 a9 o1 D! b3 { array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",# _/ @7 L7 T: r/ w. t6 q& p# B7 N
"id" => $shortname."_logo_url",
- {- R- K" y# K7 b4 N2 x "type" => "text",9 s( @% N5 B: t0 a X1 Q: s ^
"box" => "social",6 r6 E& r( A1 j
"std" => "",
; `1 k9 M/ X2 r' W8 X- k- O )," V: P2 x. t6 R
- c, T/ M) G( r8 t- b* ]3 j4 J. v
array( "name" => "Insert Header Banner HTML Code (Header)
+ A7 R" d4 t; O( E* Q }! i <br /><em>*Recommended Size 468 x 60</em>$ R; \7 A; Q; W. D- R2 i
<br /><em>*leave blank if not use</em>",7 J% H7 s. U& h
"id" => $shortname."_header_banner",
/ y. d4 N$ ]. ~ "type" => "textarea",/ t7 H5 s H; `0 }
"std" => "",: @- b, ]' k; S% C; N" {* g
),
; K( u) N3 m/ i( g+ u6 Y7 w8 Q5 [
array( "name" => "</div></div>",4 J: A9 Q$ ~- {
"type" => "close",# P0 g9 n/ H9 O* ?; v. S+ f' X
),
0 l1 C( ?5 v# e9 m9 D& h" h! x R. @7 ^8 p4 Z
* M% W1 V# [6 w. J+ w6 j: ^! c array( "name" => "Header Navigation Settings",$ E2 ~2 ^- z; D1 ~
"type" => "heading",9 z8 h/ W1 H- d$ z0 Q
),% I4 R0 H2 a+ P! K, ?, f
6 X7 c- u1 d# c K+ }( l
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />4 K1 j+ O, B6 d
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />5 {! i a: D8 F
<em>*Enter the page post ID number only</em><br />+ f9 \1 v r& i
<em>*separate by comma</em><br />
6 y% T; K: _7 ^4 W: Y/ F <em>*Exclude pages which you don't want to show on the header navigation</em>",# ?9 v) v( K+ A6 v
"id" => $shortname."_header_page_navigation",% L5 L+ O3 L2 s9 T$ q2 D. b
"type" => "text",: O4 j* \/ q- e) D0 T/ ^
"std" => "",* S8 Z" X% w2 Z! @2 C4 r
),
. U; Z" t I+ W. H" \$ o# L6 B/ O& z, T
array( "name" => "</div></div>",* G# j/ j( D7 I# E6 @) {
"type" => "close",& Z6 S: r5 b" V: h; D1 _
),
$ T5 x; C0 M8 e& v% i4 U# w + t1 u! q% K) b! o
. d3 y$ B; W* F, c8 i0 E array( "name" => "Post Auto Thumbnails Settings",
- P/ y0 Y" `3 ?* l2 a "type" => "heading",- T% k% K, k2 n% j. ~
),8 s3 y# f5 C/ }- Z( V* T
5 j4 ~; [* y- }& s2 N+ d& G5 i
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, P8 ~$ |7 X: j "id" => $shortname."_timthumb_activate",
6 P' F5 I! m- C$ G# Y2 z "type" => "select",
% C/ u! W- \( X" J1 {5 ~+ @ "std" => "No",
" p: V, v; H2 Q" [0 F* L- m "options" => array("No", "Yes")),
0 f4 ^( d! _, J0 K 1 g' q* Z/ r, I
array( "name" => "If Timthumb is enabled, Please choose its cropping method",8 J6 N) L {6 b7 N
"id" => $shortname."_timthumb_cropping",/ }# ~4 ]+ s, T/ V: P- D
"type" => "select",3 _, z1 ^$ y7 a* H: h& @
"std" => "",! j, _, m3 h8 C7 q4 }% }
"options" => $crop_position),/ W# c6 }% M2 q$ g% G' Z, F
' X8 q; x. Z3 \6 o- p4 A# c
array( "name" => "Insert Width Of Thumbnail Image<br />
- c8 c& R( t" d$ ~ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />! z5 h' q( U% W& Y
<em>*Leave Blank To Use Default: 250</em><br />",
# _+ D( w: Q1 ^/ ^ "id" => $shortname."_thumb_width",; z6 b7 F+ f& T. G+ M9 b; X# H( Y
"type" => "text",& V. W' a6 P N3 J) H
"std" => "",
$ v4 w$ t( y' _0 X1 x5 m8 a )," l. c0 x3 M* V
: g2 P- E+ q Q4 S% ? E array( "name" => "Insert Height Of Thumbnail Image<br />" P& C3 ~! e6 @8 w
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
6 |" Q. C. W1 N6 r h5 F4 x# [ <em>*Leave Blank To Use Default: 200</em><br />",
! E, g0 D, _/ m& |# F9 G "id" => $shortname."_thumb_height",
. D% u) N- i/ C7 R% {1 U% l) M. q "type" => "text",
5 I( ?0 X# h- t3 N) }8 K( K "std" => "",
8 B. Y/ V7 h4 L# E0 j ),
, h! x! P. _& ~$ O9 D% l2 a( P/ p4 ^5 y2 U
array( "name" => "</div></div>",/ a1 X/ H! B# @9 d O' u4 `
"type" => "close",
7 _: ~7 S3 M- Q5 l+ B# v' y i ),
3 p* V) h' j- `0 m
3 f( h, ]: P# L' o6 r2 o2 F array( "name" => "Featured Content Slider Settings",
6 A+ \7 d; D! k, Q, Y: d "type" => "heading",
+ }- _# S' ^" B( `- n: J ),
! j5 @( F! I c/ c# D! D
' ?1 Z) ^! f% v array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
) h* [. q1 a: d* I& a/ J2 X, _; E! E+ D% P "id" => $shortname."_featured_activate",
" B" V' n. D# v6 \/ |8 r9 S "type" => "select",5 E- C! g; Q/ j: z: M
"std" => "No",
8 ^) M6 O7 H1 l4 G% [+ A! M "options" => array("No", "Yes")),
) H( u( s5 q- j2 Y- J) ]. k/ ]% J- [/ |0 O; v) C0 W8 @ B
0 y# L1 F. Q7 p" Y E
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",8 O( a* y( t( D& H" p
"id" => $shortname."_featured_category",$ D: F( f- I) M7 c- j h' s) L0 h) }
"type" => "select",
! z3 K/ L( M( n "std" => "Choose a category:",5 E2 i1 \7 v) B: _8 ~$ p
"options" => $wp_getcat),
% i Q2 m# _+ M3 t% _. v/ g2 u4 V* w. x' I/ r
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",1 _; T% j1 L! J3 n u( r
"id" => $shortname."_featured_number",: H7 k3 t8 {7 }8 b: C! ?8 c9 O, G
"type" => "select",# K- z) p" d: V5 O' ~
"std" => "Number of post:",3 Z2 u2 l0 I0 W- l
"options" => $number_entries),% X l6 l* t1 ]4 E' r* I- c1 }3 ]
0 f; J3 {. ] N3 ]# y/ v1 u+ F array( "name" => "</div></div>",$ R* t0 y* n1 K$ k# z& {, N) Q
"type" => "close",
) v( n- ?/ t) ]7 O# l" X ),
9 S1 z: ^. B) B- Y) D1 M, J! ?9 @& g
* G+ u0 Q& T* V! x* j# W# F/ n array( "name" => "Featured Category Settings",; M/ G O* g5 `. i
"type" => "heading",; B5 o4 X% G1 `0 A6 B" x8 d
),
( o" H' n9 Q% ~0 [
0 l% z$ @4 Z# C4 o0 c( X array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",6 v+ t' Q5 \8 G
"id" => $shortname."_featured_category_activate",# @- f. E+ q" h' l! B
"type" => "select",
; \" [2 G/ z$ R! t5 [( k3 l9 v* q "std" => "No",
6 g3 I3 ?- D( Q, x "options" => array("No", "Yes")),
' g$ z! \3 S# G: p
/ j, s n) K- R( u) p! p4 X0 E array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",! b; G$ \" |4 `/ I% e
"id" => $shortname."_featured_category_id1",
A' A! h; `1 P q+ {0 `/ N6 G E "type" => "select",
. j+ R- ?; d# a: }) A7 _9 N "std" => "Choose a category:",4 b9 z, w* K$ x8 M, D
"options" => $wp_getcat),. n. _/ n. E2 _; F9 w/ x
$ z, c' S8 N3 n array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",. M) |1 i5 j& R
"id" => $shortname."_featured_number1",' e8 b9 L: p4 E
"type" => "select",% b5 R' f0 a. l
"std" => "Number of post:",
* ?0 N* R8 t7 M1 @! ]3 g "options" => $number_entries),
% V; e- C; j1 y }" G ; X$ T, u2 ^# x. h* W
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",3 h) j7 r! ^1 @& P
"id" => $shortname."_featured_category_id2",
+ f/ q* m6 L: Q "type" => "select",0 {, z+ L/ L3 t7 T' o W
"std" => "Choose a category:",
3 r: `+ O0 S/ M( ` "options" => $wp_getcat),& q/ m7 {; g# _* t4 A1 X
; s: t' O h% a) d4 b array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
& `! h" Y! i+ o& }' N "id" => $shortname."_featured_number2",8 O3 K# z: u- ^, r# ^
"type" => "select",4 n; O5 A; f4 P. D E& s' k
"std" => "Number of post:",
+ M8 j5 U. q! G& J "options" => $number_entries),
" u2 F) i5 b8 t- L0 u- ~6 E8 E. y/ J5 \ ' ~# t1 Y7 [+ i4 v. o7 _
( e# t; M& ]2 b$ Q8 d array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",! P0 ~$ U3 u @+ I& q. S: d; P
"id" => $shortname."_featured_category_id3",; _% ^1 _, f7 _
"type" => "select",# T( V$ m0 ]9 q1 {
"std" => "Choose a category:",# ]6 I! {2 W; s ~* O
"options" => $wp_getcat),
- Y* j! L w2 v' k9 i
( [% y* \5 v' K7 g9 R array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
2 k* `+ d; R7 ]8 l6 K$ K. x "id" => $shortname."_featured_number3",
( C! F9 t9 c9 R6 r1 e, o; F "type" => "select",
4 O$ R/ K5 r! K% t "std" => "Number of post:",7 e/ T, C& J i2 ?# I0 s
"options" => $number_entries),4 w$ w; m% C* O* j0 L, H
8 k& l& ~& j* S& X: h$ m' c& D
array( "name" => "</div></div>", `$ q. d8 j7 z% _7 ~1 t
"type" => "close",
" o7 `- F* p7 m ),4 U( `3 D' X. p4 _( P; N1 i/ `
$ s6 @; l0 `3 A* y
4 N: L4 a( p% B. @- ]0 |- }- w1 p array( "name" => "Google Adsense & Analytics Settings",- i0 J6 Z; J, z: C- ?
"type" => "heading"," |7 i, f" K3 @) k l
),5 A c5 X( o* h+ C
: q5 m) z. z0 z& [ [, [9 D array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
, x$ k" r, H! N, i "id" => $shortname."_adsense_loop_activate",& e. X, T4 z; F+ J( G- O
"type" => "select",
8 A6 t/ R3 q# V! N3 e' b "std" => "Disable",, h n5 v/ g5 }& E2 Y, F7 h
"options" => array("Disable", "Enable")),4 h8 T" S% P* p% D+ }
: I/ W J- V$ S' ~ array( "name" => "Insert Google Adsense Code For Loops Here<br />" ]; h& d! |9 s) z8 w
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
0 n9 q( ]0 t2 n X2 ` a "id" => $shortname."_adsense_loop",. s6 m4 i& v. H' ?: w
"type" => "textarea",) L0 q! C1 e8 {& W+ I
"std" => "",
6 N4 _; R( l! _ ),: N* \) v) p4 p. G/ M4 M' M
8 h( |7 Q @( ~, u8 l2 ?5 G array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
9 @. R% r# {+ M$ q3 C, R' D "id" => $shortname."_adsense_single_activate",! S$ |5 _4 Y8 ~- _' E$ ]+ q
"type" => "select",
* K! p! |0 m1 {" I% B7 b5 h "std" => "Disable", M# j. U0 k7 o5 m( _; H j A
"options" => array("Disable", "Enable")),5 Y" S+ ~5 B( W
# ]6 e* K+ c! d/ ]0 H- W8 w6 z0 X
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
2 {) N4 F9 C! n. N <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",6 u' w2 f% b- S- s4 ~' L4 P
"id" => $shortname."_adsense_single",
# I: h! Y3 i5 o/ |# E* ` "type" => "textarea",# {. P: m+ F& a* \! x7 r
"std" => "",8 A, k& O3 i. d- x2 P% d* p! l
),
R. i. ~2 D1 P4 {1 N! T
3 g, l$ C$ s* [) r) b* I* K& m& Q4 _" C( |- C, k( u. W$ [
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",( U2 M2 O' H# @& }4 ^1 I
"id" => $shortname."_google_analytics",
7 O2 }7 N5 C( T. }( B- S5 a "type" => "textarea",7 m9 j- q) b: h" C& C. M* O
"std" => "",4 x$ G7 ]) ]# ]* }2 K
),6 [& p- |, K; c- X+ u/ K
6 D' k0 F: a! S+ H+ a( i }7 g
array( "name" => "</div></div>", j! w) F# r' M7 P9 R; A
"type" => "close",+ m/ X* ~8 ^- Y- }
),( j3 }4 W- a7 _2 E% }
) f& A6 M# r9 S5 d# A + _+ r' _6 j5 u( r: e6 B
array( "name" => "AddThis Social Bookmarking Settings", u; ~6 \) w1 r
"type" => "heading",0 s6 H" Y9 y8 d
),
/ e+ f) @7 X. j; B& r( {" g/ I% E0 L: R7 I5 c" s6 f/ N" A
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>) h& t8 r# E6 s1 E
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
7 Q% X9 q2 X- ^2 i "id" => $shortname."_addthis",* d$ {. n! \$ X: y4 G# @1 _ x
"type" => "text", y0 K0 Y) @, |$ h9 E" a
"box" => "social",: H) l: y* Q) z! K m$ ]( A
"std" => "",# Q+ c% l9 }2 k0 O
),4 U {5 R6 E9 t3 K; w7 x
7 J# d9 p C' [5 M! Z+ i- h array( "name" => "</div></div>",1 w' }0 c: e: v7 T
"type" => "close",2 c; \* |1 e: @
),; k2 A' h" R$ r8 H
4 B" \, L6 v! ?( r' @1 U
- B0 c) {! m: Z) G$ S6 E
# O: q* C# C9 I( e( B6 @ array( "name" => "YouTube Video Settings",9 t* r) d# o e. T0 K
"type" => "heading",
6 x( m# D# `$ G. F$ b1 L% k6 t+ j ),1 t* I! o) w* P3 j ~( b1 |9 j& {
8 [( } O0 O: R$ v array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 k% v* U% h, l
"id" => $shortname."_emvideo_activate",
# W$ }* y# U3 {# L1 o "type" => "select",* w3 j: z; f3 P5 }& L \" ?
"std" => "No",
7 }2 }' g- F+ B1 V& }$ Z "options" => array("No", "Yes")),
( ^# R$ y- q' G7 t/ {* l" s' E4 [+ E0 `! Q) N9 s
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",5 X; o: b1 y4 Y' |* i6 O M: k
"id" => $shortname."_emvideo",- A, c4 y6 @9 H' y
"std" => "",
. M H0 U6 f* ~, C$ R "type" => "text"),
# _" _4 j6 E$ r9 {# ~5 b |' W8 ~0 e
array( "name" => "</div></div>",
7 \% W3 Z; d% I1 U+ t3 x9 |9 S2 f "type" => "close",6 @0 L" U! f' M8 ?; y1 P6 ]
),
; x5 W3 u- ?0 J5 @6 f b* K
1 N- j. @+ f$ Z" l# k, J! U# m array( "name" => "Twitter Settings",
0 G* ]$ `1 T4 w# F5 y# k: I "type" => "heading",$ c5 H9 a2 c Z
),* h/ h/ e- @, R, N+ T
3 e4 w# g" z. C& q array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 O. z: p- k& k5 r8 n* h/ j "id" => $shortname."_twitter_activate",$ v" C+ @/ ]- T8 ^2 H# }' d
"type" => "select",8 @ i0 \: |% D
"std" => "No",' U+ g R# X" G3 S7 k7 y8 ~. H3 f
"options" => array("No", "Yes")),
! P7 n5 X6 v H5 h: ] N0 Y1 v5 q0 X; S1 f
array( "name" => "Insert Your Twitter ID here; E, K7 H0 u5 e, l2 n
<br /><em>*leave blank if not necessary</em>
3 S+ }3 i5 [: _0 v8 l; p <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
: s1 x9 Q0 j6 ~8 B "id" => $shortname."_twitter", j9 l+ K+ g0 o/ H* [3 q5 }
"type" => "text",4 v. g7 L1 x: J) P1 c1 h6 O; q6 C
"box" => "social",+ n' T9 p% m( ^, \
"std" => "",
- s4 M, I* {# f' S: ~( ~ ),
) g( I8 d& q4 D3 U) l [( Z Q
array( "name" => "Enter Twitter Feed Count here" X! e% P0 w% `$ y
<br /><em>*leave blank if not necessary</em>
3 X- Y$ ?! _2 w# W <br /><em>*Enter How Many Twitter Feed To Display</em>",
8 C4 A8 U5 q4 r% l/ y "id" => $shortname."_twitter_count",& c& Q0 A$ ^' d% N7 |3 d6 a' X3 H: O
"type" => "text",1 P- S" u! b" [2 S# U. }7 J
"box" => "social",
! J; l/ I S& v% g+ W) R "std" => "",
7 f9 q. V. p0 _) b% I$ O0 x ),
% {! H1 P$ X" T. A5 b! b# W6 j8 B$ c
array( "name" => "</div></div>",
8 b; r X o2 k, t) H/ { "type" => "close",+ I" f( ]& G0 o8 d, r2 s# g
),. S5 r: F+ l. S% r
$ d: ^5 C5 r" l' k# K; `; Z
, i" N. F4 q B( i+ n0 [: {$ f( f array( "name" => "125 x 125 Banners Advertisement Settings"," T0 ^* _- z1 ?$ e1 p- q
"type" => "heading",5 r% N, A3 g- V# u
),% s1 r) C" L5 S o
3 J6 w _- I, m% k2 v" s array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! m( b& O3 U. j- _
"id" => $shortname."_sponsor_activate",
; R3 I. T4 o! A* d( p" F! s$ H "type" => "select",
7 {- I) D& l4 s' T# L "std" => "No",' Z9 G! }3 O$ z l2 a! Y4 P
"options" => array("No", "Yes")),3 |, j$ Z, | ]9 f; s
8 C2 [, W- n2 R% Q
3 O2 d# r* g7 B7 l& Z. [* b
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",1 D% g, R9 n7 j, `9 O! a b
"id" => $shortname."_sponsor_banner_one",
( S9 Y5 d- r) g" y "type" => "textarea",
, G* q& [4 f+ E; d7 e8 H1 t "std" => "",4 t* G& \( z7 K3 b$ ?8 H
), ' Z% D( l# K7 Y6 P
. i0 A- ?8 F# u array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
- T3 P, C( c& m. J6 Q' K' m5 @3 |$ k "id" => $shortname."_sponsor_banner_two",) a* {% {3 }/ U( i2 }( P
"type" => "textarea",
' j/ C4 G3 s: n, r& T "std" => "",8 w, }9 G' ?9 k2 W5 w
),
: A" V* B3 P5 Y0 O6 r% f" w9 T" X; ~9 l; l6 n8 u8 v6 E
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
1 Y$ Z; J- \6 R8 I3 c! {9 f "id" => $shortname."_sponsor_banner_three",' C; N! \( u+ p3 i7 t7 p
"type" => "textarea",
# ~- l6 m2 W' }: o "std" => "",
, d/ A. w$ C0 B) y% { ),
8 C1 R6 X4 Z" S- m' v
: x# `' m2 X0 S" R/ B) Y array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
7 ^6 I i( I# p, [+ ^5 F; D2 c "id" => $shortname."_sponsor_banner_four",
$ F S, U$ {3 S/ a4 ? "type" => "textarea",
6 l% U6 |2 z6 ?" R* q& { "std" => "",$ q" h f, ?5 b t+ U. _6 [& N
),
% B# ^! S% v3 ~
0 h/ v! m D2 o array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",6 g; e& Q9 @! U1 T& I: z
"id" => $shortname."_sponsor_banner_five",
1 P6 ]: @" g1 U& c& ?/ R "type" => "textarea",/ o! _" j Q9 H! k* r
"std" => "",
1 T; R2 H) z- l9 F$ n0 p ),
' b) z( t% A3 S
) F7 e% ]; Q7 M! d) Y' x/ p# m, I8 X array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
l# Y, Z' M0 d, t3 E "id" => $shortname."_sponsor_banner_six",
$ E. I$ q1 F8 P6 t; V, c8 h "type" => "textarea",: j* ?2 ?7 d/ F, i
"std" => "",
0 s+ `8 a7 f( m; j ),) ~1 y5 @! Q9 g; ?" u: N
; u; H# W: [$ _4 _
array( "name" => "</div></div>",' B" [1 g- E# U% F J6 |
"type" => "close",
L3 \" ^% ~5 C5 [5 O6 K4 {/ i+ g! J$ j ),. R* V$ t1 B9 O* z, V: n4 U
, G& ~" m2 |; C. T& P. z
2 k4 n2 `- B7 ?8 Y4 q
8 f- |, R7 g5 ~/ Z);
8 U- v1 O% K; {( T' {8 t6 M! X: x( ?: T/ }9 I
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
9 e! w+ G* B @9 O% r8 y, i3 u$ g# O* W, o
echo "<div id=\"admin-options\"> ";
9 T4 A7 z; p1 N' H# t4 G( _. J9 `5 ^. J- e
global $themename, $shortname, $options;
& a3 p0 ]3 c5 m1 r- Eif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
9 {2 N! g( t( z1 Hif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
8 [0 E" i0 K9 U! ~! `?>3 V& @8 g: d/ X; Y* {' d- i
C) b' @7 _! f4 ~' D% }* b0 Q
<h4><?php echo "$themename"; ?> Theme Options</h4>$ }* h9 M" b- k" B" ^7 E8 i- z
* F1 @- v( N% ~- K/ W
<div class="annouce">
9 a3 n4 r6 b# H/ g& c<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
& x- `7 E8 R% l9 a1 S1 L: e<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>& E5 B# y* H! p
</div># }0 ?9 g* v* ~) K4 l
4 L$ G6 `& v% Z% l6 n3 a* r
<form action="" method="post">
4 }: ~9 b6 Z* V# X$ _+ ]8 w9 E6 G( X4 m+ y2 J+ K
<?php foreach ($options as $value) { ?>
7 n* w; e" w" o2 |$ {: S% m- f" s u% ?
7 N) U+ R0 n) D0 x# D$ A<?php switch ( $value['type'] ) { case 'heading': ?>. X8 O3 U- b! e5 M
$ D& B, {7 i/ h# t& \" N, R2 P& g6 w
<div class="get-option">
9 T8 }) F9 o$ {$ _1 T* e M8 h: h0 G0 u" |& k
<h2><?php echo $value['name']; ?></h2>: \2 y6 e# X B1 h
, f" @: R ?4 m+ `. F9 h/ ?<div class="option-save">2 g, S# b$ n% I9 l3 S9 z
$ K! y- H; n. Z7 `6 E
<?php$ P4 N9 ]& g$ I# D) i7 }
break;. r8 P: [; S/ d! }$ c# O9 }% ~$ y
case 'text':
( j/ m8 J0 ?* a6 m: G/ |: U?>
7 M5 G% v5 C* V7 r: ^0 ?9 R% V) j$ Y
<div class="description"><?php echo $value['name']; ?></div>! T7 E* j- i/ v$ H( }9 [4 L6 J
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
$ F5 Q$ L6 d9 X9 Y* k
8 b* X! J! s2 O, x* Hget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>; V4 C( |1 G( G
- R }( u* s5 O0 R; X" Y<?php \& N8 {+ B# ~- b, E6 X% H
break;
: `, S+ B0 z) y Y+ Q, Rcase 'select':
! G- W7 D$ m* y8 s- O?>
7 n8 X/ i+ L. \( X
/ T# L3 M5 V* b4 V2 b" ]1 k<div class="description"><?php echo $value['name']; ?></div>
$ i' |8 v ~- H# \2 w* b/ D<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">, t" ^- P4 ~6 c: @+ s
<?php foreach ($value['options'] as $option) { ?>; s8 h. }: r6 a( w4 W
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>5 P, g' i. r! v$ h
<?php } ?>6 i8 T, ^% K$ v& k. q
</select>& r+ s2 d' K* e* w0 ^! }& T
</p>1 b0 w# Y; l2 u
l, L a/ P8 a
<?php
( H5 [& q/ p6 S& n- E- ?break;
. r7 z2 a' B f# e; A$ b& ?2 ccase 'textarea':
( g4 P; s8 W3 t( X& ~; W; N$valuex = $value['id'];
% k: u& A% L! p$valuey = stripslashes($valuex);3 M+ r: N7 I3 l
$video_code = get_settings($valuey);9 G/ e: b* G+ X: O+ r
?> a! N5 C ?- a4 Q% J
6 \% M, a, z# L2 a$ N5 R! b8 V, `
<div class="description"><?php echo $value['name']; ?></div>" c: K/ o( y/ z3 [( n/ ?4 k
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }) E/ V2 ~2 }+ }6 Z
b1 V4 H! K, H. A# j9 N( felse { echo $value['std']; } ?></textarea></p>8 P& A$ S; O; J( T
% O% X5 {2 C# F( c<?php) a0 @9 P2 }) [4 y2 G! S& C
break;3 P3 T) X5 t; q. O2 |9 R. y" s
case 'close':! p; {$ x5 ~1 J. [9 i, x M
?>5 g Q: _0 f7 p: a
N3 t+ w* E$ Q. m) \3 H# d" i<div class="clearfix"></div>% D7 i6 n+ t2 C- N2 _7 Z4 a) f
</div><!-- OPTION SAVE END -->* F* z5 @; }0 { z6 h, L
! [0 [3 H$ S$ ~4 B
<div class="clearfix"></div>
! _) p1 _ I& a$ T</div><!-- GET OPTION END -->
! Q& `* I4 |; C8 [0 ?+ V& u, ^$ g3 ]! v+ C; X0 X
<?php
& Q: Z& r+ f3 ?4 B1 F+ Fbreak;
1 P. z" W5 b# xdefault;& k. t9 C/ B) v H# K8 b
?>, R% ^1 n# P, S/ I
% _8 {/ M$ z5 I, M$ _/ ~, S- m+ y5 j7 }) R8 H% m8 Q4 r
<?php
3 r- x, B8 D9 A ^) [% e( k! N# dbreak; } ?>
& r) f0 h& {$ N$ D% Y2 E9 C) s7 p( M0 R0 j8 @" }( i
<?php } ?>
3 E' q. K1 [! Z* l$ t! D% T! U: r. ?# u; A% }; ?
<p class="save-p">( A4 p" W& v( A$ y- A% T
<input name="save" type="submit" class="sbutton" value="Save Options" />
?3 F& s6 k" ]) S<input type="hidden" name="action" value="save" />
8 C* Z8 G2 K2 T$ \</p>2 v+ a- N4 F `6 ?& w! w# h6 }
</form>
4 Z4 M' t* A" x, w c0 m0 o* F5 [$ Q) l2 A0 A ?
<form method="post">% X3 h; C( W# h
<p class="save-p">
/ n) b& P1 g2 a8 _/ H! H<input name="reset" type="submit" class="sbutton" value="Reset Options" />
& X- q4 t* i+ C0 z5 J<input type="hidden" name="action" value="reset" />+ M: v; l( d- }2 V, Q! g
</p>
4 U5 ]% F5 |/ W6 l5 g! ~( Y) ^</form>& d7 G- t0 } ? n6 V* T+ K# r
' V* o- j( j/ v8 I+ D
</div><!-- ADMIN OPTIONS END -->+ i& l5 N# ~4 r, a
; S) `. A. }% K+ Y, a" e7 I, U/ ?<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
3 Z6 y2 O. {0 r1 Z: S+ j/ s: a' W; j e1 U6 m" U/ j# y
function mytheme_admin_register() {
0 k5 t+ U& T: y4 t2 aglobal $themename, $shortname, $options;! v; z0 Y0 t$ g9 W& I
if ( $_GET['page'] == basename(__FILE__) ) {
; M' o0 F- w0 Z9 g+ [0 Jif ( 'save' == $_REQUEST['action'] ) {
; V4 B( A% K* g* |1 R) gforeach ($options as $value) {( q0 w7 W5 ?- d) S) Z4 \8 o' s
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }# |- E, @, ]- t5 k! |
foreach ($options as $value) {+ w s9 o$ c; A0 z# P3 { E
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }' ?8 G$ \9 a' [& B5 ?
header("Location: themes.php?page=functions.php&saved=true");
X. f$ a# O2 g8 |/ E4 H+ edie;0 L4 G5 ^0 {# V. f! C
} else if( 'reset' == $_REQUEST['action'] ) {
. K/ D7 V5 Y( tforeach ($options as $value) {
" W$ Y% D' L4 Y m, X" A/ C$ Kdelete_option( $value['id'] ); }; }/ E9 J' @* a& c+ e- y
header("Location: themes.php?page=functions.php&reset=true");
+ u/ B! i0 G! V: l h" E2 X) Vdie;
$ g2 H' h% p% m}8 X$ w6 N! {# H! s1 k0 g" z
}
1 @' X0 Z8 k) l0 O4 n5 eadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
/ k* C' x' P& J}3 M/ k$ L5 K6 U: {
- K1 M/ K; y" P+ M# [9 K
function mytheme_admin_head() { ?>2 P1 o. T" q( c$ b1 ?: j& Y
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />/ Y2 T3 _ Z8 u4 @
<?php }
6 _# b. | X( K$ U% W |
|