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)
-   -   Restrict access to vB files to users with x referals! (https://vborg.vbsupport.ru/showthread.php?t=47803)

Link14716 01-16-2003 10:00 PM

Restrict access to vB files to users with x referals!
 
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Function referalcheck hack, by Link14716.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

This is a very simple, but useful little hack. By adding a little line into a file, it will automatically restrict access to that file for anyone who has less than $n referals. $n is a variable that may be set to whatever you want for whatever file you want. I plan on adding admin CP functions to just enter a filename and how many referals you want to require for access to it later, but for now, here it is!

Enjoy. :) :banana:

Link14716 01-17-2003 03:53 PM

Here is a screen when a user does not have enough referals to access a page (for the purpose of this screen, I restricted access to proarcade.php to users with 4 referals or more.)

heretic 01-17-2003 03:53 PM

what would be great is having a custom title/avatar based on a numbr of referrals, but great hack nonetheless :)

Link14716 01-17-2003 03:55 PM

I think there are hacks that will do that, but this hack is meant for whole files. Useful for hacks such as the arcade and the custom postbit hacks. :) Thanks for the compliment. :)

geniuscrew 01-17-2003 10:03 PM

Perhaps checking if the referred members have more than X posts too? Coz some people refer members just to boost referrals, they don't care whether they post or not [how stupid]

Nice hack though :)

Link14716 01-17-2003 10:17 PM

Sure, change:

Code:

$referals = $DB_site->query_first("SELECT COUNT(*) AS referals FROM user WHERE referrerid='$bbuserinfo[userid]'");
to:

Code:

$referals = $DB_site->query_first("SELECT COUNT(*) AS referals FROM user WHERE referrerid='$bbuserinfo[userid]' AND posts>'Y'");
Change Y to the minimum amount of posts the referred member must have. (And maybe note that in the error template so they won't scream "It's broken!" ;))

geniuscrew 01-17-2003 10:22 PM

Cool - I'm sure I'll have some use for it =)

Dean C 01-18-2003 08:27 AM

Nice hack buddy :)

- miSt

Chris M 01-18-2003 01:27 PM

Nice idea;)

Satan

EvilLS1 01-19-2003 05:10 AM

Nice one Link! :)

I'm suprised that more people aren't using the referral system or referral hacks. I think its a neat way to get more members, and it works! Check the attachment.



Quote:

Originally posted by heretic
what would be great is having a custom title/avatar based on a numbr of referrals, but great hack nonetheless :)
You can find the avatar hack in my profile. :)


All times are GMT. The time now is 11:21 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.01040 seconds
  • Memory Usage 1,728KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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