DeckConstruct Forums

Full Version: Autocard for MyBB forums
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you have an MTG forum that runs on MyBB (like this one does), you might be interested in how to implement autocard for MTG cards. Here how.

1. Head over to your Admin CP and login, then go to Configuration and click MyCode on the left-hand side.

2. Click Add New MyCode and give your MyCode a name (like Autocard!). You don't have to put a short description but if you want to, you can.

3. In the Regular Expression box, put this in:

Code:
\[c\](.*?)\[/c\]

4. In the Replacement box, use this:

Code:
<a href="http://magiccards.info/autocard.php?card=$1" onclick="return !window.open(this.href,'_blank','width=800,height=600,menubar=no,resizable=yes,s​crollbars=yes'); return false;" title="$1">$1</a>

5. Test your code in the Sandbox. If it's all good, hit Save MyCode and you're done!

If you also want to link to cards without using the card name, put this in a new MyCode in Regular Expression:

Code:
\[c=(.*?)\](.*?)\[/c\]

and this in Replacement:

Code:
<a href="http://magiccards.info/autocard.php?card=$1" onclick="return !window.open(this.href,'_blank','width=800,height=600,menubar=no,resizable=yes,s​crollbars=yes'); return false;" title="$1">$2</a>

There you go!
Reference URL's