Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: PurpleCrow on July 23, 2010, 01:32:40 PM

Title: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 01:32:40 PM
It is possible to add an image that appears before links that are posted by members/staff etc when they use the URL BBCode? If so, how would I go about it?
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 01:43:50 PM
One specific image?
Title: Re: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 01:53:48 PM
Yeah, I'd like to have the hyperlink symbol to appear just before the link.
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 01:56:32 PM
Heh...

If that was me, I'd use the "Censored words" feature, to do that.

If you censor "{url", so that it gets changed to "{img}http://www.yourimageurl.com/image.gif{/img}{url="

it should work.

Squared brackets, though, obviously. ;)
Title: Re: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 01:59:54 PM
Ooo good idea, I'll give it a go :D
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 02:01:48 PM
Easier than all that coding stuff, innit? ;)
Title: Re: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 02:09:26 PM
Worked perfectly! Will play around with the image so it looks slightly better postioned but here's a link to a random thread with a link in to show you how it ended up - http://thewitchespath.com/index.php?topic=499.0
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 02:18:20 PM
Dead easy to change the image, too!

Nice one, squirrel!
Title: Re: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 02:22:51 PM
Definately :D

Another question... Should probably start a new thread but... How would I add small images before peoples usernames? So that where ever their username appears a little icon is displayed just before it?
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 02:27:43 PM
Without doing censored words for every name, I don't know.

On one forum that I used to visit, they did that so that everyone's name was replaced by an image, using censoring.

That would be a right pain, if you have loads of members, though.
Title: Re: Adding an image before posted links
Post by: PurpleCrow on July 23, 2010, 02:31:22 PM
Hmm yeah would be a pain... Hmm will see if I can work out a way of coding it. Although, I dont even know how usernames are coded or if they are coded into different usergroups or not... Hmm!
Title: Re: Adding an image before posted links
Post by: kat on July 23, 2010, 02:36:29 PM
Looking at index.template.php, it looks like it might be ['user']. As in:

if ($context['user']['is_logged'])

I could well be wrong, though...