vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   attachements.php ? (https://vborg.vbsupport.ru/showthread.php?t=44779)

etones 10-20-2002 10:53 AM

attachements.php ?
 
Is there a simple way to make sure that attachments stored in the DB cant be hot linked by extrernal sites?

Secondly, is there a hack that will only allow you to se an attachment if you are a registed member?

Cheers,
Taz

Chris M 10-20-2002 11:06 AM

@etones - Just set the attachments to "display a link to the attachment", then set Guest viewing permissions "can download attachments" to NO...

As for the attachments protection :

Open up attachment.php (root folder)

Find :

PHP Code:

<?php

add after it
PHP Code:

$referers = array ('www.yoursite.com','yoursite.com','123.456.7.8'); 

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); 

Change "yoursite.com", "www.yoursite.com", and "123.456.7.8" to the proper values:)

123.456.7.8 = your site's IP address;)

You can also do the same for avatar.php, if you dont want them to be able to view your avatars off your site:)

i.e.

My Profile with Avatar <- Viewing from my site

http://www.darkblazes.com/forums/ava...ine=1034425026 <- My avatar - Cant view it:)

Satan

etones 10-20-2002 11:10 AM

nice one hellsatan, appreciate that one! :D

Cheers,
Taz

Chris M 10-20-2002 11:14 AM

No probs:)

I found this a while back on vB.org myself - Its very useful:)

Satan


All times are GMT. The time now is 01:51 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.01126 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete