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