News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 1.1.8 einzelne Beiträge drucken?

Started by Homicide, May 07, 2009, 07:28:51 PM

Previous topic - Next topic

Homicide

Hallo,
ich habe das Forum nun schon durchsucht und auch mr. Google befragt aber bin nicht fündig geworden.

Ich suche eine Möglichkeit das man einzelne Beiträge eines Themas ausdrucken kann.
Ein Mod für einzelne Beiträge anzuzeigen gibt es ja schon, aber ausdrucken kann man immer nur das gesamte Thema mit allen Beiträgen.

Hat jemand da ein Mod oder ein paar Codeschnipsel?

Danke

Homicide

ディン1031

#1
Hmmm ich habe so etwas schon mal gemacht jetzt muß ich es nur wieder finden xD.



$sourcedir/Printpage.php
Suche nach:

fatal_lang_error(472, false);


Fuge danach ein:   

// First remove look if only a single post should be shown :D
if(!empty($_GET['msg']))
$_GET['msg'] = (int) $_GET['msg'];
else
$_GET['msg'] = 0;


Suche nach

$request = db_query("
SELECT subject, posterTime, body, IFNULL(mem.realName, posterName) AS posterName
FROM {$db_prefix}messages AS m
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE ID_TOPIC = $topic
ORDER BY ID_MSG", __FILE__, __LINE__);


Ersetze mit:

$request = db_query("
SELECT subject, posterTime, body, IFNULL(mem.realName, posterName) AS posterName
FROM {$db_prefix}messages AS m
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE ID_TOPIC = $topic" . (!empty($_GET['msg']) ? '
AND ID_MSG = ' . $_GET['msg'] . '
LIMIT 1': '
ORDER BY ID_MSG'), __FILE__, __LINE__);


Nun der Button ;)
$themedir/Display.template.php

Suche nach

$split_button = create_button('split.gif', 'smf251', 'smf251', 'align="middle"');

Füge danach ein:

$print_button = create_button('print.gif', 465, 465, 'align="middle"');


Suche nach

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '">', $split_button, '</a>';

Füge danach ein:


// Print only this Post
echo '
<a href="', $scripturl, '?action=printpage;topic=', $context['current_topic'], '.0;msg=', $message['id'], '">', $print_button, '</a>';


Habe ich aber damals nie getestet da nix mehr kam denke ich mal das er ok war ;).
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Homicide

hi ディン1031 ,
habs grade getestet und es funktioniert genial.

Vielen vielen Dank

Advertisement: