|
|

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