From: <vo...@us...> - 2011-12-19 11:47:44
|
Revision: 8526 http://xoops.svn.sourceforge.net/xoops/?rev=8526&view=rev Author: voltan1 Date: 2011-12-19 11:47:33 +0000 (Mon, 19 Dec 2011) Log Message: ----------- Fix some bugs Modified Paths: -------------- XoopsModules/fmcontent/branches/news/blocks/list.php XoopsModules/fmcontent/branches/news/class/story.php XoopsModules/fmcontent/branches/news/sql/mysql.sql Modified: XoopsModules/fmcontent/branches/news/blocks/list.php =================================================================== --- XoopsModules/fmcontent/branches/news/blocks/list.php 2011-12-19 09:13:05 UTC (rev 8525) +++ XoopsModules/fmcontent/branches/news/blocks/list.php 2011-12-19 11:47:33 UTC (rev 8526) @@ -19,14 +19,16 @@ * @author Hossein Azizabadi (Aka Voltan) * @version $Id$ */ - -require dirname(__FILE__) . '/header.php'; -if (!isset($forMods)) exit('Module not found'); function news_list_show($options) { $story_handler = xoops_getmodulehandler ( 'story', 'news' ); $topic_handler = xoops_getmodulehandler ( 'topic', 'news' ); + $module_handler = xoops_gethandler('module'); + + require_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php'; + require_once XOOPS_ROOT_PATH . '/modules/news/class/perm.php'; + require_once XOOPS_ROOT_PATH . '/modules/news/class/utils.php'; global $xoTheme; @@ -42,7 +44,11 @@ $width = $options[8]; $float = $options[9]; $story_infos['story_order'] = $options[10]; - + $block['showmore'] = $options[11]; + $block['morelink'] = $options[12]; + + array_shift($options); + array_shift($options); array_shift($options); array_shift($options); array_shift($options); @@ -51,12 +57,12 @@ array_shift($options); array_shift($options); array_shift($options); - array_shift($options); array_shift($options); array_shift($options); + array_shift($options); - $module_handler = xoops_gethandler('module'); $forMods = $module_handler->getByDirname($forMods); + $options0 = $options[0]; $story_infos ['topics'] = $topic_handler->getall (); Modified: XoopsModules/fmcontent/branches/news/class/story.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/story.php 2011-12-19 09:13:05 UTC (rev 8525) +++ XoopsModules/fmcontent/branches/news/class/story.php 2011-12-19 11:47:33 UTC (rev 8526) @@ -563,18 +563,17 @@ function getContentBlockList($forMods, $story_infos ,$options) { $ret = array (); $criteria = new CriteriaCompo (); - $criteria->add ( new Criteria ( 'story_type', 'news' ) ); $criteria->add ( new Criteria ( 'story_status', '1' ) ); - $access_topic = NewsPermission::getItemIds ( 'news_access', $forMods); - $criteria->add ( new Criteria ( 'story_topic', '(' . implode ( ',', $access_topic ) . ')', 'IN' ) ); - if (! (count ( $options ) == 1 && $options [0] == 0)) { - $criteria->add ( new Criteria ( 'story_topic', '(' . implode ( ',', $options ) . ')', 'IN' ) ); - } $criteria->add ( new Criteria ( 'story_publish', time() , '<=' )); $criteria->add ( new Criteria ( 'story_publish', 0 , '>' )); $criteria->add ( new Criteria ( 'story_expire', time() , '>=' )); $criteria->add ( new Criteria ( 'story_expire', 0 ) ,'OR'); $criteria->add ( new Criteria ( 'story_modid', $forMods->getVar ( 'mid' ) ) ); + $access_topic = NewsPermission::getItemIds ( 'news_access', $forMods); + $criteria->add ( new Criteria ( 'story_topic', '(' . implode ( ',', $access_topic ) . ')', 'IN' ) ); + if (! (count ( $options ) == 1 && $options [0] == 0)) { + $criteria->add ( new Criteria ( 'story_topic', '(' . implode ( ',', $options ) . ')', 'IN' ) ); + } $criteria->setSort ( $story_infos ['story_sort'] ); $criteria->setOrder ( $story_infos ['story_order'] ); $criteria->setLimit ( $story_infos ['story_limit'] ); Modified: XoopsModules/fmcontent/branches/news/sql/mysql.sql =================================================================== --- XoopsModules/fmcontent/branches/news/sql/mysql.sql 2011-12-19 09:13:05 UTC (rev 8525) +++ XoopsModules/fmcontent/branches/news/sql/mysql.sql 2011-12-19 11:47:33 UTC (rev 8526) @@ -35,9 +35,12 @@ `doimage` tinyint(1) NOT NULL, `dosmiley` tinyint(1) NOT NULL, `doxcode` tinyint(1) NOT NULL, -PRIMARY KEY (`story_id`,`story_modid`), -UNIQUE KEY `story_id` (`story_id`,`story_modid`) -) ENGINE=MyISAM ; +PRIMARY KEY (`story_id`), +KEY `idxstoriestopic` (`story_topic`), +KEY `story_title` (`story_title`), +KEY `story_create` (`story_create`), +FULLTEXT KEY `search` (`story_title`,`story_short`,`story_text`,`story_subtitle`) +) ENGINE=MyISAM; CREATE TABLE `news_topic` ( @@ -68,8 +71,11 @@ `topic_alias` varchar(255) NOT NULL, `topic_homepage` tinyint (4) NOT NULL , `topic_show` tinyint (1) NOT NULL default '1', -PRIMARY KEY (`topic_id`,`topic_modid`), -UNIQUE KEY `topic_id` (`topic_id`,`topic_modid`) + PRIMARY KEY (`story_id`), + KEY `idxstoriestopic` (`story_topic`), + KEY `story_title` (`story_title`), + KEY `story_create` (`story_create`), + FULLTEXT KEY `search` (`story_title`,`story_short`,`story_text`,`story_subtitle`) ) ENGINE=MyISAM; CREATE TABLE `news_file` ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |