RisteDimitrievski
Active member
PHP:
class Thread extends XFCP_Thread{
public function actionAddReply(ParameterBag $params)
{
//$this->assertPostOnly();//
$param = parent::actionAddReply($params);
$visitor = \XF::visitor();
$user = $visitor->user_id;
$threadid = $param->thread_id;
$topic = $this->assertViewableThread($threadid, ['Watch|' . $visitor->user_id]);
$thread = \XF::finder('pointssystem:Node')->where('node_id','=',$topic->node_id)->fetchOne();
$threadpoints = $thread['points'];
$users = \XF::finder('pointssystem:User')->where('user_id','=',$user)->fetchOne();
$userpoints = $users['points'] + $threadpoints;
$users->points = $userpoints;
$users->save();
return $param;
}
}
I get:
ErrorException: [E_NOTICE] Undefined property: XF\Mvc\Reply\View::$thread_id in src\addons\pointssystem\XF\Pub\Controller\Thread.php at line 28
What might cause this ??
This line in my code on line 28:
PHP:
$threadid = $param->thread_id;