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