Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-21-2003, 05:07 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Code to prevent linking from specific site(s)

I know this is possible because I have seen it done on a commercial site.

What I need is code to prevent somebody from linking to my board (any where on my board) from a given site. If somebody clicks on a link to my board from that site, they should get a custom error message that says something along the lines of "We do not welcome traffic from this site" or whatever.

Every once in a while, I get "freebied" by some of the major freebie boards. They descend and kill my server and I would like to shoo them off.

Amy
Reply With Quote
  #2  
Old 04-21-2003, 05:24 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

amy I guess the samples in this page might help to ban sites in .htaccess according to referrer info:
http://diveintomark.org/mobile/002210.html
Reply With Quote
  #3  
Old 04-21-2003, 05:33 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Logician. I tested by blocking one of my own sites, and it worked. Hopefully, it will solve my problem

Amy
Reply With Quote
  #4  
Old 04-21-2003, 07:22 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just play with the $url that gets defined in global.php.

I disallow guest access to my forums at peek times. But I have made an exception to allow people who visit my board from VB.org to come in at any time, and I display a welcome note at the top of the loaded page.

Click on my profile link and check it out.

http://www.ls1.com/forums/member.php...fo&userid=4112
Reply With Quote
  #5  
Old 04-22-2003, 02:31 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 02:22 PM Zzed said this in Post #4
You can just play with the $url that gets defined in global.php.

I disallow guest access to my forums at peek times. But I have made an exception to allow people who visit my board from VB.org to come in at any time, and I display a welcome note at the top of the loaded page.

Click on my profile link and check it out.

http://www.ls1.com/forums/member.php...fo&userid=4112
How do you do that exactly?
Reply With Quote
  #6  
Old 04-22-2003, 09:31 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 07:31 PM Boofo said this in Post #5
How do you do that exactly?
In global.php:
Look for:
Code:
// check to see if server is too busy. this is checked at the end of session.php
And insert this right above it:
Code:
if(strstr($url, "http://www.vbulletin.org")) {
  // Insert code here...
}
Reply With Quote
  #7  
Old 04-22-2003, 10:29 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:31 AM Zzed said this in Post #6
In global.php:
Look for:
Code:
// check to see if server is too busy. this is checked at the end of session.php
And insert this right above it:
Code:
if(strstr($url, "http://www.vbulletin.org")) {
  // Insert code here...
}
I don't allow guests to view threads or messages at all. How would I make it so if I linked to something on my site from vb.org here, the link would show, but only for this site?
Reply With Quote
  #8  
Old 04-22-2003, 11:01 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:29 AM Boofo said this in Post #7
I don't allow guests to view threads or messages at all. How would I make it so if I linked to something on my site from vb.org here, the link would show, but only for this site?

Ok, I have not tested this but here it goes.

change the if() statement from my previous post to this:
Code:
$vb_org = 0;
if(strstr($url, "http://www.vbulletin.org")) {
  $vb_org = 1;
}
In showthread.php there are 2 instances of the following code:
Code:
$getperms=getpermissions($thread['forumid'],-1,-1,$forum['parentlist']);
Insert the following code directly below both of them:
Code:
if($vb_org == 1) {
  $getperms['canview'] = 1;
}
This should allow a one time temporary view permission to VB.org visitors.
Reply With Quote
  #9  
Old 04-22-2003, 02:53 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you zzed.

You gave me the info I need to track what people are searching for at Google that makes them wind up at my site.

Instead of checking for vbulletin.org, I check for google. Then, I update a new table with the url. I use webtemplates to display the table to me and let me see what people were searching for. (the search term is in the url)

Amy

ps, How I did it is here: https://vborg.vbsupport.ru/showthrea...526#post385526
Reply With Quote
  #10  
Old 04-22-2003, 04:03 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're very welcome Amy.
Reply With Quote
Reply


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 02:54 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.04880 seconds
  • Memory Usage 2,266KB
  • 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
  • (7)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete