https://www.icyphoenix.com/viewtopic.php?f=2&t=9639&p=60824#p60824
-----------------------------------
MWE_001
Fri 26 Aug, 2016 06:38

Another Minor Activity Mod SQL Error Just Found
-----------------------------------
Submitting a rating for a game and it has rewards turned on for rating. Meaning in the ACP I turned it on to give points for game ratings. When submitting I get this:

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

[code linenumbers=false]
// 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);
	}
}
[/code]




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 [code linenumbers=false]include( IP_ROOT_PATH . ACTIVITY_PLUGIN_PATH . 'includes/rewards_api.' . PHP_EXT);[/code] I know this path can't be correct, but it works.  :oops:

I tried this [code linenumbers=false]include( ACTIVITY_PLUGIN_PATH . 'includes/rewards_api.' . PHP_EXT);[/code], but it didnt work. The search page came up but no search options at all were available.


