2020-02-23, 02:13 PM
(2020-02-23, 01:36 PM)Crazycat Wrote:(2020-02-23, 01:10 PM)LouisRep Wrote: Thanks guys, uploaded it here: https://community.mybb.com/mods.php?acti...w&pid=1342
This is my first php project, so feedback is welcome.
I had a look to your plugin, I think you can optimize a little bit.
Incount_threads
, your query retrieve everything from threads table... Could be heavy. You can just get "tid" field, or better directly get the count.:
$query = $db->write_query("SELECT COUNT(DISTINCT(tid)) AS nbtid FROM ".TABLE_PREFIX."threads WHERE uid=$uid AND fid=$fid AND visible=1"); $threadCount = $db->fetch_field($query, 'nbtid');
Thank you very much! This is the kind of feedback I was hoping for. Will look into it when I find the time