Jump to content

Portal Plugin - Status Updates


z1000-forum.de

Recommended Posts

  • 2 weeks later...

[Sat Jul 14 10:49:58 2012] [error] [client 1.2.3.4] PHP Catchable fatal error: Argument 1 passed to members_hookGateway::__construct() must be an instance of ipsRegistry, null given, called in /home/foo/web/main/admin/applications/members/extensions/portalPlugins/status_updates.php on line 45 and defined in /home/foo/web/main/admin/applications/members/sources/classes/hooks/gateway.php on line 51, referer: http://foo.org

This plugin causes the portal page to 403 with the above error using PHP 5.3.

Link to comment
Share on other sites

  • 1 month later...

I added a simple fix to this hook so that the "Recent Status Updates" title displays. Currently the hook can't properly access the language bit needed for that. To fix it you just need to add this line to the init function.


ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_boards' ), 'forums' );

Giving this as the end result,



<?php


if ( ! defined( 'IN_IPB' ) )

{

        print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";

        exit();

}


class ppi_status_updates extends public_portal_portal_portal

{


        /**

         * IPS Global object

         *

         * @var string

         */

        var $ipsclass;


        /**

         * Array of portal objects including:

         * good_forum, bad_forum

         *

         * @var array

         */

        var $portal_object = array();


        /*-------------------------------------------------------------------------*/

        // INIT

        /*-------------------------------------------------------------------------*/

        /**

         * This function must be available always

         * Add any set up here, such as loading language and skins, etc

         */

        function init()

        {

        ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_boards' ), 'forums' );

        }


        /*-------------------------------------------------------------------------*/

        // SHOW

        /*-------------------------------------------------------------------------*/


    public function show_status_updates()

        {

                $classToLoad       = IPSLib::loadLibrary( IPSLib::getAppDir( 'members' ) . '/sources/classes/hooks/gateway.php', 'members_hookGateway', 'members' );

                $hook = new $classToLoad( $this->registry );


                return $hook->statusUpdates();

        }


}


?>

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 2 months later...
  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...