Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 05-23-2003, 01:16 AM
DelFDgfd_gT DelFDgfd_gT is offline
 
Join Date: Oct 2001
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Ban Browser

Im sessions table in PHPMyAdmin You can view browsers. I wanted to know, How can I can a certain browser from my forums?
Seems small and easy, can anyone help?
Reply With Quote
  #2  
Old 05-23-2003, 01:28 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure?

You can add this to the bottom of your "phpinclude" template:

To allow IE only:

PHP Code:
if (!eregi("MSIE",$HTTP_USER_AGENT)) show_nopermission(); 
To allow Netscape only:

PHP Code:
if (!eregi("Netscape",$HTTP_USER_AGENT)) show_nopermission(); 
To allow Mozilla only:

PHP Code:
if (!eregi("Mozilla",$HTTP_USER_AGENT)) show_nopermission(); 
Reply With Quote
  #3  
Old 05-23-2003, 01:59 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For shame, using the ereg functions!

Better (according to php.net):
PHP Code:
if (preg_match("/.*MSIE.*/siU"$_SERVER['HTTP_USER_AGENT'])) show_nopermission(); 
Faster (according to my completely untested theories):
PHP Code:
if (strpos("MSIE"$_SERVER['HTTP_USER_AGENT']) != falseshow_nopermission(); 
Reply With Quote
  #4  
Old 05-23-2003, 11:31 PM
DelFDgfd_gT DelFDgfd_gT is offline
 
Join Date: Oct 2001
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, I didnt wanna "allow IE only" or "allow mozilla only" thats completely irrelevant to what I asked.

What I want is to BAN a user using the browser:
Quote:
Internet Explorer V Hohoh , i bet you wish you knew ++++ you though.
Block browsers.
Reply With Quote
  #5  
Old 08-30-2003, 08:49 PM
Linux's Avatar
Linux Linux is offline
 
Join Date: Feb 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I am not sure but this is a pseuocode if some one can recheck it will be grateful


PHP Code:
$agent $_SERVER['HTTP_USER_AGENT'];
    if(
$agent == "AGENT_NAME"){
        
header("Location:htt p : //url_to_e-direct_the_user");
        exit();
    } 
change AGENT_NAME to whatever brower you want to ban

for ex : IE = Mozilla/4.0
Reply With Quote
  #6  
Old 08-30-2003, 08:58 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Provided that AGENT_NAME is the full name and not a subsring of it like Mozilla/4.0 then that will work fine.
Reply With Quote
  #7  
Old 08-31-2003, 03:20 AM
Linux's Avatar
Linux Linux is offline
 
Join Date: Feb 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes

You must Provided the full name of the AGENT

for example you cannot just add WebCopier

it must be WebCopier v3.5
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 01:51 PM.


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.10794 seconds
  • Memory Usage 2,221KB
  • 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
  • (6)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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