【问题标题】:'article' ,'Id' module in joomla 2.5joomla 2.5中的'article','Id'模块
【发布时间】:2012-04-25 09:21:49
【问题描述】:

我需要同时输出在菜单中链接的每个“文章”、“Id”,全部在一个页面中,每个都在一个 div id=articleID 中。输出可以是带有模块的句柄,我可以在 joomla 2.5 中安装和更新这个模块

【问题讨论】:

    标签: php joomla joomla2.5


    【解决方案1】:

    下面的代码应该这样做:

    //  init
    $searchBase = 'index.php?option=com_content&view=article&id=';
    $articles = array();
    
    //  get all menu items and find links to articles
    $menu = JFactory::getApplication()->getMenu()->getItems('type', 'component');
    foreach ($items  as $item) {
        $id = str_replace($searchBase, '', $item->link, $count);
        if ($count){
            $articles[] = (int) $id;
        }
    }
    
    //  build query for articles info
    $csvIds = implode(',', $articles);
    $sql = "select id, title from #__content WHERE published=1 AND id IN ($csvIds)";
    // TODO: query and process
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      • 2012-08-03
      • 2012-07-05
      • 1970-01-01
      • 1970-01-01
      • 2014-02-06
      • 1970-01-01
      相关资源
      最近更新 更多