|
|

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