From: <vo...@us...> - 2012-01-08 07:19:23
|
Revision: 8666 http://xoops.svn.sourceforge.net/xoops/?rev=8666&view=rev Author: voltan1 Date: 2012-01-08 07:19:16 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Add topic list block Modified Paths: -------------- XoopsModules/fmcontent/branches/news/class/story.php XoopsModules/fmcontent/branches/news/class/topic.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 Added Paths: ----------- XoopsModules/fmcontent/branches/news/blocks/topic.php XoopsModules/fmcontent/branches/news/templates/blocks/news_block_list.html XoopsModules/fmcontent/branches/news/templates/blocks/news_block_page.html XoopsModules/fmcontent/branches/news/templates/blocks/news_block_topic.html Removed Paths: ------------- XoopsModules/fmcontent/branches/news/blocks/header.php XoopsModules/fmcontent/branches/news/templates/blocks/news_list.html XoopsModules/fmcontent/branches/news/templates/blocks/news_page.html Deleted: XoopsModules/fmcontent/branches/news/blocks/header.php =================================================================== --- XoopsModules/fmcontent/branches/news/blocks/header.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/blocks/header.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -1,28 +0,0 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -/** - * News header file - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Andricq Nicolas (AKA MusS) - * @package forcontent - * @version $Id$ - */ - -require_once XOOPS_ROOT_PATH . '/class/tree.php'; -require_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php'; - -$module_handler =& xoops_gethandler('module'); -$forMods =& $module_handler->getByDirname(basename(dirname(dirname(__FILE__)))); - -?> \ No newline at end of file Added: XoopsModules/fmcontent/branches/news/blocks/topic.php =================================================================== --- XoopsModules/fmcontent/branches/news/blocks/topic.php (rev 0) +++ XoopsModules/fmcontent/branches/news/blocks/topic.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -0,0 +1,132 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Module block page file + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Hossein Azizabadi (Aka Voltan) + * @version $Id$ + */ + +function news_topic_show($options) { + + + $story_handler = xoops_getmodulehandler ( 'story', 'news' ); + $topic_handler = xoops_getmodulehandler ( 'topic', 'news' ); + $module_handler = xoops_gethandler('module'); + + $block = array(); + $NewsModule = $options[0]; + $block['showtype'] = $options[1]; + $block['img'] = $options[2]; + $block['description'] = $options[3]; + $count = $options[4]; + $float = $options[5]; + $info['topic_order'] = $options[6]; + $info['topic_sort'] = $options[7]; + + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + + $NewsModule = $module_handler->getByDirname($NewsModule); + + if($count) { + $info['newscountbytopic'] = $story_handler->News_GetNewsCountByTopic(); + } + $topics = $topic_handler->News_GetBlockTopics($NewsModule, $info); + $block['topics'] = $topics; + $block['float'] = $float; + $block['count'] = $count; + return $block; +} + +function news_topic_edit($options) { + + $module_handler = xoops_gethandler('module'); + $NewsModule = $module_handler->getByDirname($options[0]); + + $form = "<input type=\"hidden\" name=\"options[]\" value=\"" . $options[0] . "\" />"; + + $show_select = new XoopsFormSelect(_NEWS_MI_SHOWTYPE, 'options[]', $options[1]); + $show_select->addOption("list", _NEWS_MI_SHOWTYPE_4); + $show_select->addOption("table", _NEWS_MI_SHOWTYPE_2); + $form .= _NEWS_MI_SHOWTYPE . " : " . $show_select->render() . '<br />'; + + if ($options[2] == false) { + $checked_yes = ''; + $checked_no = 'checked="checked"'; + } else { + $checked_yes = 'checked="checked"'; + $checked_no = ''; + } + $form .= _NEWS_MB_IMG . " : <input name=\"options[2]\" value=\"1\" type=\"radio\" " . $checked_yes . "/>" . _YES . " \n"; + $form .= "<input name=\"options[2]\" value=\"0\" type=\"radio\" " . $checked_no . "/>" . _NO . "<br />\n"; + + if ($options[3] == false) { + $checked_yes = ''; + $checked_no = 'checked="checked"'; + } else { + $checked_yes = 'checked="checked"'; + $checked_no = ''; + } + $form .= _NEWS_MB_DESCRIPTION . " : <input name=\"options[3]\" value=\"1\" type=\"radio\" " . $checked_yes . "/>" . _YES . " \n"; + $form .= "<input name=\"options[3]\" value=\"0\" type=\"radio\" " . $checked_no . "/>" . _NO . "<br />\n"; + + if ($options[4] == false) { + $checked_yes = ''; + $checked_no = 'checked="checked"'; + } else { + $checked_yes = 'checked="checked"'; + $checked_no = ''; + } + $form .= _NEWS_MB_COUNT . " : <input name=\"options[4]\" value=\"1\" type=\"radio\" " . $checked_yes . "/>" . _YES . " \n"; + $form .= "<input name=\"options[4]\" value=\"0\" type=\"radio\" " . $checked_no . "/>" . _NO . "<br />\n"; + + $float_select = new XoopsFormSelect(_NEWS_MI_IMAGE_FLOAT, 'options[]', $options[5]); + $float_select->addOption("left", _NEWS_MI_IMAGE_LEFT); + $float_select->addOption("right", _NEWS_MI_IMAGE_RIGHT); + $form .= _NEWS_MI_IMAGE_FLOAT . " : " . $float_select->render() . '<br />'; + + $order_select = new XoopsFormSelect(_NEWS_MI_SHOWORDER, 'options[]', $options[6]); + $order_select->addOption("DESC", _NEWS_MI_DESC); + $order_select->addOption("ASC", _NEWS_MI_ASC); + $form .= _NEWS_MI_SHOWORDER . " : " . $order_select->render() . '<br />'; + + $sort_select = new XoopsFormSelect(_NEWS_MI_SHOWSORT, 'options[]', $options[7]); + $sort_select->addOption("topic_id", _NEWS_MI_SHOWSORT_1); + $sort_select->addOption("topic_publish", _NEWS_MI_SHOWSORT_2); + $sort_select->addOption("topic_update", _NEWS_MI_SHOWSORT_3); + $sort_select->addOption("topic_title", _NEWS_MI_SHOWSORT_4); + $sort_select->addOption("topic_order", _NEWS_MI_SHOWSORT_5); + $sort_select->addOption("RAND()", _NEWS_MI_SHOWSORT_6); + $form .= _NEWS_MI_SHOWSORT . " : " . $sort_select->render() . '<br />'; + + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + array_shift($options); + + return $form; +} + +?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/class/story.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/story.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/class/story.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -1011,6 +1011,23 @@ return $spotlightid; } + + /** + * Returns the number of published news per topic + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @author Hervé Thouzard (ttp://www.instant-zero.com) + */ + function News_GetNewsCountByTopic() + { + $ret = array(); + $sql = "SELECT count( story_id ) AS cpt, story_topic FROM ".$this->db->prefix('news_story')." WHERE ( story_publish > 0 AND story_publish <= " . time() . " ) AND ( story_expire = 0 OR story_expire > " . time() . " ) GROUP BY story_topic"; + $result = $this->db->query($sql); + while ($row = $this->db->fetchArray($result)) { + $ret [ $row["story_topic"] ] = $row["cpt"]; + } + return $ret; + } } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/class/topic.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/topic.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/class/topic.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -350,6 +350,35 @@ } return $topic_show; } + + /** + * + */ + function News_GetBlockTopics($NewsModule , $info) { + $ret = array (); + $criteria = new CriteriaCompo (); + $criteria->add ( new Criteria ( 'topic_modid', $NewsModule->getVar ( 'mid' ) ) ); + $criteria->add ( new Criteria ( 'topic_asmenu', 1 ) ); + $criteria->add ( new Criteria ( 'topic_online', 1 ) ); + $criteria->setSort ( $info['topic_sort'] ); + $criteria->setOrder ( $info['topic_order'] ); + $topics = $this->getObjects ( $criteria, false ); + if ($topics) { + foreach ( $topics as $root ) { + $tab = array (); + $tab = $root->toArray (); + $tab ['topicurl'] = NewsUtils::News_TopicUrl ( $NewsModule->getVar ( 'dirname' ), $tab ); + $tab ['thumburl'] = XOOPS_URL . xoops_getModuleOption ( 'img_dir', $NewsModule->getVar ( 'dirname' ) ) . '/thumb/' .$root->getVar ( 'topic_img' ); + $tab ['imageurl'] = XOOPS_URL . xoops_getModuleOption ( 'img_dir', $NewsModule->getVar ( 'dirname' ) ) . '/medium/' .$root->getVar ( 'topic_img' ); + if(isset($info['newscountbytopic'])) { + $tab ['count'] = $info['newscountbytopic'][$root->getVar ( 'topic_id' )]; + } + $ret [] = $tab; + } + } + return $ret; + } + } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/arabic/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/arabic/blocks.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/arabic/blocks.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -29,5 +29,8 @@ define('_NEWS_MB_SHOE_MORELINK', 'Show more link'); define('_NEWS_MB_MORELINK', 'More link'); define("_NEWS_MB_IMPORTANT", "Immediate "); + define("_NEWS_MB_COUNT", "Show news count"); + define("_NEWS_MB_TOPIC_NAME", "Title"); + define("_NEWS_MB_TOPIC_IMG", "image"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/arabic/modinfo.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -35,6 +35,7 @@ // Block define("_NEWS_MI_BLOCK_PAGE", "الصفحة"); define("_NEWS_MI_BLOCK_LIST", "الفهرسة"); + define('_NEWS_MI_BLOCK_TOPIC', 'Topic list'); // Editor define("_NEWS_MI_FORM_EDITOR", "اختیار شکل"); define("_NEWS_MI_FORM_EDITOR_DESC", "تحدید محرر للاستخدام في صفحة إرسال المواضیع."); Modified: XoopsModules/fmcontent/branches/news/language/english/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/english/blocks.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/english/blocks.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -29,5 +29,8 @@ define('_NEWS_MB_SHOE_MORELINK', 'Show more link'); define('_NEWS_MB_MORELINK', 'More link'); define("_NEWS_MB_IMPORTANT", "Immediate "); + define("_NEWS_MB_COUNT", "Show news count"); + define("_NEWS_MB_TOPIC_NAME", "Title"); + define("_NEWS_MB_TOPIC_IMG", "image"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/english/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/english/modinfo.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/english/modinfo.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -34,7 +34,8 @@ define('_NEWS_MI_FILE', 'File'); // Block define('_NEWS_MI_BLOCK_PAGE', 'Article page'); - define('_NEWS_MI_BLOCK_LIST', 'Article list'); + define('_NEWS_MI_BLOCK_LIST', 'Article list'); + define('_NEWS_MI_BLOCK_TOPIC', 'Topic list'); // Editor define("_NEWS_MI_FORM_EDITOR", "Form Option"); define("_NEWS_MI_FORM_EDITOR_DESC", "Select the editor to use for editing your article."); Modified: XoopsModules/fmcontent/branches/news/language/persian/blocks.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/persian/blocks.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/persian/blocks.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -29,5 +29,8 @@ define('_NEWS_MB_SHOE_MORELINK', 'Show more link'); define('_NEWS_MB_MORELINK', 'More link'); define("_NEWS_MB_IMPORTANT", "Immediate "); + define("_NEWS_MB_COUNT", "Show news count"); + define("_NEWS_MB_TOPIC_NAME", "Title"); + define("_NEWS_MB_TOPIC_IMG", "image"); } ?> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/language/persian/modinfo.php =================================================================== --- XoopsModules/fmcontent/branches/news/language/persian/modinfo.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/language/persian/modinfo.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -34,7 +34,8 @@ define('_NEWS_MI_FILE', 'فایل'); // Block define("_NEWS_MI_BLOCK_PAGE", "صفحه"); - define("_NEWS_MI_BLOCK_LIST", "فهرست"); + define("_NEWS_MI_BLOCK_LIST", "فهرست"); + define('_NEWS_MI_BLOCK_TOPIC', 'Topic list'); // Editor define("_NEWS_MI_FORM_EDITOR", "انتخاب فرم"); define("_NEWS_MI_FORM_EDITOR_DESC", "انتخاب ویرایشگر برای استفاده در صفحه ارسال مطلب."); Added: XoopsModules/fmcontent/branches/news/templates/blocks/news_block_list.html =================================================================== --- XoopsModules/fmcontent/branches/news/templates/blocks/news_block_list.html (rev 0) +++ XoopsModules/fmcontent/branches/news/templates/blocks/news_block_list.html 2012-01-08 07:19:16 UTC (rev 8666) @@ -0,0 +1,113 @@ +<{if $block.show == 'news'}> + <div class="itemBlock"> + <{foreach item=content from=$block.contents}> + <div class="item"> + <div class="itemHead"> + <div class="itemTitle"><h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a title="<{$content.title}>" href="<{$content.url}>"><{$content.title}></a></h3></div> + </div> + <{if $block.date}> + <div class="itemInfo"><{$smarty.const._NEWS_MB_DATE}> :<{$content.date}></div> + <{/if}> + <{if $block.img || $block.description}> + <div class="itemBody" id="story_<{$content.story_id}>"> + <{if $block.img && $content.story_img}> + <div class="itemImg"> + <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> + </div> + <{/if}> + <{if $block.description}> + <{if $content.story_short}> + <div class="itemText"><{$content.story_short}></div> + <{else}> + <div class="itemText"><{$content.story_text|truncate:300}></div> + <{/if}> + <{/if}> + <div class="clear"></div> + </div> + <{/if}> + </div> + <{/foreach}> + </div> +<{elseif $block.show == 'list'}> + <div class="itemBlock"> + <{if $block.img || $block.description}> + <ul class="itemList"> + <{foreach item=content from=$block.contents}> + <{if $block.img && $content.story_img}> + <div class="itemImg"> + <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> + </div> + <{/if}> + <li> + <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title}></a></h3> + <{if $block.date}> + <div class="itemPostDate"><{$content.date}></div> + <{/if}> + <{if $block.description}> + <{if $content.story_short}> + <div class="itemText"><{$content.story_short}></div> + <{else}> + <div class="itemText"><{$content.story_text|truncate:130}></div> + <{/if}> + <{/if}> + <div class="clear"></div> + </li> + <{/foreach}> + </ul> + <{else}> + <ul> + <{foreach item=content from=$block.contents}> + <li> + <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title}></a></h3> + <{if $block.date}> + <div class="itemPostDate"><{$content.date}></div> + <{/if}> + </li> + <{/foreach}> + </ul> + <{/if}> + </div> +<{elseif $block.show == 'spotlight'}> + <div class="itemBlock"> + <{foreach item=content from=$block.contents}> + <{if $content.story_id == $block.spotlightid}> + <div class="itemBlockLeft"> + <div class="item"> + <div class="itemHead"> + <div class="itemTitle"><h2><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a title="<{$content.title}>" href="<{$content.url}>"><{$content.title}></a></h2></div> + </div> + <{if $block.date}> + <div class="itemInfo"><{$smarty.const._NEWS_MB_DATE}> :<{$content.date}></div> + <{/if}> + <{if $block.img || $block.description}> + <div class="itemBody" id="story_<{$content.story_id}>"> + <{if $block.img && $content.story_img}> + <div class="itemImg"> + <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> + </div> + <{/if}> + <{if $block.description}> + <{if $content.story_short}> + <div class="itemText"><{$content.story_short|truncate:200}></div> + <{else}> + <div class="itemText"><{$content.story_text|truncate:200}></div> + <{/if}> + <div class="itemMore"><a title="<{$content.title}>" href="<{$content.url}>" ><{$smarty.const._NEWS_MB_MORE}></a></div> + <{/if}> + <div class="clear"></div> + </div> + <{/if}> + </div> + </div> + <{/if}> + <{/foreach}> + <{foreach item=content from=$block.contents}> + <{if $content.story_id != $block.spotlightid}> + <div class="itemBlockRight"> + <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title|truncate:80}></a></h3> + </div> + <{/if}> + <{/foreach}> + <div class="clear"></div> + </div> +<{/if}> \ No newline at end of file Added: XoopsModules/fmcontent/branches/news/templates/blocks/news_block_page.html =================================================================== --- XoopsModules/fmcontent/branches/news/templates/blocks/news_block_page.html (rev 0) +++ XoopsModules/fmcontent/branches/news/templates/blocks/news_block_page.html 2012-01-08 07:19:16 UTC (rev 8666) @@ -0,0 +1,31 @@ +<div class="itemBlock"> + <div class="itemHead"> + <div class="itemTitle"> + <h2><{$block.story_title}></h2> + </div> + </div> + <{if $block.story_short}> + <div class="itemBody"> + <{if $block.story_img}> + <div class="itemImg"> + <img width="<{$block.width}>" class="<{$block.float}> story_img" src="<{$block.thumburl}><{$block.story_img}>" alt="<{$block.story_title}>" /> + </div> + <{/if}> + <div class="itemText"><{$block.story_short}></div> + <div class="itemMore"> + <a href="<{$block.link}>" title="<{$block.story_title}>"><{$smarty.const._NEWS_MB_MORE}></a> + </div> + <div class="clear"></div> + </div> + <{else}> + <div class="itemBody"> + <{if $block.story_img}> + <div class="itemImg"> + <img width="<{$block.width}>" class="<{$block.float}> story_img" src="<{$block.thumburl}><{$block.story_img}>" alt="<{$block.story_title}>" /> + </div> + <{/if}> + <div class="itemText"><{$block.story_text}></div> + <div class="clear"></div> + </div> + <{/if}> +</div> \ No newline at end of file Added: XoopsModules/fmcontent/branches/news/templates/blocks/news_block_topic.html =================================================================== --- XoopsModules/fmcontent/branches/news/templates/blocks/news_block_topic.html (rev 0) +++ XoopsModules/fmcontent/branches/news/templates/blocks/news_block_topic.html 2012-01-08 07:19:16 UTC (rev 8666) @@ -0,0 +1,50 @@ +<{if $block.showtype == 'list'}> + <div class="itemBlock"> + <ul> + <{foreach item=topic from=$block.topics}> + <li> + <{if $block.img || $block.description}> + <h3><a title="<{$topic.topic_title}>" href="<{$topics.topicurl}>"><{$topic.topic_title}></a><{if $block.count}> ( <{$topic.count}> ) <{/if}></h3> + <div class="itemBody" id="topic_<{$topic.story_id}>"> + <{if $block.img && $topic.topic_img}> + <div class="itemImg"> + <img class="<{$block.float}>" src="<{$topic.thumburl}>" alt="<{$topic.topic_title}>" /> + </div> + <{/if}> + <{if $block.description && $topic.topic_desc}> + <div class="itemText"><{$topic.topic_desc}></div> + <{/if}> + <div class="clear"></div> + </div> + <{else}> + <a title="<{$topic.topic_title}>" href="<{$topic.topicurl}>"><{$topic.topic_title}></a><{if $block.count}> ( <{$topic.count}> ) <{/if}> + <{/if}> + </li> + <{/foreach}> + </ul> + </div> +<{elseif $block.showtype == 'table'}> + <table> + <thead> + <th class="txtcenter"><{$smarty.const._NEWS_MB_TOPIC_NAME}></th> + <th class="txtcenter"><{$smarty.const._NEWS_MB_TOPIC_IMG}></th> + </thead> + <tbody> + <{foreach item=topic from=$block.topics}> + <tr class="odd"> + <td<{if !$topic.topic_img}> colspan="2"<{/if}> class="top"> + <div class="topicTitle"><a title="<{$topic.topic_title}>" href="<{$topic.topicurl}>"><{$topic.topic_title}></a><{if $block.count}> ( <{$topic.count}> ) <{/if}></div> + <div class="topicDesc"><{$topic.topic_desc}></div> + </td> + <{if $topic.topic_img}> + <td class="top txtcenter"> + <div class="topicImg"> + <img class="<{$imgfloat}> story_img" src="<{$topic.thumburl}>" alt="<{$topic.topic_title}>" /> + </div> + </td> + <{/if}> + </tr> + <{/foreach}> + </tbody> + </table> +<{/if}> \ No newline at end of file Deleted: XoopsModules/fmcontent/branches/news/templates/blocks/news_list.html =================================================================== --- XoopsModules/fmcontent/branches/news/templates/blocks/news_list.html 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/templates/blocks/news_list.html 2012-01-08 07:19:16 UTC (rev 8666) @@ -1,113 +0,0 @@ -<{if $block.show == 'news'}> - <div class="itemBlock"> - <{foreach item=content from=$block.contents}> - <div class="item"> - <div class="itemHead"> - <div class="itemTitle"><h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a title="<{$content.title}>" href="<{$content.url}>"><{$content.title}></a></h3></div> - </div> - <{if $block.date}> - <div class="itemInfo"><{$smarty.const._NEWS_MB_DATE}> :<{$content.date}></div> - <{/if}> - <{if $block.img || $block.description}> - <div class="itemBody" id="story_<{$content.story_id}>"> - <{if $block.img && $content.story_img}> - <div class="itemImg"> - <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> - </div> - <{/if}> - <{if $block.description}> - <{if $content.story_short}> - <div class="itemText"><{$content.story_short}></div> - <{else}> - <div class="itemText"><{$content.story_text|truncate:300}></div> - <{/if}> - <{/if}> - <div class="clear"></div> - </div> - <{/if}> - </div> - <{/foreach}> - </div> -<{elseif $block.show == 'list'}> - <div class="itemBlock"> - <{if $block.img || $block.description}> - <ul class="itemList"> - <{foreach item=content from=$block.contents}> - <{if $block.img && $content.story_img}> - <div class="itemImg"> - <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> - </div> - <{/if}> - <li> - <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title}></a></h3> - <{if $block.date}> - <div class="itemPostDate"><{$content.date}></div> - <{/if}> - <{if $block.description}> - <{if $content.story_short}> - <div class="itemText"><{$content.story_short}></div> - <{else}> - <div class="itemText"><{$content.story_text|truncate:130}></div> - <{/if}> - <{/if}> - <div class="clear"></div> - </li> - <{/foreach}> - </ul> - <{else}> - <ul> - <{foreach item=content from=$block.contents}> - <li> - <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title}></a></h3> - <{if $block.date}> - <div class="itemPostDate"><{$content.date}></div> - <{/if}> - </li> - <{/foreach}> - </ul> - <{/if}> - </div> -<{elseif $block.show == 'spotlight'}> - <div class="itemBlock"> - <{foreach item=content from=$block.contents}> - <{if $content.story_id == $block.spotlightid}> - <div class="itemBlockLeft"> - <div class="item"> - <div class="itemHead"> - <div class="itemTitle"><h2><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a title="<{$content.title}>" href="<{$content.url}>"><{$content.title}></a></h2></div> - </div> - <{if $block.date}> - <div class="itemInfo"><{$smarty.const._NEWS_MB_DATE}> :<{$content.date}></div> - <{/if}> - <{if $block.img || $block.description}> - <div class="itemBody" id="story_<{$content.story_id}>"> - <{if $block.img && $content.story_img}> - <div class="itemImg"> - <img width="<{$block.width}>" class="<{$block.float}>" src="<{$block.thumburl}><{$content.story_img}>" alt="<{$content.title}>" /> - </div> - <{/if}> - <{if $block.description}> - <{if $content.story_short}> - <div class="itemText"><{$content.story_short|truncate:200}></div> - <{else}> - <div class="itemText"><{$content.story_text|truncate:200}></div> - <{/if}> - <div class="itemMore"><a title="<{$content.title}>" href="<{$content.url}>" ><{$smarty.const._NEWS_MB_MORE}></a></div> - <{/if}> - <div class="clear"></div> - </div> - <{/if}> - </div> - </div> - <{/if}> - <{/foreach}> - <{foreach item=content from=$block.contents}> - <{if $content.story_id != $block.spotlightid}> - <div class="itemBlockRight"> - <h3><{if $content.story_important}><span class="red bold"><{$smarty.const._NEWS_MB_IMPORTANT}></span><{/if}><a href="<{$content.url}>" title="<{$content.story_title}>"><{$content.story_title|truncate:80}></a></h3> - </div> - <{/if}> - <{/foreach}> - <div class="clear"></div> - </div> -<{/if}> \ No newline at end of file Deleted: XoopsModules/fmcontent/branches/news/templates/blocks/news_page.html =================================================================== --- XoopsModules/fmcontent/branches/news/templates/blocks/news_page.html 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/templates/blocks/news_page.html 2012-01-08 07:19:16 UTC (rev 8666) @@ -1,31 +0,0 @@ -<div class="itemBlock"> - <div class="itemHead"> - <div class="itemTitle"> - <h2><{$block.story_title}></h2> - </div> - </div> - <{if $block.story_short}> - <div class="itemBody"> - <{if $block.story_img}> - <div class="itemImg"> - <img width="<{$block.width}>" class="<{$block.float}> story_img" src="<{$block.thumburl}><{$block.story_img}>" alt="<{$block.story_title}>" /> - </div> - <{/if}> - <div class="itemText"><{$block.story_short}></div> - <div class="itemMore"> - <a href="<{$block.link}>" title="<{$block.story_title}>"><{$smarty.const._NEWS_MB_MORE}></a> - </div> - <div class="clear"></div> - </div> - <{else}> - <div class="itemBody"> - <{if $block.story_img}> - <div class="itemImg"> - <img width="<{$block.width}>" class="<{$block.float}> story_img" src="<{$block.thumburl}><{$block.story_img}>" alt="<{$block.story_title}>" /> - </div> - <{/if}> - <div class="itemText"><{$block.story_text}></div> - <div class="clear"></div> - </div> - <{/if}> -</div> \ No newline at end of file Modified: XoopsModules/fmcontent/branches/news/xoops_version.php =================================================================== --- XoopsModules/fmcontent/branches/news/xoops_version.php 2012-01-07 17:05:42 UTC (rev 8665) +++ XoopsModules/fmcontent/branches/news/xoops_version.php 2012-01-08 07:19:16 UTC (rev 8666) @@ -111,7 +111,7 @@ 'show_func' => 'news_page_show', 'edit_func' => 'news_page_edit', 'options' => '0|' . $modversion['dirname'], - 'template' => 'news_page.html'); + 'template' => 'news_block_page.html'); $modversion['blocks'][] = array( 'file' => 'list.php', @@ -120,8 +120,17 @@ 'show_func' => 'news_list_show', 'edit_func' => 'news_list_edit', 'options' => $modversion['dirname'] . '|news|10|100|1|1|1|story_publish|180|left|DESC|0|'. XOOPS_URL.'|0', - 'template' => 'news_list.html'); + 'template' => 'news_block_list.html'); +$modversion['blocks'][] = array( + 'file' => 'topic.php', + 'name' => _NEWS_MI_BLOCK_TOPIC, + 'description' => '', + 'show_func' => 'news_topic_show', + 'edit_func' => 'news_topic_edit', + 'options' => $modversion['dirname'] . '|list|0|0|0|left|DESC|topic_id', + 'template' => 'news_block_topic.html'); + // Settings // Load class xoops_load('xoopslists'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |