From: <vo...@us...> - 2012-02-29 09:54:24
|
Revision: 9077 http://xoops.svn.sourceforge.net/xoops/?rev=9077&view=rev Author: voltan1 Date: 2012-02-29 09:54:13 +0000 (Wed, 29 Feb 2012) Log Message: ----------- Limited list by topic ID if exist Modified Paths: -------------- XoopsModules/fmcontent/branches/news/blocks/list.php XoopsModules/fmcontent/branches/news/class/story.php XoopsModules/fmcontent/branches/news/class/utils.php XoopsModules/fmcontent/branches/news/language/arabic/blocks.php XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php XoopsModules/fmcontent/branches/news/language/english/blocks.php XoopsModules/fmcontent/branches/news/language/english/modinfo.php XoopsModules/fmcontent/branches/news/language/persian/blocks.php XoopsModules/fmcontent/branches/news/language/persian/modinfo.php XoopsModules/fmcontent/branches/news/xoops_version.php Modified: XoopsModules/fmcontent/branches/news/blocks/list.php =================================================================== --- XoopsModules/fmcontent/branches/news/blocks/list.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/blocks/list.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -61,26 +61,33 @@ array_shift($options); array_shift($options); array_shift($options); + array_shift($options); array_shift($options); $NewsModule = $module_handler->getByDirname($NewsModule); + // Set story publish if($story_infos['story_sort'] == 'story_hits') { if($day) { $day = 86400 * $day; - $publish = time() - $day; + $story_infos['story_publish'] = time() - $day; } else { - $publish = 0; - } + $story_infos['story_publish'] = 0; + } } else { - $publish = 0; + $story_infos['story_publish'] = 0; } - - $story_infos['story_publish'] = $publish; - - $options0 = $options[0]; + + // Set topics + if(true) { + $topics = array(); + $topics[] = NewsUtils::News_CleanVars ( $_GET, 'storytopic', 0, 'int' ); + } else { + $topics = $options; + } + $story_infos ['topics'] = $topic_handler->getall (); - $contents = $story_handler->News_GetContentBlockList($NewsModule, $story_infos ,$options); + $contents = $story_handler->News_GetContentBlockList($NewsModule, $story_infos ,$topics); if($show == 'spotlight') { $spotlightid = $story_handler->News_SpotlightId($contents); @@ -196,6 +203,16 @@ $form .= _NEWS_MB_MORELINK . " : <input name=\"options[12]\" size=\"50\" maxlength=\"255\" value=\"" . $options[12] . "\" type=\"text\" /><br />\n"; $form .= _NEWS_MB_HITINDAY1 . " <input name=\"options[13]\" size=\"5\" maxlength=\"255\" value=\"" . $options[13] . "\" type=\"text\" />" . _NEWS_MB_HITINDAY2 . "<br />\n"; + + if ($options[14] == false) { + $checked_yes = ''; + $checked_no = 'checked="checked"'; + } else { + $checked_yes = 'checked="checked"'; + $checked_no = ''; + } + $form .= _NEWS_MB_TOPICLIMIT . " : <input name=\"options[14]\" value=\"1\" type=\"radio\" " . $checked_yes . "/>" . _YES . " \n"; + $form .= "<input name=\"options[14]\" value=\"0\" type=\"radio\" " . $checked_no . "/>" . _NO . "<br />\n"; array_shift($options); array_shift($options); @@ -210,6 +227,7 @@ array_shift($options); array_shift($options); array_shift($options); + array_shift($options); array_shift($options); $form .= "<br />" . _NEWS_MB_TOPICDISPLAY . "<br /><select name=\"options[]\" multiple=\"multiple\" size=\"5\">\n"; Modified: XoopsModules/fmcontent/branches/news/class/story.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/story.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/class/story.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -565,13 +565,13 @@ /** * Get content list for list block */ - function News_GetContentBlockList($NewsModule, $story_infos ,$options) { + function News_GetContentBlockList($NewsModule, $story_infos ,$topics) { $ret = array (); $access_topic = NewsPermission::News_GetItemIds ( 'news_access', $NewsModule); - if (! (count ( $options ) == 1 && $options [0] == 0)) { - $topiclist = array_intersect($access_topic , $options); + if (! (count ( $topics ) == 1 && $topics [0] == 0)) { + $topiclist = array_intersect($access_topic , $topics); } else { $topiclist = $access_topic; } Modified: XoopsModules/fmcontent/branches/news/class/utils.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/utils.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/class/utils.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -629,7 +629,11 @@ case 'id': return XOOPS_URL . '/modules/' . $module . '/index.php?storytopic=' . $id; - break; + break; + + case 'topic': + return XOOPS_URL . '/modules/' . $module . '/index.php?storytopic=' . $id; + break; } } @@ -712,7 +716,11 @@ case 'id': return XOOPS_URL . '/modules/' . $module . '/' . $type . '.php?storyid=' . $id; - break; + break; + + case 'topic': + return XOOPS_URL . '/modules/' . $module . '/' . $type . '.php?storytopic=' . $array['story_topic'] . '&storyid=' . $id; + break; } } } Modified: XoopsModules/fmcontent/branches/news/language/arabic/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/arabic/blocks.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/arabic/blocks.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -34,5 +34,6 @@ define("_NEWS_MB_TOPIC_IMG", "image"); define("_NEWS_MB_HITINDAY1", "Show news since"); define("_NEWS_MB_HITINDAY2", "Day's ago. This option work when you sort news by hit"); + define("_NEWS_MB_TOPICLIMIT", "Limited list by topic ID if exist"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -53,6 +53,7 @@ define('_NEWS_MI_URL_REWRITE', 'Rewrite Mode'); define('_NEWS_MI_URL_SHORT', 'Short Rewrite'); define('_NEWS_MI_URL_ID', 'ID Mode'); + define('_NEWS_MI_URL_TOPIC', 'ID - Topic Mode'); // Rewrite Mode define('_NEWS_MI_REWRITEBASE', 'اختر عنوانا یمکن کتابته'); define('_NEWS_MI_REWRITEBASE_DESC', '"Module base": یجب علیک .htacces جعله في فئة الوحدة.<br />"Root base": یجب علیک .htacces في فئةROOT_PATH جعل.'); Modified: XoopsModules/fmcontent/branches/news/language/english/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/english/blocks.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/english/blocks.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -34,5 +34,6 @@ define("_NEWS_MB_TOPIC_IMG", "image"); define("_NEWS_MB_HITINDAY1", "Show news since"); define("_NEWS_MB_HITINDAY2", "Day's ago. This option work when you sort news by hit"); + define("_NEWS_MB_TOPICLIMIT", "Limited list by topic ID if exist"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/english/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/english/modinfo.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/english/modinfo.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -52,7 +52,8 @@ define('_NEWS_MI_URL_STANDARD', 'Standard Mode'); define('_NEWS_MI_URL_REWRITE', 'Rewrite Mode'); define('_NEWS_MI_URL_SHORT', 'Short Rewrite'); - define('_NEWS_MI_URL_ID', 'ID Mode'); + define('_NEWS_MI_URL_ID', 'ID Mode'); + define('_NEWS_MI_URL_TOPIC', 'ID - Topic Mode'); // Rewrite Mode define('_NEWS_MI_REWRITEBASE', 'Rewrite Mode: .htaccess file position'); define('_NEWS_MI_REWRITEBASE_DESC', '"Module": .htaccess file must be in the module directory.<br />"Root": .htaccess file must be in your ROOT directory.'); Modified: XoopsModules/fmcontent/branches/news/language/persian/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/persian/blocks.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/persian/blocks.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -34,5 +34,6 @@ define("_NEWS_MB_TOPIC_IMG", "تصویر"); define("_NEWS_MB_HITINDAY1", "نمایش اخبار از"); define("_NEWS_MB_HITINDAY2", "روز قبل. این گزینه وقتی کار میکند که شما نمایش اخبار را بر اساس بازدید مرتب کرده باشید."); + define("_NEWS_MB_TOPICLIMIT", "محدود سازی فهرست مطالب به شاخه فعلی"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/persian/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/persian/modinfo.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/language/persian/modinfo.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -52,7 +52,8 @@ define('_NEWS_MI_URL_STANDARD', 'Standard Mode'); define('_NEWS_MI_URL_REWRITE', 'Rewrite Mode'); define('_NEWS_MI_URL_SHORT', 'Short Rewrite'); - define('_NEWS_MI_URL_ID', 'ID Mode'); + define('_NEWS_MI_URL_ID', 'ID Mode'); + define('_NEWS_MI_URL_TOPIC', 'ID - Topic Mode'); // Rewrite Mode define('_NEWS_MI_REWRITEBASE', 'آدرسی که به طور پایه قابل نوشتن است انتخاب کنید'); define('_NEWS_MI_REWRITEBASE_DESC', '"برپایه ماژول": شما باید یک .htacces در شاخه ماژول قرار دهید.<br />"برپایه هسته": شما باید یک .htacces در شاخه ROOT_PATH قرار دهید.'); Modified: XoopsModules/fmcontent/branches/news/xoops_version.php =================================================================== --- XoopsModules/fmcontent/branches/news/xoops_version.php 2012-02-28 13:20:30 UTC (rev 9076) +++ XoopsModules/fmcontent/branches/news/xoops_version.php 2012-02-29 09:54:13 UTC (rev 9077) @@ -227,7 +227,7 @@ 'description' => '_NEWS_MI_FRIENDLYURL_DESC', 'formtype' => 'select', 'valuetype' => 'text', - 'options' => array(_NEWS_MI_URL_STANDARD => 'none', _NEWS_MI_URL_REWRITE => 'rewrite' , _NEWS_MI_URL_SHORT => 'short' , _NEWS_MI_URL_ID => 'id'), + 'options' => array(_NEWS_MI_URL_STANDARD => 'none', _NEWS_MI_URL_REWRITE => 'rewrite' , _NEWS_MI_URL_SHORT => 'short' , _NEWS_MI_URL_ID => 'id' , _NEWS_MI_URL_TOPIC => 'topic'), 'default' => 'none'); $modversion['config'][] = array( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |