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