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