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 Forum Thread To Your Computer (vB 3.5.x) (https://vborg.vbsupport.ru/showthread.php?t=97217)

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

Quote:

Originally Posted by Psionic Vision
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.

Quote:

Originally Posted by Psionic Vision
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....3&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:
Code:

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

Quote:

Originally Posted by Aylwin
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:
Code:

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

Quote:

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 :)

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:

PHP Code:

$filename str_replace(' ''_'$filename); 

ADD UNDERNEATH:

PHP Code:

  // -----------------------------------------------------------------------------------------------------------------------------------------------
  // 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.


All times are GMT. The time now is 12:28 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.01033 seconds
  • Memory Usage 1,771KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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