本文整理汇总了PHP中KunenaUserHelper::_topposters方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaUserHelper::_topposters方法的具体用法?PHP KunenaUserHelper::_topposters怎么用?PHP KunenaUserHelper::_topposters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaUserHelper
的用法示例。
在下文中一共展示了KunenaUserHelper::_topposters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTopPosters
public static function getTopPosters($limit = 0)
{
$limit = $limit ? $limit : KunenaFactory::getConfig()->popusercount;
if (count(self::$_topposters) < $limit) {
$db = JFactory::getDBO();
$query = "SELECT userid as id, posts AS count FROM #__kunena_users WHERE posts>0 ORDER BY posts DESC";
$db->setQuery($query, 0, $limit);
self::$_topposters = $db->loadObjectList();
KunenaError::checkDatabaseError();
}
return self::$_topposters;
}
示例2: getTopPosters
/**
* @param int $limit
*
* @return array
*/
public static function getTopPosters($limit = 0)
{
$limit = $limit ? $limit : KunenaFactory::getConfig()->popusercount;
if (count(self::$_topposters) < $limit) {
$db = JFactory::getDBO();
$query = "SELECT u.id, ku.posts AS count\n\t\t\t\tFROM #__kunena_users AS ku\n\t\t\t\tINNER JOIN #__users AS u ON u.id=ku.userid\n\t\t\t\tWHERE ku.posts>0\n\t\t\t\tORDER BY ku.posts DESC";
$db->setQuery($query, 0, $limit);
self::$_topposters = (array) $db->loadObjectList();
KunenaError::checkDatabaseError();
}
return self::$_topposters;
}