I have a videos protal system that I just udated and I am getting this error:
[24-Feb-2013 02:48:44] PHP Fatal error: Call to a member function portalIndex() on a non-object in /home/user/public_html/admin/applications_addon/other/videos/modules_public/display/index.php on line 152

The line that is on contains ths:

$this->output .= $this->registry->output->getTemplate('videos')->portalIndex( $categories, $memberVideos, $featuredVideos );

This is the code around it:

        //-----------------------------------------
        // Portal or category layout?
        //----------------------------------------- 

        $featuredVideos = $this->registry->getClass('video_functions')->getFeaturedVideos();
        $memberVideos   = $this->registry->getClass('video_functions')->mainMemberVideos();

        if( !$this->request['showcats'] AND $this->settings['vs_portal_layout'] )
        {
            $this->output .= $this->registry->output->getTemplate('videos')->portalIndex( $categories, $memberVideos, $featuredVideos );      
        }
        else
        {
            $this->output .= $this->registry->output->getTemplate('videos')->categoryIndex( $categories, $memberVideos );            
        }

        $this->output .= $this->stats(); 
    }
Member Avatar for LastMitch

I have a videos protal system that I just udated and I am getting this error:

You define these

$featuredVideos = $this->registry->getClass('video_functions')->getFeaturedVideos();
$memberVideos = $this->registry->getClass('video_functions')->mainMemberVideos();

The reason you got the error because you didn't define $categories.

These 2 code you should look a like even though it's different index: portalIndex() & categoryIndex()

Instead of this:

//portalIndex()
$this->output .= $this->registry->output->getTemplate('videos')->portalIndex( $categories, $memberVideos, $featuredVideos );
//categoryIndex()
$this->output .= $this->registry->output->getTemplate('videos')->categoryIndex( $categories, $memberVideos ); 

It should look like this:

//portalIndex()
$this->output .= $this->registry->output->getTemplate('videos')->portalIndex( $categories, $memberVideos, $featuredVideos );
//categoryIndex()
$this->output .= $this->registry->output->getTemplate('videos')->categoryIndex( $categories, $memberVideos, $featuredVideos ); 

You are missing $featuredVideos in the categoryIndex()

Member Avatar for diafol

Is this your code or one you picked up?
It's a bit messy with all those nested bits.
Show the relevant methods and say which classes they're in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.