Code: Alles auswählen
##############################################################
## MOD Title: Print Single Posts
## MOD Author: kratzer54847 < alternativ3322@web.de > (Johny Jesewski) http://www.plauderclub.de/
## MOD Description: User can print single posts
## MOD Version: 0.0.1 alpha
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: viewtopic.php, templates/viewtopic_body.tpl, lang_xxx/lang_main.php
## Included Files: templates/subSilver/printerpost_body.tpl
##############################################################
## 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:
##
## This Mod adds the ability to print single posts
##############################################################
## MOD History:
##
## 2004-10-23 - Version 0.0.1 alpha
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
lang_xxx/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['printpost'] = "Print Post";
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Load templates
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
if(isset($HTTP_GET_VARS['printerpost']))
{
$postid = $HTTP_GET_VARS['printerpost'];
$sql = "SELECT *
FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u
WHERE p.post_id = $postid
AND pt.post_id = $postid
AND u.user_id = p.poster_id";
$result = mysql_query($sql);
while ( $row = $db->sql_fetchrow($result) )
{
$postername = $row['username'];
$posttitle = $row['post_subject'];
$posttext = $row['post_text'];
$posttime = date("d.m.Y", $row['post_time']);
$template->assign_vars(array(
'POSTER' => $postername,
'POSTTITLE' => $posttitle,
'POSTTEXT' => $posttext,
'POSTTIME' => $posttime
));
}
$template->set_filenames(array(
'body' => 'printerpost_body.tpl')
);
}
#
#-----[ FIND ]------------------------------------------
#
'L_GOTO_PAGE' => $lang['Goto_page'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_PRINTPOST' => $lang['printpost'],
#
#-----[ FIND ]------------------------------------------
#
$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$printerpost = append_sid("viewtopic.php?" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&printerpost=" . $postrow[$i]['post_id']);
#
#-----[ FIND ]------------------------------------------
#
'POST_ID' => $postid,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'PRINT_POST' => $printerpost,
#
#-----[ SAVE & CLOSE ]------------------------------------------
#
viewtopic.php
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{postrow.POST_SUBJECT}
#
#-----[ AFTER, ADD ]------------------------------------------
#
<a href="viewtopic.php?p={postrow.POST_ID}&printerpost={postrow.POST_ID}" class="gensmall">{L_PRINTPOST}</a>
#
#-----[ SAVE & CLOSE ]------------------------------------------
#
viewtopic_body.tpl
#
#-----[ CREATE FILE ]------------------------------------------
#
templates/subSilver/printerpost_body.tpl
<font color=#aaaaaa>[<sup>/[</font><a title="{L_PRINT_DESC}" href="javascript:self.print()">{L_PRINT}</a>]\</sup>]<br clear=all>
<span class="nav">{PAGINATION}</span><br />
<span class="nav"><font color=black><a href="{U_INDEX}" class="nav"><font color=black>{SITENAME}</font></a>
-> <a href="{U_VIEW_FORUM}" class="nav"><font color=black>{FORUM_NAME}</font></a></font></span>
<center><hr width=80%></center>
<font color=black>{L_POST_SUBJECT}: <b>{POSTTITLE}</b> {L_AUTHOR}: <b>{POSTER}</b>, </font></span>
<a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails"><font color=black>{L_POSTED}: {POSTTIME}</font><span class="gen"><br>
<span class="gensmall"> —</span><br>
<span class="postbody">{POSTTEXT}</span></td>
<span class="gensmall"><center><hr width=48%><hr width=16%><hr width=4%></center><span>
<span class="nav"><a href="{U_INDEX}" class="nav"><font color=black>{SITENAME}</font></a>
-> <a href="{U_VIEW_FORUM}" class="nav"><font color=black>{FORUM_NAME}</font></a></span>