|
|

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