|
|

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