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