Here's a mod you can use to divide your trade pile (or whatever other section) into different pages without the need to create new categories.
// Divide a card pile into multiple ones without creating new categories. // $tcg = the name of the TCG as defined in the database; $category = the card category to display; // $start = the value you want to start with; $end = the value you want to end with; $doubles = divide pile into uniques + doubles function sortmypile($tcg, $category, $start = '', $end = '', $doubles = 0) { $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']; $cardsurl = $tcginfo['cardsurl']; $format = $tcginfo['format']; $category = $sanitize->for_db($category); $cards = $database->get_assoc("SELECT `cards`, `format` FROM `cards` WHERE `tcg`='$tcgid' AND `category`='$category' LIMIT 1"); $start = $sanitize->for_db($start); $start = strtoupper($start); $end = $sanitize->for_db($end); $end = strtoupper($end); $searchme = '/['.$start.'-'.$end.']/i'; if($cards === '') { echo '<p class="cards"><em>There are currently no cards under this category.</em></p>'; } else { $cards = explode(',',$cards['cards']); $cards = array_map(trim, $cards); $array_count = count($cards); if($doubles > 0) { $cardsuni = array_unique($cards); $cardsdou = array_diff_assoc($cards, array_unique($cards)); echo '<p class="cards">'; foreach( $cardsuni as $card ) { $card = trim($card); if(preg_match("$searchme", $card[0])){ echo '<img src="'.$cardsurl.''.$card.'.'.$format.'" alt="" title="'.$card.'" /> '; } } echo '</p><p class="cards">'; foreach( $cardsdou as $cardd ) { $cardd = trim($cardd); if(preg_match($searchme, $cardd[0])){ echo '<img src="'.$cardsurl.''.$cardd.'.'.$format.'" alt="" title="'.$cardd.'" /> '; } } echo '</p>'; } else { echo '<p class="cards">'; foreach( $cards as $card ) { $card = trim($card); if(preg_match($searchme, $card[0])){ echo '<img src="'.$cardsurl.''.$card.'.'.$format.'" alt="" title="'.$card.'" /> '; } } echo '</p>'; } } }
sortmypile($tcg, $category, $start, $end, $doubles);
sortmypile('TCG name', 'Trade', 0, 9);"I want to show all the cards on my trade pile that start with letters. And I want my doubles on a separate pile".
sortmypile('TCG name', 'Trade', 'a', 'z', 1);"I want to show all the cards on my trade pile into two pages: #-M and N-Z".
sortmypile('TCG name', 'Trade', 0, 'm'); echo '<hr />'; /// just to separate the piles sortmypile('TCG name', 'Trade', 'n', 'z');"I want to show all the cards on my trade pile that start with A. And I want my doubles on a separate pile".
sortmypile('TCG name', 'Trade', 'a', 'a', 1);That's all. If you need help or find some mistake, please let me know :D