|
|

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