Error on IPB forum

Actually, there is an IPB forum. If you go to the forum sections, the forum is displayed, but with an error:

Warning: Invalid argument supplied for foreach() in /home/p50193/www/play-mp3.ru/public/style_images/engraved/_php/IPBForumSkins.php on line 36
Warning: Invalid argument supplied for foreach() in /home/p50193/www/play-mp3.ru/public/style_images/engraved/_php/IPBForumSkins.php on line 41

Here is the IPBForumSkins.php file:

<?php
class IPBForumSkins{
    static public $_instance;
    static public function init(){
        if(self::$_instance == null)
            self::$_instance = new IPBForumSkins_Functions(ipsRegistry::instance());
        return self::$_instance;
    }
}
class IPBForumSkins_Functions{
    protected $registry;
    protected $DB;
    protected $settings;
    protected $request;
    protected $lang;
    protected $member;
    protected $memberData;
    protected $cache;
    protected $caches;
    public $topic_data;
    public function __construct(ipsRegistry $registry){
        $this->registry   =  $registry;
        $this->DB         =  $this->registry->DB();
        $this->settings   =& $this->registry->fetchSettings();
        $this->request    =& $this->registry->fetchRequest();
        $this->lang       =  $this->registry->getClass('class_localization');
        $this->member     =  $this->registry->member();
        $this->memberData =& $this->registry->member()->fetchMemberData();
        $this->cache      =  $this->registry->cache();
        $this->caches     =& $this->registry->cache()->fetchCaches();
    }
    public function loadAvatars( &$topic_data ){
        $members = array();
        $members_ids = array();
        foreach( $topic_data as $tid => $data )
            $members_ids[ $data['starter_id'] ] = $data['starter_id'];
        $members = IPSMember::load( array_keys( $members_ids ), 'core,extendedProfile' );
        foreach($members as $member )
            $members_avatars[ $member['member_id'] ] = IPSMember::buildAvatar( $member );
        foreach( $topic_data as $tid => $data )
            $topic_data[ $tid ]['starter_avatar'] = $members_avatars[ $data['starter_id'] ];
        return $topic_data;
    }
}
?>

Since I am a bottom in PHP, I ask you for help, dear professionals.


Answer 1

Well, find where exactly foreachis displayed and write if(!empty($members))or whatever you swear at… It’s “hiding” problems, not a solution, a solution (if necessary) should already be sought from freelancers.


Answer 2

The code is ok, we need to dig deeper. Is it only under your account or cant be “default”?

Is the forum still “as is” or is it already hung with mods? If mods, disable, or rather delete 1 … from the last installed. And you will be happy, 90%, that any of the addons is crooked.


Answer 3

In English translation, your error sounds like “$topic_data is some kind of nonsense”. Check if such an array exists and what is going on in it.
And if you are a bottom in php, it’s time to google and learn new knowledge.