<div class="navh3">Top Games</div>
<div class="links1">
<?php
$query = yasDB_select("select * from games order by plays desc limit 5");
while($row = $query->fetch_array(MYSQLI_ASSOC)) {
	$gameurl = $row['title'];
	$gameurl = str_replace(" ", "-", $gameurl);
	$gameurl = str_replace("'", "_", $gameurl);
	$gameurl = str_replace('"', "_", $gameurl);
	$gameurl = str_replace('/', "_", $gameurl);
	$gameurl = str_replace("\\", "_", $gameurl);
	$gameurl = rawurlencode($gameurl);
	if ($setting['seo'] == 'yes') {
		echo'<a href="' . $setting['siteurl'] . 'game/' . $row['id'] . '/' . $gameurl . '.html' . '">' . $row['title'] . '</a>';
	} else {
		echo'<a href="' . $setting['siteurl'] . 'index.php?act=game&id=' . $row['id'] . '">' . $row['title'] . '</a>';
	}
}
?></div>