简体   繁体   中英

'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. The output could be handles with a module and i could install and update this module in 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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