|
|

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