Myfreeforum Tooltips
This section illustrates the short step by step procedure for adding Magic the Gathering or World of Warcraft card tooltips to your myfreeforum forum.
Sadly, the myfreeforum administration panel and fuctions make our work a bit more complicated than other forums, because of the way it handles site templates and styles. Administrators are not allowed to edit the default site templates, but they are allowed to edit copies of them. So what we will do is make a copy the default site template, set it as the new default, and delete the original. Then we will edit this new default template to enable card tooltips. These steps are illustrated in the following screenshots.
The deletion of the original site template is necessary because we want to prevent users from selecting that template as their default, as those users will then no longer see the card tooltips.
The administration panel only lets us edit the templates with a user called editor. You have to sign up as this special user, then log in with the admin user and give editor administration privileges from the Users / Permissions section
Copying the site template to a new default
Now log in with your newly created 'editor' user, head over to Styles / Edit Templates, and copy your forum template into a new one, as shown in the screenshot.
In the same Styles / Edit Templates section, you should now be able to choose the newly created template in the Choose Template to Edit section, and click on Submit. In this template page, the first dropdown shows a list of all forum templates. We will choose viewtopic_body.tpl, and click Submit.
A textarea with the template will open. Here, we will add the javascript code that will magically transform card names and deck listings into nice tooltip links. :) Before the first line in the file, add the following snippet:
<script src="https://deckbox.org/assets/external/tooltip.js"></script>
<script src="https://deckbox.org/assets/external/decks.js"></script>
. Then, after the last line, add the following:
<script>Deckbox.utils.DeckParser.initializeMyfreeforum('mtg');</script>
If you are using this for World of Warcraft or Warhammer:Invasion tooltips, replace 'mtg' with 'wow' or 'whi' respectively.
Now click Save and Exit. Once again back on the template edit page, you will see a Make Default button (third subsection), which you will press to set our new template as the forum default. The last step is to delete the old template that we have copied, so that users cannot select that one anymore, as it does not contain the tooltip code. For this, head over to Styles / Management, and click on Delete
And you're done! From now on, all posts containing [card] tags around card names, and [deck] tags around decklists will turn these into nice links that show tooltips when you hover over them, like in the following example:
[deck] 1 Baneslayer Angel 2 Naturalize 4 Terminate [/deck] Maybe add an [card]Abyssal Persecutor[/card] too. |
turns into |
1 Baneslayer Angel 2 Naturalize 4 Terminate Maybe add an Abyssal Persecutor too. |
If you have problems with any of the steps, or my explanation is lacking in places, do not hesitate to send an email at admin@deckbox.org, I'll help you set it up!