vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   referrals adding to rep power hack (https://vborg.vbsupport.ru/showthread.php?t=73908)

Carnage 01-05-2005 10:00 PM

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:
Code:

global $vboptions;
replace with:
Code:

global $vboptions, $DB_site;
find:
Code:

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

insert after:
Code:

                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.

Code:

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)

kisersose 01-07-2005 06:30 AM

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

thanx

Elfo King 01-23-2005 11:26 AM

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

Elfo King 01-25-2005 04:16 PM

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

Carnage 01-25-2005 08:16 PM

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


All times are GMT. The time now is 10:00 AM.

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.01119 seconds
  • Memory Usage 1,721KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete