Error with Karma on stats page

Started by codeman1234, September 23, 2012, 10:15:37 PM

Previous topic - Next topic

codeman1234


Hello,

I don't know why but, on this URL of my forum

http://mysite.com/foro/index.php?action=stats

I get the following error:

Fatal error: Call to undefined function db_query() in /home/apuesta/public_html/foro/Sources/Stats.php on line 617


I am also uploading my Stats.php file, the code on that line is the following:




// Karma good top 10.
$members_result = db_query("
SELECT ID_MEMBER, realName, karmaGood
FROM {$db_prefix}members
WHERE karmaGood > 0
ORDER BY karmaGood DESC
LIMIT 10", __FILE__, __LINE__);
$context['top_karma_good'] = array();
$max_karma_good = 1;
while ($row_members = mysql_fetch_assoc($members_result))
{
$context['top_karma_good'][] = array(
'name' => $row_members['realName'],
'id' => $row_members['ID_MEMBER'],
'num_karma' => $row_members['karmaGood'],
'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
);

if ($max_karma_good < $row_members['karmaGood'])
$max_karma_good = $row_members['karmaGood'];
}
mysql_free_result($members_result);

foreach ($context['top_karma_good'] as $i => $poster)
$context['top_karma_good'][$i]['karma_percent'] = round(($poster['num_karma'] * 100) / $max_karma_good);




And for what I see it has something to do with Karma mod.


Please help me out and guide me to fix this issue!

Thanks + Regards,

Codeman

codeman1234


Kays

That's a 1.x mod which is why you're getting that error.

Uninstall it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

codeman1234

Hey Kays,

thanks again, you were right is the top karma mod

http://custom.simplemachines.org/mods/index.php?mod=1113

and is for version 1 not 2.0.2

Cheers!

That should do it right?

codeman1234

Yep the link is working!

Thanks again Kays!


Cheers!

Advertisement: