View Full Version : Download Forum Thread To Your Computer (vB 3.5.x)
Logician
09-29-2005, 10:00 PM
Here is the vb 3.5.x version of my Download Forum Thread To Your Computer hack. 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 (https://vborg.vbsupport.ru/attachment.php?attachmentid=34972))
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 works with 3.5.x, 3.6.x, 3.7.x, 3.8.x (for vb 4.x, 3.0.x and 2.x versions see my profile.)
It is very easy to install. You can install it to your board without modifying any vb files.
If you install it, please click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=97217), thank you.
Hacks of Hack:
* French Translation (https://vborg.vbsupport.ru/showpost.php?p=782733&postcount=8)
* Version that works with Russian Alphabet (https://vborg.vbsupport.ru/showpost.php?p=828645&postcount=29)
* Download it as RTF instead of TXT (https://vborg.vbsupport.ru/showpost.php?p=828749&postcount=30).
Enjoy the hack,
Logician
Logician
09-30-2005, 12:10 PM
[Reserved for future use]....
thedvs
09-30-2005, 02:25 PM
awesome mod Logician many thanks
bigcurt
09-30-2005, 02:34 PM
Congrats on the beginning of your porting process logician :).
~Curt
thedvs
09-30-2005, 02:43 PM
Would it be possible to allow downloading of threads in specific forums only?
Logician
09-30-2005, 02:46 PM
Would it be possible to allow downloading of threads in specific forums only?
edit dt.php, find:
$threadinfo = &$thread;
after that add:
$allowed_forums = array('1','2');
if (is_array($allowed_forums) AND !in_array($threadinfo['forumid'], $allowed_forums))
{
print_no_permission();
}
Now it allows downloading only in forum 1 and 2.
Edit $allowed_forums = array('1','2'); like to add more forums to allow
thedvs
09-30-2005, 02:52 PM
oh manga you are a star, many thanks
cclaerhout
09-30-2005, 03:43 PM
Works great ! Thank you.
And here's a small french translation.
dieselpowered
09-30-2005, 03:44 PM
Works great....
**runs off and click install**
Odysseus
09-30-2005, 04:09 PM
[Reserved for future use]....
Thanks for sharing!
* clicks install
XtremeOffroad
09-30-2005, 05:35 PM
Thank you
Clicks Install
Vindicare
10-01-2005, 09:47 AM
Very useful hack. Thanks (*install*)
PS: I replaced the standard DL-Pic with this one, and changed the phrase to "Download TXT Version" (In analogy to my "Download PDF Version"-Menu-Item).
cclaerhout
10-02-2005, 02:00 PM
Very useful hack. Thanks (*install*)
PS: I replaced the standard DL-Pic with this one, and changed the phrase to "Download TXT Version" (In analogy to my "Download PDF Version"-Menu-Item).
My members report me that they were characters problems (accent)
IE :
On n'arrête -> On n'arr?te
à s'afficher -> ? s'afficher
fonctionnalités -> fonctionnalit?s
(...)
How can i solve it please ?
dieselpowered
10-05-2005, 04:06 AM
This may be something very trivial, however, when you pull down the menu you will notice that the Download Thread is not lined up with the others.
Can this be fixed?
Logician
10-05-2005, 06:18 AM
This may be something very trivial, however, when you pull down the menu you will notice that the Download Thread is not lined up with the others.
Can this be fixed?
It happens because the icon of the it is slightly smaller than the other icons in the menu. Try adding "hspace="4" to the IMG like :
<img class="inlineimg" src="$stylevar[imgdir_button]/sortasc.gif" alt="$vbphrase[DownloadThisThread]" hspace="4"/>
Or you can use a larger image there.
cclaerhout
10-05-2005, 08:18 AM
Characters problem corrected.
-> solution : install the iconv module (or any one of iconv, GNU recode or mbstring) in php.
Thanks to Drupal ;)
mixylplik3
10-12-2005, 03:16 AM
This is a great hack, however, I want to limit its use to certain usergroups. Using the following, I have been unable to do so:
<if condition="$post[usergroupid]==6">
<tr>
<td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/sortasc.gif" alt="$vbphrase[DownloadThisThread]" /> <a href="dt.php?$session[sessionurl]t=$threadid">$vbphrase[DownloadThisThread]</a></td>
</tr> </if>
Anyone else doing something similar? If so, what did you do?
Logician
10-12-2005, 05:52 AM
This is a great hack, however, I want to limit its use to certain usergroups. Using the following, I have been unable to do so:
<if condition="$post[usergroupid]==6">
<tr>
<td class="vbmenu_option"><img class="inlineimg" src="$stylevar[imgdir_button]/sortasc.gif" alt="$vbphrase[DownloadThisThread]" /> <a href="dt.php?$session[sessionurl]t=$threadid">$vbphrase[DownloadThisThread]</a></td>
</tr> </if>
Anyone else doing something similar? If so, what did you do?
What you do only makes its link visible or unvisible to the thread reader. For this use:
<if condition="$bbuserinfo[usergroupid]==6">
</if>
But if you like to restrict it more strongly, edit dt.php you uploaded find this line:
//$unallowed_downloaders = array(1);
after that (as a new line!),add this
if ($vbulletin->userinfo['usergroupid']!=6)
{
print_no_permission();
}
mixylplik3
10-12-2005, 01:25 PM
Thank you. :cool:
bing11
10-12-2005, 02:45 PM
excellent hack
but cannot show the thread name in download Txt file name in my web.
I use utf-8 chinese.
Could you help me?
HappyPike
11-12-2005, 03:14 PM
Thanks, Logician. Just installed it at my members' request!
akanevsky
11-23-2005, 01:16 AM
Great, but two things are not:
1. (major) this hack does not go well with any languages other than english
2. (minor) the graphical icon in the menu is smaller that all the other icons, and it is visible - and irritating - from the first glance
Logician
11-23-2005, 06:05 AM
1. (major) this hack does not go well with any languages other than english
I use it in a Turkish board and it works fine but I understand if it does not work in an other language. Unfortunately I am not able to test it with other languages.
2. (minor) the graphical icon in the menu is smaller that all the other icons,
and it is visible - and irritating - from the first glance
Changing it is easy:
https://vborg.vbsupport.ru/showpost.php?p=783303&postcount=13
Aylwin
11-23-2005, 09:12 AM
I finally upgraded to 3.5! Thanks for making this excellent hack available!
One thing I noticed though, the following line in dt.php doesn't seem to work:
print ("$vbphrase[DT_DownloadedFrom]\r\n\r\n"); In other words, the text file ends after the last post. The footer is missing. Any idea why?
Logician
11-23-2005, 09:46 AM
I finally upgraded to 3.5! Thanks for making this excellent hack available!
One thing I noticed though, the following line in dt.php doesn't seem to work:
print ("$vbphrase[DT_DownloadedFrom]\r\n\r\n"); In other words, the text file ends after the last post. The footer is missing. Any idea why?
Good catch! Here is the fix:
Create a new phrase (in Global Group) named: DT_DownloadedFrom (Case SENSITIVE!) with this content:
Downloaded from {1} ({2}) at {3}.
This should fix it. I'm about to update the hack zip either..
Aylwin
11-23-2005, 09:57 AM
Yep, that did it. Thanks!!!
akanevsky
11-23-2005, 11:30 AM
I use it in a Turkish board and it works fine but I understand if it does not work in an other language. Unfortunately I am not able to test it with other languages.
Aw.. Ok. Just FYI, for Russian, it gives out empty squares instead of letter. :( If I figure it out, I'll tell you what to fix :)
Changing it is easy:
https://vborg.vbsupport.ru/show...03&postcount=13
Duh... I'm a coder myself, so I do know that. I just thought that you might want to edit your package to fix the incongruency. ;)
akanevsky
11-23-2005, 12:14 PM
Ok, here goes the minimod that performs the conversion of Russian letters into appropriate English letters / letter combinations.
IN dt.php, FIND:
$filename = str_replace(' ', '_', $filename);
ADD UNDERNEATH:
// -----------------------------------------------------------------------------------------------------------------------------------------------
// Download Thread :: Russian Symbols Conversion Mod by Psionic Vision
// -----------------------------------------------------------------------------------------------------------------------------------------------
$preg_find = array
(
"/А/", "/Б/", "/В/", "/Г/", "/Д/", "/Е/", "/Ё/", "/Ж/", "/З/", "/И/", "/Й/", "/К/", "/Л/", "/М/", "/Н/", "/О/", "/П/", "/Р/", "/С/", "/Т/", "/У/", "/Ф/", "/Х/", "/Ц/", "/Ч/", "/Ш/", "/Щ/", "/Ъ/", "/Ы/", "/Ь/", "/Э/", "/Ю/", "/Я/",
"/а/", "/б/", "/в/", "/г/", "/д/", "/е/", "/ё/", "/ж/", "/з/", "/и/", "/й/", "/к/", "/л/", "/м/", "/н/", "/о/", "/п/", "/р/", "/с/", "/т/", "/у/", "/ф/", "/х/", "/ц/", "/ч/", "/ш/", "/щ/", "/ъ/", "/ы/", "/ь/", "/э/", "/ю/", "/я/"
);
$preg_replace = array
(
"A", "B", "V", "G", "D", "E", "Jo", "Zh", "Z", "I", "J", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "F", "H", "C", "Ch", "Sh", "Sh'", "'", "Y", "'", "Je", "Ju", "Ja",
"a", "b", "v", "g", "d", "e", "jo", "zh", "z", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "h", "c", "ch", "sh", "sh'", "'", "y", "'", "je", "ju", "ja"
);
$filename = preg_replace($preg_find, $preg_replace, $filename);
// -----------------------------------------------------------------------------------------------------------------------------------------------
// Download Thread :: Russian Symbols Conversion Mod by Psionic Vision
// -----------------------------------------------------------------------------------------------------------------------------------------------
Enjoy everyone :)
P.S. A few other things:
1) Is there any reason behind using application/octet-stream rather than text/plan?
2) Why not make a custom function printbr($text, $num_of_breaks = 1), that will remove the need of writing "\r\n" all the time? :)
Aylwin
11-23-2005, 02:26 PM
In case anyone is interested, I have a modified version of dt.php which downloads the thread in .rtf instead of .txt. It automatically converts bbcode for bold, italic and underline. This, imho, makes the downloaded document slightly better visually.
It's only for english though.
EDIT:
I've updated the attached file to convert bbcode for quoted text. You can also choose between Arial and Courier fonts by "switching" between lines 169 and 170. The font is Courier by default.
akanevsky
11-23-2005, 02:28 PM
That's a very nice way of output. My Russian modification will work with your file too, as it only has to do with the filename :)
Logician
11-23-2005, 03:52 PM
Thanks guys.. Linked your contributions in the first post.
Moparx
11-24-2005, 12:31 AM
Great hack.
Is there an easy way to separate quotes within the posts from the actual replies themselves? Right now you cannot distinguish between the two and it can be confusing. :(
Having the quotes in posts generate like below would make this hack near perfect :)
"Some Text" -- Poster or Poster wrote: "Some Text"
Aylwin
11-24-2005, 07:41 AM
Is there an easy way to separate quotes within the posts from the actual replies themselves? Right now you cannot distinguish between the two and it can be confusing. :(
Having the quotes in posts generate like below would make this hack near perfect :)
"Some Text" -- Poster or Poster wrote: "Some Text"This is something I would like to do too. I know how to do it in theory but I just don't have the skills to implement it. Basically, we need to do the following:
1) Search $post['postdate'] for (QUOTE=name)
2) Replace it with name wrote: "
3) Search $post['postdate'] for (/QUOTE)
4) Replace it with "
I don't know how to do 1) and 2) but I think 3) and 4) would be:
$post['pagetext'] = preg_replace("[\[\/QUOTE\]]", "\"", $post['pagetext']);Can anyone help with 1) and 2)?
EDIT:
Okay, I think I figured it out.
Find:
$post[pagetext] = strip_bbcode($post[pagetext]);Before this line, add:
$post['pagetext'] = preg_replace("[\[QUOTE=([a-zA-Z0-9_-]*)\]]", "Originally posted by \\1:\"", $post['pagetext']);
$post['pagetext'] = preg_replace("[\[\/QUOTE\]]", "\"", $post['pagetext']);At least I got something very close to this working on my rtf version.
croportal
11-28-2005, 05:22 PM
how can i set another picture for this hack, and where i can change phrase Download This Thread - i wont to set on croatian LAnguage
Logician
11-28-2005, 05:25 PM
how can i set another picture for this hack,
https://vborg.vbsupport.ru/showpost.php?p=783303&postcount=13
and where i can change phrase Download This Thread - i wont to set on croatian LAnguage
Admin Cp/Phrase Manager/Search In Phrases/search for "Download This Thread" in "Phrase Text"
croportal
11-28-2005, 05:36 PM
thanks a lot logician
OsMoSiS.it
12-08-2005, 02:41 PM
Okay, I think I figured it out.
Find:
$post[pagetext] = strip_bbcode($post[pagetext]);Before this line, add:
$post['pagetext'] = preg_replace("[\[QUOTE=([a-zA-Z0-9_-]*)\]]", "Originally posted by \\1:\"", $post['pagetext']);
$post['pagetext'] = preg_replace("[\[\/QUOTE\]]", "\"", $post['pagetext']);At least I got something very close to this working on my rtf version.
$post['pagetext'] = preg_replace("[\[QUOTE=(.*?)\]]", "Originally posted by \\1:\"", $post['pagetext']);
$post['pagetext'] = preg_replace("[\[\/QUOTE\]]", "\"", $post['pagetext']);
This works better, matches also names with spaces or symbols that previously broke page layout :)
* Installed with rtf hack :)
Eathanor
04-10-2006, 06:32 PM
Thank you
Clicks Install
Tralala
06-20-2006, 07:06 PM
Thanks for this!
tinjon
08-17-2006, 01:20 AM
does this work with vb 360? anybody adventerous tried it out?
please let me know. thanks.
to the author : i think its a great hack. could you please update for latest vb version?
aciurczak
08-17-2006, 02:00 PM
Works fine with 3.6.0.
jiffy
10-24-2006, 07:08 PM
Working fine on 3.6.2
RaZor Edge
11-02-2006, 09:56 PM
Great hack! It worked really fast even on thread with more than 1000 post! It even worked with a thread with more than 40 000 post!! :D
There was no problem even if the discussions of my board are in french.
jambo_1969
09-16-2007, 06:49 AM
Excellent product :D
Installed
valdet
11-30-2007, 07:55 AM
Does someone has this mod working on the latest vB 3.6.8 PL2?
mcharley94
12-01-2007, 10:47 PM
Does someone has this mod working on the latest vB 3.6.8 PL2?
Yes, as of just a few moments ago I do.
Installed, Great Job!
Boofo
03-08-2008, 08:42 PM
And it also works on 3.7.0 beta 6. ;)
maestrodamuz
03-30-2008, 01:23 PM
*installed*:D
Jase2
06-01-2008, 10:04 AM
This work with 3.7.1 -- anyone tested?
abrecher
08-15-2008, 09:39 PM
This mod has stopped working for long threads. I have a few threads that are around 75+ pages and it's only downloading around 25 pages.
Any ideas on how to get this working for longer threads please ?
Logician
08-16-2008, 08:28 AM
This mod has stopped working for long threads. I have a few threads that are around 75+ pages and it's only downloading around 25 pages.
Any ideas on how to get this working for longer threads please ?
I checked source code again and I can't see a reason why this would happen. And I don't have any thread that is as long that I can test. If you give me ftp/admin cp access to your board and url of such a thread there, I can try to debug. Through not sure if I can do anything because as far as I can see source code is fine so I'd suspect server etc. somehow. But I can check if you want to give it a shot.
MyraB
11-09-2008, 01:01 AM
This worked like a champ, and you are a genius Logician.
You also write very clear release notes and instructions.
Thank you!
Coleccromos
02-18-2009, 01:17 PM
doing in my downloads forum tabulation shows the texts without
Can I do this?
cclaerhout
08-03-2009, 07:59 AM
Works great on vB 3.8.3.
If you want to avoid to edit manually the showthread template, here's a new product file.
Thanks.
fattony69
12-27-2009, 07:20 PM
Does this work on the latest 3.8.X? I saw this for vBulletin 4 and here, but no 3.8.
Logician
12-27-2009, 08:25 PM
Yes this 3.5.x version also works with 3.6.x, 3.7.x and 3.8.x
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.