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