From 055bed1fb4169c6b79a51303755de7e2ad9de3df Mon Sep 17 00:00:00 2001 From: anomen Date: Thu, 12 Jul 2012 22:35:46 +0200 Subject: [PATCH] gc-fallout - dev - toolbox - poradi kodu (nekompletni) --- www-apps/gc-fallout/dev/cert.php | 2 +- www-apps/gc-fallout/dev/config.php.template | 3 +++ www-apps/gc-fallout/dev/index.php | 11 ++++++++++- www-apps/gc-fallout/dev/stats.php | 13 +++++++++---- www-apps/gc-fallout/dev/styles.css | 4 +++- www-apps/gc-fallout/dev/toolbox.php | 20 +++++++++++++++++--- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/www-apps/gc-fallout/dev/cert.php b/www-apps/gc-fallout/dev/cert.php index 44c6d01..6d92df9 100644 --- a/www-apps/gc-fallout/dev/cert.php +++ b/www-apps/gc-fallout/dev/cert.php @@ -16,7 +16,7 @@ $U = decodeToken($token); $certimg = imagecreatetruecolor(PERK_WIDTH*PERK_COLS+100, PERK_HEIGHT*PERK_ROWS+100); $bg = imagecolorallocate($certimg, 0xd0, 0xd0, 0xd0); $red_color = imagecolorallocate($certimg, 0xff, 0x00, 0x00); -$text_color = imagecolorallocate($certimg, 0x00, 0xff, 0x00); +$text_color = imagecolorallocate($certimg, 0x00, 0x7f, 0x00); $ii = chr(0xED); imagefill($certimg, 0, 0, $bg); diff --git a/www-apps/gc-fallout/dev/config.php.template b/www-apps/gc-fallout/dev/config.php.template index b9fdf23..0fa7325 100644 --- a/www-apps/gc-fallout/dev/config.php.template +++ b/www-apps/gc-fallout/dev/config.php.template @@ -1,5 +1,8 @@ '; foreach($U['perky'] as $perk) { - echo "
\n"; + echo "\n"; } + echo ''; echo "
odkaz pro zalogovani:
\n"; @@ -102,6 +104,13 @@ foreach ($params as $p) { $script="http://${_SERVER['SERVER_NAME']}:${_SERVER['SERVER_PORT']}" . str_replace('index.php','cert.php', $_SERVER['SCRIPT_NAME']) . "?$token_b64"; + + + if (HAVE_DEBUG) { + echo "
";
+	print_r($U);
+	echo "
"; + } // $script="http://${_SERVER['SERVER_NAME']}:${_SERVER['SERVER_PORT']}/~guppy/fallout/cert.php?$token_b64"; //TEST diff --git a/www-apps/gc-fallout/dev/stats.php b/www-apps/gc-fallout/dev/stats.php index 1bec4a5..0261c26 100644 --- a/www-apps/gc-fallout/dev/stats.php +++ b/www-apps/gc-fallout/dev/stats.php @@ -28,15 +28,15 @@ if (HAVE_MYSQL) { cas datetime, invalid varchar(200), login varchar(100), - klice varchar(200), + klice varchar(300), penize integer, jidlo integer, karma integer, - perky varchar(200), + perky varchar(300), skore integer, ip varchar(20), ua varchar(300), - cert varchar(200), + cert varchar(500), PRIMARY KEY (id) )') or die("Unable to create table ". mysql_error()); @@ -49,7 +49,12 @@ function dbstats_access(&$U) { $params = array('login','klice','penize','jidlo','karma'); foreach ($params as $p) { - $U["${p}_mysql"] = mysql_real_escape_string($U["${p}"]); + if (HAVE_MYSQL) { + $U["${p}_mysql"] = mysql_real_escape_string($U["${p}"]); + } + else { + $U["${p}_mysql"] = $U["${p}"]; + } } $sql = 'INSERT INTO fallout_stats (cas, ip, ua, invalid '; foreach ($params as $p) { diff --git a/www-apps/gc-fallout/dev/styles.css b/www-apps/gc-fallout/dev/styles.css index db64cb4..17ac938 100644 --- a/www-apps/gc-fallout/dev/styles.css +++ b/www-apps/gc-fallout/dev/styles.css @@ -13,7 +13,9 @@ div#input_div { } - +div#perky_preview { + width: 500px; + } div#result { diff --git a/www-apps/gc-fallout/dev/toolbox.php b/www-apps/gc-fallout/dev/toolbox.php index 7a6fa90..c775ca1 100644 --- a/www-apps/gc-fallout/dev/toolbox.php +++ b/www-apps/gc-fallout/dev/toolbox.php @@ -8,15 +8,25 @@ require_once('stats.php'); function PORADI() { + $numargs = func_num_args(); if ($numargs < 3) { + echo "spatne parametry PORADI!"; return false; } - $vstup = func_get_arg(0); - $current = 1; - $current_val = func_get_arg($current); + $poradi = func_get_args(); + $vstup = array_shift($poradi); + + $prunik = array_intersect($zadane, $poradi); + foreach ($prunik as $v) { + } + +// $current = 1; +// $current_val = func_get_arg($current); + foreach ($vstup as $v) { + if (in_array($v, )) { if ($v == $current_val) { $current ++; if ($current >= $numargs) { @@ -24,6 +34,10 @@ function PORADI() } $current_val = func_get_arg($current); } + } + else { + } + } return false; } -- 2.11.4.GIT