vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   uCash & uShop (https://vborg.vbsupport.ru/forumdisplay.php?f=100)
-   -   Referral Points not issued. (https://vborg.vbsupport.ru/showthread.php?t=73887)

deb0 01-06-2005 04:45 PM

Referral Points not issued.
 
Today, i noticed that when I updated user X to specifiy user Y as a referrer, user Y did not get the points for it.

What gives?

Link14716 01-06-2005 06:50 PM

It only works on register.php. It is not some magical code.

Dan 01-06-2005 09:23 PM

Quote:

Originally Posted by Link14716
It only works on register.php. It is not some magical code.

Is there a way we can add some magical code for it?

Link14716 01-06-2005 09:35 PM

The number of file edits is already painfully large. But if you want me to add yet another one, fine, I'll look into it.

Dan 01-07-2005 12:34 AM

Quote:

Originally Posted by Link14716
The number of file edits is already painfully large. But if you want me to add yet another one, fine, I'll look into it.

Did I mention I love you yet Matt?

Link14716 01-07-2005 01:08 AM

Ok then.

In admincp/user.php, find:
PHP Code:

    if ($user['referrerid'])
    {
        
$referrername $DB_site->query_first("SELECT username FROM " TABLE_PREFIX "user WHERE userid = $user[referrerid]");
        
$user['referrer'] = $referrername['username'];
    } 

Replace with:
PHP Code:

    if ($user['referrerid'])
    {
        
$referrername $DB_site->query_first("SELECT username, userid FROM " TABLE_PREFIX "user WHERE userid = $user[referrerid]");
        
$user['referrer'] = $referrername['username'];
        
construct_hidden_code('user[referrerido]'$referrername['userid']);
    } 

Find:
PHP Code:

        if ($referrerid $DB_site->query_first("SELECT userid FROM " TABLE_PREFIX "user WHERE username = '" addslashes(htmlspecialchars_uni($referrer)) . "'"))
        {
            
$user['referrerid'] = $referrerid['userid']; 

Add under:
PHP Code:

            if ($user['referrerido'] != $user['referrerid'] && $vboptions['uttpoints_enablesystem'] == && $vboptions['uttpoints_pointsperreferral'] != 0) {
                
$DB_site->query("UPDATE ".TABLE_PREFIX "$vboptions[uttpoints_pointtable] SET $vboptions[uttpoints_pointsfield]=$vboptions[uttpoints_pointsfield]+$vboptions[uttpoints_pointsperreferral] WHERE userid='".intval($referrerid['userid'])."'");
            }
            unset(
$user['referrerido']); 

Looks like I will be keeping uCS 0.9x around after the next major release, because this is just a monster now.


All times are GMT. The time now is 07:12 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.01042 seconds
  • Memory Usage 1,741KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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