vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Download Thread as PDF (https://vborg.vbsupport.ru/showthread.php?t=91562)

Frenck 07-02-2005 10:00 PM

Download Thread as PDF
 
What this hack does:
This hack creates an new thread tool.
Download the complete thread as an PDF.

Credits:

Julien Mourot, Renato A. C. & MaRTy.
Developers of the 'html2fpdf' lib used for this hack.

Jacqieline of e-Dot.nl for creating
icons for this hack.

KirbyDE for his code modification for this hack.
Now it doesn't need code modifications anymore! :)

Details:

1 plugin
1 new file
1 new phrase
1 template modification
7 new templates

Installation:

See install.txt in the zip package

Notes:

Becarefull with editting the pdf templates!
Due to limitations of the html2fpdf lib, the templates where kept a simple as possible to create a working an nice pdf.

Also this is my first 'big' hack, so if i've made a mistake somewhere, i'm sorry. Please report it so I can fix it.

This hack is currently in beta stage...


Don't forget to hit the 'Install' button!

Chris M 07-03-2005 03:10 PM

Nice - Installing :)

Satan

Chris M 07-03-2005 03:24 PM

I think we are missing a few files :p

It's trying to point to pdfthread.php :)

Satan

Frenck 07-03-2005 03:26 PM

Oh my god, how stupid of me.

I've updated the zip file.

Chris M 07-03-2005 03:27 PM

Happens to the best of us ;)

Installed, very nice, working well :)

Satan

Chris M 07-03-2005 03:34 PM

Just a thought - I copied the image from the attach folder over to the buttons folder, and it looks ok :)

Satan

Frenck 07-03-2005 03:38 PM

It looks ok, but it is a little to small.

Just like the image I've put in the zip.

The pulldown menu is not completely straight.

uae 07-03-2005 05:26 PM

this is cool, I like it.
Thanks for sharing :)

Installed here...

tamarian 07-03-2005 07:35 PM

Great idea. :up:

What format does it print? Regular thread view, custom view, or "print thread" view?

Does it have a limit on thread size in the number of posts?

Frenck 07-03-2005 07:37 PM

It looks very much like the printthread view.

Currently it adds ALL posts of a thread into one pdf.

Kirk Y 07-03-2005 08:00 PM

This is a great idea. I don't think I need it on my board... but a great idea none the less.

Xenon 07-03-2005 09:11 PM

absolutelly a great idea.

i know a lot of boards i would love to see this installed.

iSpanish 07-03-2005 09:47 PM

Nice work bro

Install& i like it
CooooL

amykhar 07-03-2005 09:47 PM

can't this be made as a plugin? ;)

Frenck 07-04-2005 06:59 AM

LOL @ amykhar :) Is this called revence? :P

No it can't, it needs a modification to class_bbcode.php.
For the PDF generation it needs different template for
the quote, php, html & code block.

There are no hooks at that locations :(


[edit]

Although, it could be done WITHOUT the class_bbcode.php modification!

In that case you need to replace your templates of bbcode_html_printthread, bbcode_code_printthread, bbcode_php_printthread & bbcode_html_printthread with the ones of the PDF thread.

than open pdfthread.php in your favorite editor and search for:

Code:

$bbcode_parser->pdfthread = true;
replace it with:
Code:

$bbcode_parser->printthread = true;
There it is, a download as pdf without any code modifications...
(Only the look of your printthread will change and might need some further template modifications)

xware 07-04-2005 09:40 AM

where is the gb2312.map? I need it.

Frenck 07-04-2005 09:49 AM

That is from the html2fpdf lib.
I have included the complete html2fpdf lib with this zip package.

It looks like you use a non standard font or a font that is not included with the package.

Maybe you could check out the fpdf libary (used for the html2fpdf lib).
I could be in that package.

http://www.fpdf.org/

chanhlinh 07-05-2005 10:13 AM

It's work okay, but i download without font Unicode-8 (I'm Vietnamese) :) Please help me.

Thanks in advanced
Chanhlinh
www.quantri.com.vn

Frenck 07-05-2005 11:20 AM

If you need special font, than visit fpdf.org, there you will find a manual/scripts about convering font for use with this scripts.

chanhlinh 07-05-2005 11:33 AM

Thanks alot Frenck,

You are so kind.

Best regards!
chanhlinh

Andreas 07-05-2005 02:52 PM

Hmm ... it can be done without editing class_bbcode.php and without having to modify the printthread Templates :)

In pdfthread.php
FIND
PHP Code:

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// ####################################################################### 

BELOW that ADD
PHP Code:

$vbulletin->templatecache['bbcode_php'] = $vbulletin->templatecache['bbcode_php_pdfthread'];
$vbulletin->templatecache['bbcode_html'] = $vbulletin->templatecache['bbcode_html_pdfthread'];
$vbulletin->templatecache['bbcode_quote'] = $vbulletin->templatecache['bbcode_quote_pdfthread'];
$vbulletin->templatecache['bbcode_code'] = $vbulletin->templatecache['bbcode_code_pdfthread']; 

Done :)

Marco van Herwaarden 07-05-2005 03:14 PM

Quote:

Originally Posted by KirbyDE
Hmm ... it can be done without editing class_bbcode.php and without having to modify the printthread Templates :)

In pdfthread.php
FIND
PHP Code:

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// ####################################################################### 

BELOW that ADD
PHP Code:

$vbulletin->templatecache['bbcode_php'] = $vbulletin->templatecache['bbcode_php_pdfthread'];
$vbulletin->templatecache['bbcode_html'] = $vbulletin->templatecache['bbcode_html_pdfthread'];
$vbulletin->templatecache['bbcode_quote'] = $vbulletin->templatecache['bbcode_quote_pdfthread'];
$vbulletin->templatecache['bbcode_code'] = $vbulletin->templatecache['bbcode_code_pdfthread']; 

Done :)

There is no pdfthread.php anymore Kirby. You just removed it. :D

Andreas 07-05-2005 03:18 PM

I know. But when it comes back the change can be applied ;)

Frenck 07-05-2005 05:39 PM

Version 1.10 out!

Thx to KirbyDE this hack now can be marked as an extension!

jesus likes pie 07-06-2005 05:31 PM

1st of all I dont get the image to display, and 2nd, when i click it, the pdf is blank...

lazorde 07-06-2005 05:52 PM

tahnxxx for hack

bat he dont support arabic

voclain 07-08-2005 01:58 PM

I realize this is probably a super silly question....being I'm surfing the 3.5 version area....but....I'll ask anyway....will this work on verson 3.0.3????

Kirk

ThorstenA 07-08-2005 02:09 PM

Very great that you do not need any code modifications now.

Is there an option to set a variable in template to begin a new (pdf-) site? I would like to have a new pdf-page after every posting (#1 is on page 1, #2 is on page 2, #3 is page 3 ...) How can I do that?

red_baron2000 07-09-2005 12:49 AM

great hack indeed thanks. just a question..can some forums be excluded ? i do not want my users print all threads posted on board..i mean can this be shown as active on some forum and others not ? or maybe set for some users groups and others not? thank you again.

ThorstenA 07-11-2005 07:12 AM

Quote:

Originally Posted by red_baron2000
great hack indeed thanks. just a question..can some forums be excluded ? i do not want my users print all threads posted on board..i mean can this be shown as active on some forum and others not ? or maybe set for some users groups and others not? thank you again.

Just put in a conditional for forums in the showthread template.

dayblue 07-29-2005 04:26 AM

Hmm... I'm on vb3.5 RC1 and it's rejecting the xml file. Had to add it in manually. Everythings working fine though now.

Code:

if (THIS_SCRIPT=='pdfthread' && !PDFASHTML) {
  $pdf = new html2fpdf();
  $pdf->AddPage();
  $pdf->WriteHTML($output);

  header("Content-type: application/pdf");
  header("Content-Disposition: attachment; filename=thread-".$threadid.".pdf");

  $pdf->Output();
  exit();
}


Boofo 07-29-2005 04:41 AM

Quote:

Originally Posted by dayblue
Hmm... I'm on vb3.5 RC1 and it's rejecting the xml file. Had to add it in manually. Everythings working fine though now.

Code:

if (THIS_SCRIPT=='pdfthread' && !PDFASHTML) {
$pdf = new html2fpdf();
$pdf->AddPage();
$pdf->WriteHTML($output);
 
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=thread-".$threadid.".pdf");
 
$pdf->Output();
exit();
}


What did you change? ;)

dayblue 07-29-2005 04:47 AM

Well, the odd thing is I didn't change anything. Just took the stuff between the CDATA tags and pasted that in manually instead of importing an XML file. The XML import didn't work for some reason.

Boofo 07-29-2005 05:16 AM

It worked fine for me on RC 1. Strange.

Although the file name is always pdfthread with no threadid number after it.

dbembibre 08-06-2005 12:42 AM

Installed on RC2 work fine
Thanks a lot for this great hack

Boofo 08-06-2005 11:54 AM

Has anyone else run into the problem with it not putting the thread id number in the downloadable file name?

ajpritch 08-31-2005 06:10 AM

I have it working fine but when I click the drop down the pdf icon is missing. I coppied it over to the images/buttons folder as pdf.gif. Any Ideas?

chikkoo 09-05-2005 12:25 PM

I installed it but it is not giving the output properly as I am using a Unicode Font.

I went to www.fpdf.org, but I don't understand the procedure to make a font file. Can someone explain me step by step, how to do it?

nexialys 09-05-2005 12:39 PM

i've put the title instead of the threadid in the file name:
PHP Code:

    header("Content-Disposition: attachment; filename=thread-".str_replace(' ''_'$threadinfo['title']).".pdf"); 


Princeton 09-05-2005 01:03 PM

GREAT extenstion! :up:


All times are GMT. The time now is 04:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01399 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete