From: <tr...@us...> - 2013-01-09 22:03:22
|
Revision: 10727 http://sourceforge.net/p/xoops/svn/10727 Author: trabis Date: 2013-01-09 22:03:19 +0000 (Wed, 09 Jan 2013) Log Message: ----------- Fixing bug in index page Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/index.php Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-09 21:43:27 UTC (rev 10726) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-09 22:03:19 UTC (rev 10727) @@ -1607,8 +1607,11 @@ { $ret = array(); $catIds = array(); - foreach ($categoriesObj as $category) { - $catIds[] = $category->getVar('categoryid'); + foreach ($categoriesObj as $parentid) { + foreach ($parentid as $category) { + $catId = $category->getVar('categoryid'); + $catIds[$catId] = $catId; + } } if (empty($catIds)) { return $ret; Modified: XoopsModules/publisher/trunk/publisher/index.php =================================================================== --- XoopsModules/publisher/trunk/publisher/index.php 2013-01-09 21:43:27 UTC (rev 10726) +++ XoopsModules/publisher/trunk/publisher/index.php 2013-01-09 22:03:19 UTC (rev 10727) @@ -53,7 +53,7 @@ redirect_header("javascript:history.go(-1)", 2, _MD_PUBLISHER_NO_CAT_EXISTS); exit; } - //exit('here'); + // Get subcats of the top categories $subcats = $publisher->getHandler('category')->getSubCats($categoriesObj); @@ -65,7 +65,7 @@ if ($publisher->getConfig('idxcat_display_last_item') == 1) { // Get the last item in each category - $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array_merge($categoriesObj, $subcats)); + $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array_merge(array($categoriesObj), $subcats)); } // Max size of the title in the last item column |