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