-
-
Save tml/2041653 to your computer and use it in GitHub Desktop.
creatures displayed in table based levels and sins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $page_title = "Ancient Beast - Bestiary"; | |
include("../header.php"); | |
include("../global.php"); | |
?> | |
<script type="text/javascript" src="<?php echo $WorkingDir; ?>utils/tinybox.js"></script> | |
<?php | |
echo "$start_div<div style='text-align:center; position:absolute;'>"; | |
$pdo = new PDO(...); | |
$q = $pdo->query("SELECT * FROM ab_creatures ORDER BY sin, lvl"); | |
$rows = $q->fetchAll(); | |
foreach(array_chunk($rows, 7) as $chunk) { | |
foreach($chunk as $row) { | |
if ($row['lvl'] == $x) echo "<div style=\"background:url('" . $WorkingDir . "creatures/" . $row["id"] . "/avatar.jpg'); background-size: 100%; display: inline-block;\" onclick=\"TINY.box.show({url:'details.php',post:'id=" . $row['id'] . "',width:880,height:650,topsplit:2,close:true});\"><a href=\"#id=" . $row['id'] . "\" class=\"lighten\"><img class=\"img lighten\" src=\"frame.png\"></a></div>"; | |
else echo "<div style=\"display: inline-block;\"><img class=\"img lighten\" src=\"frame.png\"></a></div>"; | |
} | |
$i++; | |
echo "<br>"; | |
} | |
echo "</div><div style='height:915px;'></div><center>"; | |
//TODO: rename folders from "creature" directory from id to creature names | |
echo "</center>$end_div" . $the_end; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment