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