|
|

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