Failed to add rewards
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= + 5 WHERE user_id = 2' at line 2
UPDATE ip_users SET = + 5 WHERE user_id = 2
Line : 37
File : rewards_api.php
Offending code
// give rewards to the user
function add_reward($user_id,$amount)
{
global $userdata, $db;
$dbfield = get_db_reward();
if ( $userdata['user_id'] == $user_id )
{
$userdata[$dbfield] += $amount;
}
$sql = "UPDATE " . USERS_TABLE . "
SET $dbfield = $dbfield + $amount
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to add rewards", "", __LINE__, __FILE__, $sql);
}
}
function add_reward($user_id,$amount)
{
global $userdata, $db;
$dbfield = get_db_reward();
if ( $userdata['user_id'] == $user_id )
{
$userdata[$dbfield] += $amount;
}
$sql = "UPDATE " . USERS_TABLE . "
SET $dbfield = $dbfield + $amount
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Failed to add rewards", "", __LINE__, __FILE__, $sql);
}
}
BUT ...... I went back to activity.php and looked at the game I tried to give a rate to and it failed in sql error, it was in fact rated.
If I got to ACP/ Activity/Games/Extra Settings and turn off the Give Points To Users For Submitting Game Ratings? submit and then go clear cache, I go back to activity.php and try to rate a game and
it gives me this: Thank you for submitting a rating.
And upon further review, the game is rated.
---------------------------------------------------------------------------------------------------------------------
Separate Error and hopefully the last one I find.
When clicking search for a game, I get this:
[Icy Phoenix Debug] PHP Notice: in file /plugins/activity/activity_search.php on line 51: include(./includes/rewards_api.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /plugins/activity/activity_search.php on line 51: include(./includes/rewards_api.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /plugins/activity/activity_search.php on line 51: include(): Failed opening './includes/rewards_api.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php55/lib/php')
There is a rewards_api.php in the plugins/activity/includes folder, but not in the IP root/includes folder.
This makes it work
include( IP_ROOT_PATH . ACTIVITY_PLUGIN_PATH . 'includes/rewards_api.' . PHP_EXT);

I tried this , but it didnt work. The search page came up but no search options at all were available.