peterisgb Posted April 24, 2021 Share Posted April 24, 2021 This is only a basic mod that i made today, But it beats the default one. Update the questions and answers to suit your needs. This is v1 of this mod so i may update it and release new versions here. create a blank page and call it help.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Here is the Sql. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted April 25, 2021 Share Posted April 25, 2021 (edited) I probably would have just stored all these in a database and just do some rough query searches for questions and answers. Plus it would probably condense your code by like 75% You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Something like that Edited April 25, 2021 by KyleMassacre Quote Link to comment Share on other sites More sharing options...
peterisgb Posted April 25, 2021 Author Share Posted April 25, 2021 (edited) 10 minutes ago, KyleMassacre said: I probably would have just stored all these in a database and just do some rough query searches for questions and answers. Plus it would probably condense your code by like 75% $db->query("select * from `faq` where `question` like '%{$ask}%' or where `answer` like '%{$ask}%'"); You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Something like that As i said this is v1, but yes this is the way i was planning to go with it. but for not i just wanted to get it working. Your welcome to give it a go and post back 🙂 Edited April 25, 2021 by peterisgb Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted April 25, 2021 Share Posted April 25, 2021 8 minutes ago, peterisgb said: As i said this is v1, but yes this is the way i was planning to go with it. but for not i just wanted to get it working. Your welcome to give it a go and post back 🙂 Nope, all good. Looks like we're on the same page Quote Link to comment Share on other sites More sharing options...
Zerex Posted August 18, 2023 Share Posted August 18, 2023 This is actually something that I'm surprised wasn't in the engine to begin with. Something so simple, yet it completely changes the whole "Tutorial" system that exists within Mccodes. Great work! I'll be playing around with this. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted August 19, 2023 Share Posted August 19, 2023 Here's a PHP 8 version, because why not? You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 3 1 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 19, 2023 Author Share Posted August 19, 2023 Out of curiosity, how hard is it to update mccodes v2 to work in PHP 8? Quote Link to comment Share on other sites More sharing options...
Ishraq Posted August 19, 2023 Share Posted August 19, 2023 2 hours ago, peterisgb said: Out of curiosity, how hard is it to update mccodes v2 to work in PHP 8? Seems like once you remove/replace deprecated functions it'll work as normal. That's what I noticed. For example, the legendary mysql_real_escape_string. Once you remove that 90% of errors disappear since its always used in every escape situation although someone posted here an article showing why its the worst function to use which is a good thing its been deprecated. Moreover, all the danger is coming from the very statement in question: zounds of PHP users still do believe that the notorious mysqli_real_escape_string() function's only purpose is "to protect SQL from injections" (by means of escaping some fictional "dangerous characters"). If only they knew the real purpose of this honest function, there would be no injections in the world! If only they were formatting their queries properly, instead of "protecting" them - they'd have real protection as a result. https://phpdelusions.net/sql_injection#badpractices What MTG did with match() is what you could do to improve the codes by using new PHP 8 functions. Beautiful ain't it!! 😉 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 19, 2023 Author Share Posted August 19, 2023 Mccodes doesn't typically use mysql_real but $db->escape(); Quote Link to comment Share on other sites More sharing options...
Ishraq Posted August 19, 2023 Share Posted August 19, 2023 The $db->escape is just a shortcut to the function itself. Just as how other functions work, instead of calling mysqli_real_escape_string, they just use $db->escape to then call mysqli_real_escape_string. Like $db->query class function is a shortcut for mysqli_query php function. Check your class_db_mysqli.php file for the function escape(). You'll see what it uses. 😉 But yep, that change was only for mysql and not mysqli. I just thought to mention that example after reading about this a while back. As we already know mccodes wasn't made with best of practices. I did also notice errors with the main menu, smenu using that define() function. But to make it work on php 8 shouldn't be too much of a hassle tbh Quote Link to comment Share on other sites More sharing options...
Uridium Posted August 20, 2023 Share Posted August 20, 2023 This is bloody fab Not the fact the the script work but the fact people have contributed to make it better 2 1 Quote Link to comment 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.