' . (!isset($_COOKIE['id']) ? 'You have a tag link! Click a tag to vote' : 'You have used up your tag vote, please come back tomorrow') . '

'; // --- End $result = mysql_query("SELECT * FROM `tagcloud`"); while($row = mysql_fetch_assoc($result)){ $fontsize = array(11, 15, 20, 30, 50); switch ($fontsize){ case ($row['clicks'] >= 1 AND $row['clicks'] <= 20): echo "
  • $row[link]($row[clicks])
  • \n"; break; case ($row['clicks'] >= 21 AND $row['clicks'] <= 35): echo "
  • $row[link]($row[clicks])
  • \n"; break; case ($row['clicks'] >= 36 AND $row['clicks'] <= 50): echo "
  • $row[link]($row[clicks])
  • \n"; break; } } // Close While Loop } // Close !isset else{ $link = intval($_GET['link']); $result = mysql_query("SELECT * FROM `tagcloud` WHERE id=$link"); if($row = mysql_fetch_assoc($result)){ // Check for cookie, if non present create one // otherwise leave as standard but dont update the database. if(!isset($_COOKIE['id'])){ setcookie('id','voter',time()+25,'/','',0); mysql_query("UPDATE `tagcloud` SET `clicks` = `clicks` + 1 WHERE `id` = $link"); echo '

    ' . 'Your tag has been logged!' . '

    '; } // End else{ echo '

    ' . 'You can view the site but your tag has not been logged' . '

    '; } echo $row['link']; echo "

    Go Back"; } else { echo 'Nothing was found, please press back on your browser!'; } } } // Close if($dbc) else { // DB Connection Failed echo 'Ooops Theres A Problem. Please contact the' . ' ' . "" . 'admin'; } ?> PHPTagCloud