|
|

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