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)

ADiuM 11-18-2004 06:06 PM

Ok nevermind got it..

Open up dt.php

Find:

Code:

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

Code:

  $filename=preg_replace("[\s]", "_", $thread[title]);
That'll replace all spaces in the topic title to underscore's... you can replace the _ with whatever you want to seperate the words.

Works perfectly now in Firefox 1.0

breathwork 11-27-2004 07:32 PM

Verrrry Niiiiiice

Clicks install

Geoffrey

iSpanish 01-30-2005 11:50 PM

Nice and cooool hack

*Installed*

Polo 03-25-2005 02:10 PM

Thank you Logician, great hack... and also thanks to adium... that fixed the issue with firefox ;)

[high]* Polo clicks install[/high]

Aylwin 04-20-2005 04:43 AM

Great hack, Logician! Thanks! Thanks also to ADiuM for sorting out the Firefox issue!

By the way, does anyone else have text formatting problems? Regardless of whether it's txt or rtf, the files don't display exactly right with either Notepad or Word. With Wordpad, it looks fine though.

I'd like to generate a "proper" rtf file by adding some control codes but I need some help. How do I print "{\rtf" without the "\r" being misinterpretted? Also, is there any way to preg_replace or add characters after each line break or carriage return?

Here's sample of rtf code:
Code:

{\rtf
Hello!\par
I need some {\b help}.\par
}

That would generate:

Hello!
I need some help.

As you can see, we could also preg_replace the bbcode with rtf code to make nicer looking files. I'd like to do that too but I first need to figure how to get started with the basics.

Regards,
Aylwin

edit:
Figured it out. :)

Aylwin 04-20-2005 08:41 AM

Attached is my version of dt.php which produces an RTF formatted document. It also interprets the bbcode for bold, italic and underline.

Imperial Fritz 05-06-2005 04:29 AM

nice improvement, but doesn't work for cyrillic encoding :)

Logician 05-06-2005 04:48 AM

Quote:

Originally Posted by Imperial Fritz
nice improvement, but doesn't work for cyrillic encoding :)

It should.. What exactly happens?

Aylwin 05-06-2005 04:55 AM

Quote:

Originally Posted by Imperial Fritz
nice improvement, but doesn't work for cyrillic encoding :)

If you're referring to my version, have a look at line 108:
Code:

  print '{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}}{\f0 \fs22';
The character encoding is ansicpg1252. Try changing that to the correct version for cyrillic. Sorry, I can't check it right now but just reply if you need more help.

Aylwin

edit:
Perhaps you can try this:
Code:

  print '{\rtf1\ansi\ansicpg1251\uc1 \deff0\deflang1026\deflangfe1026{\fonttbl{\f0\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}}{\f0 \fs22';
1251 is for Windows 3.1 (Cyrillic) and default language 1026 is for Bulgarian

Imperial Fritz 05-07-2005 05:47 PM

um, weird, wordpad opens the file but shows only a few lines and those aren't cyrillic either, and word just says "wrong filename/part of file" even if I change the filename to a 1-2 latin characters.

well I'm ok with the pure text version so don't really sweat over it :)


All times are GMT. The time now is 09:48 AM.

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.01137 seconds
  • Memory Usage 1,740KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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