<?php
// Include main
template system
include('defaul
t.php');
// Site Name
$smarty->ass
ign('site_page'
, 'Mp3');
// Is there a
query in the
URL?
if
(isset($_GET['q
uery'])) {
if
($_GET['query']
== null) {
$content =
"You did
not search for
anything."
;
}
// Clean
up the query
$query =
mysql_real_esca
pe_string($_GET
['query']);
$search_sql =
mysql_query(&qu
ot;SELECT
`mp3_id`,
`title`,
`song_author`,
`genre`,
`album` FROM
`mp3` WHERE
`title` LIKE
'%".$query
."%' OR
`song_author`
LIKE
'%".$query
."%' OR
`genre` LIKE
'%".$query
."%' OR
`album` LIKE
'%".$query
."%' LIMIT
0, 30"

;
$search_row =
mysql_fetch_ass
oc($search_sql)
;
if
($search_row
> 1) {
$content =
"<b>
".$search_
row['song_autho
r']."</
b> -
".$search_
row['title'].&q
uot;
<object
type=\"app
lication/x-shoc
kwave-flash\&qu
ot;
data=\"htt
p://sarvar.x10h
osting.com/play
er/musicplayer_
f6.swf?&son
g_url=file.php?
id=".$sear
ch_row['mp3_id'
]."\"
width=\"17
\"
height=\"1
7\">
<param
name=\"mov
ie\"
value=\"ht
tp://musicplaye
r.sourceforge.n
et/button/music
player.swf?&
;playlist_url=?
playlist_url=al
lshows.xspf&
;\" />
<img
src=\"nofl
ash.gif\"
width=\"17
\"
height=\"1
7\"
alt=\"\&qu
ot; />
</object>
<BR
/>";
} else {
$query_outcome
=
stripslashes($_
GET['query']);
$content =
"No
matches found
for: <a
href=\"mp3
.php?query=&quo
t;.$query_outco
me."\"
;>".$qu
ery_outcome.&qu
ot;</a>&q
uot;;
}
}
// Smarty
Template System
$smarty->ass
ign('body',
$content);
$smarty->dis
play('custom.tp
l');
?>