Verfasst: 23.10.2004 18:11
werde ich gleich mal machen.
muss ich eigentlich dafür vorher den print-topic-mode installieren?
muss ich eigentlich dafür vorher den print-topic-mode installieren?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
Print Posts MOD
Version 0.0.1 alpha
Author: kratzer54847(Johny Jesewski)
#
#-----[ 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 ]------------------------------------------
#
$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">Print Post</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>
Code: Alles auswählen
'PRINT_POST' => $printerpost,
Sorry, meinte auch, dass ichkratzer54847 hat geschrieben:die sollst du ja auch gar nicht finden sondern adden...
#
#-----[ FIND ]------------------------------------------
#
'POST_ID' => $postid,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'PRINT_POST' => $printerpost,
abschnitt ist schon klar. habe ich da aber nicht gefunden...kratzer54847 hat geschrieben:hm?
$template->assign_block_vars('postrow', array(
das sollte irgendwo da dabei sein sonst hab ich das geadded und übersehen