|
|

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