PDA

View Full Version : Subscriptions - Still not getting vbBux points (3.6 with latest 1.5.8 vbBux)


Quarterbore
08-08-2006, 06:14 PM
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/showthread.php?t=110932&highlight=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
/*================================================= =====================*\
|| ################################################## ################## ||
|| # 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_enoug h_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
/*================================================= =====================*\
|| ################################################## ################## ||
|| # 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_enoug h_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...