Announcement

Collapse
No announcement yet.

write active topics to a text file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • write active topics to a text file

    Hi,
    I've just implemented an active topics hack that uses vB's template parsing with a couple of new templates. However, I'd like to change the way it functions so that it simply writes its contents to a text file, for low overhead considerations.
    Is there any easy way to take a PHP script and make it export the results of it to a text file?

  • #2
    now content is gzipped

    I figured out how to write this to a text file using the object buffer. However, vB gzips the output of a template, so my textfile is full of gzipped content. When I try to uncompress it using gzuncompress($str) it simply creates a blank file.
    Here's what I've done.
    Code:
    ob_start();
    evaling a bunch of templates
    $content=ob_get_contents();
    $uncompressed_content=gzuncompress($content);
    ob_end_clean(); 
    
    	$fp = fopen("$Active_News_File_Name", "w");
    	fwrite($fp, $content_compressed);
    	fclose($fp);
    When I look at the contents of the output text file, it's blank. If I don't uncompress it before writing it to a file, the file is filled with compressed garbage when I include it...
    Any help is greatly appreciated!

    note to mod: please feel free to move this to the php coding forum.

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X