PDA

View Full Version : BBCode Adoptable Reference - VERY SMALL MOD


The Codfin Keeper
02-12-2011, 04:12 PM
Okay, this is a code so users can reference adoptables on your site without having to use img and url codes wherever there's BBCode enabled.

Under the folder inc, open up bbcodes.php:

Where it has all the BBCodes, under one of them put:

$text = preg_replace('|\[adoptable\](.+?)\[\/adoptable\]|i', '<a href="/levelup.php?id=$1"><img src="/siggy.php?id=$1"></a>', $text);

...where "adoptable" can be changed to your liking.

Have fun, and this is a very small mod, if you didn't see so by the title.

RoconzaArt
02-12-2011, 07:08 PM
Um I don't understand can you explain it to me.

PTGigi
02-13-2011, 12:50 AM
Oh hey this :3 I remember you talking about this 8D

To ignore the 'yoursite' thing you can change it to:

<img src="/siggy.php?id=$1"> Something like that :3 It auto adds the beginning

Why is my text red all of a sudden? D:

The Codfin Keeper
02-13-2011, 05:53 AM
@Gigi - lol ok I'll change that.

@Roconza - basically it's adding a new BBCode to the list of BBCodes (bold, italics, color, image, url, etc.) that allows users to reference an adoptable (levelup link and image) using one BBCode tag. This involves going into that BBCode file on your Mys site, and adding this in so you and other users can use it wherever BBCode is allowed on your site.