Display Automatic Tables of TCGs
This snippet automatically shows all the tcgs you're in, and you can even sort it by active/hiatus/inactive! This script assumes you have your func.php file in your header file, but if not, add it to wherever this snippet is going to be displayed! This is not a script that goes in your mods.php file – instead, it goes in your index.php file or wherever you'd like it to be displayed! Just make sure your file is a php file!
You can see an example of my active tcgs listed below! Every tcg I set to active from hiatus/inactive/etc will show up on this list automatically without me having to edit it! If you have any automatic tcgs that aren't listed in eTCG, you'll have to add/update those manually.
| TCG Name | URL | Status | TCG Type | Updated |
|---|---|---|---|---|
| Sidequest | ![]() | active | Manual | November 27, 2025 |
| Automatic TCG Name | Status here | Automatic | Last Updated Date |
<table>
<thead>
<tr>
<th>TCG Name</th>
<th>URL</th>
<th>Status</th>
<th>TCG Type</th>
<th>Updated</th>
</tr>
</thead>
<tbody>
<?php
$database = new Database;
$tcginfo = $database->query("SELECT * FROM `tcgs` ORDER BY `status` ASC, `name`");
while($row = $tcginfo->fetch_object()) {
if ($row->status == 'active') { // if you want to show just your hiatus tcgs, just change 'active' to 'hiatus', if you want both active and hiatus in the same list, replace it with $row->status !== 'inactive', and if you want every single tcg listed, remove this line entirely!
$dirname = "img/buttons/"; // path to your button images, make sure the buttons are all in the same folder
$filename = strtolower($row->name); // name of the tcg, don't change this! name your buttons the same name as the tcg, in all lowercase letters
$images = glob($dirname."$filename.{jpg,gif,png}", GLOB_BRACE); // this calls the image, don't change this line!
foreach($images as $image) { }
echo "<tr><td>$row->name</td><td><a href=\"$row->url\"><img src=\"";
if (strpos($image, $filename) !== false) { echo $image; } else { echo "https://placehold.co/100x35"; }
echo "\"></a></td><td>$row->status</td><td>Manual</td><td>" . date('F d, Y', strtotime($row->lastupdated)) . "</td></tr>";
} // if you remove the status line above, remove this closing bracket!
}
?>
<!-- Automatic TCGs can start here -- unfortunately, these will have to be put in manually -->
<tr><td>Automatic TCG Name</td><td><a href="linkhere"><img src="https://placehold.co/100x35"></a></td><td>Status here</td><td>Automatic</td><td>Last Updated</td></tr>
</tbody>
</table>
