Simple Machines Community Forum

SMF Development => Feature Requests => Next SMF Discussion => Topic started by: diffy on August 31, 2007, 11:00:48 PM

Title: Print topic should include images
Post by: diffy on August 31, 2007, 11:00:48 PM
I think that the print feature in SMF is too simple

When clicking print SMF generates a text only output.
This is 2007 and images are cool to have on a printout, thus SMF should
display images when showing a print-view.

Also I have often got use for Joomla's PDF function. Can this be included in SMF as well? Print to PDF. It would be very handy, and a very moderm addon to SMF...
Title: Re: Print topic should include images
Post by: tranqui69 on January 30, 2008, 01:23:16 AM
I think the same. I Edit myself

The solution was in the forum. This works for me.

In my theme directory. Display.template.php

Find

             $buttonArray[] = '<li class="print"><a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . $txt[465] . '</a></li>';

Replace with

             $buttonArray[] = '<li class="print"><a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0;images" target="_blank">' . $txt[465] . '</a></li>';

So simple.

Title: Re: Print topic should include images
Post by: karlbenson on January 30, 2008, 02:38:11 AM
yeah you can either do that.

Or do it permanently.

OPEN Sources/Subs.php
FIND & REMOVE

// !!! Change maybe?
if (!isset($_GET['images']))
$disabled['img'] = true;
Title: Re: Print topic should include images
Post by: falguni1 on January 30, 2008, 02:49:13 AM
right it should include images by default.

I thought I was included by default because I never tookout printout.

I was not knowing it doesnot include images by default.
Title: Re: Print topic should include images
Post by: karlbenson on January 30, 2008, 02:54:04 AM
IMO print out should be text only.
But having the option to toggle images would be nice.

The functionality is there, as posted above, but a link to it on Print_only page would be nice.

eg
Text Only | With Images
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on January 30, 2008, 02:55:29 AM
I have to say that the print view is fine as it is, but an option to include images when needed would be cool. :)
Title: Re: Print topic should include images
Post by: falguni1 on January 30, 2008, 06:22:57 AM
*falguni1 thinks now karlbenson has one more mod idea which he may like to develop.
Title: Re: Print topic should include images
Post by: L'AltroWeb on February 06, 2009, 01:38:10 PM
Hi!
I have maked this little mod ( smf 1.1.8 ):
In Display.template.php search:
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
replace with:
'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
'printimage' => array('text' => 466, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0;images'),
Now open index.english.php and search:
$txt[465] = 'Print';
replace with:
$txt[465] = 'Print(txt)';
$txt[466] = 'Print(img)';
(466 is free)  :)
U can test here: http://darkwolf.altervista.org/forum/modemrouter/guida-alluso-di-ciclamab/msg61/#msg61  ;)
Title: Re: Print topic should include images
Post by: klumy on February 06, 2009, 02:34:09 PM
Quote from: diffy on August 31, 2007, 11:00:48 PM
I think that the print feature in SMF is too simple

When clicking print SMF generates a text only output.
This is 2007 and images are cool to have on a printout, thus SMF should
display images when showing a print-view.

Also I have often got use for Joomla's PDF function. Can this be included in SMF as well? Print to PDF. It would be very handy, and a very moderm addon to SMF...

I absolutely agree. This should be a default feature !!
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 05:36:15 AM
I would like to be able to print off a whole topic complete with images too.  I am using  SMF 1.1.11 and the string is not the same.  I think it is now :-

   'print' => array('text' => 465, 'image' => 'print.gif', 'lang' => true, 'custom' => 'target="_blank"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),

I am no PHP programmer so don't know how to alter this string to include the images as per the advice in the quoted post.  Can anyone help?


Quote from: tranqui69 on January 30, 2008, 01:23:16 AM
I think the same. I Edit myself

The solution was in the forum. This works for me.

In my theme directory. Display.template.php

Find

             $buttonArray[] = '<li class="print"><a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank">' . $txt[465] . '</a></li>';

Replace with

             $buttonArray[] = '<li class="print"><a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0;images" target="_blank">' . $txt[465] . '</a></li>';

So simple.


Title: Re: Print topic should include images
Post by: Arantor on February 04, 2010, 05:40:27 AM
http://custom.simplemachines.org/mods/index.php?mod=2340 perhaps?
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 05:46:13 AM
Well found! I'll give it a try, I'm trying to print a whole topic to a PDF so that we can remove it from the database but still have a reference copy of the contents.


Thanks.
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 05:54:29 AM
this works on small topics but not on some of my larger ones.  Also I really would like to have a copy of the posters avatar included.
Title: Re: Print topic should include images
Post by: Arantor on February 04, 2010, 06:14:40 AM
Well found? I originally wrote it...

It should work on all topics, if it doesn't it's actually an SMF bug since it uses an internal SMF feature.

So in reality what you're after ISN'T the printable view, but actually a low-fat theme.
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 06:20:08 AM
Well the owner of the site doesn't want to lose any of the posts but the DB is getting quite large.  I was trying to print out/export an entire archived topic as seen on the screen to a pdf so we still had a record but we could happily delete the topic/records from the DB.

I think several people are looking for this sort of feature.
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 04, 2010, 06:23:23 AM
Quote from: nax on February 04, 2010, 06:20:08 AM
Well the owner of the site doesn't want to lose any of the posts but the DB is getting quite large.  I was trying to print out/export an entire archived topic as seen on the screen to a pdf so we still had a record but we could happily delete the topic/records from the DB.

I think several people are looking for this sort of feature.
You could just get your self a pdf printer, and print the actual topic view.... ;)
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 12:08:06 PM
errr I can print to PDF but the mod will not work with large threads.


Quote from: LexArma on February 04, 2010, 06:23:23 AM
Quote from: nax on February 04, 2010, 06:20:08 AM
Well the owner of the site doesn't want to lose any of the posts but the DB is getting quite large.  I was trying to print out/export an entire archived topic as seen on the screen to a pdf so we still had a record but we could happily delete the topic/records from the DB.

I think several people are looking for this sort of feature.
You could just get your self a pdf printer, and print the actual topic view.... ;)
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 04, 2010, 12:27:04 PM
Quote from: nax on February 04, 2010, 12:08:06 PM
errr I can print to PDF but the mod will not work with large threads.
No, I mean no mod at all - just a PDF fileprinter, and then print the topic like it's actually shown.
Title: Re: Print topic should include images
Post by: nax on February 04, 2010, 01:03:52 PM
If you print the topic this way it is without images which is not what we want - the default print thread is text only.
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 04, 2010, 01:19:41 PM
No you still didn't understand. Don't use the print view, use the normal topic view, and your browsers print function to print to a pdf file. So print what you see normally....
Title: Re: Print topic should include images
Post by: nax on February 05, 2010, 03:59:04 AM
That will only print the numer of records allowed per viewing page, not the whole thread.  You can try raising the number of posts per page but if you try over a 100 or so the system defaults back to 20.

Only the print button within SMF prints all the records in a thread, but only in text and only if the thread is relatively small, some of my threads have 170000 posts in them and I want to print the whole thread as you would see when you do use the browser print button i.e. WUSIWYG.
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 05, 2010, 04:03:05 AM
I do understand that, but there's a problem in trying to print through the print view when the topic is large enough.
Many server setups out there will simply refuse to serve the page due to it's size then....
Title: Re: Print topic should include images
Post by: Arantor on February 05, 2010, 04:17:01 AM
Not to mention likely your browser going nuts trying to handle a page that big.
Title: Re: Print topic should include images
Post by: nax on February 05, 2010, 07:04:18 AM
Yes this is something I have inherited and I'm trying to reduce he size of the DB but the owner want to keep full records of what is there but woould accept a print out of a thread but ony as it is seen "on screen" not the print option within SMF.  One of our member died and they set up a book of condolence.  They then wanted this thread printed as a book for her family.  The only way I could do it was copy and paste each individual page into word then create a pdf for the printers.  It was 2000 pages and took me quite a while.

I could split the old archives and then recombine the resultant print outs but I just don't have the time hence me looking for an easy method.
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 05, 2010, 07:06:13 AM
Quote from: nax on February 05, 2010, 07:04:18 AM
They then wanted this thread printed as a book for her family.  The only way I could do it was copy and paste each individual page into word then create a pdf for the printers.  It was 2000 pages and took me quite a while.
You could have just printed page by page from the topic directly to pdfs and then combine them.
( And even first set a higher number of posts / page to save time. )
Title: Re: Print topic should include images
Post by: nax on February 05, 2010, 07:23:53 AM
at 15 posts per page that would be 11540 pages even if I can double that it's still pretty impractical.
Title: Re: Print topic should include images
Post by: Aleksi "Lex" Kilpinen on February 05, 2010, 07:25:49 AM
That's an insane sized topic :o
Title: Re: Print topic should include images
Post by: nax on February 05, 2010, 07:29:22 AM
I know! as I say I inherited these problems.  The db is 1.1GB and I'm about to add a fultext search index taking it to 1.6.  Some of the threads are huge!
Title: Re: Print topic should include images
Post by: hartiberlin on April 02, 2012, 04:58:44 PM
Has there any solution been found to this problem yet ?

I am having the same problem now.


Otherwise, do you know how to do it this way for SMF 2.x ?

http://www.simplemachines.org/community/index.php?topic=446835.msg3305503#msg3305503


Many thanks.

Regards, Stefan.
Title: Re: Print topic should include images
Post by: garry383 on April 22, 2012, 09:27:52 AM
so it should.
Title: Re: Print topic should include images
Post by: emanuele on December 19, 2012, 04:40:09 AM
https://github.com/emanuele45/playpen/commit/e56717ee173ece39c56fe01c977e1a9166acd2bb