|
|

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