简体   繁体   English

joomla 2.5中的'article','Id'模块

[英]'article' ,'Id' module in joomla 2.5

I need outputs every 'article' ,'Id' that is linked in the menues at once, all in one page, each within a div id=articleID. 我需要输出一次在菜单中链接的每个“ article”,“ Id”,都在一个页面中,每个页面都在div id = articleID中。 The output could be handles with a module and i could install and update this module in joomla 2.5 输出可能是带有模块的句柄,我可以在joomla 2.5中安装和更新此模块

Code below should do: 下面的代码应该这样做:

//  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

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

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