r3jded Posted October 10, 2017 Share Posted October 10, 2017 I have a script for a gameserver that acts up a bit, or rather a piece of code that need some recoding. I most kindly ask for help from somone who could help me as i am not very good at PHP. From what i gather i need to transform this in to some kind of public static function but i dont know how to. The code is: //Output error if($umsg) { Core::getObject('messages')->add($message, true); //Line 71 } else { echo $message; } //Log the error if(!empty(Core::getObject('session')->server->login)) { $login = '_'.Core::getObject('session')->server->login; } else { $login = ''; } writeLog('errors'.$login, $message); Wich gives me the following error message: Strict Standards: Non-static method Core::getObject() should not be called statically in G:\xamp556\htdocs\rcp\includes\core.functions.php on line 71 Link to comment Share on other sites More sharing options...
requinix Posted October 10, 2017 Share Posted October 10, 2017 The code is old. Any chance of finding something up to date? Written within the last, say, 5 years? Link to comment Share on other sites More sharing options...
requinix Posted October 10, 2017 Share Posted October 10, 2017 I partially take that back: looks like the author made a mistake. Code's still old though. Go into class.core.php and make the getObject method be static. Link to comment Share on other sites More sharing options...
r3jded Posted October 10, 2017 Author Share Posted October 10, 2017 Thank you. That works.And no, there is very little but more like no chance of finding a more updated version of the script as it is from 2009 and it is the latest version. i´ve spent a couple of days finding the right version PHP to run this on Link to comment Share on other sites More sharing options...
gizmola Posted October 10, 2017 Share Posted October 10, 2017 We need a McDonald's counter: 123,759 obsolete scripts re-served. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.