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