ok im using yabbse for an expample
$af = fopen("data.ya","rb");
while(!feof($af)) {
$data = explode('|^|', chop(fgets($af, 4086)));
if(!isset($data[1])){ $data[1] = ''; }
$filename = $directory."/".$data[1];
if($data[0] == "dir" && !file_exists($filename) && $data[1] != ".") {
mkdir($filename, 0777);
chmod($filename, 0777);
}
if($data[0] == "file") {
if(file_exists($filename) && filemtime($filename) >= $data[3] && !isset($_POST['overwrite']))
echo "Skipping $filename because it's a newer version or a version of the same age<br />\n";
else {
$buffer = fread($af, $data[2]);
$fp = fopen($filename, "wb");
fputs($fp, $buffer, $data[2]);
fclose($fp);
chmod($filename, 0666);
touch($filename, $data[3]);
//echo system("chown $filename $chownuser");
echo "Wrote $filename ...<br />\n";
}
}
}
fclose($af);
that spilts the files apart and makes them.
data.ya contains:
file||help.php||1613||1028666456
<?php
/**************************************************************************/
/ Help.php /
/***********************************************************************/
/ YaBB: Yet another Bulletin Board /
/ Open-Source Project started by Zef Hemel (zef@zefnet.com) /
/ Software Version: YaBB SE /
/ ========================================================================= /
/ Software Distributed by: http://www.yabb.info /
/ Support, News, Updates at: http://www.yabb.info/community /
/ http://yabb.xnull.com/community /
/ ========================================================================= /
/ Copyright (c) 2001-2002 Lewis Media - All Rights Reserved /
/ Software by: The YaBB Development Team /
/***********************************************************************/
/ This file gives admins some help in the admin center /
/**************************************************************************/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> YaBBSE Admin Help </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE>
<TR>
<TD>
<font face="verdana, serif" size="2">
<?
include("helpadmin.help");
echo $helptxt[$help];
?>
</font>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
you will notice this:
file||help.php||1613||1028666456
this contains the data of (in order) the file type in this case its a "file" it could also be dir which would make a directory which would be "dir||YaBBImages" for example
the next part (seperated by "||") is the file name after that these the file size now these to ways you can get this just buy getting the original file and seeing how big it is using filesize() or just by checking on your computer its in bytes and the last bit is the creation date this can be left alone.
also you keep adding things like the example about to data.ya there is no limit tothe number of files inside you can also store images