Quiver
Active member
Could someone please explain this?
And why it's displaying this:
Code:
<?php
class XenTrCom_TopPoster_Model_XTopPoster extends Xenforo_Model_User
{
public static function XenTrCom_TopPosterArray() {
$db = XenForo_Application::get('db');
$userModel = new Xenforo_Model_User;
$XenTrCom_TopPoster = array();
$options = XenForo_Application::get('options');
$numShown = XenForo_Application::get('options')->xentrcom_tp_show;
$long = "3600";
if (XenForo_Application::get('options')->xentrcom_tp_enable)
{
$excludedusergroup = '';
if (XenForo_Application::get('options')->xentrcom_tp_tpuyegrubu)
{
$excludedusergroup = XenForo_Application::get('options')->xentrcom_tp_tpuyegrubu;
$excludedusergroup = "AND user_group_id NOT IN ($excludedusergroup)";
}
$TTArray = $db->fetchAll( $db->limit( "SELECT u.username AS username, COUNT( * ) AS totalPosts FROM xf_post AS p LEFT JOIN xf_user AS u ON ( u.user_id = p.user_id ) WHERE post_date > UNIX_TIMESTAMP()-$long GROUP BY p.user_id ORDER BY totalPosts DESC", $numShown ));
if(sizeof($TTArray) != 0) {
foreach($TTArray as $TTX) {
$TTIds[] = $TTX['user_id'];
}
$userObjs = $userModel->getUsersByIds($TTIds,array());
foreach($TTArray as $TT) {
if ($TT['user_id'])
{
$hrefx = XenForo_Link::buildPublicLink('toposters', $TT);
}
$XenTrCom_TopPoster[] = array("user" => $userObjs[$TT['user_id']], "username" => $TT['username'], "totalPosts" => $TT['totalPosts']);
}
}
if(count($XenTrCom_TopPoster))
{
return $XenTrCom_TopPoster;
}
}
}
}
And why it's displaying this:
Server Error
Undefined index: user_id
- XenForo_Application::handlePhpError() in XenTrCom/TopPoster/Model/XTopPoster.php at line 24
- XenTrCom_TopPoster_Model_XTopPoster::XenTrCom_TopPosterArray() in XenTrCom/TopPoster/Controller/Public.php at line 10
- XenTrCom_TopPoster_Controller_Public->actionIndex() in Arcade/Extend/ControllerPublic/Index.php at line 23
- Arcade_Extend_ControllerPublic_Index->actionIndex() in XenForo/FrontController.php at line 310
- XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
- XenForo_FrontController->run() in /home/<myusername>/public_html/index.php at line 13