It's 2020 and counting coins is outdated. Subtracting and adding to your card count is tedious and we know that you guys hate it. We've changed the way that we give you currency to make things a little easier, and this is just a quick mod to help you display your currency from a category.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/32a23c45-91a0-4207-a054-f5b73756d0e6/Untitled.png

For your mods.php file

function show_currency( $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);

    $gold_count = 0;
    $gem_count = 0;

    foreach($cards as $currency){
        if($currency == 'gold'){
            $gold_count++;
        }
        elseif($currency == 'gem'){
            $gem_count++;
        }
    }

    echo '<img src="<http://idolise.letstrade.cards/img/coins.png>"> x '.$gold_count.'<br>';
    echo '<img src="<http://idolise.letstrade.cards/img/gems.png>"> x '.$gem_count.'<br>';

}

Create an eTCG category

For the purpose of this, I've created a category called 'currency' (but you can call it anything you'd like), and I've put a couple of currency into it.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/25ba710c-7368-494e-a3d0-c3a02914036f/Untitled.png


Display it on your page

<?php show_currency('idolise', 'currency'); ?>