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

member_view_tabs_content per page

Discussion in 'XenForo Development Discussions' started by Mike2020, May 16, 2016.

  1. Mike2020

    Mike2020 Well-Known Member

    Hi all

    I need some help passing perpage and page to my member_view_tabs_content.

    I have it loading all the data into the member_view_tabs_content but it will not pass the perpage and page to this .

    My model file has this

    PHP:
    public function getAllGivenMediaByUser ($userId, array $fetchOptions = array())
        {   
            
    $limitOptions $this->prepareLimitFetchOptions($fetchOptions);
            
    $db $this->_getDb();
       
            
    //Query the database with what we wat
               
                
    return $this->fetchAllKeyed($this->limitQueryResults(
                
    '
                SELECT
                F.*,
                M.*,
                category.title AS categorytitle,
                category.id AS categoryid
                FROM xf_gallery_files AS F
                INNER JOIN    xf_user M
                ON            F.creator_id = M.user_id
                LEFT JOIN xf_gallery_category AS category
                ON category.id = F.category_id
                WHERE F.creator_id = '
    .$userId.'
                ORDER BY F.updated DESC
                '
    $limitOptions['limit'], $limitOptions['offset']
            ), 
    'id');
        }
    my Listener
    PHP:

        
    public static function templateHook($hookName, &$contents, array $hookParamsXenForo_Template_Abstract $template)
        {
           
            
    $param = array();
            
    $options XenForo_Application::get('options');
            switch(
    $hookName){
                case 
    'search_form_tabs':
                    
    $contents .= $template->create('gallery_search_tab'$template->getParams());
                    break;
                case 
    'member_view_tabs_heading':
                    
    $contents .= $template->create('gallery_gallery_tab'$template->getParams());
                    break;
                case 
    'member_view_tabs_content':
                    
    $contents .= $template->create('gallery_gallery_tabs_content'$template->getParams());
                    break;
            }

        }
    as well as the load_controller adds all the info and outputs to the profile page when i click my tab.
    but cannot pass the page number and other info to the template that outputs the content.

    Any help would be great.
     

Share This Page