|
|

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