vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Download Forum Thread To Your Computer (Vb3.x) (https://vborg.vbsupport.ru/showthread.php?t=65536)

Logician 05-25-2004 10:00 PM

Download Forum Thread To Your Computer (Vb3.x)
 
This hacks allows you to download a forum thread into your computer (desktop etc.) as a text file with one click.

The hack adds a "DOWNLOAD THREAD" link inside Thread Tools pop-up and when clicked entire thread is downloaded to your computer. (See Screenshot)

It's useful when:
a) You want to archive and save the thread,
b) Want to read it offline,
c) It's a long thread and you want to browse it faster as a text file, use better searching features of your text editor.

The hack is tested with vB3.0.0 And vB 3.0.1, it is NOT tested with versions prior to 3.0.0. (vB2.x version is here). It is very easy to install. As a matter of fact it is an add-on, not a hack so you can install to your board without modifying any vb files. Just upload dt.php to your forum directory and make a easy change in showthread template and it is installed. Simple as that.

VERSION FOR VB 3.5 is released here:
https://vborg.vbsupport.ru/showthread.php?t=97217

If you install it, please click INSTALL, thank you.

Note : Download function is tested with IE v.6.0, Netscape v.4.7, Mozilla 1.2a and it's working fine in these browsers. I dont know other browsers or older versions though.
27.May.2004 Bug Fix : A small bug is fixed in file dt.php which effect users with prefixed tables in database.
29.May.2004 Bug Fix : A small bug in dt.php is fixed to cure post titles with special characters ("'?&) in it. Attached dt.php file is uptodate.
12.Dec.2004 Bug Fix : A small bug which causes soft deleted posts to be included in the downloaded text is fixed. Attached dt.php file is uptodate.


Note 1: If you want to use a different download thread image, see this post.
Note 2: If you want to save threads as .rtf, instead of .txt, see this post.


Enjoy the hack,
Logician

sabret00the 05-26-2004 08:02 AM

great work :D

Boofo 05-26-2004 10:09 AM

Sinan, Do I need to add the htmlspecialchar like I did in the vB2 version or will this automatically handle that? And thank you, sir. I have been waiting for this one. ;)

Erwin 05-26-2004 10:17 AM

The master has done it again. :) Good job.

mmw 05-26-2004 11:26 AM

Very nice :D
[high]* mmw clicks install[/high]

Phalynx 05-26-2004 11:35 AM

Great Tool!

colicab-d 05-26-2004 11:45 AM

Thnk you kindly :) quite ahandy wee addon :)

MrNase 05-26-2004 12:50 PM

Nice one :)

ashley53680 05-26-2004 12:54 PM

Ohhhh I cannot wait to install this!!!!!!

skinvb 05-26-2004 03:11 PM

wow .Its cool Mod.I will install it right now

SnowBot 05-26-2004 04:13 PM

great idea, nice hack
/me click install

Reeve of shinra 05-26-2004 05:29 PM

Very useful - especially for forums that have a writers area.

djohn 05-26-2004 06:20 PM

Does it work with multi page threads?

Logician 05-26-2004 06:22 PM

Quote:

Originally Posted by djohn
Does it work with multi page threads?

Yes of course. It is the whole point, right? :D

dndog 05-26-2004 08:15 PM

Logician, my forum tables have the prefix vB3_. Your hack assumes there is no prefix and can't find the post table. I sifted through the code but can't figure out what I need to change to fix this. What should I do?

Boofo 05-26-2004 08:46 PM

Quote:

Originally Posted by dndog
Logician, my forum tables have the prefix vB3_. Your hack assumes there is no prefix and can't find the post table. I sifted through the code but can't figure out what I need to change to fix this. What should I do?

Change this:

PHP Code:

 $post_db=$DB_site->query("SELECT p.dateline, p.title, p.pagetext, p.userid, user.username from post p LEFT JOIN user on user.userid=p.userid WHERE threadid=$threadid AND visible=1 ORDER BY dateline ASC"); 

To this:

PHP Code:

$post_db=$DB_site->query("SELECT p.dateline, p.title, p.pagetext, p.userid, user.username from " TABLE_PREFIX "post p AS post p LEFT JOIN " TABLE_PREFIX "user AS user on user.userid=p.userid WHERE threadid=$threadid AND visible=1 ORDER BY dateline ASC"); 


dndog 05-26-2004 09:34 PM

I now get this error

PHP Code:

Database error in vBulletin 3.0.1:

Invalid SQLSELECT p.datelinep.titlep.pagetextp.useriduser.username from vb3_post p AS post p LEFT JOIN vb3_user AS user on user.userid=p.userid WHERE threadid=AND visible=1 ORDER BY dateline ASC
mysql error
You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS post p LEFT JOIN vb3_user AS user on user.userid=p.userid WH

mysql error number: 1064 


Boofo 05-26-2004 09:45 PM

Quote:

Originally Posted by dndog
I now get this error

PHP Code:

Database error in vBulletin 3.0.1:
 
Invalid SQLSELECT p.datelinep.titlep.pagetextp.useriduser.username from vb3_post p AS post p LEFT JOIN vb3_user AS user on user.userid=p.userid WHERE threadid=AND visible=1 ORDER BY dateline ASC
mysql error
You have an error in your SQL syntaxCheck the manual that corresponds to your MySQL server version for the right syntax to use near 'AS post p LEFT JOIN vb3_user AS user on user.userid=p.userid WH
 
mysql error number: 1064 


I know. When I use that, I get the same error. Sorry about that. We will have to wait for Logician to telll us what to change it to, I guess.

It should have worked. Why it doesn't, I don't know. Again, sorry. ;)

dstruct2k 05-26-2004 10:29 PM

Here's a version that supports table prefixes. :)

Just replace the PHP file and you're on your way!

(Small grammar error fixed too. :p)

GamerJunk.net 05-27-2004 04:32 AM

Installed great!

ashley53680 05-27-2004 05:19 AM

Okay for some reason this isn't in my SHOWTHREAD template:

PHP Code:

<tr>
  <
td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/collapse_tcat_collapsed.gif" alt="$vbphrase[email_this_page]/> <a href="sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=$threadid">$vbphrase[email_this_page]</a></td>
 </
tr

And that means I don't know where to add the next one... lol Anyone know where I add these two things so that I may have a proper working board. lol Also what does the above code do? (I am wondering why I didn't have it on there....)

Thanks in advance!

Ashley

dstruct2k 05-27-2004 05:28 AM

Ashley:

Just search for "email_this_page" in the SHOWTHREAD template, and add the new code after the </tr> :)


I had the same problem, I think this template was updated in 3.0.1 and the phrasing isn't identical. :)

ashley53680 05-27-2004 05:40 AM

Thank you, that worked perfectly!!!!

**clicks install**

Logician 05-27-2004 05:42 AM

Quote:

Originally Posted by dndog
Logician, my forum tables have the prefix vB3_. Your hack assumes there is no prefix and can't find the post table. I sifted through the code but can't figure out what I need to change to fix this. What should I do?

Sorry about it. I've just updated dt.php in the first post to support prefixed table names. I also added there support for weird thread titles with '"&? etc.

Replace your dt.php with the new file and you'll be fine.

Boofo 05-27-2004 12:55 PM

Quote:

Originally Posted by Logician
Sorry about it. I've just updated dt.php in the first post to support prefixed table names. I also added there support for weird thread titles with '"&? etc.

Replace your dt.php with the new file and you'll be fine.

Did you get my pm on the filename and the quotes problem? ;)

Logician 05-27-2004 12:57 PM

Quote:

Originally Posted by Boofo
Did you get my pm on the filename and the quotes problem? ;)

yes ty.. update includes this fix too. ;)

Boofo 05-27-2004 01:22 PM

Quote:

Originally Posted by Logician
yes ty.. update includes this fix too. ;)

Just tried it. The filename defaults to dt for threads like that. ;)

You might want to unhtmlchars the post title too as it will look defunct on the first post. ;)

SteveK 05-27-2004 10:05 PM

Nice... Installed. I hope they add this to vb.com & vb.org!

I notice it doesn't include posts that are "hidden" as a result of the hack by Xenon "Staff can Post hidden Posts " located here: https://vborg.vbsupport.ru/showthread.php?t=64860

Any way to include these (if you have permission to view those hidden posts)?

Thanks,

Steve K.

pjdaley 05-28-2004 01:56 PM

im just wondering, i noticed it saves the txt file of the thread with the name of the thread.... is it posssible you can add your site's name in front of it so it'll be called VBulletin.org - Thread name.txt? anyone have any ideas?

gmarik 05-29-2004 09:29 AM

great solution for the old problem...

Intex 05-29-2004 09:33 AM

Nice hack Logician. Works great :cool:.

[high]* Intex clicks INSTALL[/high]

Logician 05-29-2004 02:43 PM

Quote:

Originally Posted by pjdaley
im just wondering, i noticed it saves the txt file of the thread with the name of the thread.... is it posssible you can add your site's name in front of it so it'll be called VBulletin.org - Thread name.txt? anyone have any ideas?

in dt.php, find
PHP Code:

 if (strlen(trim($filename))<2) {$filename='Thread'.$threadid;} 

after that add:
PHP Code:

$filename='ANY TEXT YOU LIKE HERE - '.$filename


Logician 05-29-2004 02:48 PM

I fixed a small bug to clean certain weird characters from post titles. You can overwrite your dt.php with the new dt.php (attached in the first post of the thread) to use the new version. Thanks for Boofo for pointing it out.

Logician 05-29-2004 02:55 PM

Quote:

Originally Posted by SteveK
Nice... Installed. I hope they add this to vb.com & vb.org!

I notice it doesn't include posts that are "hidden" as a result of the hack by Xenon "Staff can Post hidden Posts " located here: https://vborg.vbsupport.ru/showthread.php?t=64860

Any way to include these (if you have permission to view those hidden posts)?

Give it a shot but I haven't tested:

find:
PHP Code:

 $i=1

after that add :
PHP Code:

if (in_array($bbuserinfo['usergroupid'], array(567))) {$secret_post=1;$visiblequery='';} else {$secret_post=0;$visiblequery=' AND visible=1 ';} 

find:
PHP Code:

p.titlep.pagetextp.userid

replace it as:
PHP Code:

p.titlep.pagetextp.userid,p.visible

Find
PHP Code:

AND visible=

replace it as

PHP Code:

$visiblequery 

find:
PHP Code:

print ("[Post $i]\r\n"); 

replace it as
PHP Code:

if ($post[visible]==0) {$visibletext 'HIDDEN TEXT!!!';} else {unset($visibletext);}
print (
"[Post $i$visibletext\r\n"); 


ashley53680 05-29-2004 03:02 PM

Quote:

Originally Posted by Logician
in dt.php, find
PHP Code:

 if (strlen(trim($filename))<2) {$filename='Thread'.$threadid;} 

after that add:
PHP Code:

$filename='ANY TEXT YOU LIKE HERE - '.$filename


I can't find this in my dt.php file? :ermm:

Jujimufu 05-29-2004 04:41 PM

PERFECT TIMING! It's as if you met the very request I made a week or so ago. I'll install it once my website comes back online. Dude, Logician rules!

Logician 05-29-2004 09:05 PM

Quote:

Originally Posted by ashley53680
I can't find this in my dt.php file? :ermm:

Check around line 100. And please remember to use the latest dt.php if you don't already.

ashley53680 05-30-2004 01:54 AM

Okay I guess I didn't check that! :blush: Thanks!

Boofo 05-30-2004 03:07 AM

The hidden posts addition to this hack doesn't work without the following change:

This:

PHP Code:

if (in_array($usergroupid, array(567))) {$secret_post=1;$visiblequery='';} else {$secret_post=0;$visiblequery=' AND visible=1 ';} 

needs to be changed to this:

PHP Code:

if (in_array($bbuserinfo['usergroupid'], array(567))) {$secret_post=1;$visiblequery='';} else {$secret_post=0;$visiblequery=' AND visible=1 ';} 

The $usergroupid needs to be $bbuserinfo['usergroupid']. ;)

Logician 05-30-2004 07:18 AM

Quote:

Originally Posted by Boofo
The hidden posts addition to this hack doesn't work without the following change:

You are right Bob. I've updated my post too. TY!


All times are GMT. The time now is 04:47 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.01445 seconds
  • Memory Usage 1,869KB
  • 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
  • (19)bbcode_php_printable
  • (12)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