As any player of Online Trading Card Games — TCGs — will know, there are only three options for managing your own trading post:
- Do it manually.
- Use Card Manager, a PHP script created by Mandi.
- Use Trade Post Manager, a PHP script created by Marfisa.
In my opinion, the best option here is to use Card Manager. My reasons are thus:
- Using Card Manager requires you to have a full copy of your tradepost on your own computer — loss of either your website or own hard drive data can be easily remedied by simply copying from one place to another. Trade Post Manager does not require any kind of backup, and it would be pretty easy to lose track of your work if your website disappeared for any reason.
- Doing it manually can be extremely time-consuming, and can easily make updating a chore rather than a hobby. I found that taking time to figure out how to use Card Manager was definitely worth it.
I also just didn’t require a complete Trade Post Manager and preferred to use the features of Card Manager. So, if you’d like to use Card Manager too, keep reading because I’m going to attempt to explain how to install it.
Prelimary
During this tutorial, I will be assuming that you are familiar with FTP (I recommend Georgina’s tutorial) and that you have PHP-compatible webspace (I recommend Bubble.nu).
If you get stuck at any point, please don’t hesitate to leave a comment. I can’t help you if I don’t know you’re having a problem; and I would like to help you! If you know me through Twitter, feel free to drop me a line on there as well.
Step One: Download Card Manager.
- Visit the Card Manager download page: http://scripts.enchanted-rose.net/cm/download.php
- Follow the instructions, or if in doubt, just download one of everything to a folder of your choice. Got it? I’ve put mine in a folder called “tcg”. Please note: You need to right-click on the link to the file and “save target as”, “save link as” or “save file as”; clicking on the link normally to view in the browser and then using “save page as” could result in a mangled file.
- Now you need to make sure that all of the ‘.txt’ files are renamed to ‘.php’ — this means that cardmanager.txt, cardcount.txt, config.txt and index.txt need to become cardmanager.php, cardcount.php, config.php and index.php. If you cannot see the file extensions, try viewing the files with the FTP client.
The rest of the tutorial will be in the same order as the readme.txt which you have just downloaded — I recommend reading that first, and then reading the appropriate section of this tutorial if you need any clarification. There are also explanations inside each of the .php files, and I recommend reading those as well.
Step Two: Create Folders
In order to make things easier when you eventually join multiple TCGs (it’s hard to resist once you’ve started, trust me!) we’re going to create a new folder inside our tcg folder. For my example I’m going to use cards from Choices, so my folder will be called choices. If you’d like to use a different TCG, just create a folder named after that instead. Once you’ve created that folder, copy config.php and index.php into it but leave everything else where it is – in the tcg folder.
According to the readme.txt which we’ve just downloaded, the next step is to organise all of your cards into folders. A quick look inside config.php shows that the default folders are collecting, mastered, future, maybe, trading, pending and special. Those are a good starting point, but we need a filler folder (to hold the blank ‘filler’ cards for our collecting sets) and two more special folders (create one inside future, one inside pending and put one inside trading) for most TCGs. Create those folders inside choices (or whichever TCG you’re creating a post for) and then compare it to this image:

If you’re not quite with me, just create/rearrange your folders so that they’re in the order shown in the image and then make sure that there are copies of config.php and index.php inside the choices folder.
Step Three: Organise Your Cards
If you’re a member of a TCG, use your own cards and sort them into the correct folders above. If you haven’t joined any yet, I suggest saving the cards on my Example Trading Post, which I’m creating as I write this tutorial. Here’s a description of each folder:
- Collecting. When you register at a TCG, you usually have to declare which deck you’re going to collect first. Put any cards from the deck(s) you are collecting inside the collecting folder.
- Future. This folder is for cards from any decks you plan to collect in the future and don’t want to trade away. Simple!
- Mastered. Pretty much what it sounds like – this is for any decks you have completed.
- Maybe. I don’t use this folder, but it’s for cards you want to collect, but will trade for cards from your collecting decks.
- Special. Most TCGs have ‘special’ decks, which have a higher card worth than the normal cards. Those cards need to go in the special folders.
- Trading. Any cards which you aren’t collecting and are happy to trade for just about anything!
- Pending. If you make a trade offer to somebody, put the cards you’ve offered inside pending so nobody else will ask for them.
It should be fairly easy to sort your cards out now — if you want any extra folders (ie specific categories inside trading, or a members folder for member cards), just create them at this stage and I’ll show you how to add them to your post later in the tutorial.
Step Four: Editing config.php
Open the copied config.php (should be in choices or your equivalent) in Notepad or Notepad++ and edit the variables. These are all explained quite clearly, so I’ll just include hints for parts which may confuse less experienced readers.
$cardcount = "/home/YOURDOMAIN/public_html/YOURSUBDOMAIN/FOLDERS/cardcount.php";
<?php echo dirname(__FILE__); ?>
$cardcount = "/home/flower/public_html/tcg/cardcount.php";
Next you’ll need to change your collecting sets. For my example trading post, I’m collecting ootp-sirius, which has 15 cards and is worth 1. I can see from the Choices card page that it’ll look good in rows of 5, so that’s how I will display it too. It’s also not a puzzle deck. In this case, my $collecting array would look like this:
$collecting = array( array(Name => "ootp-sirius", Worth => "1", Num => "15", Row => "5", Puzzle => "no"), );
The mastered decks array works in the same way — once you’ve finished collecting a deck, just copy that line from $collecting and put it in the $mastered array. For my example it would look like this:
$mastered = array( array(Name => "ootp-sirius", Worth => "1", Num => "15", Row => "5", Puzzle => "no"), );
$directories = array( array(Folder => "future/", Section => "Future Collecting", Worth => "1", Page => "1"), array(Folder => "maybe/", Section => "Might Trade", Worth => "1", Page => "2"), array(Folder => "trading/", Section => "Trading", Worth => "1", Page => "2"), array(Folder => "special/", Section => "Specials", Worth => "2", Page => "1"), array(Folder => "trading/pending/", Section => "Pending", Worth => "1", Page => "3"), );
array(Folder => "future/special/", Section => "Future Special", Worth => "2", Page => "1"),
You can also use this section to rearrange the pages on your Trading Post — in conjunction with the menu section which you’ll find at the bottom of the config.php file. After adding the folders we created earlier, the array should look like this:
$directories = array( array(Folder => "future/", Section => "Future Collecting", Worth => "1", Page => "1"), array(Folder => "future/special/", Section => "Future Special", Worth => "2", Page => "1"), array(Folder => "maybe/", Section => "Might Trade", Worth => "1", Page => "2"), array(Folder => "maybe/special/", Section => "Might Trade: Special", Worth => "2", Page => "2"), array(Folder => "trading/", Section => "Trading", Worth => "1", Page => "2"), array(Folder => "trading/special/", Section => "Trading Specials", Worth => "2", Page => "2"), array(Folder => "pending/", Section => "Pending Trades", Worth => "1", Page => "3"), array(Folder => "pending/special/", Section => "Pending Special", Worth => "2", Page => "3"), );
$pageTitles = array ( array(Num => "1", Title => "Keeping"), array(Num => "2", Title => "Trading"), array(Num => "3", Title => "Pending Trades"), array(Num => "4", Title => "Mastered"), array(Num => "", Title => "Index"), );
$pageTitles = array ( array(Num => "1", Title => "Collecting"), array(Num => "2", Title => "Future"), array(Num => "3", Title => "Trading"), array(Num => "4", Title => "Pending"), array(Num => "5", Title => "Mastered"), array(Num => "", Title => "Index"), );
If you’ve added any extra pages (like splitting maybe and trading), you’ll need to go back up to the $directories array and update all the page numbers to match this new set-up, remembering to leave page numbers for collecting and mastered. Always make sure that each page has a different number. When you add or remove pages, remember to adjust the variables just above this section – particularly $pages. These links also appear in the order they do in the file – if you want the index link first, just move the line to the top of the array.
$last = " | <a href='trade.php'>Trade?</a>";
Step Three: Editing Index.php
<?php include("cards.css"); ?>
<?php include("../cards-pink.css"); ?>
<?php include("cardmanager.php"); ?>
<?php include("../cardmanager.php"); ?>
<p><a href="http://daisykitten.net/animals/"><img src="badge.gif" border="0" alt="Kingdom Animalia"></a></p> Card count: <b><?php print($total1)?></b><br> Card worth: <b><?php print($total2)?></b><br>
<!-- Credit link, please do not remove unless you are crediting me on another page. This link only apears on the index page. -->
<?php if(!$_GET['page'] && !$_GET['set']) {echo "<p align='center'><font style='font-size: 8pt'>[Powered by <a href='http://scripts.enchanted-rose.net' target='_blank'>Card Manager</a>]</font></p>";}?>
<!-- End of credit link. -->
<!-- Credit link, please do not remove unless you are crediting me on another page. This link only apears on the index page. -->
<?php if(!$_GET['page'] && !$_GET['set']) { ?>
<!-- PUT YOUR INDEX PAGE HERE -->
<p align="center"><font style="font-size: 8pt">[Powered by <a href="http://scripts.enchanted-rose.net" target="_blank">Card Manager</a>]</font></p>
<?php } ?>
<!-- End of credit link. -->
<!-- Credit link, please do not remove unless you are crediting me on another page. This link only apears on the index page. -->
<?php if(!$_GET['page'] && !$_GET['set']) {?>
<p><a href="http://choices.dustysky.net/"><img src="Jennifer-mc.png" border="0" alt="Choices"></a></p>
Card count: <b><?php print($total1)?></b><br>
Card worth: <b><?php print($total2)?></b><br>
<p align="center"><font style="font-size: 8pt">[Powered by <a href="http://scripts.enchanted-rose.net" target="_blank">Card Manager</a>]</font></p>
<?php } ?>
<!-- End of credit link. -->
Let’s leave this as it is for now, and upload everything to your webspace so you can see how it works and customise it in your own way. I hope you’re feeling confident in using this script now, but if you have any questions at all simply leave a comment on this page and I’ll do my best to help you.
P.S. You can view my real Trading Post, powered by Card Manager, here: tcg.fangirl.co.uk
I just wanted to thank you for this! I think I found it via Google search? Anyway, I had never used a card manager before and I really had no idea what I was doing any I finally got it to work. You have some neat tricks like the “../”
And this: Note: Don’t use any quotation marks here, unless you ‘escape’ the character first by putting a slash in front of it: \”
The helped when I broke everything
The only thing that might help is I had to cheat and read Marfisa’s to find my home directory. The part here called PHP FINDS YOUR FULL PATH! http://clavis-sama.com/tutorials.php?php
Yay, now onward to a life of never counting cards or manually editing again!
Thank you, Siouxsie! I’m glad it helped and I will make sure to add something about finding the full path in my next revison.