vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Download Thread (https://vborg.vbsupport.ru/showthread.php?t=40981)

Logician 07-11-2002 10:00 PM

Download Thread
 
This hacks allows you to download a thread into your computer (desktop etc.) as a text file with one click.

The hack adds a "DOWNLOAD THREAD" link next to "Subscribe to this Thread" and when clicked entire thread is downloaded. (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. For example wouldnt it be nice to download and search a keyword in the text file in, say, Lesene's Store Hack Thread which has 921 replies? :p

Anyway the hack works with ALL vb versions and very easy to apply (2 steps/ 2 minutes..). If you install it, please click INSTALL, thank you.

Note : Download function is tested with IE v.6.0 and Netscape v.4.7 and it's working in both browsers. I dont know other browsers or older versions though

Note : For Italian Translation (and instructions) of the hack, see this post. Thanks to Geminy.


UPDATE AT 13.OCTOBER.2002 : Due to a small bug, I updated the hack code. If you are downloading now, the code you dowload is already updated. If you installed the hack prior to 13.October.2002, you may want to reapply STEP 2, if you encounter problems.

Enjoy the hack. :)
Logician

Logician 07-12-2002 04:13 PM

Screenshot

Link14716 07-12-2002 04:15 PM

Looks good. I will probably install this :D

Link14716 07-12-2002 04:21 PM

Installed and working great. Thanks :)

BigJohnson 07-12-2002 05:11 PM

Works great. Very nice hack. That would be cool if this hack needed no support hehehe. It works for everyone hehe. Great hack. I love the layout of the TXT file also. Great work indeed.

Xenon 07-12-2002 09:19 PM

think i will install it, good work pal!!

just a question: does it have any problems on large threads like servertimeouts or something?
do you know anything like that, or that a posters username disappears (as happens sometimes in my archiv hack, and i don't know why ;))

TECK 07-12-2002 09:36 PM

excellent work logician. :)
congrats on this great idea. i will use it on my tutorials forum.

Logician 07-12-2002 10:30 PM

Quote:

Originally posted by Xenon
just a question: does it have any problems on large threads like servertimeouts or something?

I didnt test with very long threads so I dont know what would happen if it is applied to Store Hack thread for instance..
But I really dont think it would be a problem, because even a long thread should not take more than 30 seconds to compile. Depends on your MYSQL performance too of course.

Quote:

do you know anything like that, or that a posters username disappears (as happens sometimes in my archiv hack, and i don't know why ;))
yeah I know! Same happened to me in this hack. I didnt bother to trace its reason but I applied a LEFT JOIN in my query to get the username from user table, instead of using the username in thread table. Strange but thread table usernames sometimes disappear as you mentioned.. Anyway take a look at my query and you can adopt the same method in your hack too. It obviously works..

Logician 07-12-2002 10:34 PM

Quote:

Originally posted by Nakkid
congrats on this great idea.
Thx but I cant say its my idea. I'm highly inspired by Bira's "Download PMs to a file" hack (great hack BTW)..

In fact I requested this hack in that thread months ago, but nobody coded it, so I did.. ;)

Boofo 07-13-2002 12:46 AM

Another excellent hack, sir. Installed without a hitch and works great! There is one thing, though. Is there a way to parse out the font color codes and other codes like that before it writes the message to a text file? :)

PET 07-13-2002 06:40 AM

yea ! This is very very cool & usefull !

squawell 07-13-2002 08:45 AM

what a wonderful hack u did Logician......:D:D:D

[high]* squawell like this one too.... installed.....[/high]

ULTIMATESSJ 07-13-2002 11:26 AM

great hack, nice work

/me clicks install

Logician 07-13-2002 02:45 PM

Quote:

Originally posted by Boofo
Is there a way to parse out the font color codes and other codes like that before it writes the message to a text file? :)
it can be possible but it requires some work. I cant promise it done soon, but I can try to add the feature when I'm more available.. :)

Boofo 07-13-2002 02:48 PM

Sounds good to me. :) Let me know if and when you need some testing done on it. :)

Quote:

Originally posted by Logician

it can be possible but it requires some work. I cant promise it done soon, but I can try to add the feature when I'm more available.. :)


Ryangel 07-13-2002 03:24 PM

hmm not sure if there is something wrong but, the savefile name looks weird.
See attachment.

Logician 07-13-2002 03:31 PM

Quote:

Originally posted by Ryangel
hmm not sure if there is something wrong but, the savefile name looks weird.
See attachment.

You should be able to download/save the thread anyway, could you? BTW what was the exact thread name you were trying to DL?

Ryangel 07-13-2002 03:35 PM

Yup . It viewed fine :)

Threadname was : "[News] 4 Jul: Minister's Speech at ITE East (Macpherson)'s Opening "

So maybe that was a problem .

Logician 07-13-2002 03:44 PM

I tried parse out special characters from thread title so that file name will be nice but some may be missed. In your example it was : char. It's no big deal but if it bothers you, there are 2 possible solutions:

1- edit line:

$filename=preg_replace("/[.!\\\?\^\'\"\$]/", '', $thread[title]);


and replace it as:

$filename=preg_replace("/[.!:\\\?\^\'\"\$]/", '', $thread[title]);

(This will parse out : char too)

2- If you are not interested in naming the file name after thread title, replace the same line as:

PHP Code:

$filename='Thread'.$threadid

After the change all file names will be like "Thread1244.txt" and no more file name bugs. However I personally prefer to use thread title as file name, it is much better IMO..

Your call :)

Ryangel 07-13-2002 03:52 PM

I followed your first soloution .

Worked out well :)

Thanks for the hack!

Boofo 07-13-2002 06:39 PM

The original line in your text file had an extra \ in it (right before the '). You didn't add that to what you told him to replace. Is it supposed to be there? (It isn't showing in here for some reason)

[disable]$filename=preg_replace("/[.!:\\\?\^\'\"\$]/", '', $thread[title]);[/disable]

Quote:

Originally posted by Logician
I tried parse out special characters from thread title so that file name will be nice but some may be missed. In your example it was : char. It's no big deal but if it bothers you, there are 2 possible solutions:

1- edit line:

$filename=preg_replace("/[.!\\\?\^\'\"\$]/", '', $thread[title]);


and replace it as:

$filename=preg_replace("/[.!:\\\?\^\'\"\$]/", '', $thread[title]);

(This will parse out : char too)



Logician 07-13-2002 08:10 PM

Quote:

Originally posted by Boofo
The original line in your text file had an extra \ in it (right before the '). You didn't add that to what you told him to replace. Is it supposed to be there? (It isn't showing in here for some reason)

parsing in board playing tricks on us.. Just add a : in my original code right before ! char

Technical info: This line removes some special chars from thread title when forming file name and by adding : char we make it remove that char too..

Boofo 07-13-2002 08:14 PM

Ok, I just wanted to make sure in case the extra \ was needed. :)

lordnet 07-13-2002 08:16 PM

Great hack ;)

my best wish...

LORD :)

Reverend 07-13-2002 08:57 PM

Nice one Logician.
Works great. :cool:

Ryangel 07-13-2002 11:43 PM

Quote:

Originally posted by Boofo
The original line in your text file had an extra \ in it (right before the '). You didn't add that to what you told him to replace. Is it supposed to be there? (It isn't showing in here for some reason)

[disable]$filename=preg_replace("/[.!:\\\?\^\'\"\$]/", '', $thread[title]);[/disable]


Thanks for pointing that out !

*Goes to fix code*

Boofo 07-13-2002 11:57 PM

No problem. :)

Quote:

Originally posted by Ryangel


Thanks for pointing that out !

*Goes to fix code*


DWZ 07-15-2002 03:15 AM

Looks like a great idea, can someone post the format of the .txt file...

i.e. download a thread then paste it (or part of it) here in the [code] tag?

Thanks :)

Logician 07-15-2002 05:33 AM

Quote:

Originally posted by DWZ
can someone post the format of the .txt file...

sample downloaded thread.. here you go..

FleaBag 07-16-2002 11:02 PM

You uploaded the template instructions as a text file and hence vB.org is parsing the replacements. So everyone is leeching sortasc.gif from this site. ;) Besides that, great addition to my forums; working well on 2.2.6. Thanks. :)

Logician 07-17-2002 07:51 AM

Quote:

Originally posted by GamerForums
You uploaded the template instructions as a text file and hence vB.org is parsing the replacements. So everyone is leeching sortasc.gif from this site. ;)
corrected.. thx.. :)

jassim 07-21-2002 05:58 AM

i like thise hack tankX :glasses:

ripman 07-25-2002 11:57 AM

Good idea - I've instaled it :)

but there's a problem - i'm using iuso-8559-2 with polish chars and that causes problems in output .txt file (polish characters are printed badly)

Logician 07-25-2002 02:18 PM

Quote:

Originally posted by ripman
but there's a problem - i'm using iuso-8559-2 with polish chars and that causes problems in output .txt file (polish characters are printed badly)
Weird.. I also use a non-english ISO in my own board but I dont have any problems with non-english chars. Unfortunately I cant provide you with a solution for this but just give this a chance:

edit hack code, find:
PHP Code:

  header("Content-disposition: attachment;filename=".$filename.".txt"); 

After that add:
PHP Code:

  header("CHARSET=ISO-8559-2"); 

Actually this header is not for attachments, so I dont think it will work, but your wont lose anything by trying anyway..

ripman 07-25-2002 02:34 PM

Blah - still there's a bug :(

FleaBag 09-03-2002 03:32 PM

Works with 2.2.7. ;) Cheers!

chitown 09-12-2002 12:34 AM

i have installed this hack and when i click on download thread it opens another blank page and no pop up window to save.... what did i do wrong?

Logician 09-12-2002 05:47 AM

Quote:

Originally posted by chitown
i have installed this hack and when i click on download thread it opens another blank page and no pop up window to save.... what did i do wrong?
Which browser (and its version too) do you use? If you have any other browser (Netscape, IE, Opera), please check with that one too. Also try this: left click on the download thread link and choose open in new browser window. Does it still happen then?

chitown 09-12-2002 09:52 AM

<a href="http://www.cardtrix.com/forum/showthread.php3?threadid=321&action=download" target="_blank">http://www.cardtrix.com/forum/showth...ction=download</a>

IE6 that is the browser i am using and above is the link it is attempting to send me to.

chitown 09-14-2002 01:25 AM

still opening another blank window, can someone please help


All times are GMT. The time now is 05:18 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.01425 seconds
  • Memory Usage 1,828KB
  • 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
  • (3)bbcode_php_printable
  • (14)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