Mesden Posted July 1, 2010 Share Posted July 1, 2010 I'm really confused by what this means. It's on Line 84: Uploaded Filename doesn't point to an uploaded File: <?php function createAPMImage($vals, $length, $fn) { $width = 300; $height = 200; $pixelsPerSecond = $width/ $length; $pic = imagecreatetruecolor($width,$height); $lineColor = imagecolorallocate($pic,0,0,0); $lineColorGrey = imagecolorallocate($pic,192,192,192); $bgColor = imagecolorallocate($pic,255,255,255); $bgColorT = imagecolorallocatealpha($pic,255,255,255,127); imagefill($pic,0,0,$bgColorT); // first create x/y pairs $xypair = array(); $maxapm = 0; for ($x = 1;$x <= $width;$x++) { $secs = ceil($x / $pixelsPerSecond); $apm = 0; if ($secs < 60) { for ($tmp = 0;$tmp < $secs;$tmp++) $apm += $vals[$tmp]; $apm = $apm / $secs * 60; } else { for ($tmp = $secs - 60;$tmp < $secs;$tmp++) $apm += $vals[$tmp]; $apm = $apm; } if ($apm > $maxapm) $maxapm = $apm; $xypair[$x] = $apm; } // then draw them if ($maxapm == 0) return; for ($i = 2;$i <= $width;$i++) { imageline($pic,$i - 1,$xypair[$i - 1] / $maxapm * $height, $i, $xypair[$i] / $maxapm * $height,$lineColor); } $frame = imagecreatetruecolor($width +50,$height+50); imagefill($frame,0,0,$bgColor); imagerectangle($frame,40,0,$width + 40,$height,$lineColor); imageline($frame,40,$height / 2,$width + 40,$height / 2, $lineColorGrey); imagestringup($frame,4,5,$height - 15,"APM -->",$lineColor); imagestring($frame,4,55,$height + 20,"Time (minutes)",$lineColor); imagestring($frame,2,25,$height - 15,"0",$lineColor); imagestring($frame,2,20,($height / 2),floor($maxapm / 2),$lineColor); imagestring($frame,2,20,0,floor($maxapm),$lineColor); $lengthMins = ($length / 60); for ($i = 0;$i < $lengthMins;$i+=5) { imagestring($frame,2,40+($width / ($lengthMins / 5) * ($i / 5)),$height + 5,$i,$lineColor); if ($i > 0) imageline($frame,40+($width / ($lengthMins / 5) * ($i / 5)),0,40+($width / ($lengthMins / 5) * ($i / 5)),$height, $lineColorGrey); } imagecopy($frame,$pic,40,0,0,0,$width,$height); imagepng($frame,$fn); imagedestroy($frame); imagedestroy($pic); } $MAX_FILE_SIZE = 1000000; if (isset($_FILES['userfile'])) { $error = $_FILES['userfile']['error']; $type = $_FILES['userfile']['type']; $name = $_FILES['userfile']['name']; $tmpname = $_FILES['userfile']['tmp_name']; $size = $_FILES['userfile']['size']; $err = false; if ($size >= $MAX_FILE_SIZE) { echo "Error: File is too large. Replay File must be below 1MB.<br />"; $err = true; } if ($error == UPLOAD_ERR_PARTIAL) { echo "Error: The upload was not completed successfully. Please try again.<br />"; $err = true; } if ($error == UPLOAD_ERR_NO_FILE) { echo "Error: Please select a File to upload.<br />"; $err = true; } if (!is_uploaded_file($tmpname)) { echo "Error: Uploaded filename doesn't point to an uploaded file.<br />"; $err = true; } if ($err !== true) { if (class_exists("MPQFile") || (include 'mpqfile.php')) { $start = microtime_float(); if ($_POST['debug'] == 1) { echo sprintf("<b>Debugging is on.</b><br />\n"); } $a = new MPQFile($tmpname,true,(($_POST['debug'] == 1)?2:0)); $init = $a->getState(); if ($init == MPQ_ERR_NOTMPQFILE) echo "Could not parse the Replay. Check to make sure it's a valid .SC2Replay File.<br />\n"; else if ($a->getVersion() < 9) echo "Error: Invalid Version.<br />\n"; else { echo sprintf("Major version %d, build %d<br />\n",$a->getVersion(),$a->getBuild()); $b = $a->parseReplay(); $tmp = $b->getPlayers(); echo sprintf("Map name: %s, Game length: %s<br />\n",$b->getMapName(),$b->getFormattedGameLength()); echo sprintf("Team size: %s, Game speed: %s<br />\n",$b->getTeamSize(), $b->getGameSpeedText()); $apmString = "<b>APM graphs</b><br />\n"; echo "<table border=\"1\"><tr><th>Player name</th><th>Long name</th><th>Race</th><th>Color</th><th>Team</th><th>Average APM<br />(experimental)</th><th>Winner?</th></tr>\n"; foreach($tmp as $value) { $wincolor = ($value['won'] == 1)?0x00FF00:0xFF0000; echo sprintf("<tr><td>%s</td><td>%s</td><td>%s</td><td><font color=\"#%s\">%s</font></td><td>%s</td><td style=\"text-align: center\">%d</td><td style=\"background-color: #%06X; text-align: center\">%d</td></tr>\n", $value['sName'], $value['lName'], $value['race'], $value['color'], $value['sColor'], ($value['party'] > 0)?"Team ".$value['party']:"-", ($value['party'] > 0)?(round($value['apmtotal'] / ($b->getGameLength() / 60))):0, ((isset($value['won']))?$wincolor:0xFFFFFF), (isset($value['won']))?$value['won']($value['party'] > 0)?"Unknown":"-") ); if ($value['party'] > 0) { $apmFileName = $value['id']."_".md5($name).".png"; createAPMImage($value['apm'],$b->getGameLength(),$apmFileName); $apmString .= sprintf("%s:<br /><img src=\"$apmFileName\" /><br />\n",$value['sName']); } } echo "</table><br />"; $messages = $b->getMessages(); if (count($messages) > 0) { echo "<b>Messages:</b><br /><table border=\"1\"><tr><th>Time</th><th>Player</th><th>Target</th><th>Message</th></tr>\n"; foreach ($messages as $val) echo sprintf("<tr><td>%d sec</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",$val['time'], $val['name'], ($val['target'] == 2)?"Alliance":"All",$val['message']); echo "</table><br />\n"; } echo $apmString; $t = $b->getEvents(); if (isset($sc2_abilityCodes) || (include 'abilitycodes.php')) { echo "<table border=\"1\"><tr><th>Timecode</th>\n"; $pNum = count($tmp); foreach ($tmp as $value) { if ($value['party'] > 0) echo sprintf("<th>%s (%s)</th>",$value['sName'],$value['race']); } echo "</tr>\n"; foreach ($t as $value) { echo sprintf("<tr><td>%d sec</td>",$value['t'] / 16); foreach ($tmp as $value2) { if ($value2['party'] == 0) continue; if ($value['p'] == $value2['id']) echo sprintf("<td>%s</td>",$b->getAbilityString($value['a'])); else echo "<td></td>"; } echo "</tr>\n"; } echo "</table>"; } } $end = microtime_float(); echo sprintf("Time to parse: %d ms.<br />\n",(($end - $start)*1000)); } } } ?> Link to comment https://forums.phpfreaks.com/topic/206441-what-does-this-mean/ Share on other sites More sharing options...
kenrbnsn Posted July 1, 2010 Share Posted July 1, 2010 What does what mean? Please post the exact error message you're getting. Ken Link to comment https://forums.phpfreaks.com/topic/206441-what-does-this-mean/#findComment-1079908 Share on other sites More sharing options...
Mesden Posted July 1, 2010 Author Share Posted July 1, 2010 I did post the Error I'm getting. It's on Line 181 of the PHP Coding. Link to comment https://forums.phpfreaks.com/topic/206441-what-does-this-mean/#findComment-1079909 Share on other sites More sharing options...
Mesden Posted July 1, 2010 Author Share Posted July 1, 2010 Oops, my bad. It's on Line 84. This is an Error I get when I try to submit the upload form without selecting a File, but I also get the Error "Error: No file was selected for uploading.", so it's not trying to tell me I didnt select a file.. Link to comment https://forums.phpfreaks.com/topic/206441-what-does-this-mean/#findComment-1079910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.