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