QA 3.0.18
Sep 29 2006, 12:53 AMPHPQA 3.0.18 is here!
This includes some minor bugfixes and a new tar import feature. Makes use of Sean's untar function (see in the script)
and I basically just wrote the adminCP area.
PHPQA service users need not worry about the below updates. They've already been applied and the service is running 3.0.18.
Updates:
You can easily get the below updates by overwriting your:
acp.php
Arcade.php
And making a /tars/ folder in your root. CHMOD it 777.
For manual updates see this post:
http://support.b1.jcink.com:81/index.php?s...indpost&p=13796
Files url: http://support.b1.jcink.com:81/index.php?showtopic=71
-Jcink
Sep 29 2006, 07:25 AM
UpGraded
Sep 29 2006, 02:01 PM
tar function is very nice
Sep 29 2006, 05:08 PM
The actual function itself? or the fact that PHPQA now allows you to untar files?
Thanks if you're talking about the actual function. <_<
Edit: Whoa Jcink, the way you currently have it coded... if someone has uploaded lets say... 50 games with the tar method, then everytime you go to the manager it runs 50+ queries? X_x The tar files never get deleted unless by manual deletion, and that adds up. Just my two cents.
Sep 29 2006, 06:34 PM
Edit: Never mind. Get away from this post!
-Masky
Sep 29 2006, 06:39 PM
What are you talking about? Download the file, it's fine. I can't find a trace of 3.0.17 in the download.
Sep 30 2006, 11:50 PM
UpGraded
Thanks
Oct 4 2006, 10:31 PM
Sorry it took so long.. But eh UpGraded and UpDated along with Copyright. lol XD hehe
Nov 4 2006, 06:24 PM
Manual Stuff:
1. Tar system. You can now upload IbProArcade tar files to a new folder called /tars/ and press "import" and it'll add it for you.
FIND (in acp.php) :
CODE <tr><td class='arcade1' align='left'><b><A href='Arcade.php?cparea=addgames&method=hotlink'>Remote Method</b><br></td><td class='arcade1'>Hotlink the game from a remote site.</td></tr>
ADD BELOW:
CODE <tr><td class='arcade1' align='left'><b><A href='Arcade.php?cparea=tar_import'>Tar Method</b><br></td><td class='arcade1'>Add games using IbProArcade tars.</td></tr>
THEN FIND:
CODE
<?php
} elseif($place == "skin") {
ADD ABOVE:
CODE } elseif($place == "tar_import") {
?>
<?php
$thecat="0";
if($_GET['cat']) $thecat=htmlspecialchars($_GET['cat']);
if($_GET['untar']) {
$tarfile=$_GET['untar'];
$tarfile_name=str_replace(".tar", "", $tarfile);
$tarfile_name=str_replace("game_", "", $tarfile_name);
// Untar file
// Function
// By SeanJ.Jcink.com
function untar($file,$to){
if (substr($to,-1)!="/") $to.="/";
$o=@fopen($file,"rb"); if (!$o) return false;
while(!feof($o)){
$d=unpack("a100fn/a24/a12size",fread($o,512));
if (!$d[fn]) break;
$d[size]=octdec(trim($d[size]));
$o2=@fopen($to.$d[fn],"w");if(!$o2) return false;
fwrite($o2,fread($o,$d[size]));
fclose($o2);
$t=512-($d[size]%512);
if ($t) fread($o,$t);
}
fclose($o);
return true;
}
// untar ALL the crap
untar("./tars/$tarfile", "./tars/");
@rename("./tars/$tarfile_name.swf","./arcade/$tarfile_name.swf");
@rename("./tars/{$tarfile_name}1.gif","./arcade/pics/{$tarfile_name}.gif");
@unlink("./tars/{$tarfile_name}2.gif");
if(file_exists("./tars/$tarfile_name.php")) {
require("./tars/$tarfile_name.php");
} else {
message("The tar file is corrupted or invalid, and the game cannot be added, sorry.");
}
@unlink("./tars/{$tarfile_name}.php");
$gamename = $config['gtitle'];
$about = htmlspecialchars($config['gwords'], ENT_QUOTES);
$gameheight = $config['gheight'];
$gamewidth = $config['gwidth'];
$idname = $config['gname'];
$idname = htmlspecialchars($idname, ENT_QUOTES);
$addedalready = mysql_fetch_array(run_query("SELECT * FROM phpqa_games WHERE gameid='$idname'"));
if (!$addedalready) {
if($idname !="") {
run_query("INSERT INTO phpqa_games (game,gameid,gameheight,gamewidth,about,gamecat,remotelink,Champion_name,Champion_score,times_played) VALUES ('$gamename','$idname','$gameheight','$gamewidth','$about','$thecat','$remoteurl','$champ','$champs','')");
}
} else {
}
}
?>
<div class='tableborder'><table width=100% cellpadding='4' cellspacing='1'><td width='60%' align='center' class='headertableblock' colspan='2'> Adding Game</td><tr>
<?php
if ($handle = opendir('./tars/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$tarfile_name=str_replace(".tar", "", $file);
$idname=str_replace("game_", "", $tarfile_name);
$addedalready = mysql_fetch_array(run_query("SELECT * FROM phpqa_games WHERE gameid='$idname'"));
?>
<tr><td class='arcade1' align='center'><?php echo $file; ?></td><td class='arcade1' align='center'>[ <?php if(!$addedalready) { ?><a href='?cparea=tar_import&untar=<?php echo $file; ?>&cat=<?php echo $thecat; ?>'>Install</a> <?php } else { echo "Added"; } ?> | <a href='?cparea=tar_import&untar=<?php echo $file; ?>&cat=<?php echo $thecat; ?>'>Reupload</a> ]</td></tr>
<?php
}
}
closedir($handle);
}
?>
<tr><td class='arcade1' align='center' colspan='2'><b>Choose A Category</b></td>
<form action='' method='GET' enctype="multipart/form-data">
<tr><td class='arcade1' align='left'><b>Category Option:</b></td><td class='arcade1' align='center'><select name='cat'>
<?php
$catquery=run_query("SELECT * FROM phpqa_cats");
while ($catlist= mysql_fetch_array($catquery)) {
if( $_GET['cat'] == $catlist[0] ) {
echo "<option value='$catlist[0]' selected='selected'>$catlist[1]</option>";
} else {
echo "<option value='$catlist[0]'>$catlist[1]</option>";
}
}
?>
</select>
<tr><td class='headertableblock' colspan='2'><div align=center><input type='hidden' name='cparea' value='tar_import'><input type='Submit' name='addgame' value='Switch Category'></div></td></tr>
</form>
</table>
</div>
<br />
2. IPB 1.3 skins will work with PHPQA.
FIND(in acp.php again):
CODE if ($_POST['skinedit']) {
ADD BELOW:
CODE // IPB skin allowance
$slash=str_replace("maintitle","headertableblock", $slash);
$slash=str_replace("row1","arcade1", $slash);
3. Fixed bug where arcade does not remember the login (same as textfileBB bug recently fixed)
FIND( in Arcade.php):
The two old setcookies, lookin something like
CODE
setcookie("phpqa_user_c", "$userID", time()+9999);
setcookie('phpqa_user_p', $thepassword_in_db, time()+9999);
replace em with
CODE setcookie("phpqa_user_c", "$userID", time()+9999999);
setcookie('phpqa_user_p', $thepassword_in_db, time()+9999999);
4. Fixed bug where you could signup with a blank pass.
FIND in arcade.php:
CODE if ($_POST['usernamesign'] != "") {
REPLACE WITH:
CODE if ($_POST['usernamesign'] != "" && $_POST['postpassword'] !="") {
Please let me know if you have any questions/problems.
Dec 4 2006, 07:07 PM
If I downloaded the one from the main page, is that this version?
Dec 4 2006, 07:09 PM
Correct. It says on the main page that the latest v is 1.0.18 by the golden box image.
Dec 5 2006, 05:22 PM
QUOTE (Jcink @ December 04, 2006 07:09 pm) Correct. It says on the main page that the latest v is 1.0.18 by the golden box image.
is the latest version 1.0.18 or 3.0.18?
Dec 5 2006, 05:24 PM
3* sorry.
TextfileBB (The latest v of THAT is 1.0.18) and PHP-Quick-Arcade's version ( 3.0.18) numbers sometimes confuse me XD