Version 0.9.9
- several bugfixes - Code cleaning
This commit is contained in:
@@ -1,66 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_hist.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$graphvalues1 = explode(",",$values1);
|
||||
$matchdays = sizeof($graphvalues1);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 15;
|
||||
$vert = 9;
|
||||
$start = 25;
|
||||
$imgWidth= $matchdays * $vert + 20;
|
||||
$imgHeight=90;
|
||||
|
||||
// Create image and define colors
|
||||
$image = imagecreate($imgWidth, $imgHeight);
|
||||
$colorBackground = imagecolorallocate($image, 236, 240, 246);
|
||||
$colorWhite = imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack = imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey = imagecolorallocate($image, 106, 106, 106);
|
||||
$colorBlue = imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed = imagecolorallocate($image, 176, 0, 0);
|
||||
$colorGreen = imagecolorallocate($image, 0, 176, 0);
|
||||
|
||||
imagefill($image, 0, 0, $colorBackground);
|
||||
|
||||
imageline($image, 0, 45, $imgWidth, 45, $colorGrey);
|
||||
imagestring($image,4, 5, 15, 'H', $colorBlack);
|
||||
imagestring($image,4, 5, 60, 'A', $colorBlack);
|
||||
|
||||
imagesetthickness($image, 5);
|
||||
|
||||
$count_values=count($graphvalues1);
|
||||
// Create line graph
|
||||
for ($i = 0; $i < $count_values; $i++)
|
||||
{
|
||||
if (substr($graphvalues1[$i],0,1) == '-')
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 1, strlen($graphvalues1[$i]) - 1), $colorRed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (substr($graphvalues1[$i],0,1) == ' ')
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 1, strlen($graphvalues1[$i]) - 1), $colorGreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 0, strlen($graphvalues1[$i])), $colorGrey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_hist.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$graphvalues1 = explode(",",$values1);
|
||||
$matchdays = sizeof($graphvalues1);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 15;
|
||||
$vert = 9;
|
||||
$start = 25;
|
||||
$imgWidth= $matchdays * $vert + 20;
|
||||
$imgHeight=90;
|
||||
|
||||
// Create image and define colors
|
||||
$image = imagecreate($imgWidth, $imgHeight);
|
||||
$colorBackground = imagecolorallocate($image, 236, 240, 246);
|
||||
$colorWhite = imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack = imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey = imagecolorallocate($image, 106, 106, 106);
|
||||
$colorBlue = imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed = imagecolorallocate($image, 176, 0, 0);
|
||||
$colorGreen = imagecolorallocate($image, 0, 176, 0);
|
||||
|
||||
imagefill($image, 0, 0, $colorBackground);
|
||||
|
||||
imageline($image, 0, 45, $imgWidth, 45, $colorGrey);
|
||||
imagestring($image,4, 5, 15, 'H', $colorBlack);
|
||||
imagestring($image,4, 5, 60, 'A', $colorBlack);
|
||||
|
||||
imagesetthickness($image, 5);
|
||||
|
||||
$count_values=count($graphvalues1);
|
||||
// Create line graph
|
||||
for ($i = 0; $i < $count_values; $i++)
|
||||
{
|
||||
if (substr($graphvalues1[$i],0,1) == '-')
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 1, strlen($graphvalues1[$i]) - 1), $colorRed);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (substr($graphvalues1[$i],0,1) == ' ')
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 1, strlen($graphvalues1[$i]) - 1), $colorGreen);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageline($image, $start + ($i * $vert), 45, $start + ($i * $vert), substr($graphvalues1[$i], 0, strlen($graphvalues1[$i])), $colorGrey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
|
||||
@@ -1,126 +1,126 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_points.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0;
|
||||
$values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$values2 = ( isset($_GET['v2']) ) ? $_GET['v2'] : 0;
|
||||
$values3 = ( isset($_GET['v3']) ) ? $_GET['v3'] : 0;
|
||||
$values4 = ( isset($_GET['v4']) ) ? $_GET['v4'] : 0;
|
||||
$valuesmin = ( isset($_GET['min']) ) ? $_GET['min'] : 0;
|
||||
$valuesmax = ( isset($_GET['max']) ) ? $_GET['max'] : 0;
|
||||
$caption = ( isset($_GET['c']) ) ? $_GET['c'] : '';
|
||||
|
||||
$graphvalues1 = explode(",", $values1);
|
||||
$graphvalues2 = explode(",", $values2);
|
||||
$graphvalues3 = explode(",", $values3);
|
||||
$graphvalues4 = explode(",", $values4);
|
||||
$graphvaluesmin = explode(",", $valuesmin);
|
||||
$graphvaluesmax = explode(",", $valuesmax);
|
||||
$caption_lang = explode(",", $caption);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 20;
|
||||
$vert = 24;
|
||||
$horzp = 4;
|
||||
$maximum = max($graphvaluesmax);
|
||||
$rows = (int) ($maximum / 5) + 2;
|
||||
$maximum = ($rows - 1) * 5;
|
||||
$imgWidth = $matchdays * $vert + 10;
|
||||
$imgHeight = $rows * $horz + 50;
|
||||
|
||||
if ($imgWidth < 106)
|
||||
$imgWidth = 106;
|
||||
|
||||
// Create image and define colors
|
||||
$image=imagecreate($imgWidth, $imgHeight);
|
||||
$colorWhite=imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack=imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey=imagecolorallocate($image, 192, 192, 192);
|
||||
$colorBlue=imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed=imagecolorallocate($image, 255, 0, 0);
|
||||
$colorGreen=imagecolorallocate($image, 0, 255, 0);
|
||||
$colorAzur=imagecolorallocate($image, 0, 255, 255);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $rows; $i++)
|
||||
{
|
||||
imageline($image, $vert, $i * $horz, $imgWidth - 10, $i * $horz, $colorGrey);
|
||||
if ($i > ($rows - 2))
|
||||
imagestring($image, 3, 10, $i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack);
|
||||
else
|
||||
imagestring($image, 3, 3,$i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack);
|
||||
}
|
||||
imagestring($image, 1, 0, 0, $caption_lang[0] , $colorBlack);
|
||||
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $matchdays; $i++)
|
||||
{
|
||||
$label = $i + 1;
|
||||
imageline($image, $i * $vert, $horz, $i * $vert, $imgHeight - 50, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image,3,$i * $vert - 3, $imgHeight - 40, $i, $colorBlack);
|
||||
else
|
||||
imagestring($image, 3, $i * $vert - 6, $imgHeight - 40, $i, $colorBlack);
|
||||
}
|
||||
|
||||
imageline($image, 3, $imgHeight - $horz + 6, 15, $imgHeight - $horz + 6, $colorBlack);
|
||||
imagestring($image, 3, 20, $imgHeight - $horz, $caption_lang[1] , $colorBlack);
|
||||
|
||||
imagesetthickness($image, 2);
|
||||
|
||||
$count_values=count($graphvalues1);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues1[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues1[$i]) * $horzp + $horz), $colorBlue);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues2);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues2[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues2[$i]) * $horzp + $horz), $colorGreen);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues3);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues3[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues3[$i]) * $horzp + $horz), $colorAzur);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues4);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues4[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues4[$i]) * $horzp + $horz), $colorRed);
|
||||
}
|
||||
|
||||
$count_values=count($graphvaluesmin);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvaluesmin[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmin[$i]) * $horzp + $horz), $colorBlack);
|
||||
}
|
||||
|
||||
$count_values=count($graphvaluesmax);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvaluesmax[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmax[$i]) * $horzp + $horz), $colorBlack);
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_points.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0;
|
||||
$values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$values2 = ( isset($_GET['v2']) ) ? $_GET['v2'] : 0;
|
||||
$values3 = ( isset($_GET['v3']) ) ? $_GET['v3'] : 0;
|
||||
$values4 = ( isset($_GET['v4']) ) ? $_GET['v4'] : 0;
|
||||
$valuesmin = ( isset($_GET['min']) ) ? $_GET['min'] : 0;
|
||||
$valuesmax = ( isset($_GET['max']) ) ? $_GET['max'] : 0;
|
||||
$caption = ( isset($_GET['c']) ) ? $_GET['c'] : '';
|
||||
|
||||
$graphvalues1 = explode(",", $values1);
|
||||
$graphvalues2 = explode(",", $values2);
|
||||
$graphvalues3 = explode(",", $values3);
|
||||
$graphvalues4 = explode(",", $values4);
|
||||
$graphvaluesmin = explode(",", $valuesmin);
|
||||
$graphvaluesmax = explode(",", $valuesmax);
|
||||
$caption_lang = explode(",", $caption);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 20;
|
||||
$vert = 24;
|
||||
$horzp = 4;
|
||||
$maximum = max($graphvaluesmax);
|
||||
$rows = (int) ($maximum / 5) + 2;
|
||||
$maximum = ($rows - 1) * 5;
|
||||
$imgWidth = $matchdays * $vert + 10;
|
||||
$imgHeight = $rows * $horz + 50;
|
||||
|
||||
if ($imgWidth < 106)
|
||||
$imgWidth = 106;
|
||||
|
||||
// Create image and define colors
|
||||
$image=imagecreate($imgWidth, $imgHeight);
|
||||
$colorWhite=imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack=imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey=imagecolorallocate($image, 192, 192, 192);
|
||||
$colorBlue=imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed=imagecolorallocate($image, 255, 0, 0);
|
||||
$colorGreen=imagecolorallocate($image, 0, 255, 0);
|
||||
$colorAzur=imagecolorallocate($image, 0, 255, 255);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $rows; $i++)
|
||||
{
|
||||
imageline($image, $vert, $i * $horz, $imgWidth - 10, $i * $horz, $colorGrey);
|
||||
if ($i > ($rows - 2))
|
||||
imagestring($image, 3, 10, $i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack);
|
||||
else
|
||||
imagestring($image, 3, 3,$i * $horz - 6, $maximum - (($i - 1) * 5), $colorBlack);
|
||||
}
|
||||
imagestring($image, 1, 0, 0, $caption_lang[0] , $colorBlack);
|
||||
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $matchdays; $i++)
|
||||
{
|
||||
$label = $i + 1;
|
||||
imageline($image, $i * $vert, $horz, $i * $vert, $imgHeight - 50, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image,3,$i * $vert - 3, $imgHeight - 40, $i, $colorBlack);
|
||||
else
|
||||
imagestring($image, 3, $i * $vert - 6, $imgHeight - 40, $i, $colorBlack);
|
||||
}
|
||||
|
||||
imageline($image, 3, $imgHeight - $horz + 6, 15, $imgHeight - $horz + 6, $colorBlack);
|
||||
imagestring($image, 3, 20, $imgHeight - $horz, $caption_lang[1] , $colorBlack);
|
||||
|
||||
imagesetthickness($image, 2);
|
||||
|
||||
$count_values=count($graphvalues1);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues1[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues1[$i]) * $horzp + $horz), $colorBlue);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues2);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues2[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues2[$i]) * $horzp + $horz), $colorGreen);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues3);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues3[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues3[$i]) * $horzp + $horz), $colorAzur);
|
||||
}
|
||||
|
||||
$count_values=count($graphvalues4);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvalues4[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvalues4[$i]) * $horzp + $horz), $colorRed);
|
||||
}
|
||||
|
||||
$count_values=count($graphvaluesmin);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvaluesmin[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmin[$i]) * $horzp + $horz), $colorBlack);
|
||||
}
|
||||
|
||||
$count_values=count($graphvaluesmax);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, (($maximum - $graphvaluesmax[$i - 1]) * $horzp + $horz), ($i + 1) * $vert, (($maximum - $graphvaluesmax[$i]) * $horzp + $horz), $colorBlack);
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
|
||||
@@ -1,97 +1,97 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_rank.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$numb_users = ( isset($_GET['t']) ) ? intval($_GET['t']) : 0;
|
||||
$matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0;
|
||||
$Values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$Values2 = ( isset($_GET['v2']) ) ? $_GET['v2'] : 0;
|
||||
$Values3 = ( isset($_GET['v3']) ) ? $_GET['v3'] : 0;
|
||||
$Values4 = ( isset($_GET['v4']) ) ? $_GET['v4'] : 0;
|
||||
$caption = ( isset($_GET['c']) ) ? $_GET['c'] : '';
|
||||
|
||||
$graphValues1 = explode(",",$Values1);
|
||||
$graphValues2 = explode(",",$Values2);
|
||||
$graphValues3 = explode(",",$Values3);
|
||||
$graphValues4 = explode(",",$Values4);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 15;
|
||||
$vert = 24;
|
||||
$imgWidth=$matchdays * $vert + 10;
|
||||
$imgHeight=$numb_users * $horz + 20;
|
||||
|
||||
// Create image and define colors
|
||||
$image=imagecreate($imgWidth, $imgHeight);
|
||||
$colorWhite=imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack=imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey=imagecolorallocate($image, 192, 192, 192);
|
||||
$colorBlue=imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed=imagecolorallocate($image, 255, 0, 0);
|
||||
$colorGreen=imagecolorallocate($image, 0, 255, 0);
|
||||
$colorAzur=imagecolorallocate($image, 0, 255, 255);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $numb_users; $i++)
|
||||
{
|
||||
imageline($image, $vert, $i * $horz, $imgWidth - 10, $i * $horz, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image,3,10,$i * $horz - 6,$i,$colorBlack);
|
||||
else
|
||||
imagestring($image,3,3,$i * $horz - 6,$i,$colorBlack);
|
||||
}
|
||||
imagestring($image, 1, 0, 0, $caption, $colorBlack);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $matchdays; $i++)
|
||||
{
|
||||
$label = $i + 1;
|
||||
imageline($image, $i * $vert, $horz, $i * $vert, $imgHeight - 20, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image, 3,$i * $vert - 3,$imgHeight - $horz, $i, $colorBlack);
|
||||
else
|
||||
imagestring($image, 3,$i * $vert - 6,$imgHeight - $horz, $i, $colorBlack);
|
||||
}
|
||||
|
||||
imagesetthickness($image, 2);
|
||||
|
||||
$count_values=count($graphValues1);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues1[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues1[$i] * $horz), $colorBlue);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues2);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues2[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues2[$i] * $horz), $colorGreen);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues3);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues3[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues3[$i] * $horz), $colorAzur);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues4);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues4[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues4[$i] * $horz), $colorRed);
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Football
|
||||
* @version $Id: chart_rank.php 1 2010-05-17 22:09:43Z football $
|
||||
* @copyright (c) 2010 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
$numb_users = ( isset($_GET['t']) ) ? intval($_GET['t']) : 0;
|
||||
$matchdays = ( isset($_GET['m']) ) ? intval($_GET['m']) : 0;
|
||||
$Values1 = ( isset($_GET['v1']) ) ? $_GET['v1'] : 0;
|
||||
$Values2 = ( isset($_GET['v2']) ) ? $_GET['v2'] : 0;
|
||||
$Values3 = ( isset($_GET['v3']) ) ? $_GET['v3'] : 0;
|
||||
$Values4 = ( isset($_GET['v4']) ) ? $_GET['v4'] : 0;
|
||||
$caption = ( isset($_GET['c']) ) ? $_GET['c'] : '';
|
||||
|
||||
$graphValues1 = explode(",",$Values1);
|
||||
$graphValues2 = explode(",",$Values2);
|
||||
$graphValues3 = explode(",",$Values3);
|
||||
$graphValues4 = explode(",",$Values4);
|
||||
|
||||
// Define .PNG image
|
||||
header("Content-type: image/png");
|
||||
$horz = 15;
|
||||
$vert = 24;
|
||||
$imgWidth=$matchdays * $vert + 10;
|
||||
$imgHeight=$numb_users * $horz + 20;
|
||||
|
||||
// Create image and define colors
|
||||
$image=imagecreate($imgWidth, $imgHeight);
|
||||
$colorWhite=imagecolorallocate($image, 255, 255, 255);
|
||||
$colorBlack=imagecolorallocate($image, 0, 0, 0);
|
||||
$colorGrey=imagecolorallocate($image, 192, 192, 192);
|
||||
$colorBlue=imagecolorallocate($image, 0, 0, 255);
|
||||
$colorRed=imagecolorallocate($image, 255, 0, 0);
|
||||
$colorGreen=imagecolorallocate($image, 0, 255, 0);
|
||||
$colorAzur=imagecolorallocate($image, 0, 255, 255);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $numb_users; $i++)
|
||||
{
|
||||
imageline($image, $vert, $i * $horz, $imgWidth - 10, $i * $horz, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image,3,10,$i * $horz - 6,$i,$colorBlack);
|
||||
else
|
||||
imagestring($image,3,3,$i * $horz - 6,$i,$colorBlack);
|
||||
}
|
||||
imagestring($image, 1, 0, 0, $caption, $colorBlack);
|
||||
|
||||
// Create grid
|
||||
for ($i = 1; $i <= $matchdays; $i++)
|
||||
{
|
||||
$label = $i + 1;
|
||||
imageline($image, $i * $vert, $horz, $i * $vert, $imgHeight - 20, $colorGrey);
|
||||
if ($i < 10)
|
||||
imagestring($image, 3,$i * $vert - 3,$imgHeight - $horz, $i, $colorBlack);
|
||||
else
|
||||
imagestring($image, 3,$i * $vert - 6,$imgHeight - $horz, $i, $colorBlack);
|
||||
}
|
||||
|
||||
imagesetthickness($image, 2);
|
||||
|
||||
$count_values=count($graphValues1);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues1[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues1[$i] * $horz), $colorBlue);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues2);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues2[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues2[$i] * $horz), $colorGreen);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues3);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues3[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues3[$i] * $horz), $colorAzur);
|
||||
}
|
||||
|
||||
$count_values=count($graphValues4);
|
||||
// Create line graph
|
||||
for ($i = 1; $i < $count_values; $i++)
|
||||
{
|
||||
imageline($image, $i * $vert, ($graphValues4[$i - 1] * $horz), ($i + 1) * $vert, ($graphValues4[$i] * $horz), $colorRed);
|
||||
}
|
||||
|
||||
// Output graph and clear image from memory
|
||||
imagepng($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
|
||||
@@ -78,7 +78,7 @@ $sql_bets = "SELECT
|
||||
FROM " . FOOTB_MATCHES . ' AS m
|
||||
LEFT JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
||||
WHERE m.season = $season AND m.league = $league
|
||||
ORDER BY matchday ASC, match_no ASC, user_id ASC";
|
||||
ORDER BY m.matchday ASC, m.match_no ASC, b.user_id ASC";
|
||||
|
||||
if(!$result_users = $db->sql_query($sql_users))
|
||||
{
|
||||
@@ -268,4 +268,3 @@ else
|
||||
echo utf8_decode($export);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -170,8 +170,8 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
|
||||
INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
||||
INNER JOIN ' . USERS_TABLE . " AS u ON (b.user_id = u.user_id)
|
||||
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday AND m.status IN (2,3)
|
||||
GROUP BY b.user_id
|
||||
ORDER BY points DESC, nobet ASC, username ASC
|
||||
GROUP BY u.user_id
|
||||
ORDER BY points DESC, nobet ASC, u.username ASC
|
||||
";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
@@ -586,13 +586,13 @@ function set_footb_points($points_type, $season, $league, $matchday, $wins, $cas
|
||||
|
||||
function _sort_points($value_a, $value_b)
|
||||
{
|
||||
if ($value_a['points'] > $value_b['points'])
|
||||
if ($value_a['points'] > $value_b['points'])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($value_a['points'] == $value_b['points'])
|
||||
if ($value_a['points'] == $value_b['points'])
|
||||
{
|
||||
if (isset($value_a['nobet']))
|
||||
{
|
||||
@@ -616,12 +616,12 @@ function _sort_points($value_a, $value_b)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -838,7 +838,8 @@ function next_delivery($season, $league)
|
||||
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
|
||||
ELSE 'Error' END,
|
||||
DATE_FORMAT(delivery_date,' %d.%m.%Y %H:%i')
|
||||
) AS deliverytime
|
||||
) AS deliverytime,
|
||||
matchday
|
||||
FROM " . FOOTB_MATCHDAYS . "
|
||||
WHERE season = $season AND league = $league AND status = 0
|
||||
ORDER BY matchday ASC
|
||||
@@ -999,7 +1000,7 @@ function first_league($season, $complete = true)
|
||||
{
|
||||
$join_matchday = 'INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = l.season AND m.league = l.league) ';
|
||||
}
|
||||
$sql = 'SELECT *
|
||||
$sql = 'SELECT l.*
|
||||
FROM ' . FOOTB_LEAGUES . ' AS l ' .
|
||||
$join_matchday . "
|
||||
WHERE l.season = $season
|
||||
@@ -1030,12 +1031,12 @@ function current_league($season)
|
||||
$curr_user = $user->data['user_id'];
|
||||
$user_spec = 'AND b.user_id = ' . $curr_user;
|
||||
}
|
||||
$sql = 'SELECT DISTINCT m.league
|
||||
$sql = 'SELECT DISTINCT m.league, m.match_datetime
|
||||
FROM ' . FOOTB_MATCHES . ' AS m
|
||||
INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league ' . $user_spec . ")
|
||||
WHERE m.season = $season
|
||||
AND m.status in (0,1,2)
|
||||
ORDER BY m.match_datetime ASC
|
||||
ORDER BY m.match_datetime ASC, m.league ASC
|
||||
LIMIT 1";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -1826,7 +1827,7 @@ function get_team($season, $league, $matchnumber, $field, $formula)
|
||||
$third_group[$team]= $row['group_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sort 3. Place on points, diff, goals
|
||||
array_multisort($points3, SORT_DESC, $diff3, SORT_DESC, $goals3, SORT_DESC, $third_team, $third_group);
|
||||
@@ -2096,7 +2097,8 @@ function get_team($season, $league, $matchnumber, $field, $formula)
|
||||
m.goals_overtime_home,
|
||||
m.goals_overtime_guest,
|
||||
m.goals_home,
|
||||
m.goals_guest
|
||||
m.goals_guest,
|
||||
m.match_no
|
||||
FROM ' . FOOTB_MATCHES . ' AS m
|
||||
LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
|
||||
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest)
|
||||
@@ -2316,7 +2318,7 @@ function ko_group_next_round($season, $league, $matchday_from, $matchday_to, $ma
|
||||
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
|
||||
WHERE t.season = $season AND t.league = $league AND m.matchday >= $matchday_from AND m.matchday <= $matchday_to AND m.status IN (3,6)
|
||||
GROUP BY t.team_id
|
||||
ORDER BY group_id ASC,points DESC, goal_diff DESC, goals DESC
|
||||
ORDER BY t.group_id ASC, points DESC, goal_diff DESC, goals DESC
|
||||
";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -2530,4 +2532,3 @@ function select_points($creator = 'm', $sum = false)
|
||||
}
|
||||
return $select_part;
|
||||
}
|
||||
?>
|
||||
@@ -1,115 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - Football Football
|
||||
* @copyright (c) 2016 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace football\football\includes;
|
||||
|
||||
class version_check
|
||||
{
|
||||
/**
|
||||
* @var array version_data
|
||||
*/
|
||||
protected $version_data;
|
||||
|
||||
/**
|
||||
* @var \phpbb\config\config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var \phpbb\version_helper $version_helper phpBB version helper
|
||||
*/
|
||||
protected $version_helper;
|
||||
|
||||
/**
|
||||
* @var \phpbb\template\twig\twig
|
||||
*/
|
||||
protected $template;
|
||||
|
||||
/**
|
||||
* @var \phpbb\user
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @var string Current version
|
||||
*/
|
||||
protected $current_version;
|
||||
|
||||
/**
|
||||
* Construct a version_check object
|
||||
*
|
||||
* @param array $version_data Version data
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\version_helper $version_helper phpBB version helper
|
||||
* @param \phpbb\template\twig\twig $template phpBB template object
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
*/
|
||||
public function __construct($version_data, $config, $version_helper, $template, $user)
|
||||
{
|
||||
$this->version_data = $version_data;
|
||||
$this->config = $config;
|
||||
$this->version_helper = $version_helper;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->current_version = $this->config[str_replace(' ', '', $this->version_data['version'])];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Extension version and assign template variables for version info if not
|
||||
* returning current version
|
||||
*
|
||||
* @param bool $return_version Yes if current version should be returned
|
||||
* @return string Current version if $return_version is set to true
|
||||
*/
|
||||
public function check($return_version = false)
|
||||
{
|
||||
$allow_url_fopen = (int) @ini_get('allow_url_fopen');
|
||||
if ($allow_url_fopen)
|
||||
{
|
||||
|
||||
// Set file location
|
||||
$this->version_helper->set_file_location($this->version_data['file'][0], $this->version_data['file'][1], $this->version_data['file'][2]);
|
||||
// Set current version
|
||||
$this->version_helper->set_current_version($this->current_version);
|
||||
|
||||
$this->version_helper->force_stability(($this->config['extension_force_unstable'] || !$this->version_helper->is_stable($this->current_version)) ? 'unstable' : null);
|
||||
|
||||
$updates = $this->version_helper->get_suggested_updates(true);
|
||||
|
||||
// Return version if $return_version is set to true
|
||||
if ($return_version)
|
||||
{
|
||||
return $this->current_version;
|
||||
}
|
||||
|
||||
$version_up_to_date = empty($updates);
|
||||
|
||||
$template_data = array(
|
||||
'AUTHOR' => $this->version_data['author'],
|
||||
'CURRENT_VERSION' => $this->current_version,
|
||||
'UP_TO_DATE' => sprintf((!$version_up_to_date) ? $this->user->lang['NOT_UP_TO_DATE'] : $this->user->lang['UP_TO_DATE'], $this->version_data['title']),
|
||||
'S_UP_TO_DATE' => $version_up_to_date,
|
||||
'U_AUTHOR' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $this->version_data['author'],
|
||||
'TITLE' => (string) $this->version_data['title'],
|
||||
'LATEST_VERSION' => $this->current_version,
|
||||
);
|
||||
|
||||
if (!$version_up_to_date)
|
||||
{
|
||||
$updates = array_shift($updates);
|
||||
$template_data = array_merge($template_data, array(
|
||||
'ANNOUNCEMENT' => (string) $updates['announcement'],
|
||||
'DOWNLOAD' => (string) $updates['download'],
|
||||
'LATEST_VERSION' => $updates['current'],
|
||||
));
|
||||
}
|
||||
$this->template->assign_block_vars('mods', $template_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - Football Football
|
||||
* @copyright (c) 2016 football (http://football.bplaced.net)
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace football\football\includes;
|
||||
|
||||
class version_check
|
||||
{
|
||||
/**
|
||||
* @var array version_data
|
||||
*/
|
||||
protected $version_data;
|
||||
|
||||
/**
|
||||
* @var \phpbb\config\config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var \phpbb\version_helper $version_helper phpBB version helper
|
||||
*/
|
||||
protected $version_helper;
|
||||
|
||||
/**
|
||||
* @var \phpbb\template\twig\twig
|
||||
*/
|
||||
protected $template;
|
||||
|
||||
/**
|
||||
* @var \phpbb\user
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @var string Current version
|
||||
*/
|
||||
protected $current_version;
|
||||
|
||||
/**
|
||||
* Construct a version_check object
|
||||
*
|
||||
* @param array $version_data Version data
|
||||
* @param \phpbb\config\config $config phpBB config
|
||||
* @param \phpbb\version_helper $version_helper phpBB version helper
|
||||
* @param \phpbb\template\twig\twig $template phpBB template object
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
*/
|
||||
public function __construct($version_data, $config, $version_helper, $template, $user)
|
||||
{
|
||||
$this->version_data = $version_data;
|
||||
$this->config = $config;
|
||||
$this->version_helper = $version_helper;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->current_version = $this->config[str_replace(' ', '', $this->version_data['version'])];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Extension version and assign template variables for version info if not
|
||||
* returning current version
|
||||
*
|
||||
* @param bool $return_version Yes if current version should be returned
|
||||
* @return string Current version if $return_version is set to true
|
||||
*/
|
||||
public function check($return_version = false)
|
||||
{
|
||||
$allow_url_fopen = (int) @ini_get('allow_url_fopen');
|
||||
if ($allow_url_fopen)
|
||||
{
|
||||
|
||||
// Set file location
|
||||
$this->version_helper->set_file_location($this->version_data['file'][0], $this->version_data['file'][1], $this->version_data['file'][2]);
|
||||
// Set current version
|
||||
$this->version_helper->set_current_version($this->current_version);
|
||||
|
||||
$this->version_helper->force_stability(($this->config['extension_force_unstable'] || !$this->version_helper->is_stable($this->current_version)) ? 'unstable' : null);
|
||||
|
||||
$updates = $this->version_helper->get_suggested_updates(true);
|
||||
|
||||
// Return version if $return_version is set to true
|
||||
if ($return_version)
|
||||
{
|
||||
return $this->current_version;
|
||||
}
|
||||
|
||||
$version_up_to_date = empty($updates);
|
||||
|
||||
$template_data = array(
|
||||
'AUTHOR' => $this->version_data['author'],
|
||||
'CURRENT_VERSION' => $this->current_version,
|
||||
'UP_TO_DATE' => sprintf((!$version_up_to_date) ? $this->user->lang['NOT_UP_TO_DATE'] : $this->user->lang['UP_TO_DATE'], $this->version_data['title']),
|
||||
'S_UP_TO_DATE' => $version_up_to_date,
|
||||
'U_AUTHOR' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $this->version_data['author'],
|
||||
'TITLE' => (string) $this->version_data['title'],
|
||||
'LATEST_VERSION' => $this->current_version,
|
||||
);
|
||||
|
||||
if (!$version_up_to_date)
|
||||
{
|
||||
$updates = array_shift($updates);
|
||||
$template_data = array_merge($template_data, array(
|
||||
'ANNOUNCEMENT' => (string) $updates['announcement'],
|
||||
'DOWNLOAD' => (string) $updates['download'],
|
||||
'LATEST_VERSION' => $updates['current'],
|
||||
));
|
||||
}
|
||||
$this->template->assign_block_vars('mods', $template_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user