https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ddfa260a-ed5e-4cec-8c36-dc25845e0457/Untitled.png

Add to Mods.php

function display_coupons( $tcg, $category ) {

    $database = new Database;
    $sanitize = new Sanitize;
    $tcg = $sanitize->for_db($tcg);
    $category = $sanitize->for_db($category);
    $altname = strtolower(str_replace(' ','',$tcg));

    $tcginfo = $database->get_assoc("SELECT * FROM `tcgs` WHERE `name`='$tcg' LIMIT 1");
    $tcgid = $tcginfo['id'];
    $cardsurl = $tcginfo['cardsurl'];
    $format = $tcginfo['format'];

    $cards = $database->get_assoc("SELECT `cards`, `format` FROM `cards` WHERE `tcg`='$tcgid' AND `category`='$category' LIMIT 1");

    if ( $cards['cards'] === '' ) { $cards['cards'] = []; }

    $cards = explode(',',$cards['cards']);
    $cards = array_map(trim, $cards);

    $unique = array_count_values($cards);

    echo '<div style="display: flex; flex-wrap: wrap; text-align:center; justify-content: space-between;">';
    foreach ($unique as $c => $v) {
        echo '<div style="margin-right: 5px">';
        echo '<img src="<http://idolise.letstrade.cards/coupons/'.$c.'.png>"><br>';
        echo "$v";
        echo "</div>";
    }
    echo '</div>';
}

Display on Page

<?php display_coupons('idolise', 'coupons'); ?>