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