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