Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
VERY quick avatar/attachment protector Details »»
VERY quick avatar/attachment protector
Version: 1.00, by CJi CJi is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-13-2002 Last Update: Never Installs: 4
 
No support by the author.

This has probably been written before (I haven't checked), but I am beginning to get annoyed with people linking to my attachments/users avatars. It's quick, it's dirty, and it works. Installation time: 15 seconds per file. Number of files to edit: 2.

PHP Code:
$referers = array ('www.yourforums.com','yourforums.com','aaa.bbb.ccc.ddd'); 

function 
check_referer($referers){ 
   if (
count($referers)){ 
      
$found false
      
$temp explode('/',getenv("HTTP_REFERER")); 
      
$referer $temp[2]; 
      for (
$x=0$x count($referers); $x++){ 
         if (
ereg ($referers[$x], $referer)) { 
            
$found true
         } 
      } 
      if (!
$found){ 
      exit;
      } 
         return 
$found
      } else { 
         return 
true;
   } 


check_referer($referers); 
Edit the $referers array with your details (DOMAINS and IP Addresses ONLY. Do NOT include path information or 'http://').

Place at the top of avatar.php and attachment.php just after:

PHP Code:
<?php
Hope this is of help to some people.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-15-2002, 07:36 AM
CJi CJi is offline
 
Join Date: Oct 2001
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Other requests I'll deal with later Got to get back to work now.
Reply With Quote
  #23  
Old 07-15-2002, 08:41 PM
wot-Mike wot-Mike is offline
 
Join Date: Oct 2001
Location: Netherlands
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, one request I have:

in case somebody is hotlinking, could this script be made so that a default image is served instead of the one they want?

I like the idea of advertising my site for free
Reply With Quote
  #24  
Old 07-17-2002, 06:55 AM
CJi CJi is offline
 
Join Date: Oct 2001
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'd be better off doing that with htaccess files, but the script could be changed to do this I suppose, although that wasn't it's intended purpose. I apologise for being busy, I'll attempt to get everything sorted out at the weekend.
Reply With Quote
  #25  
Old 07-29-2002, 12:23 PM
WebMasterAJ WebMasterAJ is offline
 
Join Date: Oct 2001
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps I am missing the point of this hack, but should the image below be blank? My server is hosting that image, yet it is still displaying that image. If I am using the wrong hack for what I want to do, can someone please re-direct me?
Thanks!

Reply With Quote
  #26  
Old 07-29-2002, 01:32 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats because...

That image isnt stored in Avatar.php

Satan
Reply With Quote
  #27  
Old 07-29-2002, 02:44 PM
WebMasterAJ WebMasterAJ is offline
 
Join Date: Oct 2001
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is gonna sound really stupid, and probably makes no sense.... but how do you store it in Avatar.php?

The only reason why I'm asking is because a lot of people are using my avatars for avatars on other message boards... and this isn't just one or two peopel... its more than 10...

Thanks for your help...
Reply With Quote
  #28  
Old 07-29-2002, 02:51 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

By stored, i mean...

You havent linked that image from your avatar in your posts...

https://vborg.vbsupport.ru/avatar.ph...ine=1023286012

A link to my avatar at vB.org...

http://www.darkblazes.com/forums/ava...ine=1027536317

A link to my avatar at DarkBlazes.com (my forums)...

It get stored when you upload it as your avatar...Just like an attachment link from DarkBlazes.com wont work here...

You have to have actually requested that image/attachment from your board, not your server...

Satan
Reply With Quote
  #29  
Old 10-20-2002, 08:50 PM
omniweapon omniweapon is offline
 
Join Date: Nov 2001
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this hack, but users are complaining saying they can't see the images even when they're on the forum. And I've put these in the referrers array:

www.ppgworld.com , ppgworld.com , 206.126.4.17

The forums are located on forums.ppgworld.com
Reply With Quote
  #30  
Old 10-20-2002, 08:57 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you'll need to add forums.ppgworld.com too as your blocking that domain.
Reply With Quote
  #31  
Old 10-23-2002, 04:58 PM
omniweapon omniweapon is offline
 
Join Date: Nov 2001
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did. Still caused problems with users. Had to uninstall it.
Reply With Quote
Reply

Thread Tools

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:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12628 seconds
  • Memory Usage 2,302KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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