Little bug in "router.php"

Phoca Gallery - image gallery extension
susi
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 17 Oct 2009, 12:42

Little bug in "router.php"

Post by susi »

hi,

I use joomla core-Sef.
For some phoca-Gallery-Categories a created there own menu-items.
But at links to this categories only the default-itemId (itemid of the Site with the link) were set NOT the ItemId of the existing Menu-Item.

I changed in the router.php following lines:

Code: Select all

			
foreach ($items as $item)
			{
				// Check if this menu item links to this view.
				if (isset($item->query['view']) && ($item->query['view'] == 'detail' || $item->query['view'] == 'map' || $item->query['view'] == 'info' || $item->query['view'] == 'comment' )
					&& isset($query['view']) && $query['view'] != 'category'
					&& isset($item->query['id']) && $item->query['id'] == $query['id']) {
						$itemid	= $item->id;
				}
				else if (isset($item->query['view']) && $item->query['view'] == 'category'
					&& isset($query['view']) && ($query['view'] != 'detail' || $query['view'] != 'map' || $query['view'] != 'info' || $query['view'] != 'comment')
					&& isset($item->query['catid']) && $item->query['catid'] == $query['catid']) {
						$itemid	= $item->id;
				}
			}
to

Code: Select all

			foreach ($items as $item)
			{
				// Check if this menu item links to this view.
				if (isset($item->query['view']) && ($item->query['view'] == 'detail' || $item->query['view'] == 'map' || $item->query['view'] == 'info' || $item->query['view'] == 'comment' )
					&& isset($query['view']) && $query['view'] != 'category'
					&& isset($item->query['id']) && $item->query['id'] == $query['catid']) {
						$itemid	= $item->id;
				}
				elseif (isset($item->query['view']) && $item->query['view'] == 'category'
					&& isset($query['view']) && ($query['view'] != 'detail' && $query['view'] != 'map' && $query['view'] != 'info' && $query['view'] != 'comment')
					&& isset($item->query['id']) && $item->query['id'] == $query['id']) {
						$itemid	= $item->id;
				}
			}
I hope I could help somebody with this information and maybe Jan can check the solution.

PS: Thanks at Phoca for this create component!!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Little bug in "router.php"

Post by Jan »

Hi, thank you for this info, I will do some tests.

Jan
If you find Phoca extensions useful, please support the project
Post Reply