简体   繁体   English

如果有文章更新 [Joomla 2.5] 的主菜单通知?

[英]Main Menu Notification if there is an article update [Joomla 2.5]?

hello i am using joomla 2.5 , is there any extension to give notification such as star or image on main menu if there is a new article or content within category submitted for some period of time?你好,我正在使用 joomla 2.5,如果在一段时间内提交了新文章或类别内的内容,是否有任何扩展可以在主菜单上发出星号或图像等通知? let's just say if an article was submitted today, the main menu (Product type: category list) shows notification such as star or new label right next to the menu for about 3 days after the article was submitted.假设今天提交了一篇文章,主菜单(产品类型:类别列表)在文章提交后大约3天的菜单旁边会显示诸如星级或新标签之类的通知。

you can override the mod_menu-template and add this functionality:您可以覆盖 mod_menu-template 并添加此功能:

  • copy modules/mod_menu/tmpl/default_component.php to your template templates/yourtemplate/html/mod_menu/default_component.php将 modules/mod_menu/tmpl/default_component.php 复制到您的模板 templates/yourtemplate/html/mod_menu/default_component.php
  • Edit default_component.php to check for new articles using your own criteria.编辑 default_component.php 以使用您自己的标准检查新文章。

F.ex:例子:

if($item->query['option']=='com_content' && $item->query['view']=='category' ){
$sql="select id from #__content where published=1 and catid="
.intval($item->query['id'])
." and created>='2014-03-27'";
$db=JFactory::getDbo();  
$db->setQuery($sql);
if(count($db->loadAssoc())) $item->title.='*';  
}

...thus, a * is added to the title if newest item is from 2014-03-27 or later... ...因此,如果最新项目来自 2014-03-27 或以后,则在标题中添加 *...

regards Jonas问候乔纳斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM