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