Support for PhpBB3 BBCodes.
Post here to get help with any BBCode related issue
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe exactly what it is you want.
3. Tell us what version of phpBB3 you are currently using.
Else your topic may be ignored or locked!
I have a fan site for a trading card game. I created a database with all the cards and images in it. Now I want to write a custom BBCode that searches my database for the card image given the name. Something like this:
Thanks for the response, but that's not exactly what I'm looking for. That would work great assuming the poster knows the url of the image. But since they more than likely won't know the url, I would like to look it up in the database.
So I guess my real question is: Is there a way to do this using PHP or javascript? I actually tried using PHP already in the "HTML Replacement" field, but it didn't work because when I try to run the $rs->execute($query), I'm guessing the "greater than" sign is causing a parsing problem, and I don't get the expected result.
Anyway, if there is any insight you can provide, it is much appreciated.
what Stoker is saying is simple, if you have the images of the cards, just upload them in a particular folder inside your images folder and use the html replacement similar to what Stoker pointed to, that way you use the bbcode just like the country flag bbcode uses!
The problem is my card images are not stored including the name. They are stored something like "./images/cards/ST4.jpg", where "ST" is the abbreviation for the set name, and 4 is the card number.
So here's what I'd like to have happen. The poster types something like:
And the code would take the card name, and look up the set and number in the database so I can create the url. So it would look up "Infiltrate" and find that the set is "ST" and the number is 4. Then I can create the string: "./images/cards/ST4.jpg".
Yes, but the user will not know "ST4", he will only know that the name of the card is "Infiltrate". I need some way of looking it up without the user knowing the set and number.
I have a card database consisting of over 300 cards. Each card has a unique image. For example, "Infiltrate" is ST4.jpg, "Forge" is ST20.jpg, etc. But the user does not know the image names, he only knows that there exists a card named "Infiltrate" and a card named "Forge".
Now here's where the magic happens. And I'm not sure how to do this. I need to be able to take the user's input, ie. the card name, and search a database to get the image name so that I can display the correct image. Once this is done, the above would be replaced with: