vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Stop Users from Cross-linking Attachments (https://vborg.vbsupport.ru/showthread.php?t=35399)

Guru 09-08-2002 10:38 PM

I see a small red "X" You may be seeing a cached image in your browser. Try "Refresh."

SgtSling 09-10-2002 01:14 PM

ok this is working for me..
I can't see attachment images on other websites...
BUT...

All mp3 files cannot be downloaded from my domain. For some reason when you click to download it downloads the .gif

Does anyone know?

Rapdis 09-10-2002 10:42 PM

thanks guru... u were right

Ritsui 09-11-2002 03:38 PM

If you're on a win32 server, use "rb" in place of just "r" in your call to fopen. I'm sure this will be irrelevant to 99% of everyone on the planet, but since my forum has both Linux and Windows servers, I made a version that works on both:
PHP Code:

if (! strstr($checkurl"domain")) {
  
// what server, Linux or Win32?
  
$svr 'lin';
  if (!
file_exists("/etc/fstab")) { $svr 'win';} 

  
// Substitute our Logo
  
header("Content-Type: image/gif"); 
  if (
$svr == 'win') {
    
$readflag 'rb';    // binary read flag for windows server
    
$imgfile "c:\\pathto\\image.jpg";
  }
  else {
    
$readflag 'r'// standard read flag
    
$imgfile "/pathto/image.jpg";
  }
  
$image fread(fopen($imgfile,$readflag),10000); 
  echo 
$image
  
fclose($image);
  exit; 



Guru 09-11-2002 11:23 PM

Thanks for the addition. That's cool. I added a link to this post with a note in the original hack.

groovesalad 09-15-2002 08:34 PM

Quote:

Originally posted by DR2000
A slight variation for those who are interested:

I have a forum set up so guests wouldn't be able to see the attachments, and attachments themselves are shown right in the thread (not with a link).

So the following change in code does the following:
- all guest see an specified image instead of an attachment.
- whoever tries to link to your attachment image from the different site will not be able to show it. the replacement image is going to show up instead of whatever is in attachment for all unregged people.

Find this in attachment.php:
PHP Code:

$permissions=getpermissions($getforuminfo[forumid]);
if (!
$permissions[canview] or !$permissions[cangetattachment]) {
  
show_nopermission();


and replace show_nopermissions(); with this:

PHP Code:

  header("Location: [url]http://www.4adrive.com/img/attachment.jpg[/url]");
  exit; 

So here's how it should end up looking:
PHP Code:

$permissions=getpermissions($getforuminfo[forumid]);
if (!
$permissions[canview] or !$permissions[cangetattachment]) {
  
header("Location: [url]http://www.4adrive.com/img/attachment.jpg[/url]");
  exit;


Of course replace the url of the image to whatever you want displayed there.

I use the following image:
http://www.4adrive.com/img/attachment.jpg

How do I get this image to show up without a link?

omniweapon 09-29-2002 03:39 PM

Did anyone notice if you place this code in your avatar.php script, it'll prevent your avatars from being hotlinked too? Awesome!

omniweapon 09-30-2002 03:50 AM

O.....kay. I now have about 6 users saying they can't see the attachments or avatars absolutely anywhere. Even linked on the board. But it works fine for everyone else. I'm confused now.

Guru 09-30-2002 11:25 PM

Some of our users that use IE 6.0 have reported that problem. Are you running the latest vBulletin?

omniweapon 10-05-2002 10:05 PM

Quote:

Originally posted by Guru
Some of our users that use IE 6.0 have reported that problem. Are you running the latest vBulletin?
Yep. vBulletin 2.2.8. And it seems to be an issue with AOL users mainly.


All times are GMT. The time now is 11:12 AM.

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.01253 seconds
  • Memory Usage 1,748KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete