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