Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 04-22-2003, 06:33 PM
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 06:01 AM Zzed said this in Post #8
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.
Thank you, sir.

Will this allow the view of the link only from here or can they view the rest of the site after getting in this way?
Reply With Quote
  #12  
Old 04-22-2003, 06:35 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just the link. The visitor gets a one time permission to view the contents of the link. Any further navigation will be prevented.
Reply With Quote
  #13  
Old 04-22-2003, 06:56 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, installed and will test.
Reply With Quote
  #14  
Old 04-22-2003, 06:58 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool.

Please let me know how it works.
Reply With Quote
  #15  
Old 04-22-2003, 07:11 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I just tried it it I get a "No hot linking allowed" because I have that in my attachment.php and avatar.php at the top. Anyway to bypass that just for the link?
Reply With Quote
  #16  
Old 04-22-2003, 07:23 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

avatar.php is not using global.php. So you may want to add the same logic as in global.php. Except that you have to use $REMOTE_ADDR instead of $url.

In attachment php:
Look for:
Code:
$permissions=getpermissions($getforuminfo[forumid]);
And add this directly below it:
Code:
if($vb_org == 1) {
  $permissions['canview'] = 1;
  $permissions['cangetattachment'] = 1;
}
Reply With Quote
  #17  
Old 04-22-2003, 07:35 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still giving me the same error. Here is the code at the top of the file to prevent hot-linking.

PHP Code:
/////////////////////////////////// Start of Avatar/Attachment Protector ///////////////////////////////////

$referers = array ('www.bearfacts2.com','bearfacts2.com','66.250.216.66');

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){
      echo 
"No hot linking allowed!";
      exit;
      }
         return 
$found;
      } else {
         return 
true;
   }
}

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

You may want to add 205.214.66.221 and www.vbulletin.org to your list of referrers.
Reply With Quote
  #19  
Old 04-22-2003, 08:22 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still couldn't get it to work for messages. Thanks anyway, buddy.

Edit: Finally got it working. Thanks Edwin. I have the "guests not allowed to view threads" hack by PPN installed and had to work around that.

One last question. How do I add more than one IP or site address to the line so I can add more instead of having to do it for each separate address?
Reply With Quote
  #20  
Old 11-15-2003, 06:38 PM
Guru Guru is offline
 
Join Date: Nov 2001
Location: Pacific Northwet
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?threadid=35399" target="_blank">https://vborg.vbsupport.ru/showt...threadid=35399</a>
Reply With Quote
Reply

Thread Tools
Display Modes

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:59 AM.


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.04639 seconds
  • Memory Usage 2,257KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_code
  • (1)bbcode_php
  • (1)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_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