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