|
|

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