|
|

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