vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vbBux / vbPlaza (https://vborg.vbsupport.ru/forumdisplay.php?f=171)
-   -   Subscriptions - Still not getting vbBux points (3.6 with latest 1.5.8 vbBux) (https://vborg.vbsupport.ru/showthread.php?t=123411)

Quarterbore 08-08-2006 06:14 PM

Subscriptions - Still not getting vbBux points (3.6 with latest 1.5.8 vbBux)
 
I am still stumped by this one... I have just started working with 3.6 Gold and I have installed a classifieds script and vbBux only on my site so far and I have a problem in that when I pay for a Subscription the usergroups get advanced BUT I do not get the vbBux that should have come with the subscription. I do get the 100-points that come from ANY subscription.

I know from the following thread:

https://vborg.vbsupport.ru/showthrea...ht=quarterbore

Now, from that other thread I understand that this is handled by the hook paidsub_build or possibly the following file:

/plugins/vbplaza_paidsub_build.php

My guess is that it is a php version issue but I need to find an alternate code as my usergroups get vbBux to allow them to purchase extras for their donations using vbPlaza....

I'll post updates if I can figure this out!

OK, I am trying to disect the code in the file vbplaza_paidsub_build.php following is the complete file:

PHP Code:

<?php
/*======================================================================*\
|| #################################################################### ||
|| # vbPlaza Integrated Store System for vBulletin 3.5+               # ||
|| # ---------------------------------------------------------------- # ||
|| # All PHP code in this file is ?2006 GSCCC, Inc.                   # ||
|| # http://www.cmgsccc.com                                           # ||
|| #################################################################### ||
\*======================================================================*/

// check to make sure VB_AREA is defined
if (defined('VB_AREA'))
{
    
// check if it's enabled first
    
if ($vbulletin->options['vbbux_enabled'] == 1)
    {
        
// check to see if there is a different amount of points for this individual subscription
        
$findsub $vbulletin->db->query_first("SELECT `vbp_vbbuxsub` FROM " TABLE_PREFIX "subscription WHERE subscriptionid = '" $subscriptionid "'");

        
// check if it was found
        
$givepoints 0;
        if (!empty(
$findsub['vbp_vbbuxsub']) && ($findsub['vbp_vbbuxsub'] != 0))
        {
            
// set the amount of points to give
            
$givepoints $vbulletin->options['vbbux_persubscription'];
        }
        
// check if the user gets any global points per subscription
        
else if ($vbulletin->options['vbbux_persubscription'] !=  0)
        {
            
// set the amount of points to give
            
$givepoints $vbulletin->options['vbbux_persubscription'];
        }


        
// check if any points should be added
        
if ($givepoints != 0)
        {
            
// verify they have enough points to do this action
            
if (($user[$vbulletin->options['vbbux_pointsfield']] + $givepoints) < 0)
            {
                
// display error, not enough points
                
eval(standard_error(fetch_error('vbplaza_not_enough_points')));
            }

            
// send the query to add to this users points
            
$vbulletin->db->query_write("
                UPDATE " 
TABLE_PREFIX $vbulletin->options['vbbux_pointstable'] . "
                SET
                    `" 
$vbulletin->options['vbbux_pointsfield'] . "` = `" $vbulletin->options['vbbux_pointsfield'] . "` + " $givepoints "
                WHERE userid = '" 
$user['userid'] . "'
                    AND vbp_receivespoints = '1'
            "
);
        }
    }
}
?>

I have verified that the problem is in this file! The following code CORRECTLY adds the points that my users would get with their paid subscription! Note that I have cut out a LOT of code to verify that this was the problem and the problem could be fixed here!

PHP Code:

<?php 
/*======================================================================*\ 
|| #################################################################### || 
|| # vbPlaza Integrated Store System for vBulletin 3.5+               # || 
|| # ---------------------------------------------------------------- # || 
|| # All PHP code in this file is ?2006 GSCCC, Inc.                   # || 
|| # http://www.cmgsccc.com                                           # || 
|| #################################################################### || 
\*======================================================================*/ 

// check to make sure VB_AREA is defined 
if (defined('VB_AREA')) 

    
// check if it's enabled first 
    
if ($vbulletin->options['vbbux_enabled'] == 1
    { 
        
$givepoints 0
        
// check to see if there is a different amount of points for this individual subscription 
        
$findsub $vbulletin->db->query_first("SELECT `vbp_vbbuxsub` FROM " TABLE_PREFIX "subscription WHERE subscriptionid = '" $subscriptionid "'"); 
        
$givepoints $findsub['vbp_vbbuxsub']; 

        
// check if any points should be added 
        
if ($givepoints != 0
        { 
            
// verify they have enough points to do this action 
            
if (($user[$vbulletin->options['vbbux_pointsfield']] + $givepoints) < 0
            { 
                
// display error, not enough points 
                
eval(standard_error(fetch_error('vbplaza_not_enough_points'))); 
            } 

            
// send the query to add to this users points 
            
$vbulletin->db->query_write(
                UPDATE " 
TABLE_PREFIX $vbulletin->options['vbbux_pointstable'] . 
                SET 
                    `" 
$vbulletin->options['vbbux_pointsfield'] . "` = `" $vbulletin->options['vbbux_pointsfield'] . "` + " $givepoints 
                WHERE userid = '" 
$user['userid'] . "' 
                    AND vbp_receivespoints = '1' 
            "
); 
        } 
    } 

?>


Quarterbore 08-10-2006 08:53 PM

So, is my code rework the only option?

agiacosa 08-26-2006 02:45 PM

Did this get sorted out?

Quarterbore 08-26-2006 06:03 PM

I hav ebeen using it with the change I posted above and it has been working since the day I posted it...

I posted over at vBplaza.com and never got a reply there either...


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