Nudaii
Well-known member
Howdy i am working on an addon which i have got working all except the ability to automatically pick up the threadID
If i manually add a number to the model query it works as it should, of course what i need is for it to automatically detect the ID of the thread.
Like below if i have
any suggestions on how this can be accomplished?
@Lawrence any ideas friend?
If i manually add a number to the model query it works as it should, of course what i need is for it to automatically detect the ID of the thread.
Code:
<?php
class RRWS_WhoPostAvatar_ControllerPublic_Index extends XFCP_RRWS_WhoPostAvatar_ControllerPublic_Index
{
public function actionIndex()
{
$response = parent::actionIndex();
$threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);
$response->params += array('whoPostedAvatar' => $this->_getWhoPostAvatarModel()->getAllAvatars());
return $response;
}
protected function _getWhoPostAvatarModel()
{
return $this->getModelFromCache ( 'RRWS_WhoPostAvatar_Model_Model' );
}
}
?>
Like below if i have
Code:
<?php
class RRWS_WhoPostAvatar_Model_Model extends XenForo_Model
{
//Lets Poke the Database
public function getAllAvatars()
{
return $this->fetchAllKeyed('SELECT DISTINCT(xf_user.username), xf_thread_user_post.user_id,xf_user.user_id FROM xf_thread_user_post INNER JOIN xf_user ON xf_thread_user_post.user_id=xf_user.user_id WHERE xf_thread_user_post.thread_id = 60 ', 'user_id'
);
}
}
?>
any suggestions on how this can be accomplished?
@Lawrence any ideas friend?