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