16/01/2013, 19:46
|
| | Fecha de Ingreso: marzo-2008
Mensajes: 228
Antigüedad: 16 años, 8 meses Puntos: 12 | |
Respuesta: Ignorar caracter de un termino de busqueda en un buscador php Index.php
Código:
<?php include('header.php');?>
<div class="container">
<div class="box">
<div class="title">Recent Searches</div>
<div class="inner-box">
<?php
$newMusic = mysql_query("SELECT * FROM search GROUP BY term ORDER BY id DESC LIMIT 30") or die (mysql_error());
while ($newRow = mysql_fetch_array($newMusic)){
?>
<a class="url-box" href="music.php?search=<?php echo $newRow['term'];?>"><button class="music-button"><?php echo $newRow['term'];?></button></a>
<?php }?>
</div><!--end inner-box-->
</div><!--end box-->
<div class="middle-box"><?php echo $adrow['ad2'];?></div>
<div class="box">
<div class="title">Top of the Charts</div>
<div class="inner-box">
<?php
$i=1;
$rss = new DOMDocument();
$rss->load('http://www.uktop40.co.uk/official_top_40.rss');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 25;
for($x=1;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$SongTitle = substr($title, 3);
$SongTerm = stristr($SongTitle, '-');
$SongTerm = substr($SongTerm, 2);
$description = $feed[$x]['desc'];
$AlbumArt = stristr($description, 'img src="');
$AlbumArt = substr($AlbumArt, 9);
$AlbumArt = explode(" ", $AlbumArt);
$AlbumArt = $AlbumArt[0];
echo '<div class="Music-Tumbs"><a href="music.php?search='.$SongTitle.'"><img src="'.$AlbumArt.' width="92" height="92"></a></div>';
}
?>
</div><!--end inner-box-->
</div><!--end box-->
<div class="middle-box"><?php echo $adrow['ad2'];?></div>
<div class="dc"><?php echo $settings['disclaimer'];?></div>
</div><!--container-->
<?php include('footer.php');?>
|