|
|

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