|
|

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