|
|

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