|
|

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