|
|

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