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