|
|

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