|
|

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