I made a mod that allows for a more customizable index page (rather than using the AdminCP), and it will allow you to use PHP. In the mod I also included example code for displaying five random pets.
Check it out!
The exact code snippet for the random pets is this:
PHP Code:
$document->add(new Comment("<div class='row'><h4>Random 5 Pets</h4>", FALSE));
$stat_rand5 = $mysidia->db->select("owned_adoptables", array("aid"), "1 ORDER BY RAND() DESC LIMIT 5");
while($aid = $stat_rand5->fetchColumn()){
$adopt = new OwnedAdoptable($aid);
$document->add(new Comment("
<div style='display: inline-table; text-align: center;'>
<a href='levelup/click/{$adopt->getAdoptID()}'><img src='{$adopt->getImage()}'></a></br>
<a href='levelup/click/{$adopt->getAdoptID()}'><b>{$adopt->getName()}</b></a> the <small><b>LVL.</b> {$adopt->getCurrentLevel()}</small> {$adopt->getType()}</div>
", FALSE));
}
$document->add(new Comment("</div>", FALSE));
If you want three instead of five, all you have to do is edit "1 ORDER BY RAND() DESC LIMIT 5" to "1 ORDER BY RAND() DESC LIMIT 3".