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