Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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: [Download] [Hide] [Select]
// 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);
    }
}





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

I tried this
Code: [Download] [Hide] [Select]
include( ACTIVITY_PLUGIN_PATH . 'includes/rewards_api.' . PHP_EXT);
, but it didnt work. The search page came up but no search options at all were available.
 




____________
"Don't gain the world and lose your soul, wisdom is better than silver and gold" -Bob Marley
 
MWE_001Send private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Another Minor Activity Mod SQL Error Just Found 
 
First one: It's because the config field default_reward_dbfield is not set. It seems you misconfigured activity, and that you should tell it to use the cash mod (admittedly, it should have a sensible default configuration). The field should not be empty by default.... I'm not sure right now if you change it via the ACP, I'll take a look this weekend. If you can't, you may manually edit the ip_config table by changing default_reward_dbfield and default_cash to the column you created via cash_mod.

-----

Second one: Thanks. It might just be that ACTIVITY_PLUGIN_PATH itself is missing the IP_ROOT_PATH!
 




____________
IcyPhoenix ADR RPGEzArena (modded phpBB2+ADR)
 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Another Minor Activity Mod SQL Error Just Found 
 
When I setup activity, I 100% for sure make sure which points or cash I am using and choose accordingly.  

 activity_config

Over the years and I;m talking pretty much since Austin released AMOD + I been busting people out on that setting. I can very easily see how people could misconfigure it, but not this time I can assure you. And I'm glad to see we are on the same wave length as far as thinking goes    That is the very first thing I went and checked.


**EDIT**

Ok man I need to quit while I am ahead.

I went back and tried it again today (rate a game) after taking that screen shot and instead of the sql error, I got this:

Notice: in file /activity_popup.php on line 77: include(./includes/rewards_api.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /activity_popup.php on line 77: include(./includes/rewards_api.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /activity_popup.php on line 77: include(): Failed opening './includes/rewards_api.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php55/lib/php')

Another broken link to rewards_api. I fixed the link and the rate and rewards works. So scrub the sql error I guess. FLuke of nature not sure why it happened. I can not recreate as per the way my ACP / plugins is configured.
 




____________
"Don't gain the world and lose your soul, wisdom is better than silver and gold" -Bob Marley
 
MWE_001Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Another Minor Activity Mod SQL Error Just Found 
 
Correct fix should be:
Code: [Download] [Hide] [Select]
include_once(ACTIVITY_ROOT_PATH . 'includes/rewards_api.' . PHP_EXT);

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Another Minor Activity Mod SQL Error Just Found 
 
Mighty Gorgon wrote: [View Post]
Correct fix should be:
Code: [Download] [Hide] [Select]
include_once(ACTIVITY_ROOT_PATH . 'includes/rewards_api.' . PHP_EXT);


Thanks!

*EDIT*

This fix also needs done to line 67 of activity_favs.php as it leads to a php error as is.

If you click add game to favorites after this fix, it will go to a all white page instead of the php error. Nothing but all white page.

I fixed Activity issue #17 at Git [Activity] activity.php>"Games" section says "vote cast" #17

Fix is easy.

OPEN activity.php
FIND
Code: [Download] [Hide] [Select]
$rating_votes_cast = str_replace('%V%', $total_votes_given, $lang['game_rating_votes_one']);

REPLACE WITH
Code: [Download] [Hide] [Select]
$rating_votes_cast = str_replace('%V%', $lang['no_votes_cast'], $lang['game_rating_votes']);


That will solve cast vote issue. Now it will say No votes cast.

Also, when clicking the copyright, I get a message that says hacking attempt which is open as a issue at Git as well.

I did this

OPEN functions_amod_plusC.php
FIND
Code: [Download] [Hide] [Select]
if (!defined('IN_ICYPHOENIX'))
{
    die('Hacking Attempt');
}

REPLACE WITH
Code: [Download] [Hide] [Select]
(nothing, needs removed)


PLEASE anyone do not remove this code without speaking to Luca first! I am NOT sure how secure or unsecure that is. It makes the page work, but at what cost? As usual as I say, Luca has the final say, NOT me. Take care!


If you delete that code that hacking attempt will go away and the copyright page will work. BUT since Amod + site is long gone, all the images are missing which is ok I guess. It is better than getting a hacking attempt message.  

I got the arrow images fixed in the copyright page as well as link to the games download and I put up a quick sorry we are offline page for demo board. Personally, I think it would be better off to remove the demo board link all together. I think for my copy of activity, I will be removing the link to the demo board as phpbb-amod is gone forever and never is coming back. This would be much simpler than including a html or php page saying sorry or what ever.

 screenshot_14

Here is one more and I swear I am done for the night as far as activity plugin goes. I would like to be able to add issues to Git and suggest fixes but not sure if I can or how git works?

But anyhow,

If I go to ACP Activity/Games Edit games on the next page that opens, click Edit. Then you get this:

 screenshot_12

Notice missing images? To fix do the following.

OPEN admin_activity.php
FIND LINE 384
Code: [Download] [Hide] [Select]
$game_image = '<img src="'. IP_ROOT_PATH .

REPLACE WITH
Code: [Download] [Hide] [Select]
$game_image = '<img src="'. ACTIVITY_ROOT_PATH .


Save and close. Give s you this now

 screenshot_13

Enjoy!
 




____________
"Don't gain the world and lose your soul, wisdom is better than silver and gold" -Bob Marley
 
MWE_001Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Another Minor Activity Mod SQL Error Just Found 
 
This is part of the error, include(./includes/rewards_api.php): failed to open stream: No such file or directory,  that I reported above for a couple files. Turns out this is happening with many files and I have fixed many of them. I will grab a complete list of the files this fix needs done in when I get home here in an hour or two. So far it is up to like 6 or 7 files.
 




____________
"Don't gain the world and lose your soul, wisdom is better than silver and gold" -Bob Marley
 
MWE_001Send private message  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron