The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
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 Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
checkurl() function in functions.php, around line 930.
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
Here's your right function:
Code:
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>";
}
|
![]() |
|
|