|
|

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