In general, there is an IPB forum. If you go to the sections of the forums, 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; } } ?> 

Because I have a bottom in PHP, I ask for help from you, dear professionals.

    3 answers 3

    Well, find out where exactly foreach is displayed and write if(!empty($members)) or what you swear at it ... This is “hiding” problems, not a solution, a solution (if necessary) you should already look for freelancers .

      With the code everything is OK, you have to dig deeper. Is it just under your account or jamb "default"?

      Is the forum still "as is" or already hung up with mods? If mods, disable, or better remove by 1 ... from the last one installed. And you will be happy, 90%, that crookedly rose any of the addons.

      • No no no! No mods and no hooks! It is only "forum" and "Users." In the sense of the default? See this error all. - Eugene Shilin
      • in the studio listing function loadAvatars - DemoriaN

      Translated into understandable, your error sounds like "in $ topic_data some kind of nonsense." Check whether such an array exists and what is going on in it.
      And if in php you bottom, it's time to google and learn new knowledge.