|
|

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