- Joined
- May 17, 2007
- Messages
- 2,741
- Reaction score
- 937
Hello,
For those of you looking for a Fetch script, and don't want to use the .ini (I don't know why you would take it into consideration), here is a script you can refer to:
To run this script, you need to do several things. You first, need to make sure you have the following tables:
application settings and fileinfo.
Please make sure in the application settings table, your Version Limit is correct, as that's what actually PATCHES the files, once the file information has been added to fileinfo.
A few tips to adding files to FILEINFO.
VERB: M - Modify, R - Replace, E - Execute
LocalFileOrDir: The file you're editing WITHIN YOUR GUNBOUND FOLDER
Remove File: Path to the file, which is BEING patched.
File Version: Change the version via IXFS, make sure that the LimitVersion in APPLICATION SETTINGS in the version of the latest file version!
FileSize: The file size should be in BYTES ONLY!
The database buildups are posted in the section (search it up), and you can't directly copy and paste the file, because you need to create a config.php file, and connect to your database. You can follow
If you use it, please click the "THANKS" button.
Regards, Aaron.
For those of you looking for a Fetch script, and don't want to use the .ini (I don't know why you would take it into consideration), here is a script you can refer to:
PHP:
<?php
header("Content-type: text/css; charset=UTF-8");
include("config.php");
$url = $_SERVER[QUERY_STRING]; //GET URL
$pos = strpos($url,"&");
$app = trim(substr($url,0,$pos)); //GET APP VERSION
$version = substr($url, $pos + 1); //GET VERSION OF CLIENT
if (!is_numeric($version) || !is_numeric($app)) { //VERSION OF APP AND CLIENT
echo "Syntax Error";
exit();
}
$query = mysql_query("SELECT * FROM applicationsetting where ApplicationId = $app");
$row = mysql_fetch_array($query);
if ($version == $row[VersionLimit]) { //No Updates -> Enter
exit();
}
if ($version <= $row[VersionLimit]) { //Update -> Update
echo "+$row[NoticeUrl]\n";
echo "=$row[BaseURL]\n";
$query = mysql_query("SELECT count(*) As files, sum(FileSize) As Size FROM fileinfo where FileVersion>$version");
$row2 = mysql_fetch_array($query);
echo "~$row2[files];$row2[Size];$row[VersionLimit]\n";
$query = mysql_query("SELECT * FROM fileinfo where FileVersion>$version order by FileVersion ASC");
while ($row3 = mysql_fetch_array($query)) {
echo "$row3[Verb];$row3[LocalFileOrDir];$row3[RemoteFile];$row3[FileVersion];$row3[FileSize]\n";
}
}
else { //Stay out.
echo "Syntax Error";
}
?>
application settings and fileinfo.
Please make sure in the application settings table, your Version Limit is correct, as that's what actually PATCHES the files, once the file information has been added to fileinfo.
A few tips to adding files to FILEINFO.
VERB: M - Modify, R - Replace, E - Execute
LocalFileOrDir: The file you're editing WITHIN YOUR GUNBOUND FOLDER
Remove File: Path to the file, which is BEING patched.
File Version: Change the version via IXFS, make sure that the LimitVersion in APPLICATION SETTINGS in the version of the latest file version!
FileSize: The file size should be in BYTES ONLY!
The database buildups are posted in the section (search it up), and you can't directly copy and paste the file, because you need to create a config.php file, and connect to your database. You can follow
You must be registered to see links
, as well as this
You must be registered to see links
to learn to connect to the database if you don't know how to!
Code:
SQL:
CREATE TABLE `applicationsetting` ( `AppId` int(11) NOT NULL DEFAULT '0', `FileUrl` varchar(255) NOT NULL, `NoticeUrl` varchar(255) NOT NULL, `VerLimit` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`AppId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `fileinfo` ( `AppId` int(11) NOT NULL DEFAULT '0', `Command` enum('M','R') NOT NULL DEFAULT 'M', `FileIns` varchar(52) NOT NULL DEFAULT '.\\', `FileDir` varchar(51) NOT NULL, `FileVer` int(11) NOT NULL DEFAULT '0', `FileSize` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`FileSize`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
If you use it, please click the "THANKS" button.
Regards, Aaron.
Last edited: