##############################################################
## MOD Title: Separate Announcements & Sticky
## MOD Author: Aiencran <
cranportal@katamail.com >
## MOD Description: This hack separates Announcements and Sticky Topics from other topics in viewforum page.
## MOD Version: 1.1.0
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: viewforum.php,
## language/lang_english/lang_main.php,
## templates/subSilver/viewforum_body.tpl
## Included Files: (n/a, or list of included/required files)
##############################################################
## For Security Purposes, Please Check:
http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at:
http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2004-10-27 - Version 1.1.0
## - It supports now Global Announcements
## - Fixed sorting issues
##
## 2004-10-20 - Version 1.0.0
## - First Version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
/viewforum.php
#
#-----[ FIND ]------------------------------------------
#
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
#
#-----[ AFTER, ADD ]------------------------------------
#
$total_global_announcements = ( isset($total_announcements) ) ? $total_announcements : 0;
#
#-----[ FIND ]------------------------------------------
#
AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY t.topic_last_post_id DESC ";
#
#-----[ REPLACE WITH ]------------------------------------
#
AND t.topic_type BETWEEN " . POST_STICKY . " AND " . POST_ANNOUNCE . "
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC ";
#
#-----[ FIND ]------------------------------------------
#
AND t.topic_type <> " . POST_ANNOUNCE . "
#
#-----[ AFTER, ADD ]------------------------------------
#
AND t.topic_type <> " . POST_STICKY . "
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_TOPIC' => $view_topic_url)
);
#
#-----[ AFTER, ADD ]------------------------------------
#
$is_first_global = ( ( $i == 0) AND ( $total_global_announcements > 0 ));
$is_first_announce = ( ( $i == $total_global_announcements ) AND ( ( $total_announcements - $total_global_announcements ) > 0 ) );
$is_first_normal_topic = ( ( $i == $total_announcements ) AND ( $total_announcements > 0 ) );
if ( $is_first_global ) {
$template->assign_block_vars('topicrow.divider', array(
'L_DIV_HEADERS' => $lang['Global_Announcements'])
);
}
if ( $is_first_announce ) {
$template->assign_block_vars('topicrow.divider', array(
'L_DIV_HEADERS' => $lang['Announcements_and_Sticky'])
);
}
if ( $is_first_normal_topic ) {
$template->assign_block_vars('topicrow.divider', array(
'L_DIV_HEADERS' => $lang['Topics'])
);
}
#
#-----[ OPEN ]------------------------------------------
#
/language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------
#
$lang['Announcements_and_Sticky'] = 'Announcements and Sticky Topics';
$lang['Global_Announcements'] = 'Global Announcements';
#
#-----[ OPEN ]------------------------------------------
#
/templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN topicrow -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN divider -->
<tr>
<td class="catHead" colspan="6" height="28"><span class="cattitle">{topicrow.divider.L_DIV_HEADERS}</span></td>
</tr>
<!-- END divider -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM