Ajoute un bloc contenant les titres des dernier topics créer dans un ou plussieur forums.
Paramétre dans l'admin : Id du/des forum(s), Titre du bloc, Activation du bloc
Etape 1 : Ouvrir sources/ipbportal.php
Chercher
CODE
$this->site_bits['affiliates'] = $this->_show_affiliates();
Ajouter en-dessousCODE
$this->site_bits['modsatester'] = $this->_show_mods_a_tester();
Chercher
CODE
}
?>
Ajouter au-dessus?>
CODE
/*-------------------------------------------------------------------------*/
// Mods a tester
/*-------------------------------------------------------------------------*/
function _show_mods_a_tester()
{
global $ibforums, $DB, $std, $print;
if ( ! $ibforums->vars['csite_modsatester_show'] )
{
return;
}
$html = "";
$limit = 5;
$forum = explode(",", $ibforums->vars['csite_modsatester_forumid'] );
if ( count($forum) > 0 )
{
$qe = "forum_id IN(".implode(',', $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, forum_id',
'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();
$forum = array_intersect( $this->good_forum, $forum );
while ( $row = $DB->fetch_row() )
{
$row['title'] = strip_tags($row['title']);
$row['title'] = str_replace( "!" , "!" , $row['title'] );
$row['title'] = str_replace( """, "\"", $row['title'] );
if (strlen($row['title']) > $ibforums->vars['csite_discuss_len'])
{
$row['title'] = substr( $row['title'],0,($ibforums->vars['csite_discuss_len'] - 3) ) . "...";
$row['title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$row['title'] );
}
if( in_array($row['forum_id'], $this->good_forum) ) $row['title'] = "<a href=\"".$ibforums->base_url."showtopic=".$row['tid']."\">".$row['title']."</a>";
$html .= $this->html->tmpl_modsatester_format($row['title']);
}
return $this->html->tmpl_modsatester($html, $ibforums->vars['csite_modsatester_titre']);
}
// Mods a tester
/*-------------------------------------------------------------------------*/
function _show_mods_a_tester()
{
global $ibforums, $DB, $std, $print;
if ( ! $ibforums->vars['csite_modsatester_show'] )
{
return;
}
$html = "";
$limit = 5;
$forum = explode(",", $ibforums->vars['csite_modsatester_forumid'] );
if ( count($forum) > 0 )
{
$qe = "forum_id IN(".implode(',', $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, forum_id',
'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();
$forum = array_intersect( $this->good_forum, $forum );
while ( $row = $DB->fetch_row() )
{
$row['title'] = strip_tags($row['title']);
$row['title'] = str_replace( "!" , "!" , $row['title'] );
$row['title'] = str_replace( """, "\"", $row['title'] );
if (strlen($row['title']) > $ibforums->vars['csite_discuss_len'])
{
$row['title'] = substr( $row['title'],0,($ibforums->vars['csite_discuss_len'] - 3) ) . "...";
$row['title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$row['title'] );
}
if( in_array($row['forum_id'], $this->good_forum) ) $row['title'] = "<a href=\"".$ibforums->base_url."showtopic=".$row['tid']."\">".$row['title']."</a>";
$html .= $this->html->tmpl_modsatester_format($row['title']);
}
return $this->html->tmpl_modsatester($html, $ibforums->vars['csite_modsatester_titre']);
}
Enregistrer et Fermer sources/ipbportal.php
Etape 2 : Aller dans l'ACP de votre forum
Etape 2.1 : Dans System Settings > View All General Setting > Import an XML settings file
Puis Puis importer les settings contenue dans le fichier [attachmentid=50]
Configuré les id du(des) forum(s) que vous souahiter afficher dans les paramétres du portail.
Etape 2.2.1 :Dans Skins & Templates > Skin Manager > IPB Default Skin > Edit Root Skin Template HTML
Puis IPB Portal > csite_skeleton_template
Ajouter
CODE
<!--CS.TEMPLATE.MODSATESTER-->
Entre <!--Main Content--> et <!--End Main Content-->Valider en cliquant sur Save Template Bit(s)
Etape 2.2.2 :Puis toujours dans IPB Portal cliquer sur Add Template Bit
QUOTE
New Template Bit Name : tmpl_modsatester
New Template Bit Incoming Data Variables : $content="", $titre="Mods à Tester"
Add New Template Bit :
Valider en cliquant sur Save Template Bit(s)New Template Bit Incoming Data Variables : $content="", $titre="Mods à Tester"
Add New Template Bit :
CODE
<br />
<div class="borderwrap">
<div class="maintitle"><{CAT_IMG}> {$titre}</div>
$content
</div>
<div class="borderwrap">
<div class="maintitle"><{CAT_IMG}> {$titre}</div>
$content
</div>
Etape 2.2.3 :Puis toujours dans IPB Portal cliquer sur Add Template Bit
QUOTE
New Template Bit Name : tmpl_modsatester_format
New Template Bit Incoming Data Variables : $modatester
Add New Template Bit :
Valider en cliquant sur Save Template Bit(s)New Template Bit Incoming Data Variables : $modatester
Add New Template Bit :
CODE
<div class="tablepad">
<b>$modatester</b>
</div>
<b>$modatester</b>
</div>
FIN

