|
|

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