silence
Well-known member
So I'm making a profile-tab, and everything works so far, but there is one issue: How would I make it so the profile tab loads the content for the profile it's triggered on?
I'm doing this but to no avail:
ControllerPublic:
Route:
What exactly is the issue? It simply won't pass in the user_id of the person's profile!
I'm doing this but to no avail:
ControllerPublic:
PHP:
public function actionTeamspeakUserStatisticsTab()
{
$input = $this->getInput();
$user_id = $input->filterSingle('user_id', XenForo_Input::UINT);
$statistics = $this->_getUserStatisticsModel()->getUserStatistics($user_id);
return $this->responseView('XenForo_ViewPublic_Base', 'account_teamspeak_userstatistics', array(
'simple' => true,
'statistics' => $statistics
));
}
Route:
PHP:
<?php
class Teamspeak_Route_Prefix_Account implements XenForo_Route_Interface
{
protected $_subComponents = array(
'identities' => array(
'controller' => 'Teamspeak_ControllerPublic_Account_Identities'
),
'viewer' => array(
'controller' => 'Teamspeak_ControllerPublic_Account_Viewer'
),
'userstatistics' => array(
'controller' => 'Teamspeak_ControllerPublic_Account_UserStatistics',
'intId' => 'user_id',
)
'settings' => array(
'controller' => 'Teamspeak_ControllerPublic_Account_Settings'
)
);
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$controller = 'Teamspeak_ControllerPublic_Account_Index';
$action = $router->getSubComponentAction($this->_subComponents, $routePath, $request, $controller);
return $router->getRouteMatch($controller, $action, 'account/teamspeak');
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
if ($action == "TeamspeakUserStatisticsTab")
{
return XenForo_Link::buildBasicLinkWithIntegerParam($outputPrefix, $action, $extension, $data, 'user_id', $strParams);
}
return XenForo_Link::buildSubComponentLink($this->_subComponents, $outputPrefix, $action, $extension, $data);
}
}
What exactly is the issue? It simply won't pass in the user_id of the person's profile!