This is a customizable mod that allows you to put a list of cards or your logs (without the dates) into it to be sorted into pre-selected categories based on how you’ve set up your trade post. It takes a little work to set up in the beginning, but once you’ve done so it’s a huge time saver.
The original mod was created by Danni for Idolise TCG. (source here)
Download the mod linked here:
(Includes link to func.php and header.php + footer.php files)
(Includes link to func.php and header.php + footer.php files)
If you have your TCG pages set up differently than that (e.g. you do not use header.php and footer.php files), here is the sorter code by itself. The page you put this code on must call to your func.php file somewhere.
NOTE: If you do not already have Dite’s ‘Get Category’ and ‘Pending Check’ mods in your mod file, make sure you add them. They’re used in a lot of popular mods like the multi-card search, etc, and you will need Get Category for this sorter to work.
// GET CATEGORY MOD BY DITE
function get_category( $tcg, $category) {
$database = new Database;
$sanitize = new Sanitize;
$tcg = $sanitize->for_db($tcg);
$category = $sanitize->for_db($category);
$altname = strtolower(str_replace(' ','',$tcg));
$result = $database->get_assoc("SELECT `id` FROM `tcgs` WHERE `name`='$tcg' LIMIT 1");
$tcgid = $result['id'];
$result = $database->get_assoc("SELECT `cards` FROM `cards` WHERE `tcg`='$tcgid' AND
`category`='$category' LIMIT 1");
return $result['cards'];
}
// PENDING MOD BY DITE
function pending_check($tcg, $card){
$database = new Database;
$sanitize = new Sanitize;
$tcg = $sanitize->for_db($tcg);
$tcginfo = $database->get_assoc("SELECT * FROM `tcgs` WHERE `name`='$tcg' LIMIT 1");
$tcgid = $tcginfo['id'];
$pending = $database->num_rows("SELECT * FROM `trades` WHERE `tcg`='$tcgid' AND `receiving` LIKE '%$card%'");
$pending = ($pending === 0 ? false : true);
return $pending;
}
This section will walk you through what portions of the code you should edit to match your own eTCG categories. You can add or delete as many sections as needed, just be careful to copy all the necessary parts in each section or it won’t work!
Scroll down until you reach this section. This is where you’ll begin editing your categories. The first line featuring ‘collecting’ will handle decks on your Collecting page in eTCG, so leave those lines alone. Begin on the next line down.
When changing the bits of the code with the kpop names ($taeyong), it doesn’t matter what you choose as long as you’re consistent. In the screenshot above I’ve highlighted the related sections that need to match each other.
On the array line, you can change the ‘keeping1’ to anything you need.