The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#2
|
|||
|
|||
![]()
This is untested but it is the concept... I think it is was what you wanted.
Code:
<?php function add_data($StringToAdd){ $filename = 'test.txt'; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { if (!$handle = fopen($filename, 'r+')) { echo "Cannot open file ($filename)"; exit; } $contents = fread($handle, filesize($filename)); if(stripos("<item>")){ $chunk1 = substr($contents,0,stripos("<item>")); $chunk2 = substr($contents,stripos("<item>")); $contents = $chunk1.$StringToAdd.$chunk2; }else{ echo "Did not find <item>"; exit; } if (fwrite($handle, $contents) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($contents) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|