Yup yup
Code:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("functions/functions_adopts.php");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
$article_title = "Random adoptables";
$article_content = $article_content."<br><h3>".$lang_randomadopts."</h3>".$lang_randomtext."<br>
<br /><form>
<input type='button' onClick='history.go(0)' value='Refresh'>
</form><br><table>
<tr>
<th>Adoptable Image: </th>
<th>Adoptable Name: </th>
<th>Owned By: </th>
<th>Total Clicks: </th>
<th>Current Level: </th>
</tr>";
// Loop out code...
$query = "SELECT * FROM ".constant("PREFIX")."owned_adoptables, ".constant("PREFIX")."adoptables, ".constant("PREFIX")."levels WHERE "
.constant("PREFIX")."adoptables.type = ".constant("PREFIX")."owned_adoptables.type AND ".constant("PREFIX")."levels.thisislevel = ".constant("PREFIX")."owned_adoptables.currentlevel AND ".constant("PREFIX")."levels.adoptiename = ".constant("PREFIX")."adoptables.type"
." ORDER BY RAND() DESC LIMIT 10";
$stmt = $adopts->query($query);
//Loop out code
while ($row = $stmt->fetchObject()) {
$aid=$row->aid;
$currentlevel=$row->currentlevel;
$owner=$row->owner;
$type=$row->type;
$name=$row->name;
$eggimage=$row->eggimage;
$usealternates=$row->usealternates;
$totalclicks=$row->totalclicks;
$primaryimage=$row->primaryimage;
$alternateimage=$row->alternateimage;
if ($usealternates=='yes') { $image = $alternateimage; }
else { $image = $primaryimage; }
if ($currentlevel==0) { $image = $eggimage; }
if ($image=='') { $image = $primaryimage; }
$article_content = $article_content."<tr>
<td><center><a href='levelup.php?id={$aid}'><img src='{$image}' border=0></a></center></td>
<td><center>{$name}</center></td>
<td><center><a href='profile.php?user={$owner}'>{$owner}</a></center></td>
<td><center>{$totalclicks}</center></td>
<td><center>{$currentlevel}</center></td>
</tr>";
}
$article_content = $article_content."</table><br><form>
<input type='button' onClick='history.go(0)' value='Refresh'>
</form>";
//***************//
// OUTPUT PAGE //
//***************//
echo showpage($article_title, $article_content, $date);
?>