Hello,
si je me base sur mon fichier index.php oui, il y a partout des commentaires "// Begin Simple Subforums MOD".
Modérateur: Modérateurs

//
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
$nav_links['chapter forum'][$forum_rows[$k]['forum_id']] = array (
'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$k]['forum_id']),
'title' => $forum_rows[$k]['forum_name']
); // www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( !isset($phpbb_seo->seo_url['forum'][$forum_rows[$j]['forum_id']]) ) {
$phpbb_seo->seo_url['forum'][$forum_rows[$j]['forum_id']] = $phpbb_seo->format_url($forum_rows[$j]['forum_name'], $phpbb_seo->seo_static['forum']);
}
$nav_links['chapter forum'][$forum_rows[$j]['forum_id']] = array (
// 'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id']),
'url' => $phpbb_seo->seo_url['forum'][$forum_rows[$j]['forum_id']] . $phpbb_seo->seo_delim['forum'] . $forum_rows[$j]['forum_id'] . $phpbb_seo->seo_ext['forum'],
'title' => $forum_rows[$j]['forum_name']
);
// www.phpBB-SEO.com SEO TOOLKIT END //
// Add an array to $nav_links for the Mozilla navigation bar.
// 'chapter' and 'forum' can create multiple items, therefore we are using a nested array.
//
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$nav_links['chapter forum'][$forum_rows[$k]['forum_id']] = array (
//'url' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_rows[$k]['forum_id']),
'url' => append_sid(format_url($forum_rows[$j]['forum_name']) . "-vf" . $forum_rows[$k]['forum_id'] . ".html")
'title' => $forum_rows[$k]['forum_name']
);
// www.phpBB-SEO.com SEO TOOLKIT END 

if ( $glance_num_recent )
{
$glance_info = 'counted recent';
$bullet_pre = '<img src="';
if ( !empty($latest_topics) )
{
for ( $i = 0; $i < count($latest_topics); $i++ )
{
if ( $userdata['session_logged_in'] )
{
$unread_topics = false;
$topic_id = $latest_topics[$i]['topic_id'];
if ( $latest_topics[$i]['post_time'] > $glance_last_visit )
{
$unread_topics = true;
if( !empty($tracking_topics[$topic_id]) && $glance_track )
{
if( $tracking_topics[$topic_id] >= $latest_topics[$i]['post_time'] )
{
$unread_topics = false;
}
}
}
$shownew = $unread_topics;
}
else
{
$unread_topics = false;
$shownew = ($board_config['time_today'] < $latest_topics[$i]['post_time']);
}
switch ($latest_topics[$i]['topic_type'])
{
case POST_ANNOUNCE:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? $images['folder_announce_new'] : $images['folder_announce'] ) . '" border="0" />';
break;
case POST_STICKY:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? $images['folder_sticky_new'] : $images['folder_sticky'] ) . '" border="0" />';
break;
default:
if ($latest_topics[$i]['topic_status'] == TOPIC_LOCKED)
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
else if ($latest_topics[$i]['topic_replies'] >= $board_config['hot_threshold'])
{
$folder = $images['folder_hot'];
$folder_new = $images['folder_hot_new'];
}
else
{
$folder = $images['folder'];
$folder_new = $images['folder_new'];
}
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? $folder_new : $folder ) . '" border="0" />';
break;
$last_poster .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $latest_topics[$i]['topic_last_post_id']) . '#' . $latest_topics[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';<!-- BEGIN recent -->
<tr>
<td nowrap="nowrap" valign="middle" class="row1" align="center" width="30"><a href="{recent.TOPIC_LINK}" title="Lire le Sujet">{recent.BULLET}</a></td>
<td valign="middle" width="40%" class="row1"><span class="genmed"><a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span></td>
<td valign="middle" align="center" width="60%" class="row1"><span class="genmed"><a href="{recent.FORUM_LINK}" class="genmed">{recent.FORUM_TITLE}</a></span></td>
<td valign="middle" class="row3" nowrap="nowrap" align="center"><span class="genmed">{recent.TOPIC_POSTER}</span></td>
<td valign="middle" class="row2" nowrap="nowrap" align="center"><span class="genmed">{recent.TOPIC_REPLIES}</span></td>
<td valign="middle" class="row3" nowrap="nowrap" align="center"><span class="genmed">{recent.LAST_POST_TIME}<br />{recent.LAST_POSTER}</span></td>
</tr>
<!-- END recent -->
// Begin Simple Subforums MOD
unset($data);
unset($item);
unset($cat_item);
unset($row_item);
for( $i = 0; $i < count($subforums_list); $i++ )
{
$forum_data = $subforums_list[$i]['forum_data'];
$parent_id = $forum_data['forum_parent'];
// Find parent item
if( isset($template->_tpldata['catrow.']) )
{
$data = &$template->_tpldata['catrow.'];
$count = count($data);
for( $j = 0; $j < $count; $j++)
{
$cat_item = &$data[$j];
$row_item = &$cat_item['forumrow.'];
$count2 = count($row_item);
for( $k = 0; $k < $count2; $k++)
{
if( $row_item[$k]['ID'] == $parent_id )
{
$item = &$row_item[$k];
break;
}
}
if( isset($item) )
{
break;
}
}
}
if( isset($item) )
{
if( isset($item['sub.']) )
{
$num = count($item['sub.']);
$data = &$item['sub.'];
}
else
{
$num = 0;
$item[] = 'sub.';
$data = &$item['sub.'];
}
// Append new entry
$data[] = array(
'NUM' => $num,
'FORUM_FOLDER_IMG' => $subforums_list[$i]['folder_image'],
'FORUM_NAME' => $forum_data['forum_name'],
'FORUM_DESC' => $forum_data['forum_desc'],
'FORUM_DESC_HTML' => htmlspecialchars(preg_replace('@<[/!]*?[^<>]*?>@si', '', $forum_data['forum_desc'])),
'POSTS' => $forum_data['forum_posts'],
'TOPICS' => $forum_data['forum_topics'],
'LAST_POST' => $subforums_list[$i]['last_post'],
'LAST_POST_SUB' => $subforums_list[$i]['last_post_sub'],
'LAST_TOPIC' => $forum_data['topic_title'],
'MODERATORS' => $subforums_list[$i]['moderator_list'],
'PARENT' => $forum_data['forum_parent'],
'ID' => $forum_data['forum_id'],
'UNREAD' => intval($subforums_list[$i]['unread_topics']),
'L_MODERATOR' => $subforums_list[$i]['l_moderators'],
'L_FORUM_FOLDER_ALT' => $subforums_list[$i]['folder_alt'],
'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_data['forum_id'])
);
$item['HAS_SUBFORUMS'] ++;
$item['TOTAL_UNREAD'] += intval($subforums_list[$i]['unread_topics']);
// Change folder image
$images = unserialize($item['FORUM_FOLDERS']);
$item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images['subnew'] : $images['sub'];
$item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images['subaltnew'] : $images['subalt'];
// Check last post
if( $item['LAST_POST_TIME'] < $subforums_list[$i]['last_post_time'] )
{
$item['LAST_POST'] = $subforums_list[$i]['last_post'];
$item['LAST_POST_TIME'] = $subforums_list[$i]['last_post_time'];
}
if( !$item['LAST_POST_TIME_FORUM'] )
{
$item['LAST_POST_FORUM'] = $item['LAST_POST'];
}
// Add topics/posts
$item['TOTAL_POSTS'] += $forum_data['forum_posts'];
$item['TOTAL_TOPICS'] += $forum_data['forum_topics'];
}
unset($item);
unset($data);
unset($cat_item);
unset($row_item);
}
// End Simple Subforums MODdcz a écrit:Donc, à priori, c'est pas le mod simple sub forum que ta premod utilises.
Du coup, difficile de se prononcer, il faudrait voir comment ton mod gère les images pour les sous forums dans le code normal, il est possible qu'il le fasse tout simplement en dur (en appelant directement les images, sans passer par le tableau du .cfg de ton thème) un truc dans le genre.
++
switch ($latest_topics[$i]['topic_type'])
{
case POST_ANNOUNCE:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? "http://site/templates/nom_template/images/common/folder_announce_new.gif" : "http://site/templates/nom_template/images/common/folder_announce.gif" ) . '" border="0" />';
break;
case POST_STICKY:
$bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? "http://site/templates/nom_template/images/common/folder_sticky_new.gif" : "http://site/templates/nom_template/images/common/folder_sticky.gif" ) . '" border="0" />';
break;
default:
if ($latest_topics[$i]['topic_status'] == TOPIC_LOCKED)
{
$folder = "http://site/templates/nom_template/images/common/folder_lock.gif";
$folder_new = "http://site/templates/nom_template/images/common/folder_lock_new.gif";
}
else if ($latest_topics[$i]['topic_replies'] >= $board_config['hot_threshold'])
{
$folder = "http://site/templates/nom_template/images/common/folder_hot.gif";
$folder_new = "http://site/templates/nom_template/images/common/folder_new_hot.gif";
}
else
{
$folder = "http://site/templates/nom_template/images/common/folder.gif";
$folder_new = "http://site/templates/nom_template/images/common/folder_new.gif"; // Change folder image
$images = unserialize($item['FORUM_FOLDERS']);
$item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images['subnew'] : $images['sub'];
$item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images['subaltnew'] : $images['subalt']; // Change folder image
$images_subf = unserialize($item['FORUM_FOLDERS']);
$item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images_subf['subnew'] : $images_subf['sub'];
$item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images_subf['subaltnew'] : $images_subf['subalt']; 
RomeoIsBleeding a écrit:Si tu peux me l'expliquer brièvement, je me coucherais moins bête dans le futur ^^
$images = unserialize($item['FORUM_FOLDERS']); 
dcz a écrit:RomeoIsBleeding a écrit:Si tu peux me l'expliquer brièvement, je me coucherais moins bête dans le futur ^^
C'est tout bête, le mod simple sub forum écrase le tableau $images :
- Code: Tout sélectionner
$images = unserialize($item['FORUM_FOLDERS']);
En lui donnant un autre nom, on règle le problème
++
Retourner vers Le Forum phpBB2
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 1 invité