Helpful Information
 
 
Category: vBulletin 3.0 Beta Releases
referrals adding to rep power hack

something i've litrally just finished coding. it seems to work ok, but since very few people on our board have referral counts high enough to make much effect on their rep power, i thought some other people may be able to help me test it some more.
i've not got an instal script yet and since i'm not really supporting the hack, it would be better if you have some knowledge of php/sql before installing.

file: includes/functions_reputation.php
edits made to function 'fetch_reppower' (the first one)
find:

global $vboptions;

replace with:

global $vboptions, $DB_site;


find:

if ($vboptions['rdpower'])
{
$reppower += intval(intval((TIMENOW - $userinfo['joindate']) / 86400) / $vboptions['rdpower']);
}

insert after:

if ($vboptions['rfpower'])
{
$ref = $DB_site->query_first("SELECT COUNT(userid) AS count
FROM " . TABLE_PREFIX . "user
WHERE referrerid = '$userinfo[userid]'
AND usergroupid != 8
AND posts > 10
");
$reppower += intval((log($ref[count]*2)/log(2))/$vboptions['rfpower']);
}


then you will need to run these database queries, if your tables have a prefix, you need to add it into the query, as i copied these straight from phpmyadmin.


INSERT INTO `setting` ( `varname` , `grouptitle` , `value` , `defaultvalue` , `optioncode` , `displayorder` , `advanced` , `volatile` )
VALUES (
'rfpower', 'reputation', '1', '1', '', '91', '0', '1'
);

INSERT INTO phrase (phraseid, languageid, varname, text, phrasetypeid)
VALUES
('', 0, 'setting_rfpower_desc', 'Changes how a users referrals effects their rep power the higher the value the more referrals are needed to get an effect. Set to 0 to disable', 5000),
('', 0, 'setting_rfpower_title', 'How should referrals alter rep power', 5000);


now i'm hoping this will work perfectly, my code usually does, if not drop me a note in this thread include as full an error report as possible. If i get no bugs, i'll add a few more options to it (specifying min posts for users to count towards referrals and allowing other banned groups to be specified)

ill give this a shot tomorrow and let you know how it went.


thanx

I need to add point at rep.point not at the rep power.
(invite use to present the community ;))
Are possible?
:nervous:

Up...i need help pls ....any :P

hmmm adding to rep with a referal is do-able i'll have a go at it.










privacy (GDPR)