Код:
<?php
require_once("include/bittorrent.php");
dbconn();
$query = mysql_query("SELECT DISTINCT tags FROM torrents WHERE modded = 'yes' AND tags IS NOT NULL") or sqlerr(__FILE__, __LINE__);
$tags = array();
while ($row = mysql_fetch_assoc($query)) {
$addtags = $row['tags'];
$addtags = explode(",", $addtags);
foreach ($addtags as $tag)
array_push($tags, trim($tag)); /// add tags to the array
}
$tags = array_filter(array_unique($tags)); ///remove dublicates and empty values
stdhead("Tags");
foreach ($tags as $name)
echo "<a href=\"$DEFAULTBASEURL/browse.php?tag=" . $name . "\" style='font: 9pt Arial,Helvetica,Sans-serif;'>" . htmlspecialchars($name) . "</a>, ";
stdfoot();
?>