Code: Select all
##############################################################
## MOD Title: Printer-friendly topic output option
## MOD Author: Svyatozar < [email protected] >
## MOD Description: This mode will add a button with a printer
## Tested on phpBB versions 2.04-2.05, may work with others
## in the row (new topic) (reply) (printer). By pressing on
## that button the reader gets a printer-friendly view of the
## topic.
## See example at http://bbs.inglia.ru/viewtopic.php?t=1
##
## MOD Version: 1.0.2 (20030718), last fixed on 20030829
## UPGRADE: If you are upgrading from version 1.0.x go directly
## to the bottom to the UPGRADES section.
## FRESH INSTALL: If you do not have version 1.0.x installed,
## follow all the instruction up to the UPGRADES section.
## Check for a recent/updated version on http://phpbbhacks.com/
##
## Installation Level: (easy), no tables/languages affected
## Installation Time: 5 Minutes
## Files To Edit:
## templates/subSilver/subSilver.cfg
## viewtopic.php
## templates/subSilver/viewtopic_body.tpl
## Included Files:
## templates/subSilver/images/printer.gif
## templates/subSilver/printer_header.tpl
## templates/subSilver/printertopic_body.tpl
## include/page_header_printer.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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/downloads/
##############################################################
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy printer.gif to templates/subSilver/images/printer.gif
copy printer_header.tpl to templates/subSilver/printer_header.tpl
copy printertopic_body.tpl to templates/subSilver/printertopic_body.tpl
copy page_header_printer.php to includes/page_header_printer.php
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
$images['reply_locked'] = "$current_template_images/{LANG}/reply-locked.gif";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$images['printer'] = "$current_template_images/printer.gif";
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
LIMIT $start, ".$board_config['posts_per_page'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
LIMIT $start, ".(isset($HTTP_GET_VARS['msgcount']) & isset($HTTP_GET_VARS['printertopic']) ? intval($HTTP_GET_VARS['msgcount']) : $board_config['posts_per_page']);
#
#-----[ FIND ]------------------------------------------
#
//
// Post, reply and other URL generation for
// templating vars
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
$printer_topic_url = append_sid("viewtopic.$phpEx?printertopic=1&" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&vote=viewresult");
#
#-----[ FIND ]------------------------------------------
#
$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$printer_img = $images['printer'];
$printer_alt = "Printer-friendly version";
#
#-----[ FIND ]------------------------------------------
#
//
// Load templates
//
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Load templates
//
if(isset($HTTP_GET_VARS['printertopic']))
$template->set_filenames(array(
'body' => 'printertopic_body.tpl')
);
else
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
#
#-----[ FIND ]------------------------------------------
#
//
// Output page header
//
$page_title = $lang['View_topic'] .' - ' . $topic_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Output page header
//
$page_title = $lang['View_topic'] .' - ' . $topic_title;
if(isset($HTTP_GET_VARS['printertopic']))
include($phpbb_root_path . 'includes/page_header_printer.'.$phpEx);
else
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
#
#-----[ FIND ]------------------------------------------
#
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ REPLACE WITH ]------------------------------------------
#
if(isset($HTTP_GET_VARS['printertopic'])) {
$pagination = ( $highlight != '' )? generate_pagination("viewtopic.$phpEx?printertopic=1&" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight". (isset($HTTP_GET_VARS['msgcount'])? "&msgcount=". intval($HTTP_GET_VARS['msgcount']): ''), $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start): generate_pagination("viewtopic.$phpEx?printertopic=1&" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order". (isset($HTTP_GET_VARS['msgcount'])? "&msgcount=". intval($HTTP_GET_VARS['msgcount']): ''), $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start);
if($pagination != '')
$pagination = $pagination. (( $highlight != '' )? " &<a href=\"viewtopic.$phpEx?printertopic=1&". POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight&start=0&msgcount=10000\" title=\"no pagination\">:||:</a>": " &<a href=\"viewtopic.$phpEx?printertopic=1&". POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&start=0&msgcount=10000\" title=\"no pagination\">:||:</a>");
}
else
$pagination = ( $highlight != '' )? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start): generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start);
#
#-----[ FIND ]------------------------------------------
#
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval($board_config['posts_per_page']) ) + 1 ), ceil( $total_replies / intval($board_config['posts_per_page']) )),
#
#-----[ REPLACE WITH ]------------------------------------------
#
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / intval((isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page'])) ) + 1 ), ceil( $total_replies / intval((isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page'])) )),
#
#-----[ FIND ]------------------------------------------
#
'REPLY_IMG' => $reply_img,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'PRINTER_IMG' => $printer_img,
#
#-----[ FIND ]------------------------------------------
#
'L_POST_REPLY_TOPIC' => $reply_alt,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_PRINTER_TOPIC' => $printer_alt,
#
#-----[ FIND ]------------------------------------------
#
'U_POST_NEW_TOPIC' => $new_topic_url,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'U_PRINTER_TOPIC' => $printer_topic_url,
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
#
#-----[ REPLACE WITH ]------------------------------------------
#
if(isset($HTTP_GET_VARS['printertopic']))
$gen_simple_header = 1;
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&&&<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&&&<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&&&<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a>&&&<a href="{U_PRINTER_TOPIC}"><img src="{PRINTER_IMG}" border="0" alt="{L_PRINTER_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&&&<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&&&<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&&&<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&&&<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a>&&&<a href="{U_PRINTER_TOPIC}"><img src="{PRINTER_IMG}" border="0" alt="{L_PRINTER_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&&&<a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Select all
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
//
// That's all, Folks!
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : merge -----------------------------------------------------------------------------------
//-- add
$lang['Refresh'] = 'Refresh';
$lang['Merge_topics'] = 'Merge topics';
$lang['Merge_title'] = 'New topic title';
[..]
$lang['Merge_topic_done'] = 'The topics have been successfully merged.';
Code: Select all
#
#-----[ FIND ]------------------------------------------
#
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ REPLACE WITH ]------------------------------------------
#
if(isset($HTTP_GET_VARS['printertopic'])) {
$pagination = ( $highlight != '' )? generate_pagination("viewtopic.$phpEx?printertopic=1&" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight". (isset($HTTP_GET_VARS['msgcount'])? "&msgcount=". intval($HTTP_GET_VARS['msgcount']): ''), $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start): generate_pagination("viewtopic.$phpEx?printertopic=1&" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order". (isset($HTTP_GET_VARS['msgcount'])? "&msgcount=". intval($HTTP_GET_VARS['msgcount']): ''), $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start);
if($pagination != '')
$pagination = $pagination. (( $highlight != '' )? " &<a href=\"viewtopic.$phpEx?printertopic=1&". POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight&start=0&msgcount=10000\" title=\"no pagination\">:||:</a>": " &<a href=\"viewtopic.$phpEx?printertopic=1&". POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&start=0&msgcount=10000\" title=\"no pagination\">:||:</a>");
}
else
$pagination = ( $highlight != '' )? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start): generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, (isset($HTTP_GET_VARS['msgcount'])? intval($HTTP_GET_VARS['msgcount']): $board_config['posts_per_page']), $start);
Code: Select all
( $highlight != '' )
Code: Select all
( $highlight_active )