z1000-forum.de

Portal Plugin - Status Updates

11 posts in this topic

[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.

Share this post


Link to post
Share on other sites

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();

        }


}


?>

Share this post


Link to post
Share on other sites

Sorry z1000 mate been off line for a bit, well buddy, things have slightly changed, i have upgraded my board to 3.4 ! so will this work with new version.

Share this post


Link to post
Share on other sites

Just curious, is there a template bit somewhere for this? I've searched through the html templates & can't find one. I have one small change in the title that I'd like to make if possible, but can't find the spot to do it.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.