Jump to content

Download: [AH30] Latest News Hook


Alex

Recommended Posts

  • 4 months later...
  • 5 months later...
  • 3 weeks later...
  • 6 months later...
Guest Talizorah
Posted

I really liked this hook, but I had to disable it because for some reason it causes a fatal PHP error in Chrome and IE. Firefox has no problems though.

Fatal error: Cannot break/continue 1 level in hooks/boardIndexLatestNews_1e2fb0078880e2ad1c562ebe3fb0c73c.php on line 42

It seems to be caused when a user doesn't have permission to view the board where the news is being drawn from. So, if you have guest viewing of that board or your forum disabled, any guest accessing your forum will be greeted by that nice PHP error including private info like the path. =P

  • 2 months later...
Posted

I really liked this hook, but I had to disable it because for some reason it causes a fatal PHP error in Chrome and IE. Firefox has no problems though.



Fatal error: Cannot break/continue 1 level in hooks/boardIndexLatestNews_1e2fb0078880e2ad1c562ebe3fb0c73c.php on line 42



It seems to be caused when a user doesn't have permission to view the board where the news is being drawn from. So, if you have guest viewing of that board or your forum disabled, any guest accessing your forum will be greeted by that nice PHP error including private info like the path. =P



m4rtin over at invisionmodding posted a solution back in February 2010:


Open ./hooks/boardIndexLatestNews_xxxx.php


Find:


/* Grab last X data */

		if ( ! $forumData['can_view_others'] )

		{

			continue;

		}


		if ( ! $this->registry->permissions->check( 'read', $forumData ) )

		{

			continue;

		}

Replace with:

/* Grab last X data */

		if ( ! $forumData['can_view_others'] )

		{

			return;

		}


		if ( ! $this->registry->permissions->check( 'read', $forumData ) )

		{

			return;

		}


Save and upload.

  • 11 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...