|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////3 \1 t+ T/ q7 g6 ~
// Theme Option
: T9 Z5 S- H" A% T0 y# w////////////////////////////////////////////////////////////////////////////////
/ {, E2 p. a; X( A: @. j$ Q* x
, V5 t; a% V9 }; Y$themename = "Zenx";) `3 |# Z% p- H9 K8 a6 A5 ~
$shortname = str_replace(' ', '_', strtolower($themename));
2 z3 n M% ~0 x4 d0 _) S3 B# \; D" _- W! H0 o& w2 A. ?# j( O6 x/ `
function get_theme_option($option)
; |$ N J8 u3 h{& _7 g" r" k0 w ^5 k
global $shortname;# f* S1 [) L( m: B8 g0 q, V" E, \2 \
return stripslashes(get_option($shortname . '_' . $option));3 J. q% `/ |' S, @. x. h) y
}
) z+ J6 x& z. s
) O/ p g% p; M/ s4 ~9 t6 Lfunction get_theme_settings($option)
2 H; c& T- ?7 g3 x. N; S9 Y3 @{ r2 v) x |7 j7 ^5 W# K
return stripslashes(get_option($option));/ i) ?2 w; t, F! V: t, ]0 c1 a2 {: m
}
) s) q% k4 }( ^3 o, ~$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");6 S/ k& i. H9 h% a
$wp_getcat = array();
$ T% a" d7 v* G: o6 z6 O" gforeach ($wp_dropdown_rd_admin as $category_list) {, r }) H; A& ~- D( H
$wp_getcat[$category_list->term_id] = $category_list->name;
8 X2 p) S+ e# m) Q5 |/ ]" d$ ?+ C}
J3 ] i: }: k$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
% {2 {0 f1 |6 C$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
3 q( `4 K6 I! D2 y* R* G$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");# q# k1 Y* B& r: p3 M W2 m
+ \" [0 W% }" i: X! ]& A$options = array (- j+ I5 C F1 }1 L4 U; ?# A
l3 |! T6 _. L- Q$ J8 t
$ J2 J' g' ^5 I; J) C array( "name" => "Blog Header Settings",% C/ q6 o6 m6 x5 W* r
"type" => "heading",
% ?/ Y* n1 t# ~& `8 ?. Q# ] ),- w1 F: o' P+ O. Y
# T+ t+ i! }" l. n; u4 W. X, l array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. W* q A3 L" |- _5 h; ^/ U "id" => $shortname."_header_logo_activate",
& m# F/ D# Q5 ~0 P1 g* o "type" => "select",* n) W& |8 F1 {/ }8 }5 p
"std" => "No",6 S' ]9 y) y/ A& i
"options" => array("No", "Yes")),$ ^, W1 Z- o4 c" e6 m
( {, ]: d& n6 _3 d3 [2 N p" V# y
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
# a! V! Z8 @1 u- u) n& [ q! L "id" => $shortname."_logo_url",* z; N5 D9 w: p1 ]( Z5 g
"type" => "text",. i2 U% G; F& X
"box" => "social",
% G" v6 g. V" q4 l. u) g( J- @; G "std" => "",
: R7 ^7 R/ }5 h' X' T( a/ g ),# T, J5 q7 A! K) H+ s# P
7 b8 j3 k$ z! m& L0 h. H array( "name" => "Insert Header Banner HTML Code (Header)
, W. g! v1 f% [( o <br /><em>*Recommended Size 468 x 60</em>9 G9 ~' s1 E- S! t7 ^3 g9 m
<br /><em>*leave blank if not use</em>",, D) f! S- q+ k. C7 E% n
"id" => $shortname."_header_banner",& G) ]! k" H" G7 ], G, M" n7 q
"type" => "textarea",; f# _) {' j+ P* e
"std" => "",' b1 Z1 W1 g( I. d! g# T, l0 B% V
),
5 Y+ S4 G! { [# c4 E3 X5 ^ V! w4 h$ U; d8 Z- @9 r" s
array( "name" => "</div></div>",
3 ?3 [+ D5 \ l) r9 c- u0 x "type" => "close",
1 ~$ g8 \' N& t2 P. M% C, a ),1 l, f S Y* e# ?+ W8 t
% I; p+ C/ g& M5 }' v, q. ^( i8 O% p; N3 _$ Q
array( "name" => "Header Navigation Settings",3 P5 Z: f5 u, J5 f$ _$ _; n
"type" => "heading",8 V+ o' [* R, ?( T' R
),* A. e0 e# ?% n/ w7 a2 o- N% N1 l
& t [( v5 o0 Q+ k: r7 a
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />. Y) i- i \) W! Q U. h3 V4 N
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
$ n i/ D( o& y) x" E1 ~- C <em>*Enter the page post ID number only</em><br />6 s6 C; b4 `6 a9 K0 J/ Z. A }
<em>*separate by comma</em><br />" C% f; X) [; h5 p
<em>*Exclude pages which you don't want to show on the header navigation</em>",/ m- {5 t" @ i D. q. H5 r$ B
"id" => $shortname."_header_page_navigation",7 U. M( S E/ L# {: z( ^0 C
"type" => "text",
' t/ m1 z8 V& I* B* j; b U1 h "std" => "",) @0 z, G, E' ?! J! ] C6 t
),- t6 r! x( T/ C* m
3 u' c, P; ?* p
array( "name" => "</div></div>",
3 d, `# E1 L5 j0 {$ P, f* K5 { "type" => "close",
2 q2 x7 q, @: n$ ? ),- w! }9 y( }7 d1 n5 J; [; J
2 L& J: g7 p- w4 B8 }1 ~
+ I* i9 p k3 o; w( W! U* I9 u
array( "name" => "Post Auto Thumbnails Settings",% W! l5 n5 J: D. e
"type" => "heading",
9 Z) D& g: m4 A: n4 q/ `( i- f ),
3 C: ]- f0 L/ I: k1 c3 W
+ Z5 i7 P& v1 \/ z9 z array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( l7 c6 ~! \8 \, h3 }, G+ y
"id" => $shortname."_timthumb_activate",) B7 w- l: N* V: V1 p, P9 z( D3 @: Y
"type" => "select",
% h" a3 b: M* Q7 y: y "std" => "No",
( A+ o; I/ r1 b) s7 S' v ~ "options" => array("No", "Yes")),
2 D* Z9 m( H: x: _+ A % N1 O5 c) {/ n
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
C0 }9 ~# b; E! t2 t( g "id" => $shortname."_timthumb_cropping",1 q6 M( f+ g% J& S! C
"type" => "select",* ~. r& [! z& ]( w# ]
"std" => "",; y [: i6 a$ J; ~" }
"options" => $crop_position),5 t5 h2 q7 i) q6 y: |1 T$ R( H# Z
* D8 X6 D5 t/ x+ t. k! Z array( "name" => "Insert Width Of Thumbnail Image<br /> ~0 F/ D- K& `* i* B! w
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
6 R* p/ z8 F% }" k <em>*Leave Blank To Use Default: 250</em><br />",' [) Y( X' w" z! ]
"id" => $shortname."_thumb_width",! q/ @, E" ^" q) y
"type" => "text",
# t$ x. t; s. T; S |- N$ h "std" => "",4 c, p( r; C/ C# }( t; o6 Q8 X, |
),& E1 ?5 n+ c% p# c' c8 h5 Z2 K
8 \/ ^$ a& \2 k7 ~% Q' @) E array( "name" => "Insert Height Of Thumbnail Image<br />5 A! |- ^- ]5 `- m" B: }
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />+ Y6 A5 P3 @ { C7 z; K6 B6 `
<em>*Leave Blank To Use Default: 200</em><br />",
& B' H0 a: j0 s "id" => $shortname."_thumb_height",( n; J' B7 h$ F8 c7 x3 I
"type" => "text",7 o0 C; f: d0 d- a1 v' B [7 j
"std" => "",9 D0 a7 [& g* n# R* ]4 [; u
),
6 j+ _4 t, X8 r1 ]# U7 E6 O& c; m9 K
array( "name" => "</div></div>",
' S3 w |: F( N "type" => "close",7 {. d3 k7 X5 ]! |" ]+ b' Z- w' P
),+ P) J0 f k: X1 o
% }3 g8 u9 V) T2 z$ i array( "name" => "Featured Content Slider Settings",
3 B4 u9 l+ I7 ?9 i- f "type" => "heading",
+ U- K" U% ~* f& q& f, c" u ),9 s; L$ k% |' `5 ~
+ O3 ]1 j( Y8 V$ Q# D1 r
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
5 @5 `. N( N1 [- @* R "id" => $shortname."_featured_activate", c$ m% z* e9 m0 v" D* Q9 q
"type" => "select",
* v6 g" C" r% k N "std" => "No",
- `5 d& |9 @" d4 G, V# d "options" => array("No", "Yes")),
1 W$ Y- J+ f+ |5 j+ }1 o( Z
% E" u0 ]% k3 O- K4 |9 M
' t/ \9 Y m- k k8 ?; E array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
# ?. F, i7 ~+ b+ d( [8 O "id" => $shortname."_featured_category",
5 Q, h: l9 Y/ Y/ o "type" => "select",
8 ~ j5 |1 o+ a- W "std" => "Choose a category:",
$ u. a" K" [1 j8 m7 F$ Q "options" => $wp_getcat),
) N# l& F) R2 c: V! {3 m9 A6 M d1 J$ Z6 }& ~ C- g
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
$ S# F J, _ w3 q w "id" => $shortname."_featured_number",6 ~8 |# _% ]+ H( R M; b9 l
"type" => "select",
* V! U, Z5 a7 r+ ~ "std" => "Number of post:"," V ?" u7 x, L$ E
"options" => $number_entries)," m1 z4 v7 a/ m# t% a" y
! O0 J: b8 x8 K2 n5 [
array( "name" => "</div></div>",
" E5 h* x" z5 w# P "type" => "close",5 d* A/ W$ _7 Q5 s/ c
),) s1 J, j# p+ ^4 }( h7 b# F( v
$ u9 A, b$ Q: O, P" R
array( "name" => "Featured Category Settings",
, b, M. V2 Z0 Z3 w" ~ "type" => "heading",
. E1 x3 K& E, @5 t1 p9 |" Y ),
7 @+ p z% \+ ?! S2 M" ?1 |6 _8 B
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) k* W& A$ N* ]
"id" => $shortname."_featured_category_activate",
% M8 {% b6 H1 {, ]! `* m% w "type" => "select",7 ?: G1 W4 z1 h" w. p2 s! u; o9 P. G
"std" => "No",0 d( L; J; M. M8 [6 n
"options" => array("No", "Yes")),+ n$ c- D; ?; g$ s1 s
5 _! Y/ i. c# ~, u8 V, M0 U9 W array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
: ?! a) |. O- N! d: ?' A) U "id" => $shortname."_featured_category_id1",7 N3 ^/ @3 Q6 B, G/ F: U; [
"type" => "select",
0 x$ w. p" {- L8 y( }. } "std" => "Choose a category:",) l: `6 g2 G7 R, ~
"options" => $wp_getcat),1 G, Y) [* }* s3 @9 b$ [* [
. C/ ^! `$ u1 Z3 p8 b
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>", V+ M4 R0 k# \# Z! f
"id" => $shortname."_featured_number1",8 w- R7 r, @5 T# j: q4 C+ b6 A
"type" => "select",
0 U) ?% Z7 r! | {) p "std" => "Number of post:",
* `: U" p4 c2 s3 _: z0 r- K "options" => $number_entries),
3 J4 F- M0 P1 v; e- u+ l) e- n
+ p6 [; Q: } m" h" N' }% W8 w array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
# V, J( w7 a1 Z "id" => $shortname."_featured_category_id2",0 a3 w( _( J2 `1 D
"type" => "select",% y5 j4 G0 A# D0 v" q7 t) Y% F" N
"std" => "Choose a category:",
! ~) m$ l) C4 h: D/ w6 f "options" => $wp_getcat),
" I1 P A7 `& v G4 J" R3 k8 c
& a2 w4 H/ v4 t4 r array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",& Z8 K; R5 w9 d2 I- R+ M w5 d$ c
"id" => $shortname."_featured_number2",; F. A! Q x6 a
"type" => "select",
1 k m5 v( W4 o! w. A2 M H& ?1 j, p "std" => "Number of post:",! p; D0 v+ e2 M% b7 M
"options" => $number_entries),
9 {7 C) b8 R1 r6 `
+ P9 Z8 z/ C/ k
$ _+ P4 W+ } G% ` F) E array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
7 n2 P' K" E1 Y "id" => $shortname."_featured_category_id3",
2 u$ c# @0 ], N+ X8 J' Z; Y "type" => "select",
b+ v! N1 ?# U2 z) J2 P7 j. ^ "std" => "Choose a category:",9 x" V/ @& O. a" O
"options" => $wp_getcat),
& t i3 [0 p6 S0 x. \4 `
, F5 q1 r% c) S* Z) @ array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
: `+ t+ t8 v7 O# M4 `2 y5 I "id" => $shortname."_featured_number3",
$ T8 L8 b& q# \* h1 g5 d "type" => "select",
3 S6 N& E' M. { s+ @- K# Z "std" => "Number of post:",3 d0 V+ c) F0 a5 q
"options" => $number_entries),1 h' u( E3 E3 `3 D
& R2 V2 M+ Z' [+ \. ]: ?0 L ~! X6 q) @ ?7 ^, Z7 j; S8 R
array( "name" => "</div></div>",- i4 I5 E4 ^! @3 @
"type" => "close",
( Y- { L( u9 M2 l/ b. `# z3 x ),' l+ n" M' a# d9 t- a
k1 J, Q4 \# B! e* b
$ b6 N" W, {; D+ q4 ]( }
array( "name" => "Google Adsense & Analytics Settings",% _5 S6 l: M6 G0 S4 ]) P
"type" => "heading",: U0 \) ^ x* a9 l0 n& {# \: F
),
m, a' b1 h$ o, u# r% l& R ]
2 P. r" ]/ Q* S2 q Z array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
$ j2 c1 b5 [# @& s, @& ] "id" => $shortname."_adsense_loop_activate",2 X) P1 w! r7 C
"type" => "select",3 H% f( I- m) _* x9 B. P
"std" => "Disable",
2 m T! d* w2 L "options" => array("Disable", "Enable")), `" a& T9 v: U/ g5 d
+ [+ b4 P/ a# L2 p: v array( "name" => "Insert Google Adsense Code For Loops Here<br />" o" Y4 i- A% ]+ f
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",, O3 u# \8 C0 V4 ^# y P+ E0 O- J
"id" => $shortname."_adsense_loop",
5 w, @9 i2 l$ E8 {; L5 J+ H "type" => "textarea",2 j: m- w3 S1 A. o( |# _+ y7 S& J
"std" => "",
/ d5 B' c( m, a ),
( A' G# V0 K" ~* F4 ]% D% q6 q& G5 h: u& ~4 m- m
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",# S n/ d* ~4 k0 }, q
"id" => $shortname."_adsense_single_activate",9 [. D) Q7 j1 B8 M' W
"type" => "select",
" ]! L* r% V7 v* z* Y1 t "std" => "Disable",7 K# Z( H" @4 U2 p/ z5 ]- u
"options" => array("Disable", "Enable")),. @. D* Y! ]5 H" g
3 Z" L* X, Y, \
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
+ k: j. N* f' W- p* P6 d <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",4 E# i4 {# T/ P; h) c
"id" => $shortname."_adsense_single",
* {; ^$ v& Z0 l# J* t8 a "type" => "textarea",
# Z8 W% K+ C5 F' O "std" => "",
# N _! C( m9 D ),
8 F, X" r5 p* t
$ G( v( i. V# {% ^ _( a! k. `$ v \8 \6 e4 A9 ]7 a- M$ N
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",0 |0 A" U: |* H' f6 ^( j
"id" => $shortname."_google_analytics",5 v( F: |1 t! F
"type" => "textarea",
6 h/ k6 ^ c( L- M "std" => "",( y" `. t8 T. M$ J. w- B
),1 e( Q& B8 `3 V9 N
- r7 i _& C# @4 r array( "name" => "</div></div>",6 C. U9 B+ G9 R; k! t' m t
"type" => "close",5 D; f: A2 q9 B7 B
),
5 c' L3 S% ?$ X) ?$ h8 C" B % w/ {% q" U3 [
: }) A5 V! ^ l( q: ^
array( "name" => "AddThis Social Bookmarking Settings",
& k* f# E$ B- m7 ? "type" => "heading",
% T/ O8 `8 N: u )," T0 D5 S8 k8 A5 R
+ t+ R% h3 l& t b5 t" G5 `& d( r array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>5 p6 q7 j/ A- J& s1 Z7 I
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
3 g. r$ X% c4 W# J7 e( ]' Y7 m2 T "id" => $shortname."_addthis",
1 t& }! T% x; r "type" => "text",& V5 p: c* l- C1 l
"box" => "social",9 H- }2 M; `- X
"std" => "",' O6 F+ Z# L; q: G9 y2 L- E& z
),9 I" o3 E8 W" J" ?/ d
8 \) ]$ q/ k7 R% G) n/ B array( "name" => "</div></div>",1 l" Z4 {- K! ^% g
"type" => "close",
3 C2 [' C: B+ B" t: g8 R! _ ),/ [0 g5 L5 [& d
9 \" j# t" Q4 u; y$ q1 x* Y
1 d, c, Z6 K5 J, x7 I$ q9 n+ q5 @5 }
; D' [" P# m" ~. H" F, E% _ array( "name" => "YouTube Video Settings",
) V* L. X A# I& q& y "type" => "heading",2 R' Z) j; T) B' B
),: r) k. R8 p: [1 m0 _
% g$ O6 S& d# V! A, H array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 Q n( a- {+ O& K# |8 ^
"id" => $shortname."_emvideo_activate",5 J( q3 i* D2 i0 L# [& Z0 r
"type" => "select",
8 c1 s% K7 I6 a1 e- \ "std" => "No",$ R" f1 u* W5 Y! B
"options" => array("No", "Yes")),
1 _( W6 [& j) t) W# O& I. t
M$ M1 \4 q% E 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>",
. d" i/ ?! E7 l5 Z" O$ O# C+ ^ "id" => $shortname."_emvideo",- M! r5 @2 D, l6 T4 M( d0 }" q
"std" => "",0 U9 y9 E1 j, }1 G; u
"type" => "text"),
+ w. n$ q) H B4 S, H: a5 ?' K& i- s" c. r
array( "name" => "</div></div>",% `/ b) S/ q" ? O K6 k. e3 E4 a$ l
"type" => "close", t: i9 b; z6 ~/ W2 m4 T1 i: P
),2 g S1 k+ ]7 R) f) E! Q( w
2 i) m/ y% g' L. N3 `" f
array( "name" => "Twitter Settings",
/ c: U+ e. E# y- P$ K5 s' Z "type" => "heading",
4 X( f6 B* l) ] P ]- u. D ),
$ ?3 j) m$ E L6 N9 z
7 O- [& [) e9 r! B/ X array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 v9 j4 b+ @. w3 G" D9 i "id" => $shortname."_twitter_activate",7 n) s" B/ Z' `7 M& D ?
"type" => "select",
% G8 k+ w( e& F7 `" X: @ "std" => "No",
, y u" ]' Y+ Z "options" => array("No", "Yes")),
9 z5 x/ C8 h& |! c; i: I* B4 y) ]3 @% W6 h% A
array( "name" => "Insert Your Twitter ID here* L+ F* K7 C# ~! Z. a
<br /><em>*leave blank if not necessary</em>8 s) t F- c& A: F
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",; d0 o/ q- Q9 N+ p6 B) {6 A! ?
"id" => $shortname."_twitter"," N) x9 l9 Y6 x% G0 N5 V! W) D
"type" => "text",
8 _* B+ O) n- ?0 f# { "box" => "social",9 w5 [% s$ }; r& T
"std" => "",8 u( ?/ G9 O- S z2 `$ W
),
& h$ L0 Q! l7 I" T
' ?' i) u" X6 r0 L4 `- y array( "name" => "Enter Twitter Feed Count here
$ n i* S& G( R! U; w <br /><em>*leave blank if not necessary</em>, v7 c/ {9 Y7 ]6 u; h% _
<br /><em>*Enter How Many Twitter Feed To Display</em>",2 b8 G) t3 _# Z) A& m- E3 ]% t" m
"id" => $shortname."_twitter_count",
& e3 V) j' v- r' A4 d: u "type" => "text",- g; ^9 f0 S1 |1 B% J; l# n
"box" => "social",, q: k/ P' l. T7 q
"std" => "",
! B+ \5 A+ d3 p% C. @0 \$ O ),
3 H- F6 {7 {8 {% E% X/ f6 l/ E& M; b# J4 z1 N' ^! a+ w
array( "name" => "</div></div>",
/ `# t A$ ]$ p" Y% K( }2 t$ V, x "type" => "close",
+ U* a5 M6 T9 x& N1 I ),/ T( {) y/ B, t0 ?
% V3 \$ P) ~& o& p$ X* l) R. J& ^1 m2 D- H3 c9 I5 ]
array( "name" => "125 x 125 Banners Advertisement Settings",
% S- a* p/ D( Y* v+ l "type" => "heading",
% I7 K; ]% [! c- i N1 Z2 x1 m& T ),
8 j8 ?% o, m& Y. h
, C" x5 l1 ~% M: ]1 ] array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 m* e1 N5 k5 s6 s$ S
"id" => $shortname."_sponsor_activate",
, k, C6 k* J6 v3 y% }) I/ Z "type" => "select",2 }- m! f B/ B
"std" => "No",/ M( ]( |! [1 f9 _$ L5 y
"options" => array("No", "Yes")),; l4 b! ]; S4 W& T
8 E4 j: \# x0 n4 c, K
9 J3 P2 a; l; a( P( I0 f4 q array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",, l8 W3 m# G Q$ M& a# D4 g
"id" => $shortname."_sponsor_banner_one",/ ~: W# n. f9 ]& q9 D( ?
"type" => "textarea",
+ ]4 j: D% N# R4 V2 o5 k6 r" H "std" => "",
! C' _, o" _6 W6 Y ),
3 M; u3 c7 _3 {( |7 d3 P
1 i6 \+ G" N/ J) x9 H( ^/ X' R array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",- v# X; g0 ^' @% d) a
"id" => $shortname."_sponsor_banner_two",) I( s I5 H3 n: F W
"type" => "textarea",
# y5 U' i8 G7 B* F* x "std" => "",
3 r% F7 Z4 _ A' | ),
, E% [8 T" F! F4 Y" g: ]$ K* M3 C" A/ W3 _& B7 z! L" |$ b# {6 C
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
! l) N* P. g/ S1 Q+ r "id" => $shortname."_sponsor_banner_three"," [2 e* e; T \8 b4 x& E
"type" => "textarea", _9 y- l/ }+ ]1 A2 y* S
"std" => "",
0 b3 a: p7 D; T% q4 M. J2 [+ d" D' ] ),% F% l9 c7 m( Z- K( e8 Q" J4 p+ ^5 z
& F/ V9 E. \* U4 @: ]3 b- ^! g array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",% G/ t! o/ A8 D- C W3 u
"id" => $shortname."_sponsor_banner_four",% ]5 L0 t7 P0 Z( d% C- m
"type" => "textarea",* p' k \5 C! [* i# a- @0 A1 v
"std" => "",
* v0 }3 N5 \+ g' I ),
3 a8 i) R/ H0 E; I i: Q
+ c/ Q/ P' q+ E; f array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
3 f4 ]: T* E4 X, z& i6 o "id" => $shortname."_sponsor_banner_five",
4 z1 C6 G' U1 V. I "type" => "textarea",& m* `! k k9 v& w6 N8 B$ a8 I
"std" => "",
" _5 n' s" E+ g3 a# i; W ),- Y2 C% j& a3 H0 R" P
4 j/ m, }1 k+ b) g6 O9 o6 X' u8 h! O array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
- t0 [+ R, A/ C6 h- v0 S9 q1 h "id" => $shortname."_sponsor_banner_six",0 w4 j) [2 }; A5 D
"type" => "textarea",
: M' o# x7 o) o5 i "std" => "",$ q! h: C& u Z! d8 ?: [0 t
),1 d h' F8 {. r" e, }0 ?) I
" G- t2 V W8 v- ?6 @ array( "name" => "</div></div>",0 _2 O4 u+ \' n$ A* l
"type" => "close",
5 m. q- {8 g/ N) w; Z ),% X0 f! w8 E( r# p( _
$ F# d' ]9 Y' V/ \ W5 ^- i7 K* W" u: Y+ |' o
3 P X! u5 D: f& i, o; m5 g) x);$ w# [/ t' ~5 S& I! n. N
2 m# _4 J, s# l. h% pfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
$ @6 y2 G7 V- V: O3 S Z0 s/ Y6 C# }2 O2 i- e
echo "<div id=\"admin-options\"> ";
1 w. Z9 |: ~/ D! P7 U# Z( `1 y* f) |9 I( f( r2 e
global $themename, $shortname, $options;
+ [# P* }7 ?$ e# `; `9 Gif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';7 r/ g; K* E) D& D$ H+ e9 `9 K- @
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
5 y: O; A: ?- C7 M?>
- `6 e- G" p5 p; S2 b" q* t2 p0 s& x7 [) M+ D
<h4><?php echo "$themename"; ?> Theme Options</h4>
# i$ ]+ x4 @3 e9 T4 p$ A$ H- F+ R8 S6 b
<div class="annouce">$ B) L8 b1 ^% C9 y
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>( `& b# A7 g. D7 C$ g$ V* s+ o
<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>0 y3 m/ {- C& B1 g6 f* J( H
</div>
. b; W4 X3 m! ^! ~8 Y: y. x( O
& n5 D2 w; U4 |5 g, x) y" @/ |<form action="" method="post">$ _8 K8 P6 G( n/ k+ B
* c( \, g6 F4 U* |' ~0 H<?php foreach ($options as $value) { ?># S+ j$ W6 u. X# N/ s% S
% T! @7 X c! v- A' N
<?php switch ( $value['type'] ) { case 'heading': ?>
3 P# n+ z1 u& W. W& m( s8 O X0 P: s1 w5 S8 O3 t% y
<div class="get-option">0 G0 Z. ?" W) G t& ^; S
. \$ X8 h5 N8 D1 ]' o+ A' n, h<h2><?php echo $value['name']; ?></h2># {6 ?0 _. c* w. F: ~
8 c. O9 y- c7 n1 w$ j/ ^# P3 U<div class="option-save">0 L- K/ y! v9 V! Z" \/ p& `
; P& o4 m4 O( U" @! C<?php: Y6 c5 L3 g$ B1 q, L% ~ u# y
break;# y8 u5 p/ N9 d3 B1 b) H
case 'text': F8 n8 V4 R I, e7 W- n
?>- v5 B% g& R8 V. z: J7 y
1 c; R( S# S0 E" |5 _8 y<div class="description"><?php echo $value['name']; ?></div>1 m! k. c R8 h1 b! y
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (- D3 ?& I+ J+ z' ^
7 S9 n1 l* \* R0 A% o) R0 D! l
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>; N: _+ {. Z9 d. `( b: W
" X, l6 O% T3 E2 z! O+ {# s<?php
7 H- r. ?+ _: B+ c4 ?. f% c( V% f1 Obreak; \% u. D) W8 s0 s
case 'select':9 O% z6 r* [8 t; L! B
?>* K/ l/ L/ S$ F1 J& ?7 V
+ e( p7 v7 E6 r2 }<div class="description"><?php echo $value['name']; ?></div>9 c* _! ^3 S' ?, Y+ z" }
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
6 P6 L/ n6 e5 {, |. `, l<?php foreach ($value['options'] as $option) { ?>
& |! O3 x9 \, G: a, M7 g<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>. x9 N! a( C! d/ r' q5 Q E, X
<?php } ?>' _. n* S1 l9 C% j2 Q
</select>
( c' s$ X& ~* Y</p>; P2 Z8 r! D, ]7 p
5 G- _- t% O( Z& g% W$ ?6 ?/ R<?php
$ i- E' s/ A* U% _" xbreak;% W: Y" ]) Y) S0 g$ r. D( q O% d* Z, s
case 'textarea':* C. t V% b- ^0 p
$valuex = $value['id'];+ F9 n) F0 m- d
$valuey = stripslashes($valuex);; ~( r4 x1 ^* z
$video_code = get_settings($valuey);
4 _. E/ n& n9 P2 ^7 H! A?>- i0 ~2 D6 j! P4 I5 q4 S
6 q: M! S f" u# I2 b: f<div class="description"><?php echo $value['name']; ?></div>
0 k1 R% f; q2 U4 k3 f: U) p/ H<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
2 d* g2 F# s- f8 v# w9 |! a# i1 {% M: d/ m, N/ e, T0 x
else { echo $value['std']; } ?></textarea></p>
( g3 G: Y1 |/ h, O, [. @1 J0 v$ o, Q, j- o' n7 c
<?php
; U2 \% o' g4 O3 K9 fbreak;! {8 ?( F. T( {+ G
case 'close':
" Y) P. d1 p' G: E* W G" ??>
8 U2 ~6 G2 K4 F6 Z
2 M, M; h S4 X/ [: @' Q3 }4 O3 z<div class="clearfix"></div>
1 I; N, _7 l- j @. o: Q/ d4 `% k</div><!-- OPTION SAVE END -->' P7 c6 f: K: n$ L4 T6 X
2 Y1 x7 I: d0 E( \5 y
<div class="clearfix"></div>
, F d0 ]% Y8 W4 X- d- f3 D</div><!-- GET OPTION END -->
* M# V; K. H; q6 O u- _1 n o# `
1 L4 m/ P2 g* G* u- }/ V! V9 e1 R<?php- V8 O: E- f' V0 h/ B% }( t8 x* S. E
break;
9 N+ C) q! G+ Vdefault;" k6 m' \1 @5 W0 \
?>
R, Z( O9 @" ^, ~2 s! F3 H1 } o- l' x5 }* M6 W. c- S
* ^$ v# U7 W2 G. i- i+ L
<?php
" z" d9 N2 j( E/ Pbreak; } ?>
) e' w' e9 w; `& P" I% {: \
4 Z9 B% Q1 u" G8 l7 K<?php } ?>
$ T9 r' {& k8 I3 b. p
$ ?& L' w" f; t; I( P8 T" T<p class="save-p">
: Z/ Q7 j; `8 f+ t. b6 \+ E<input name="save" type="submit" class="sbutton" value="Save Options" />* _5 |' k7 {3 ^
<input type="hidden" name="action" value="save" />8 R( C4 a& e' K3 w( s a" }: X
</p>
' S' m. K* X# n' {( v</form>
, f! A3 F) ~+ L5 m5 [$ M' [- l8 Q: B/ B2 |: b
<form method="post">
+ v1 @3 @* U6 i9 N; V: |<p class="save-p">! A: t* K8 ]& g2 [" t' l2 w
<input name="reset" type="submit" class="sbutton" value="Reset Options" />0 W; G/ e% k3 \) {6 t
<input type="hidden" name="action" value="reset" />
$ M3 n$ m: y8 o* g</p>
: i- a' X$ @- B; d</form>
7 o% a& d t7 [9 [! _, r% v
# T% k- G8 z3 ~) d6 D$ N: T8 L</div><!-- ADMIN OPTIONS END -->/ H. I& ]! {+ Z8 O. Y# j
# ?; C6 L6 o: g5 O" @) ~8 E* |<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }8 `/ B8 ?$ P1 e* z) c- ^% ^
u5 ~% N! W/ q$ H+ g4 u+ kfunction mytheme_admin_register() { ~- ~( W* L# t3 C
global $themename, $shortname, $options;
; u8 u. G" k; uif ( $_GET['page'] == basename(__FILE__) ) {
- l2 C# ` U; D9 Nif ( 'save' == $_REQUEST['action'] ) {
7 C1 Y# [! Z5 }7 `. F" V [: Wforeach ($options as $value) {
' i: E8 r0 ?' V$ b9 u# T8 D! ~update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
5 C" |/ O, V, m0 o' b }% W/ yforeach ($options as $value) {7 L6 I; R! C% n* b3 i. h: l6 r
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
0 }! ]+ `* F K# @2 yheader("Location: themes.php?page=functions.php&saved=true");
% T7 ~7 s+ |4 Z- |die;
, [* M; _# [( k6 \; @% c4 @/ G$ h} else if( 'reset' == $_REQUEST['action'] ) {
3 D8 [& u4 C# Y# d: E \foreach ($options as $value) {
5 d* [; b' C8 |4 |delete_option( $value['id'] ); }$ h5 A( T8 L0 b# y/ s6 K% s5 c8 o
header("Location: themes.php?page=functions.php&reset=true");7 b* J* y" m3 c# t$ V
die;! ~7 v* ~3 [# V- i' u+ d% ?( s4 x
}2 c# T+ C* T! M. J4 l) p/ a
}% ]$ U% c- F8 f$ p( }' [; X
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
: Z* U$ W3 W2 }# l+ R}
9 L! L. ]6 ^: U- F/ B( a
O* ]' J' m+ Yfunction mytheme_admin_head() { ?>
! w- l) q+ [2 q7 L<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
/ ^9 x8 d' v; ~# J3 O<?php }
1 \7 ]# y# ~" Y3 o |
|