View Full Version : Restrict access to vB files to users with x referals!
Link14716
01-16-2003, 10:00 PM
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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:
$referals = $DB_site->query_first("SELECT COUNT(*) AS referals FROM user WHERE referrerid='$bbuserinfo[userid]'");
to:
$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.
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. :)
Revenge
02-07-2003, 05:38 PM
Hm, is it possible to restrict the access via number of posts, so that one with less than 20 posts can download?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.