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