$catname
"; if (mysql_numrows($temp) == 0) echo "
There are no links within the category. Please try again later or add yours here.

"; else { echo ""; echo ""; $i = 1; while ($row = mysql_fetch_array($temp)) { if(($i % 2) == 1) { $rowcolor = $contrasting_bgcolor_1; $let = "1"; $num = "1"; } else { $rowcolor = $contrasting_bgcolor_2; $let = "2"; $num = "2"; } $i++; $link = wordwrap($row[link], 30, "
\n", 1); $rating1 = $row[rating1]; $rating2 = $row[rating2]; $rating3 = $row[rating3]; $rating4 = $row[rating4]; $rating5 = $row[rating5]; $totalvotes = $rating1+$rating2+$rating3+$rating4+$rating5; if ($totalvotes > 0) { $total = ($rating1 * 1) + ($rating2 * 2) + ($rating3 * 3) + ($rating4 * 4) + ($rating5 * 5); $end = round(2 * ($total/$totalvotes)) / 2; } else $end = 0; $rating = "$end/5"; $averagerating = $end; echo ""; } echo "
Site NameSite AddressClicksRating
$row[name]$link$row[clicks]"; if($averagerating >= 1) echo "\"Click"; elseif($averagerating > 0) echo "\"Click"; else echo "\"Click"; /* Star 2 */ if($averagerating >= 2) echo "\"Click"; elseif($averagerating > 1) echo "\"Click"; else echo "\"Click"; /* Star 3 */ if($averagerating >= 3) echo "\"Click"; elseif($averagerating > 2) echo "\"Click"; else echo "\"Click"; /* Star 4 */ if($averagerating >= 4) echo "\"Click"; elseif($averagerating > 3) echo "\"Click"; else echo "\"Click"; /* Star 5 */ if($averagerating >= 5) echo "\"Click"; elseif($averagerating > 4) echo "\"Click"; else echo "\"Click"; echo "
"; } echo "
return to the category listings"; include("footer.php"); exit; } if (isset($new)) { if (isset($genre)) { $error = ""; if (strlen($sitename) < 1) $error .= "You have not entered a site name.
"; if (strlen($site) < 1) $error .= "You have not entered a site address.
"; if ($category == 0) $error .= "Please choose a category for the link.
"; if (strlen($error) > 0) outputErrors($error); else { $site = str_replace("http://", "", $site); $site = str_replace("http:/", "", $site); $site = str_replace("http:", "", $site); $site = formatField($site); $sitename = formatField($sitename); $description = formatField($description); $description = str_replace("\n", " ", $description); $description = str_replace("\r", " ", $description); $description = str_replace(" ", " ", $description); $description = str_replace(" ", " ", $description); $dateadded = date("Ymd"); $temp = mysql_query("INSERT INTO links (link, categoryID, dateadded, name, genreID, description) VALUES ('$site', $category, '$dateadded', '$sitename', $genre, '$description')"); if (!$temp) { echo "Your link could not be added, please try again later or contact stayaround for further information.

"; echo "Click here to return to the main directory area.

"; include_once("footer.php"); exit; } else { echo "Your link has been added to the system. Please allow up to 24 hours for stayaround to validate and add it to the directory.

"; echo "Click here to return to the main directory area.

"; include_once("footer.php"); exit; } } } echo "Enter the details of your site below. Once submitted it will be sent to stayaround for approval and should be active within 24 hours.

"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
Site Name
Site Address
Category
Genre
Description
(max 255 characters)
"; } else { ?> add your link to the site.

"; $temp = mysql_query("SELECT * FROM linkcategorys ORDER BY name"); echo ""; $i = 1; while ($row = mysql_fetch_array($temp)) { if(($i % 2) == 1) { $rowcolor = $contrasting_bgcolor_2; $open = ""; $close = ""; } else { $rowcolor = $contrasting_bgcolor_2; $open = ""; $close = ""; } $i++; echo "$open$close"; } echo "
"; $name = strtoUpper($row[name]); $notallowed = array("[", "]", "{", "}", ",", "*", "&", "^", "%", "/", "|", ";", ":", "?", "'", "(", ")"); $arname = $name; $arname = str_replace($notallowed, "", $arname); $arname = str_replace(" ", "-", $arname); $paget = $arname; $paget = strtolower($paget); echo "
$name
"; echo "
"; echo "


"; } ?>