Merge remote-tracking branch 'football/master'

# Conflicts:
#	acp/matches_module.php
#	adm/style/acp_football_leagues.html
#	adm/style/acp_football_matches.html
#	block/all_bets.php
#	block/rank_matchday.php
#	block/ranks_total.php
#	config/services.yml
#	controller/main.php
#	event/main_listener.php
#	includes/constants.php
#	includes/functions.php
#	language/de/football.php
#	language/de/info_acp_leagues.php
#	language/de/info_acp_matches.php
#	styles/prosilver/template/all_bets.html
#	styles/prosilver/template/results.html
#	styles/prosilver/template/table.html
#	styles/prosilver/theme/football.css
This commit is contained in:
2023-06-07 20:40:33 +02:00
167 changed files with 12199 additions and 12181 deletions

View File

@@ -1,66 +1,70 @@
<?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
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$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);

View File

@@ -1,126 +1,130 @@
<?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
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$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);

View File

@@ -1,97 +1,101 @@
<?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
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
$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);

View File

@@ -16,7 +16,6 @@ global $table_prefix;
// Config constants
define('FOOTB_BETS', $table_prefix . 'footb_bets');
define('FOOTB_CORR', $table_prefix . 'footb_corr');
define('FOOTB_EXTRA_BETS', $table_prefix . 'footb_extra_bets');
define('FOOTB_EXTRA', $table_prefix . 'footb_extra');
define('FOOTB_LEAGUES', $table_prefix . 'footb_leagues');
@@ -47,4 +46,3 @@ define('LEAGUE_KO', 2);
define('FOOTB_BONUS_DAY', $table_prefix . 'footb_bonuspoints_day');
define('FOOTB_CORR', $table_prefix . 'footb_corr');
?>

View File

@@ -22,25 +22,8 @@ if( !$result = $db->sql_query($sql) )
}
$league_short = $db->sql_fetchfield('league_name_short');
$db->sql_freeresult($result);
$export_file = $league_short . '_'. $season. '_Tipps.csv';
$path_attachment = './../../files/' . $export_file;
$newline = "\r\n";
if (!isset($_POST['send']))
{
header('Pragma: no-cache');
header("Content-Type: text/csv; name=\"$export_file\"");
header("Content-disposition: attachment; filename=$export_file");
// header('Content-Type: text/x-csv');
// header('Expires: ' . gmdate('D, d M Y H:i:m') . ' GMT');
// header('Content-Disposition: attachment; filename='. $export_file);
$phpbb_root_path = './../';
}
else
{
$phpbb_root_path = './../../';
}
$phpbb_root_path = './../../';
$sql_users = 'SELECT DISTINCT
b.user_id,
@@ -78,7 +61,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))
{
@@ -96,16 +79,16 @@ foreach ($rows_users as $row_user)
$bet_column[$row_user['user_id']] = $lastcolumn;
$j++;
}
$export_row_users = "\"\";\"\";\"\";\"\";\"\";\"\";";
$csv_data_row_users = "\"\";\"\";\"\";\"\";\"\";\"\";";
for($j = 8; $j <= $lastcolumn; $j = $j + 3)
{
$export_row_users .= "\"\";\"\";\"" . $column[$j] . "\"";
$csv_data_row_users .= "\"\";\"\";\"" . $column[$j] . "\"";
if($j != $lastcolumn)
{
$export_row_users .= ';';
$csv_data_row_users .= ';';
}
}
$export_row_users .= $newline;
$csv_data_row_users .= $newline;
if( !$result_results = $db->sql_query($sql_results) )
{
@@ -138,16 +121,16 @@ foreach ($rows_bets as $row_bet)
{
if ($lastcolumn > 0)
{
$export_bets[$last_match_num] = '';
$csv_data_bets[$last_match_num] = '';
for($j=8; $j<=$lastcolumn; $j++)
{
$export_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
$csv_data_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
if($j!=$lastcolumn)
{
$export_bets[$last_match_num] .= ';';
$csv_data_bets[$last_match_num] .= ';';
}
}
$export_bets[$last_match_num] .= $newline;
$csv_data_bets[$last_match_num] .= $newline;
}
$column = array();
$last_match_num = $row_bet['match_no'];
@@ -157,21 +140,21 @@ foreach ($rows_bets as $row_bet)
$lastcolumn = $bet_column[$row_bet['user_id']] + 2;
}
}
$export_bets[$last_match_num] = '';
$csv_data_bets[$last_match_num] = '';
for($j = 8; $j <= $lastcolumn; $j++)
{
$export_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
$csv_data_bets[$last_match_num] .= "\"" . $column[$j] . "\"";
if($j != $lastcolumn)
{
$export_bets[$last_match_num] .= ';';
$csv_data_bets[$last_match_num] .= ';';
}
}
$export_bets[$last_match_num] .= $newline;
$csv_data_bets[$last_match_num] .= $newline;
$last_matchday = 0;
$export= '';
$export .= 'CSV;'. $league. ';'. $season. $newline;
$csv_data= '';
$csv_data .= 'CSV;'. $league. ';'. $season. $newline;
$i = 0;
foreach ($rows_results as $row_result)
@@ -180,32 +163,32 @@ foreach ($rows_results as $row_result)
{
if ($last_matchday != 0)
{
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
}
else
{
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$export .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= ";;". str_replace("\"", "\"\"", $row_result['match_time']). $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
$csv_data .= $newline;
}
$export .= $export_row_users;
$csv_data .= $csv_data_row_users;
$column = array();
$last_matchday = $row_result['matchday'];
}
@@ -242,30 +225,31 @@ foreach ($rows_results as $row_result)
$column[2] = '';
$column[4] = '';
}
$export .= "\"" . $column[0] . "\";\"" . $column[1] . "\";\"" . $column[2] . "\";\"\";\"" . $column[4] . "\";\"\";\"\";\"\";";
if ($export_bets[$row_result['match_no']] == '')
$csv_data .= "\"" . $column[0] . "\";\"" . $column[1] . "\";\"" . $column[2] . "\";\"\";\"" . $column[4] . "\";\"\";\"\";\"\";";
if ($csv_data_bets[$row_result['match_no']] == '')
{
$export .= $newline;
$csv_data .= $newline;
}
else
{
$export .= $export_bets[$row_result['match_no']];
$csv_data .= $csv_data_bets[$row_result['match_no']];
}
$column = array();
$i++;
}
if (isset($_POST['send']))
{
$fp = fopen($path_attachment , "b");
ftruncate ($fp, 0);
rewind($fp);
fwrite ($fp, $export);
fclose($fp);
}
else
{
echo utf8_decode($export);
exit;
}
?>
// Output the csv file
$filename = $league_short . '_'. $season. '_Tipps.csv';
$fp = fopen('php://output', 'w');
header('Content-Type: application/octet-stream');
header("Content-disposition: attachment; filename=\"" . basename($filename) . "\"");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Pragma: public');
header('Content-Transfer-Encoding: binary');
fwrite($fp, "\xEF\xBB\xBF"); // UTF-8 BOM
fwrite($fp, $csv_data);
fclose($fp);

View File

@@ -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);
@@ -287,21 +287,21 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
{
$curr_rank_points = $curr_rank['points'];
$curr_rank_user = $curr_rank['user_id'] + 2000;
$sql = 'UPDATE ' . FOOTB_MATCHES . "
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_home = $curr_rank_points,
status = $matchday_status
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday AND team_id_home = $curr_rank_user";
$db->sql_query($sql);
$sql = 'UPDATE ' . FOOTB_MATCHES . "
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_guest = $curr_rank_points,
status = $matchday_status
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday AND team_id_guest = $curr_rank_user";
$db->sql_query($sql);
$sql = 'UPDATE ' . FOOTB_MATCHDAYS . "
SET status = $matchday_status
$sql = 'UPDATE ' . FOOTB_MATCHDAYS . "
SET status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday";
$db->sql_query($sql);
}
}
}
if ( sizeof($ranking_ary) == 0 )
{
@@ -312,13 +312,13 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
$db->sql_query($sql);
if ($league < 51)
{
$sql = 'UPDATE ' . FOOTB_MATCHES . "
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_home = '',
goals_guest = '',
status = $matchday_status
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday;";
$db->sql_query($sql);
}
}
}
else
{
@@ -615,13 +615,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']))
{
@@ -645,12 +645,12 @@ function _sort_points($value_a, $value_b)
{
return 0;
}
}
}
else
{
return 1;
}
}
return 1;
}
}
}
@@ -893,7 +893,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
@@ -1054,7 +1055,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
@@ -1085,13 +1086,13 @@ 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.league < 51
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);
@@ -1723,7 +1724,7 @@ function get_order_team_compare($team_ary, $season, $league, $group, $ranks, $ma
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
)
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday),0)
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday),0)
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),0)
- IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points,
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest, goals_guest - goals_home)) AS goals_diff,
@@ -1886,7 +1887,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);
@@ -2156,7 +2157,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)
@@ -2376,7 +2378,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);
@@ -2649,7 +2651,7 @@ function bonuspoints($season, $league, $matchday)
{
$z3 = "0";
}
If ($z1 > 2)
{
$b1 = 6 / $z1;
@@ -2820,4 +2822,3 @@ function chart($season, $league, $matchday)
$i++;
}
}
?>

View File

@@ -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);
}
}
}