View Full Version : lost
Dixiemill
04-25-2002, 05:28 PM
I can't seem to locate the thread(s) about how to disable HTML tags. A search on the word "HTML" doesn't seem to yield the thread(s) I'm looking for.
:ermm:
- I want to disable all HTML tags. without disabling the vb codes.
- I want "Automatically parse URLs: automatically adds and around internet addresses. " to always be "no"
- I want the button http:// to not work
I want to stop my website url from showing up on other servers via referrers. I host a private site on a private url and intend to keep it that way. (We've been hacked and cracked at least 4 times already and want to do everything we can to stop it.)
NTLDR
04-25-2002, 06:03 PM
Firstly, to remove the http:// and prevent automaticly putting [ URL ] around URLS you need to remove the vb code for the [ URL ] tag in the admin CP, to disable HTML in posts you change the relevent option in the vBulletin Options part of the Admin CP.
Hope this helps,
Lee
Dixiemill
04-25-2002, 06:15 PM
you need to remove the vb code for the [ URL ] tag in the admin CP
I'm in the Admin CP, clicked on "modify custom VB Codes" The URL tag is not in there. Doesn't exist. I have bold, italic, email, etc. but not url.
I've looked all around the admin Cp and the php files....
In templates the response for the "automatically parse urls" is a $parseurlChecked value... how and where do I set that value so that it is permanently unchecked.
NTLDR
04-25-2002, 06:29 PM
OK, To remove the Parsing of URL's I think you need to remove the following from functions.php (Make sure you backup the file first, I haven't tested it and am not resposible if it goes wrong ;) )
And remove $parseurlChecked from the template
// ###################### Start checkurl #######################
function checkurl($url, $hyperlink="") {
$righturl = $url;
if(!preg_match("![a-z]://!si", $url)) {
$righturl = "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>";
}
// ###################### Start parseurl #######################
function parseurl($messagetext)
{ // the auto parser - adds tags around neccessary things
global $urlSearchArray, $urlReplaceArray, $emailSearchArray, $emailReplaceArray;
if (!isset($urlSearchArray)) {
$urlSearchArray = array(
"/([^]_a-z0-9-=\"'\/])((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si",
"/^((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si"
);
$urlReplaceArray = array(
"\\1[url]\\2\\4",
"\\1\\3"
);
$emailSearchArray = array(
"/([ \n\r\t])([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4}))/si",
"/^([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4}))/si"
);
$emailReplaceArray = array(
"\\1\\2",
"\\0"
);
}
$text = preg_replace($urlSearchArray, $urlReplaceArray, $messagetext);
if (strpos($text, "@")) {
$text = preg_replace($emailSearchArray, $emailReplaceArray, $text);
}
return $text;
}
Let me know if that works.
Dixiemill
04-25-2002, 06:31 PM
I'll try that. Right now one of our servers just crashed... might be sometime before I get back to you. Thank you for the quick reply.
NTLDR
04-25-2002, 06:36 PM
No problem Dixiemill I hope it works for you :D
Dixiemill
04-25-2002, 07:54 PM
I found that removing the code from checkurl and parseurl erases the whole message if a link is anywhere in the message.
But your lead was not in vain... I was successfully able to disable "hotlinks" by simply changing the last line in the function checkurl from:
return "<a href=\"$righturl\" target=\"_blank\">".str_replace('\"', '"', $hyperlink)."</a>";
to:
return "<a =\"$righturl\" >".str_replace('\"', '"', $hyperlink)."</a>";
now when I type www.test.com in the message or use the http:// button in the vbcode area the url appears as text not a hotlink.
NTLDR
04-25-2002, 07:59 PM
I knew that code had something to do with it, and as it wasn't a vB code in the admin CP I guessed it would be in funcions.php so I just did a quick serach, I'm glad it helped :D
Was there anything else that you needed help on or was it just the hyperlinks?
Dixiemill
04-25-2002, 08:01 PM
Just the hyperlinks... I'm trying to keep my site url from appearing on other servers via referrers.
Thanks again for all the help.
NTLDR
04-25-2002, 08:09 PM
No problem, glad I could help you out.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.