Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: kbox - joulukuu 21, 2005, 09:07:34 IP

Otsikko: Precede all outgoing URLs with code.
Kirjoitti: kbox - joulukuu 21, 2005, 09:07:34 IP
Hi.

Im looking to add http://mysite.com/redir.php?goto= before all urls posted and all urls in peoples sigs.

I want to do this so i can track which links are clicked and to prevent spammers gaining PR from posting in my forum..

Can someone tell which files i need to edit and where to include this jumper script to allposted URL's?

thanks.
Otsikko: Re: Precede all outgoing URLs with code.
Kirjoitti: kbox - joulukuu 22, 2005, 08:00:11 IP
buzump
Otsikko: Re: Precede all outgoing URLs with code.
Kirjoitti: -MunDy- - joulukuu 23, 2005, 02:48:31 AP
I'm not 100% sure wether this is the best way (or even the correct way) as I'm a bit of a novice, but from poking around the SMF code, it seems that Sources/Subs-Post.php is where the bbc code is parsed. If you found where it parses the url tags from this:

[url=http://thisisasite.com/]OMGSPLOSION[/url]

to this:

<a href="http://thisisasite.com/">OMGSPLOSION</a>

You could just tell it to add http://mysite.com/redir.php?goto= to the start of the href=

As for signatures and profiles, you'll need to find which script handles them, and edit it. I'd assume they are handled in similar ways. Just go poking around the code in /Sources/ and read the comments etc and you should find what you're looking for.

Hope I helped.
Otsikko: Re: Precede all outgoing URLs with code.
Kirjoitti: kbox - joulukuu 23, 2005, 10:44:39 AP
Cheers Mundy, the main problem was finding the file which deals with converting bbcode.
I'll have a look round that sources dir, hopefully that will yield some results.

Thanks.