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