|

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