Hi lynne,
revisting this thread once again.
I have a different script but I ma trying to accomplish the same thing. What am I doing wrong here:
Code:
<?php
// ############# HASANN AND BLACKTHORN TOP REPUTATION MODULE ############ //
// BLACKTHORN CODING //
// vBA CMPS Module - vBulletin 4.0.X //
// All rights reserved 2010 ? //
// http://www.metalturkiye.com //
// http://www.vBulletin-TR.com //
// ############# HASANN AND BLACKTHORN TOP REPUTATION MODULE ############ //
// ------------------------------------------------------------------------------
// Code written by Hasann. vB4 Convert and edited and updated by BlackThorn(c) 2009
// Copy and/or re-use of this code (or part of it) without authors approval in writing is forbidden.
// BT - Top Reputation Display Module Core Codes Starting
$limit = $mod_options['portal_top_reputation_count'];
// BT - Top Reputation SQL Query start.
$top_reputations = $db->query("
SELECT userid, username, posts, credits, usergroupid,
IF(displaygroupid=0, usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "user AS user
WHERE credits > 0
ORDER BY credits DESC
LIMIT 0, $limit
");
// BT - Top Reputation Module SQL Query the end.
$bgclass = "alt2";
$count = 0;
while($top_reputation = $db->fetch_array($top_reputations)){
$count++;
$bgclass = exec_switch_bg();
$top_reputation[musername] = fetch_musername($top_reputation);
// BT - Top Reputation Module Template Registers
$templater = vB_Template::create('adv_portal_top_reputations_bit');
$templater->register('bgclass',$bgclass);
$templater->register('mod_options',$mod_options);
$templater->register('top_reputation',$top_reputation);
$blackthorn_top_reputation_bit .= trim($templater->render()).' ';
}
$db->free_result($top_reputations);
// BT - Top Reputation Module Template Registers and HOOK(s)
$templater = vB_Template::create('adv_portal_top_reputations');
$templater->register('mod_options',$mod_options);
$templater->register('top_reputations',$top_reputations);
$templater->register('blackthorn_top_reputation_bit',$blackthorn_top_reputation_bit);
$home["$mods[modid]"]['content'] = $templater->render();
// BT - Top Reputation module module core codes and UNSET.
unset($top_reputation, $top_reputations, $blackthorn_top_reputation_bit, $limit, $mod_options);
?>