nohoper Posted October 24, 2019 Share Posted October 24, 2019 Hi, I'm an old boy with concentration problems due to illness but do get some days when i can focus well, but it's difficult for me to learn coding from scratch and I'm more of a tinkerer. I recently decided to try my hand at modernising an old open source Portal/Forum MKPortal integrated with AEF forum, both of which are now non existent. After doing a decent job on the template I thought it might be a good idea to fork it, then realised it uses mysql rather than mysqli. MKportal integrates with several forums but the one supplied with it is AEF which is no longer in development, and while I recognise that will be a problem I would still like to continue trying to update it, with my limited knowledge. MK uses 'drivers' to connect with AEF and the code used in both of them is as follows: $conn = mysql_connect($globals['server'], $globals['user'], $globals['password']); @mysql_select_db($globals['database'], $conn) or die( "Unable to select database"); Simply changing it to mysqli doesn't work but I was able to get AEF forum to use mysqli, only to find there is also a problem with a functions.php file in AEF which prevents MK from working. Both work fine using mysql up to php5.6 but later versions of php do not use mysql. If anyone would like to look at the site as it is at the moment please do, http://oraclemeters.com I would like to know what your thoughts are, if i should persevere with my quest or if it's a total waste of time? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/ Share on other sites More sharing options...
requinix Posted October 24, 2019 Share Posted October 24, 2019 If by "simply changing it to mysqli" you mean adding an 'i' in, well yes: while it's very similar to mysql, the biggest difference is that it takes the connection parameter first instead of last. But besides that it shouldn't be that hard. Which means the problem is dealing with the "doesn't work" aspect. What doesn't work, how, and what have you tried? Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570984 Share on other sites More sharing options...
nohoper Posted October 24, 2019 Author Share Posted October 24, 2019 Thanks for your response. i used this in AEForum: $connection =Â mysqli_connect($host,$user,$password,$db); And also in MKPortal's aef driver file. The result was that aeforum worked as usual and displayed correctly inside mkportal, i.e. showing the side panels of MK, but MK's home page was just blank with no error reported. I carefully went through a lot of files to find the following: if((mysql_num_rows($qresult) > 0)){ Â Â Â for($i = 0; $i < mysql_num_rows($qresult); $i++){ Â Â Â Â Â Â Â Â Â $row = mysql_fetch_assoc($qresult); Â Â Â Â Â Â Â Â Â Â Â Â $globals[$row['name']] = $row['regval']; Â Â Â Â Â Â } } @mysql_free_result($qresult); //Load Session File include_once($globals['mainfiles'].'/sessions.php'); //Checks a user is logged in include_once($globals['mainfiles'].'/checklogin.php'); //Is the user Logged In $logged_in = checklogin(); Â Plus a load more in AEF's functions.php. Â I'm assuming that these need to be re-writen somehow, but as mentioned I'm not too smart! But I do get the hang of things quick, with a bit of guidance. Â Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570985 Share on other sites More sharing options...
requinix Posted October 24, 2019 Share Posted October 24, 2019 There doesn't need to be a whole lot of rewriting. For example, mysql_num_rows becomes mysqli_num_rows. The two are very similar. Then there are others like mysql_free_result. mysqli has one too, but it's in the "statement" side of things and so is called mysqli_stmt_free_result. The other case is the ones that take the connection. mysql functions put it last, mysqli functions put it first. Additionally it's optional with mysql but required with mysqli. You can get, like, 99% done by looking at the mysql function name and finding a corresponding mysqli function name; it lists by the object-oriented method there (eg, mysqli_stmt::free_result), but the docs page will tell you about the procedural alias. The docs also have the arguments list - check that in case there's a difference in how the function is called. Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570986 Share on other sites More sharing options...
nohoper Posted October 24, 2019 Author Share Posted October 24, 2019 Thanks a lot for that, that's exactly what I need. I'm pleased that you sound optimistic about it, I do like the portal though a few things are a bit outdated now, but I think it's worth a new lease of life...have you viewed the site? Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570987 Share on other sites More sharing options...
requinix Posted October 24, 2019 Share Posted October 24, 2019 Long enough to remember the internet of yester-decade. I think it's made good progress since then. Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570988 Share on other sites More sharing options...
nohoper Posted October 25, 2019 Author Share Posted October 25, 2019 Yes it's a short space of time but moves too fast for me! Quote Link to comment https://forums.phpfreaks.com/topic/309411-resourcing-an-obsolete-portalforum-help/#findComment-1570989 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.