|
|

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