Pseudomizer: Thanks again for figuring out the upload bug in the Admin CP. I worked with it a bit and discovered what the exact problem was.
In some versions of Apache/PHP, variable names are automatically created from forms. So for example, the input file "championicon" would turn into "$championicon_name" and "$championicon_data" automatically when it's passed through the headers into the next page.
So for some combinations of OS/Apache/PHP, this wouldn't happen, and the variables would not get inserted correctly into the database. The key then is to use the $HTTP_POST_FILES array for everything, rather than relying on PHP to do the dirty work.
The vpaupload() function already does this for the data portion, but the name was being mishandled. So the code now looks like this:
PHP Code:
// only process the files if changes were made
if (is_array($HTTP_POST_FILES)) {
$thumbnail_name= $HTTP_POST_FILES[thumbnail]['name'];
$championicon_name= $HTTP_POST_FILES[championicon]['name'];
if ($thumbnail_name != "")
$thumbdata = vpaupload("thumbnail");
else
$thumbdata = "";
if ($championicon_name != "")
$championdata = vpaupload("championicon");
else
$championdata = "";
} else {
$thumbdata = "";
$championdata = "";
}
// make sure we have a valid hash offset
if ($hashoffset > 31)
$hashoffset = $hashoffset % 31;
else if ($hashoffset < 0)
$hashoffset = 0;
$updatearcade = "UPDATE arcadegames
SET name='$name', title='$title', description='$desc', filename='$filename', hashoffset='$hashoffset',
".iif(($championdata != "") || ($deletechampicon == 1),"championpicname='$championicon_name', championpicdata='$championdata',","")."
".iif(($thumbdata != "") || ($deletethumb == 1),"thumbnailname='$thumbnail_name', thumbnaildata='$thumbdata',","")."
active='$active', scorevar='$scorevar', gamecode='$gamecode',championactive='$championactive',championtext='$championtext',championcolor='$championcolor'
WHERE gameid='$gameid'";
$DB_site->query($updatearcade);
This fix (and appropriate credit) is given in Beta 2.1.