• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[Help] Create Add-ons

Status
Not open for further replies.
#1
Hi, im a newbie learning to create some add-ons, but i've some problem ...
Now, im trying to make 1 add-ons can show thread. And threads have Thread Prefixes
i already create Route/prefix, ControlPublic, Model and Template.
This my code in ControlPublic/file.php:
Code:
<?php

class Name_ControllerPublic_Home extends XenForo_ControllerPublic_Abstract
{
    protected function getdata()
    {
        return $this->getModelfromCache('Name_Model_Model');
       
    }
   
    public function actionIndex()
    {
       $thread = '';
 
     
       $abc = array (
            'threadinfo' => $this->getdata()->getAllThread($thread)
            );
       
        return $this->responseView('Name_ViewPublic_Home', 'Name_Home', $abc);
    }
}
and file Model/Model.php
Code:
<?php

class Name_Model_Model extends XenForo_Model
{
   
    public function getAllThread($thread)
    {
        return $this->_getDb()->fetchAll("
            SELECT *
            FROM xf_thread
            WHERE node_id = '11' AND (prefix_id = '1' OR prefix_id = '2' OR prefix_id = '3')
            ORDER BY thread_id
            ASC
           
        ");
       
    }
}
i have a problem... only show 1 result although my forum have 4 threads use prefix_id. What can i do with template code or any code. Sorry for my bad English and Knowledge
 
Status
Not open for further replies.