PDA

View Full Version : Restrict access to vB files to users with x referals!


Link14716
17 Jan 2003, 16:38
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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
17 Jan 2003, 16:53
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
17 Jan 2003, 16:53
what would be great is having a custom title/avatar based on a numbr of referrals, but great hack nonetheless :)

Link14716
17 Jan 2003, 16:55
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
17 Jan 2003, 23:03
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
17 Jan 2003, 23:17
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
17 Jan 2003, 23:22
Cool - I'm sure I'll have some use for it =)

Dean C
18 Jan 2003, 09:27
Nice hack buddy :)

- miSt

Chris M
18 Jan 2003, 14:27
Nice idea;)

Satan

EvilLS1
19 Jan 2003, 06:10
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
07 Feb 2003, 18:38
Hm, is it possible to restrict the access via number of posts, so that one with less than 20 posts can download?