Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 04-25-2002, 05:28 PM
Dixiemill Dixiemill is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default lost

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.)
Reply With Quote
  #2  
Old 04-25-2002, 06:03 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 04-25-2002, 06:15 PM
Dixiemill Dixiemill is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #4  
Old 04-25-2002, 06:29 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

PHP Code:
// ###################### 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==$urliif(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 [url] 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[/url]",
      
"[url]\\1\\3[/url]"
    
);

    
$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[email]\\2[/email]",
      
"[email]\\0[/email]"
    
);
  }

  
$text preg_replace($urlSearchArray$urlReplaceArray$messagetext);
  if (
strpos($text"@")) {
    
$text preg_replace($emailSearchArray$emailReplaceArray$text);
  }

  return 
$text;


Let me know if that works.
Reply With Quote
  #5  
Old 04-25-2002, 06:31 PM
Dixiemill Dixiemill is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-25-2002, 06:36 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem Dixiemill I hope it works for you
Reply With Quote
  #7  
Old 04-25-2002, 07:54 PM
Dixiemill Dixiemill is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 04-25-2002, 07:59 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Was there anything else that you needed help on or was it just the hyperlinks?
Reply With Quote
  #9  
Old 04-25-2002, 08:01 PM
Dixiemill Dixiemill is offline
 
Join Date: Apr 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just the hyperlinks... I'm trying to keep my site url from appearing on other servers via referrers.

Thanks again for all the help.
Reply With Quote
  #10  
Old 04-25-2002, 08:09 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, glad I could help you out.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04124 seconds
  • Memory Usage 2,264KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete