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