View Full Version : BB Code [url]
stamper
12-16-2001, 07:06 AM
Hi guys,
I can't find a option, where I can edit the bb code for [url]! Where is this option saved? I want to know it, because I want to add to every directlink a redirect script!
In the BB Code.php I can't find this option!
I HOPE FOR FAST HELP!
GREETZ BRIANNA STAMPER
Admin
12-16-2001, 11:37 AM
checkurl() function in functions.php, around line 930.
stamper
12-20-2001, 01:19 PM
thx for the first help!
i have edited the code so:
function checkurl($url, $hyperlink="") {
$righturl = $url;
if(!preg_match("![a-z]://!si", $url)) {
$righturl = "http://freemail.web.de/jump.htm?url=http://$righturl";
}
// remove threat of users including javascript in url
/*$righturl = preg_replace("/javascript:/si", "java script:", $righturl);
$righturl = preg_replace("/about:/si", "about :", $righturl);*/
$hyperlink = iif(trim($hyperlink)=="" or $hyperlink==$url, iif(strlen($url)>55,substr($url,0,35)."...".substr($url,-15),$url) ,$hyperlink);
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
}
Now every link with www.xxx.com will be linked so:
http://freemail.web.de/jump.htm?url=http://www.xxx.com
But when somebody write the link http://www.xxx.com, the redirect link, which I wish, isn't add!
where must I change the code? I hope for fast help!
greetz stamper
Admin
12-20-2001, 02:11 PM
Here's your right function:
function checkurl($url, $hyperlink="") {
$righturl = $url;
if(!preg_match("![a-z]://!si", $url)) {
$righturl = "http://$righturl";
}
$righturl = "http://freemail.web.de/jump.htm?url=" . $righturl;
// remove threat of users including javascript in url
/*$righturl = preg_replace("/javascript:/si", "java script:", $righturl);
$righturl = preg_replace("/about:/si", "about :", $righturl);*/
$hyperlink = iif(trim($hyperlink)=="" or $hyperlink==$url, iif(strlen($url)>55,substr($url,0,35)."...".substr($url,-15),$url) ,$hyperlink);
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.