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