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)

Ocean 09-07-2004 03:20 PM

I'm having a problem. When I try to download a Thread, the file name defaults to something like "dt.php?t=14".

The Thread Title has nothing strange about it - we're talking about titles like "Smilie Test".


Any ideas?

Logician 09-07-2004 05:15 PM

Quote:

Originally Posted by Ocean
I'm having a problem. When I try to download a Thread, the file name defaults to something like "dt.php?t=14".

The Thread Title has nothing strange about it - we're talking about titles like "Smilie Test".

Have you hacked dt.php? Is the lines around 100 is like that:
PHP Code:

  $thread[title] = unhtmlspecialchars($thread[title]);
  
$filename=preg_replace("/[.&!:\\\?\^\'\"\$]/"''$thread[title]);
  if (
strlen(trim($filename))<2) {$filename='Thread'.$threadid;}
  
header("Content-disposition: attachment;filename=".$filename.".txt"); 


Ocean 09-07-2004 08:43 PM

Quote:

Originally Posted by Logician

Have you hacked dt.php? Is the lines around 100 is like that:

I used the dt.php file as downloaded directly from here. The section you quoted is exactly what I have in my file.

Logician 09-08-2004 05:51 AM

Quote:

Originally Posted by Ocean
I used the dt.php file as downloaded directly from here. The section you quoted is exactly what I have in my file.

For debugging purposes try to change the section above like this:

PHP Code:

echo "thread[title] = $thread[title] <br><br>";
$thread[title] = unhtmlspecialchars($thread[title]); 
echo 
"unhtmlspecialchars (thread[title]) = $thread[title] <br><br>";
  
$filename=preg_replace("/[.&!:\\\?\^\'\"\$]/"''$thread[title]); 
echo 
"filename1= $filename <br><br>";
  if (
strlen(trim($filename))<2) {$filename='Thread'.$threadid;} 
echo 
"filename2= $filename <br><br>";
  
header("Content-disposition: attachment;filename=".$filename.".txt"); 

This will make the hack stop working correctly, but it is temporary debugging so after you make the change, try to dl a thread, note what screen has been posted, you can revert the lines back.

Also please mention your vb version and the browser you are using.

Ocean 09-08-2004 10:43 AM

Quote:

Originally Posted by Logician

For debugging purposes try to change the section above like this:

This will make the hack stop working correctly, but it is temporary debugging so after you make the change, try to dl a thread, note what screen has been posted, you can revert the lines back.

Also please mention your vb version and the browser you are using.

Replacing the code in question causes no discernable difference in behavior. When I click on "Download This Thread", I get the dialog box asking me if I want to save this file - and the name is still formatted the same way.

Incidentally, if it matters - when I hover over the "Download This Thread" link, the Status Bar shows this as the URL: http://www.mydomain.com/forums/dt.php?t=3


And to answer your last question, I'm using vB 3.0.3, and IE 6.

However, something interesting to note - when I try using this hack (either original or debug version) from a FireFox 0.9.3 browser, the file name shows up as the first word in the Title.

For example, if the Title Thread is "Here we go again", these are the results I get:


IE 6 Filename: "dt.php?t=3"

FireFox 0.9.3 filename: "Here"

Logician 09-09-2004 07:15 AM

Quote:

Originally Posted by Ocean
Replacing the code in question causes no discernable difference in behavior. When I click on "Download This Thread", I get the dialog box asking me if I want to save this file - and the name is still formatted the same way.

This does not sound right. When you add the lines, it is not possible for the hack to download the thread anymore. It should post some debugging lines into the screen then give "Warning: Cannot modify header information - headers already sent by.. " error and post the entire thread into the page. (I've tested and confirmed). Its not doing it makes me think that something is wrong with your installation like script's being run from another board (test board/localhost) or smt.

Alzeimer 09-09-2004 08:08 AM

Nice hack, installed.

vishalsachar 09-09-2004 11:18 PM

Superb --- an absolute must install

AbSoluTc 09-10-2004 01:53 PM

Just wanted to say thank you for an awsome hack and a simple install. Simple, yet one of those things that leaves you saying "how could I live without it". :)

Thank you and INSTALLED BABY!

Ig@r 09-10-2004 03:28 PM

That is "must have" hack! Thank you!


All times are GMT. The time now is 02:50 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.01338 seconds
  • Memory Usage 1,754KB
  • 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_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