MyBB Community Forums

Full Version: Latest News Mod Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
After following the instructions,
I seem to installed the scripts,
but the following error occurs on top of my forum:

Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 25 in /home/aqua/public_html/community/inc/db_mysql.php on line 73
Going to guess that you don't have any news in there? Try adding a news item and it should go. I'm not the mod creator so it might not be the right answer.
Once again this is another mod using some quite old code which is in need of updating. I converted this mod to a plugin a couple of weeks ago whilst playing with the new MyBB plugins system, and I updated a few sections of code whilst doing so, including the section which is probably causing this error.

Below is a section of code from the updated plugin which should fix the bug you are experiencing, although I haven't managed to test it yet.

In global.php, find this code...

$query = $db->query("SELECT lastthreadtid FROM ".TABLE_PREFIX."forums WHERE fid='$settings[latestnewsfid]' AND active!='no'");
$latesttid = $db->result($query, 0);
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE tid='$latesttid'");

...and replace it with this...

$query = $db->query("SELECT lastthreadtid FROM ".TABLE_PREFIX."forums WHERE fid='$settings[latestnewsfid]' AND active!='no'");
$forum = $db->fetch_array($query);
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE tid='$forum[lastthreadtid]'");