PDA

View Full Version : tweak of existing mod (own redirector)


tokenyank
10-25-2005, 10:17 AM
Redlabour has said it is ok to have someone else look into this for me so I am posting a request. (oringinal mod: https://vborg.vbsupport.ru/showthread.php?t=98131&page=1&pp=15)

Basically what this mod does (if you haven't yet seen it) is parse all links through your own redirector (local links.php rather than a service like anon.to or safeurl.de)...

This works fine as it is now, but it only parses links with www. in the url so any links posted without the www is still a direct link.

I've tried to change the code myself with no success (https://vborg.vbsupport.ru/showpost.php?p=802339&postcount=12)


Basically, all I want is the abilibilty to declare multiple domains in class_bbcode...

i.e. this:

$url_info = parse_url($rightlink);
if ($url_info["host"]=="www.YOURDOMAIN.de"):
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
else:
return "<a href=\"http://www.YOURDOMAIN.de/forum/links.php?url=$rightlink\" target=\"_blank\">$text</a>";
endif;


to this:

$url_info = parse_url($rightlink);
if ($url_info["host"]=="www.YOURDOMAIN.de") || ($url_info["host"]=="YOURDOMAIN.de") || ($url_info["host"]=="http://YOURDOMAIN.de") || ($url_info["host"]=="http://www.YOURDOMAIN.de") || ($url_info["host"]=="YOURDOMAIN2.de") || ($url_info["host"]=="YOURDOMAIN3.de"):
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
else:
return "<a href=\"http://www.YOURDOMAIN.de/forum/links.php?url=$rightlink\" target=\"_blank\">$text</a>";
endif;

Could someone good in php tell me how to add extra domains to that variable so that they do not parse?

Thanks in advance

Anyone? Bueller?

haha, I like the automerge! Bumping has to be more creative now, eh? :D



So what happens if you need to make another post ? Weired!