Peter píše:
Prosim Vas, ako sa vola tento mod? Na tie kategórie, ze su tak pekne usporiadanie, a odseknuté...
Diky...
A ak to tu nahodou bolo, tak sa osrpavedlnujem, ale neviem ako sa vola ten mod, tak neviem ani kde mam hladat
tento mod sa vola
Separate Announcements and Sticky Topics
instalacia
Kód:
###############################################
## Hack Title: Separate Announcements & Sticky
## Hack Version: 2.0.0
## Author: Aiencran
## Description: This hack separates Announcements and Sticky Topics from other topics in viewforum page.
##
## Compatibility: 2.0.13
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 3
## viewforum.php,
## language/lang_english/lang_main.php,
## templates/subSilver/viewforum_body.tpl
##
## Included Files: 1
## includes/functions_separate.php
##
## History:
## 2005-03-15 - Version 2.0.0
## - Announcements and Sticky Topics are separated
## - Sticky Topics are shown only in the first page (original behaviour)
##
## 2004-10-27 - Version 1.1.0
## - It supports now Global Announcements
## - Fixed sorting issues
##
## 2004-10-20 - Version 1.0.0
## - First version
##
## Author Notes:
## None
##
## Support: None
## Copyright: ©2005 Separate Announcements & Sticky 2.0.0 - Aiencran
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################
#
#-----[ COPY ]------------------------------------------
#
copy includes/functions_separate.php to includes/functions_separate.php
#
#-----[ OPEN ]------------------------------------------
#
/viewforum.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------
#
include($phpbb_root_path . 'includes/functions_separate.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
$total_topics += $total_announcements;
#
#-----[ AFTER, ADD ]------------------------------------
#
$dividers = get_dividers($topic_rowset);
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_TOPIC' => $view_topic_url)
);
#
#-----[ AFTER, ADD ]------------------------------------
#
if ( array_key_exists($i, $dividers) )
{
$template->assign_block_vars('topicrow.divider', array(
'L_DIV_HEADERS' => $dividers[$i])
);
}
#
#-----[ OPEN ]------------------------------------------
#
/language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------
#
$lang['Global_Announcements'] = 'Global Announcements';
$lang['Announcements'] = 'Announcements';
$lang['Sticky_Topics'] = 'Sticky Topics';
#
#-----[ 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 ]--------------------------
#
#End
vytvoris si novy subor a nahras do priecinku includes cize
includes\functions_separate.php a ten subor bude obsahovat
Kód:
<?php
/***************************************************************************
* function_separate.php
* -------------------
* begin : Tuesday, Mar 15, 2005
* copyright : (C) 2005 Aiencran
* email : cranportal-katamail.com
*
* $Id: functions_separate.php,v 1.0.0.0 2005/03/15 15:20:00 psotfx Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
***************************************************************************/
//
// Select topic to be suggested
//
function get_dividers($topics)
{
global $lang;
$dividers = array();
$total_topics = count($topics);
$total_by_type = array (POST_GLOBAL_ANNOUNCE => 0, POST_ANNOUNCE => 0, POST_STICKY => 0, POST_NORMAL => 0);
for ( $i=0; $i < $total_topics; $i++ )
{
$total_by_type[$topics[$i]['topic_type']]++;
}
if ( ( $total_by_type[POST_GLOBAL_ANNOUNCE] + $total_by_type[POST_ANNOUNCE] + $total_by_type[POST_STICKY] ) != 0 )
{
$count_topics = 0;
$dividers[$count_topics] = $lang['Global_Announcements'];
$count_topics += $total_by_type[POST_GLOBAL_ANNOUNCE];
$dividers[$count_topics] = $lang['Announcements'];
$count_topics += $total_by_type[POST_ANNOUNCE];
$dividers[$count_topics] = $lang['Sticky_Topics'];
$count_topics += $total_by_type[POST_STICKY];
if ( $count_topics < $total_topics )
{
$dividers[$count_topics] = $lang['Topics'];
}
}
return $dividers;
}
?>