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