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