vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Links and Files Database (https://vborg.vbsupport.ru/showthread.php?t=60403)

Natch 08-03-2004 04:32 AM

Thanks buddy :)

AndrewD 08-03-2004 04:35 AM

Those concerned about bandwidth and not about file theft might try the following patch. Edit local_links.php and find line: (about line 1900, depending on version)

PHP Code:

if ($_REQUEST['action'] == "jump") { 

About 50 lines further down find these lines
PHP Code:

if (!is_array($mimetype)) { 
// no mimetype, so assume this is a regular link
        
$hit record_hit($id$url$LINK_OK);
        eval(
print_standard_redirect('Redirecting.',0));
    } else { 

Change the
PHP Code:

if (!is_array($mimetype)) { 

to something that is always true, e.g.
PHP Code:

if (1) { 

All link/file accesses will then be handled as redirects, so I imagine this will reduce bandwidth use for files with known mimetypes coming from a remote site.

The change will have no effect for filetypes that do not have recognised filetypes, and I suspect that it will have little if any effect for files held on your own server (but I may be wrong).

However, this improvement is at the cost of potentially making visible where the files are stored and it also causes one or two changes in the way windows are opened.

Appreciate feedback. Cheers.

Natch 08-03-2004 04:40 AM

So there is no way to have leech-protection on but without the doubled bandwidth use?

AndrewD 08-03-2004 05:09 AM

Quote:

Originally Posted by Natch
So there is no way to have leech-protection on but without the doubled bandwidth use?

Not that I've found. Seems to me that you either ask the server to read the file and pass it on in a controlled way to the client (sequences of fopen/fread/fclose), or you ask the client to go away and read the file for itself (javascript or meta tag). If the server reads the file, then by definition twice the bandwidth is used. If the client reads the file, then you have to tell it which file to read.

But I may be wrong :rolleyes: and would be delighted to learn :squareeyed:

Natch 08-03-2004 11:05 AM

You should be able to cause your PHP script to redirect to a second PHP script designed just to mask the location - it would contain just a
Code:

Header: mime-type yadda yadda
statement followed by the contents of the file - if the file is local then there hsould be no bandwidth increase ... am I totally off base here ?

AndrewD 08-03-2004 11:09 AM

Quote:

Originally Posted by Natch
You should be able to cause your PHP script to redirect to a second PHP script designed just to mask the location - it would contain just a
Code:

Header: mime-type yadda yadda
statement followed by the contents of the file - if the file is local then there hsould be no bandwidth increase ... am I totally off base here ?

Yes, that's essentially what the current code does, and it works fine. The question that was raised concerns the increased bandwidth when the file to be downloaded is held on a third machine. In that case, the main server has to read the file before downloading it. Alternatively the browser can be told to launch itself and read the third party file, but in that case one cant keep the location secret.

lmongello 08-05-2004 08:24 PM

Forgive the stupid question, but I'm going crazy with this...

I want to restrict access to this page to registered members only. I tried creating a forum with a link to local_links.php using permissions in the Vb Admin, but that prevents unregistered members from seeing the list only.

I want them to see the forum (or sub-forum, etc.), but if they try and acess it, they get redirected to the "Sorry, you are not logged in or registered" page.

Hoping someone here can help!!

Thanks!!!!!

AndrewD 08-06-2004 04:25 PM

Quote:

Originally Posted by lmongello
Forgive the stupid question, but I'm going crazy with this...

I want to restrict access to this page to registered members only. I tried creating a forum with a link to local_links.php using permissions in the Vb Admin, but that prevents unregistered members from seeing the list only.

I want them to see the forum (or sub-forum, etc.), but if they try and acess it, they get redirected to the "Sorry, you are not logged in or registered" page.

Hoping someone here can help!!

Thanks!!!!!

You want all the subcategories in a category to be visible regardless of their forum protection, but to trigger a login page if someone tries to drill down into a category that is protected for member access only?

I think this will work:

Edit local_links.php
Find lines (about line 600 or so)

PHP Code:

    // Get categories at this level
    
foreach ($linkscat AS $thiscat) {
        if (
$thiscat["parentid"] == $viewcatid and !in_array($thiscat["catforum"], $limitfids)) {
            if (
$thiscat['catmoderate'] and $bbuserinfo['userid'] != $thiscat['catuserid']) continue; 

Replace by

PHP Code:

    // Get categories at this level
    
foreach ($linkscat AS $thiscat) {
        if (
$thiscat["parentid"] == $viewcatid) {
            if (
$thiscat['catmoderate'] and $bbuserinfo['userid'] != $thiscat['catuserid']) continue; 

Let me know if this is what you want, and if this should be a switch on the admin page

tteal 08-11-2004 09:22 PM

First and foremost, thank you for making this modification available! Secondly, I was wondering if I could make a recommendation?

- For each "affiliate", would it be possible to add a feature on for users to be able to post a comment on their experience? I realize that you're rating the affiliate, however, comments help out a lot to discuss what you liked/dis-liked about their service, etc.

Thanks,
Tim

Natch 08-11-2004 11:48 PM

Quote:

Originally Posted by AndrewD
Yes, that's essentially what the current code does, and it works fine. The question that was raised concerns the increased bandwidth when the file to be downloaded is held on a third machine. In that case, the main server has to read the file before downloading it. Alternatively the browser can be told to launch itself and read the third party file, but in that case one cant keep the location secret.

Thanks for clarifying - my mistake - I guess my increased bandwidth is jsut cos I'm getting more visitors ;)


All times are GMT. The time now is 11:09 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.02234 seconds
  • Memory Usage 1,764KB
  • 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_code_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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