|
|

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