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