Darathor
Citation :
But : Ajoute des boutons dans viewforum permettant de choisir l'ordonnancement des sujets.
Prérequis :
- [Sous-MOD] Images utiles (A).
- [MOD] XHTML Validity.
Auteur : Darathor (darathor@free.fr)
Version du MOD : 1.0 (28/07/2005)
Compatibilité phpBB : 2.0.17
Validité HTML : XHTML 1.1
Dans "viewforum.php"
Code :
#
# Trouver
#
//
// End initial var setup
//
#
# Ajouter avant
#
// DEBUT MOD Ordonancement des topics au choix
if ( isset($HTTP_GET_VARS['order']) || isset($HTTP_POST_VARS['order']) )
{
$order = trim((isset($HTTP_POST_VARS['order'])) ? $HTTP_POST_VARS['order'] : $HTTP_GET_VARS['order']);
}
else
{
$order = "t.topic_last_post_id";
}
if ( isset($HTTP_GET_VARS['ascdesc']) || isset($HTTP_POST_VARS['ascdesc']) )
{
$ascdesc = trim((isset($HTTP_POST_VARS['ascdesc'])) ? $HTTP_POST_VARS['ascdesc'] : $HTTP_GET_VARS['ascdesc']);
}
else
{
$ascdesc = "DESC";
}
// FIN MOD Ordonancement des topics au choix
#
# Trouver
#
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
#
# Ajouter après
#
// COMMENTAIRE MOD Ordonancement des topics au choix : La requête qui suit a été modifiée.
// -- DEBUT Enlevé
// ORDER BY t.topic_last_post_id DESC ";
// -- FIN Enlévé
// -- DEBUT Remplacé par
// ORDER BY $order $ascdesc, t.topic_last_post_id $ascdesc ";
// -- FIN Remplacé par
#
# Trouver
#
ORDER BY t.topic_last_post_id DESC ";
#
# Remplacer par
#
ORDER BY $order $ascdesc, t.topic_last_post_id $ascdesc ";
#
# Trouver
#
//
// Grab all the basic data (all topics except announcements)
// for this forum
//
#
# Ajouter après
#
// COMMENTAIRE MOD Ordonancement des topics au choix : La requête qui suit a été modifiée.
// -- DEBUT Enlevé
// ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
// -- FIN Enlévé
// -- DEBUT Remplacé par
// ORDER BY t.topic_type DESC, $order $ascdesc, t.topic_last_post_id $ascdesc
// -- FIN Remplacé par
#
# Trouver
#
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
#
# Remplacer par
#
ORDER BY t.topic_type DESC, $order $ascdesc, t.topic_last_post_id $ascdesc
#
# Trouver
#
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
#
# Remplacer par
#
// DEBUT MOD Ordonancement des topics au choix
// -- DEBUT Enlevé
// 'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
// -- FIN Enlevé
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=$order&ascdesc=$ascdesc"),
'U_ORDER_BY_SUJET_ASC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_title&ascdesc=ASC"),
'U_ORDER_BY_AUTEUR_ASC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=u.username&ascdesc=ASC"),
'U_ORDER_BY_LECTURES_ASC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_views&ascdesc=ASC"),
'U_ORDER_BY_REPONSES_ASC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_replies&ascdesc=ASC"),
'U_ORDER_BY_DERNIER_ASC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_last_post_id&ascdesc=ASC"),
'U_ORDER_BY_SUJET_DESC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_title&ascdesc=DESC"),
'U_ORDER_BY_AUTEUR_DESC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=u.username&ascdesc=DESC"),
'U_ORDER_BY_LECTURES_DESC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_views&ascdesc=DESC"),
'U_ORDER_BY_REPONSES_DESC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_replies&ascdesc=DESC"),
'U_ORDER_BY_DERNIER_DESC' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id&order=t.topic_last_post_id&ascdesc=DESC"),
'I_HAUT' => $images['I_haut'],
'I_BAS' => $images['I_bas'],
'L_CROISSANT' => $lang['Sort_Ascending'],
'L_DECROISSANT' => $lang['Sort_Descending'],
// FIN MOD Ordonancement des topics au choix
#
# Trouver
#
'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
#
# Remplacer par
#
// DEBUT MOD Ordonancement des topics au choix
// -- DEBUT Enlevé
// 'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
// -- FIN Enlevé
'PAGINATION' => generate_pagination("viewforum.$phpEx?order=$order&ascdesc=$ascdesc&" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
// FIN MOD Ordonancement des topics au choix
Dans "template/subsilver/viewforum_body.tpl"
Code :
#
# Trouver
#
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
#
# Remplacer par
#
<!-- DEBUT MOD Ordonancement des topics au choix -->
<!--
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
-->
<th colspan="2" align="center" class="thCornerL" nowrap="nowrap">{L_TOPICS} <a href="{U_ORDER_BY_SUJET_ASC}"><img src="{I_HAUT}" width="11" height="11" title="{L_CROISSANT}" alt="{L_CROISSANT}" /></a><a href="{U_ORDER_BY_SUJET_DESC}"><img src="{I_BAS}" width="11" height="11" title="{L_DECROISSANT}" alt="{L_DECROISSANT}" /></a></th>
<th width="100" align="center" class="thTop" nowrap="nowrap">{L_REPLIES} <a href="{U_ORDER_BY_REPONSES_ASC}"><img src="{I_HAUT}" width="11" height="11" title="{L_CROISSANT}" alt="{L_CROISSANT}" /></a><a href="{U_ORDER_BY_REPONSES_DESC}"><img src="{I_BAS}" width="11" height="11" title="{L_DECROISSANT}" alt="{L_DECROISSANT}" /></a></th>
<th width="120" align="center" class="thTop" nowrap="nowrap">{L_AUTHOR} <a href="{U_ORDER_BY_AUTEUR_ASC}"><img src="{I_HAUT}" width="11" height="11" title="{L_CROISSANT}" alt="{L_CROISSANT}" /></a><a href="{U_ORDER_BY_AUTEUR_DESC}"><img src="{I_BAS}" width="11" height="11" title="{L_DECROISSANT}" alt="{L_DECROISSANT}" /></a></th>
<th width="75" align="center" class="thTop" nowrap="nowrap">{L_VIEWS} <a href="{U_ORDER_BY_LECTURES_ASC}"><img src="{I_HAUT}" width="11" height="11" title="{L_CROISSANT}" alt="{L_CROISSANT}" /></a><a href="{U_ORDER_BY_LECTURES_DESC}"><img src="{I_BAS}" width="11" height="11" title="{L_DECROISSANT}" alt="{L_DECROISSANT}" /></a></th>
<th align="center" class="thCornerR" nowrap="nowrap">{L_LASTPOST} <a href="{U_ORDER_BY_DERNIER_ASC}"><img src="{I_HAUT}" width="11" height="11" title="{L_CROISSANT}" alt="{L_CROISSANT}" /></a><a href="{U_ORDER_BY_DERNIER_DESC}"><img src="{I_BAS}" width="11" height="11" title="{L_DECROISSANT}" alt="{L_DECROISSANT}" /></a></th>
<!-- FIN MOD Ordonancement des topics au choix -->