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