Jump to content

Download: (Bim) Top New Posts in Mobile Skin


onlyME

Recommended Posts

  • 1 month later...
  • 2 months later...

Hi there, onlyME. Since I'm using it on my board, decided to post here a tiny change in your script to fix the permission issue.

Find in your XML:

	   	 $bimforum = explode(',', $this->settings['bim_topnewposts_mobile_forum'] );


			   if( count( $bimforum ) )

			   {

				$iwhere = 'forum_id IN (' . implode(',', $bimforum ).  ')';

			  }

Change to:

	   	 $forumIdsOk = $this->registry->class_forums->fetchSearchableForumIds();


			if( !is_array($forumIdsOk) OR !count($forumIdsOk) )

			{

				return '';

			}

			else

			{

				$iwhere = 'forum_id IN (' . implode(',', $forumIdsOk ).  ')';

			}

Now users will only see topics that they have permission to see and makes the setting Forums?. uselless... Unless you want to add a setting to EXCLUDE forums... so it's enough to add:

	   	 $bimforum = explode(',', $this->settings['bim_topnewposts_mobile_forum'] );


			   if( count( $bimforum ) )

			   {

				$iwhere2 = 'forum_id NOT IN (' . implode(',', $bimforum ).  ')';

			  }



You just need now to add $iwhere2 on 'where' query.

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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