|
|

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