Pour ceux qui seraient interressé d'afficher les articles de news par ordre alphabetique au lieu par date,voila un post que j'ai trouvé dans un forum xoops.
editez news/class/class.newsstory.php remplacer a partir de la ligne 171 par cette fonction:
Citation :/** * Returns published stories according to some options */ function getAllPublished($limit=0, $start=0, $checkRight=false, $topic=0, $ihome=0, $asobject=true, $order = 'published', $topic_frontpage=false) { $db =& Database::getInstance(); $myts =& MyTextSanitizer::getInstance(); $ret = array(); $sql = 'SELECT s.*, t.* FROM '.$db->prefix('stories').' s, '. $db->prefix('topics').' t WHERE (s.published > 0 AND s.published <= '.time().') AND (s.expired = 0 OR s.expired > '.time().') AND (s.topicid=t.topic_id) '; if ($topic != 0) { if (!is_array($topic)) { if($checkRight) { $topics = news_MygetItemIds('news_view'); if(!in_array ($topic,$topics)) { return null; } else { $sql .= ' AND s.topicid='.intval($topic).' AND (s.ihome=1 OR s.ihome=0)'; } } else { $sql .= ' AND s.topicid='.intval($topic).' AND (s.ihome=1 OR s.ihome=0)'; } } else { if($checkRight) { $topics = news_MygetItemIds('news_view'); $topic = array_intersect($topic,$topics); } if(count($topic)>0) { $sql .= ' AND s.topicid IN ('.implode(',', $topic).')'; } else { return null; } } } else { if($checkRight) { $topics = news_MygetItemIds('news_view'); if(count($topics)>0) { $topics = implode(',', $topics); $sql .= ' AND s.topicid IN ('.$topics.')'; } else { return null; } } if (intval($ihome) == 0) { $sql .= ' AND s.ihome=0'; } } if($topic_frontpage) { $sql .=' AND t.topic_frontpage=1'; } $sort = 'DESC'; if ($order == 'title') { $sort = 'ASC'; } $sql .= " ORDER BY s.$order $sort"; $result = $db->query($sql,intval($limit),intval($start)); while ( $myrow = $db->fetchArray($result) ) { if ($asobject) { $ret[] = new NewsStory($myrow); } else { $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']); } } return $ret; }
editez news/index.php
et remplacez a la ligne 181 by cette ligne
Citation :restrictindex'], $xoopsOption['storytopic'], 0, true, 'title', $topic_frontpage);
et à la ligne 247 news/index.php remplacer par :
Citation :$allstories = NewsStory::getAllPublished($xoopsModuleConfig['storyhome'], 0, $xoopsModuleConfig['restrictindex'], $topicid, 0, true , 'title');