Fantome
vendredi 01 juillet 2005 à 18:31
Code original
CODE
/*-------------------------------------------------------------------------*/
// Latest Posts
/*-------------------------------------------------------------------------*/
function _show_latestposts()
{
global $ibforums, $DB, $std, $print;
if ( ! $ibforums->vars['csite_discuss_on'] )
{
return;
}
$html = "";
$limit = $ibforums->vars['csite_discuss_max'] ? $ibforums->vars['csite_discuss_max'] : 5;
if ( count($this->good_forum) > 0 )
{
$qe = "forum_id IN(".implode(',', $this->good_forum ).") AND ";
}
$DB->simple_construct( array( 'select' => 'tid, title, posts, starter_id as member_id, starter_name as member_name, start_date as post_date, views',
'from' => 'topics',
'where' => "$qe approved=1 and state != 'closed' and (moved_to is null or moved_to = '')",
'order' => 'start_date DESC',
'limit' => array( 0, $limit ) ) );
$DB->simple_exec();
while ( $row = $DB->fetch_row() )
{
$html .= $this->_tmpl_format_topic($row, $ibforums->vars['csite_discuss_len']);
}
return $this->html->tmpl_latestposts($html);
}
code modifier en 30s et pas tester
CODE
/*-------------------------------------------------------------------------*/
// Latest Posts
/*-------------------------------------------------------------------------*/
function _show_latestposts()
{
global $ibforums, $DB, $std, $print;
if ( ! $ibforums->vars['csite_discuss_on'] )
{
return;
}
$html = "";
$limit = $ibforums->vars['csite_discuss_max'] ? $ibforums->vars['csite_discuss_max'] : 5;
/* if ( count($this->good_forum) > 0 )
{
$qe = "forum_id IN(".implode(',', $this->good_forum ).") AND ";
}*/
//colone 1
$html .="<table><tr><td>";
$DB->simple_construct( array( 'select' => 'tid, title, posts, starter_id as member_id, starter_name as member_name, start_date as post_date, views',
'from' => 'topics',
'where' => "forum_id IN (1,2) AND approved=1 and state != 'closed' and (moved_to is null or moved_to = '')",
'order' => 'start_date DESC',
'limit' => array( 0, $limit ) ) );
$DB->simple_exec();
while ( $row = $DB->fetch_row() )
{
$html .= $this->_tmpl_format_topic($row, $ibforums->vars['csite_discuss_len']);
}
//colone 2
$html .="</td><td>";
$DB->simple_construct( array( 'select' => 'tid, title, posts, starter_id as member_id, starter_name as member_name, start_date as post_date, views',
'from' => 'topics',
'where' => "forum_id IN (3,4) AND approved=1 and state != 'closed' and (moved_to is null or moved_to = '')",
'order' => 'start_date DESC',
'limit' => array( 0, $limit ) ) );
$DB->simple_exec();
while ( $row = $DB->fetch_row() )
{
$html .= $this->_tmpl_format_topic($row, $ibforums->vars['csite_discuss_len']);
}
//colone 3
$html .="</td><td>";
$DB->simple_construct( array( 'select' => 'tid, title, posts, starter_id as member_id, starter_name as member_name, start_date as post_date, views',
'from' => 'topics',
'where' => "forum_id IN (5) AND approved=1 and state != 'closed' and (moved_to is null or moved_to = '')",
'order' => 'start_date DESC',
'limit' => array( 0, $limit ) ) );
$DB->simple_exec();
while ( $row = $DB->fetch_row() )
{
$html .= $this->_tmpl_format_topic($row, $ibforums->vars['csite_discuss_len']);
}
$html .= "</td></tr></table>";
return $this->html->tmpl_latestposts($html);
}
Voila ça doit étre un truc du genre qu'il faut faire.