Topic: A printer-friendly version of threads.
A seperate parser that optimises the page for printing/saving is basically what I mean. I have checked punres for a similar mod but I couldn't find one, so yea.
You are not logged in. Please login or register.
PunBB Forums → Feature requests → A printer-friendly version of threads.
A seperate parser that optimises the page for printing/saving is basically what I mean. I have checked punres for a similar mod but I couldn't find one, so yea.
Normally, you don't need one. It's a CSS job (mostly), and the 1.2 branch arleady has this (try a preview print on this board to see it).
And 1.3 has a specific print stylesheet
That's even better
And since we are on the feature request forum : it would be nice to have a conditionnal printed stylesheet, because half the world use A4, when the other half use Letter.
And the half of the world that uses A4 cannot agree on the size of A4. I think catering for different paper sizes if probably overkill though.
Uh? First time I heard about this...
A4 is defined in ISO 216, as 210×297 mm. It's the size I've always seen from several countries.
jeremie, i checked the print preview of this exact page and it didnt show any diferences betwin the normal view, expet for the background remove which is a browser setting.
Thats actually a cool mode. I will chack out if i can do something, but it will take time.
In case somebody starts to write a module for a print version allow me to drop an advice: remove all vertical lines, dont wrap content in a box, the vertical lines really slow down the inkjet printers.
Just before i start anything... let me put my ideas together and please tell me if i am missing something.
So i would need to:
*place a "print this topic" link on viewtopic.php
*include comon.php
*check if the current user has read permitions ( i can use the same checking procedure as in viewtopic.php )
*remove the pagination from the sql
*output it
Is anybody avaluable to write the html/css? my skills on that are poor.
pedrotuga, why not just use CSS?
pedrotuga, why not just use CSS?
because the page content should not be the same. If i want to print a topic with 4 pages it doesnt make sense to print page by page.
That's actually a good point. So maybe not a "print" function, but a "see the whole thread" function ; that could be use for all kind of things.
Extensions, extensions, extensions
Trac public login, trac public login, trac public login
This is offtopic, but getting that set up properly is more difficult than it would seem
I must confess i didnt understand your last posts smartyes and jeremie.
Anyway... jeremie, i dont think a "show full thread" function would be practical for anything else than a print view.
Smartys, how dificult would it be and why? can you be more speciffic?
Jérémie is talking about non-developers getting logins for the PunBB Trac; Smartys is talking about integrating the login info for Trac and this forum.
Edit:
because the page content should not be the same. If i want to print a topic with 4 pages it doesnt make sense to print page by page.
So why not use Jérémie's "see whole topic" idea with CSS and let the user decide what to do with the content. All you really need to do is provide a way to not paginate the posts in a topic.
mmm ok, i see, it was ot.
guardian, i dont see any use of showing a page with 60 messages normaly styled. Then also in a print version is not only the layout that changes, it's also the content,a nd it changes a lot in fact.
I made up mind mind on this, sorry. It will be a printable version mod
Two other uses, right off the hat:
1. Easy save/archive thing
2. Easy local search (when you have a 1K or 2K posts thread, remember a word/a sentence in it but don't remember when; it happens to me all the time).
The other place that paginated threads are a pain is when extracting the thread as an hatom microformat. Each page ends up as a seperate feed. However, a show whole thread option wouldn't get around that one, it would have to be the default with pagination as the option.
it's also the content,a nd it changes a lot in fact.
I'm not so sure about this, but I think you should be able to copy viewtopic.php and change the content it produces (unpaginated, etc.).
soonotes, thank you!
Looks like we dont need to work on this
i will look for it
Found it. http://www.punres.org/files.php?pid=145
I know I changed a couple of things for the style and if I remember right you have to make a change in viewprintable to prevent users from viewing a printable version of a topic they shouldn't have access to. I'll check on that.
Yep, i already dload and install it.
Really cool.
Snootes... it's true, you need to add user autenticity. Since you already did that, would it be ok to post your code?
There are a few things you won't need for this page, but it looks like you should be able to copy from viewtopic.php.
In viewprintable.php, try finding?
$result = $db->query('SELECT t.subject, t.num_replies, f.id AS forum_id, f.forum_name, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.id='.$id) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
?replacing with:
// Fetch some info about the topic
if (!$pun_user['is_guest'])
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
That's exactly what I did for authentication. Also, instead of adding the printable link to header I put it right in viewtopic like this
Personal preference I guess but I thought it was better there. If you want to do that open viewtopic.php and around line 171
<p class="postlink conr"><?php echo $post_link ?></p>
Replace with
<p class="postlink conr"><?php echo $post_link ?><br /><a href="viewprintable.php?id=<?php echo $id ?>"><?php echo $lang_common['Print version'] ?></a></p>
PunBB Forums → Feature requests → A printer-friendly version of threads.
Powered by PunBB, supported by Informer Technologies, Inc.