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