ставится легко, но с осторожностью - модификация производилась на рабочем форуме, который очень сильно пропатчен, поэтому вероятно что в мод вошли строки, уже пропатченные ранее
и так...
Код: Выделить всё
##############################################################
## MOD Title: View Topic Printer-Friendly
## MOD Author: quazi < nomail@nospam.com > ( quazi ) N/A
## MOD Description: This MOD allows users to read any topic in lightweight view
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 2
## viewtopic.php
## templates/subSilver/viewtopic_body.tpl
## Included Files: 2
## print_viewtopic_body.tpl
## print_viewtopic_poll_result.tpl
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##############################################################
## MOD History:
##
## 2006-09-06 - Version 1.0.1 beta
## - Added link to the printer-friendly page of topics
## 2006-08-29 - Version 1.0.0 beta
## - All lines had been rewritten in compliance with the phpBB coding standards
## 2006-08-24 - Version 0.0.1 alfa
## - First Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#---- [ COPY ] ----
#
copy print_viewtopic_body.tpl to templates/subSilver/print_viewtopic_body.tpl
copy print_viewtopic_poll_result.tpl to templates/subSilver/print_viewtopic_poll_result.tpl
#
#---- [ OPEN ] ----
#
templates/subSilver/viewtopic_body.tpl
#
#---- [ FIND ] ----
#
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
#
#---- [ IN-LINE FIND ] ----
#
<br />
#
#---- [ IN-LINE BEFORE, ADD ] ----
#
<!-- BEGIN viewtopic_printer_friendly -->
<span class="genmed"> [ <a href="{viewtopic_printer_friendly.U_VIEW_TOPIC}"> Print </a> ]</span>
<!-- END viewtopic_printer_friendly -->
#
#---- [ OPEN ] ----
#
viewtopic.php
#
#---- [ FIND ] ----
#
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
#
#---- [ REPLACE WITH ] ----
# (You may simply delete these lines)
//
//+ViewTopic Printer-Friendly
/*
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
*/
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
$select_post_days = '<select name="postdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($post_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_post_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_post_days .= '</select>';
#
#---- [ REPLACE WITH ] ----
# (You may simply delete these lines)
//
//+ViewTopic Printer-Friendly
/*
$select_post_days = '<select name="postdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($post_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_post_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_post_days .= '</select>';
*/
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
//
// Go ahead and pull all data for this topic
#
#---- [ BEFORE, ADD ] ----
#
//
//+ViewTopic Printer-Friendly
$viewTopicPrinterFriendly = ( isset($_GET['print']) && $_GET['print'] == 'yes' );
if ( $viewTopicPrinterFriendly )
{
$select_post_order = '';
if ( $post_time_order == 'ASC' )
{
$select_post_order .= $lang['Oldest_First'];
$select_post_order .= ' .::. ';
$select_post_order .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&print=yes&postorder=desc") . '">' . $lang['Newest_First'] . '</a>';
}
else
{
$select_post_order .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&print=yes&postorder=asc") . '">' . $lang['Oldest_First'] . '</a>';
$select_post_order .= ' .::. ';
$select_post_order .= $lang['Newest_First'];
}
}
else
{
$select_post_order = '<select name="postorder">';
if ( $post_time_order == 'ASC' )
{
$select_post_order .= '<option value="asc" selected="selected">' . $lang['Oldest_First'] . '</option><option value="desc">' . $lang['Newest_First'] . '</option>';
}
else
{
$select_post_order .= '<option value="asc">' . $lang['Oldest_First'] . '</option><option value="desc" selected="selected">' . $lang['Newest_First'] . '</option>';
}
$select_post_order .= '</select>';
$previous_days = array(
0 => $lang['All_Posts'],
1 => $lang['1_Day'],
7 => $lang['7_Days'],
14 => $lang['2_Weeks'],
30 => $lang['1_Month'],
90 => $lang['3_Months'],
180 => $lang['6_Months'],
364 => $lang['1_Year'],
);
$select_post_days = '<select name="postdays">';
foreach ($previous_days as $k => $v)
{
$select_post_days .= '<option value="' . $k . '"' . ( ($post_days == $k) ? ' selected="selected"' : '' ) . '>' . $v . '</option>';
}
$select_post_days .= '</select>';
}
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
LIMIT $start, ".$board_config['posts_per_page'];
#
#---- [ REPLACE WITH ] ----
#
//
//+ViewTopic Printer-Friendly
. ( $viewTopicPrinterFriendly ? '' : " LIMIT " . $start . ", " . $board_config['posts_per_page'] );
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl',
));
#
#---- [ REPLACE WITH ] ----
#
//
//+ViewTopic Printer-Friendly
if ( $viewTopicPrinterFriendly )
{
$template->set_filenames(array(
'body' => 'print_viewtopic_body.tpl',
));
$gen_simple_header = TRUE;
}
else
{
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl',
));
make_jumpbox('viewforum.'.$phpEx, $forum_id);
}
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
//
// Does this topic contain a poll?
#
#---- [ BEFORE, ADD ] ----
#
//
//+ViewTopic Printer-Friendly
if ( ! $viewTopicPrinterFriendly )
{
$template->assign_block_vars('viewtopic_printer_friendly', array(
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight&print=yes"),
));
}
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_topic_data['topic_status'] == TOPIC_LOCKED )
#
#---- [ REPLACE WITH ] ----
#
//
//+ViewTopic Printer-Friendly
/*
if ( $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_topic_data['topic_status'] == TOPIC_LOCKED )
*/
if ( $viewTopicPrinterFriendly || $user_voted || $view_result || $poll_expired || !$is_auth['auth_vote'] || $forum_topic_data['topic_status'] == TOPIC_LOCKED )
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
'pollbox' => 'viewtopic_poll_result.tpl',
#
#---- [ REPLACE WITH ] ----
#
//
//+ViewTopic Printer-Friendly
/*
'pollbox' => 'viewtopic_poll_result.tpl',
*/
'pollbox' => $viewTopicPrinterFriendly ? 'print_viewtopic_poll_result.tpl' : 'viewtopic_poll_result.tpl',
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
//
// Parse smilies
#
#---- [ BEFORE, ADD ] ----
#
//
//+ViewTopic Printer-Friendly
if ( ! $viewTopicPrinterFriendly )
{
//-ViewTopic Printer-Friendly
//
#
#---- [ FIND ] ----
#
//
// Replace naughty words
#
#---- [ BEFORE, ADD ] ----
#
//
//+ViewTopic Printer-Friendly
}
//-ViewTopic Printer-Friendly
//
#
#---- [ SAVE/CLOSE ALL FILES ] ----
#
# EoM
Код: Выделить всё
<table align="center" width="60%" cellpadding="2" cellspacing="2" border="0">
<tr>
<td><a class="gen" href="{U_VIEW_TOPIC}">»</a></td>
<td width="100%"><h1>{TOPIC_TITLE}</h1></td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div class="gensmall">{L_DISPLAY_POSTS}: <br />{S_SELECT_POST_ORDER}</div><br />{POLL_DISPLAY}</td>
</td>
</table>
<!-- BEGIN postrow -->
<hr width="60%" />
<table align="center" width="60%" cellpadding="2" cellspacing="2" border="0">
<tr>
<td class="gensmall" width="150">{L_AUTHOR}: </td>
<td class="gensmall"><b>{postrow.POSTER_NAME}</b></td>
</tr>
<tr>
<td class="gensmall">{L_POSTED}: </td>
<td class="gensmall">{postrow.POST_DATE}</td>
</tr>
<tr>
<td class="gensmall">{L_POST_SUBJECT}: </td>
<td class="gensmall"><b>{postrow.POST_SUBJECT}</b></td>
</tr>
<tr>
<td colspan="2"><hr /><span class="gen">{postrow.MESSAGE}</span><br /><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table>
<hr width="60%" />
<!-- END postrow -->
Код: Выделить всё
<table cellspacing="0" cellpadding="4" border="0">
<tr><td colspan="3" align="center" class="gen"><b>{POLL_QUESTION}</b></td></tr>
<!-- BEGIN poll_option -->
<tr>
<td class="gen">{poll_option.POLL_OPTION_CAPTION}</td>
<td align="right" class="gen"><b>{poll_option.POLL_OPTION_PERCENT} </b></td>
<td align="center" class="gen">[ {poll_option.POLL_OPTION_RESULT} ]</td>
</tr>
<!-- END poll_option -->
<tr><td colspan="3" align="center" class="gen"><b>{L_TOTAL_VOTES} : {TOTAL_VOTES}</b></td></tr>
</table>
например, если бы этот мод стоял на этом форуме то эту тему можно было бы посмотреть так http://phpbbguru.net/community/viewtopi ... &print=yes
дальнейшая разработка требует внесения изменений в языковые файлы файлы и дополнительных изменений в файлах viewtopic.php и templates/subSilver/viewtopic_body.tpl для показа ссылки на облегченную версию темы