$max = 1; } $per_host = array(); foreach ($host_data as $value) { $per_host[] = $value * 0.9 / $max; } $coll = 11; $im = 14; $x1 = 2; $y2 = 15; $x2 = $x1 + $coll; foreach ($per_host as $key => $percent) { $week_day++; if ($week_day > 6) { $week_day -= 7; } $y1 = round($im - $im * $percent + 1); if (!empty($percent)) { $col = imagecolorallocate($img, $colors[$key][0], $colors[$key][1], $colors[$key][2]); imagefilledrectangle($img, $x1 - 1, $y1, $x2 - 2, $y2, $col); } imageTTFtext($img, 6, 0, $x1, 15, $color, BASEDIR . '/assets/fonts/font.ttf', $arr_week[$week_day]); $x1 += $coll; $x2 += $coll; } imageTTFtext($img, 6, 0, 13, 23, $color2, BASEDIR . '/assets/fonts/font4.ttf', $count['count_dayhosts']); imageTTFtext($img, 6, 0, 13, 29, $color2, BASEDIR . '/assets/fonts/font4.ttf', $count['count_dayhits']); imageTTFtext($img, 12, 0, $pos, 29, $color2, BASEDIR . '/assets/fonts/font7.ttf', $online[1]); ImagePNG($img, BASEDIR . '/upload/counters/counter_new.png'); ImageDestroy($img); rename(BASEDIR . '/upload/counters/counter_new.png', BASEDIR . '/upload/counters/counter.png');
foreach ($per_host as $index => $percent) { $week_day++; if ($week_day > 6) { $week_day -= 7; } if ($index / 2 == (int) ($index / 2)) { $color = imageColorAllocate($img, 249, 243, 70); $color2 = imageColorAllocate($img, 242, 226, 42); $color3 = imageColorAllocate($img, 226, 210, 34); } else { $color = imageColorAllocate($img, 11, 215, 252); $color2 = imageColorAllocate($img, 7, 203, 239); $color3 = imageColorAllocate($img, 7, 187, 219); } $y1 = round($imageW - $imageW * $percent + 12); imageFilledRectangle($img, $x1, $y1, $x2, $y2, $color); $points = array(0 => $x1, 1 => $y1, 2 => $x1 + 3, 3 => $y1 - 5, 4 => $x1 + $collW + 3, 5 => $y1 - 5, 6 => $x2, 7 => $y1); imageFilledPolygon($img, $points, 4, $color2); $points = array(0 => $x2, 1 => $y1, 2 => $x1 + $collW + 3, 3 => $y1 - 5, 4 => $x1 + $collW + 3, 5 => $y2 - 5, 6 => $x2, 7 => $y2); imageFilledPolygon($img, $points, 4, $color3); // imageTTFtext($img, 7, 90, $x1+8, 50, $colorBlack, BASEDIR.'/assets/fonts/font.ttf', $host_data[$index]); imagestringup($img, 1, $x1 + 3, 52, $host_data[$index], $colorBlack); imageTTFtext($img, 6, 0, $x1 + 3, 66, $colorBlack, BASEDIR . '/assets/fonts/font.ttf', $arr_week[$week_day]); $x1 += $collW; $x2 += $collW; } //Header("Content-type: image/gif"); ImageGIF($img, BASEDIR . $imagecache); ImageDestroy($img); } echo '<img src="' . $imagecache . '?' . date_fixed(SITETIME, "dmY") . '" alt="Неделя" /><br /><br />';
$x2 = $x1 - 3; $y1_hits = (int) ($image - $image * $per_hit[0] + 7); $y1_host = (int) ($image - $image * $per_host[0] + 7); $counth = count($hits_data); if ($counth > 31) { $counth = 31; } for ($i = 1; $i < $counth; $i++) { // хиты $y2_hits = (int) ($image - $image * $per_hit[$i] + 7); imageLine($img, $x1, $y1_hits, $x2, $y2_hits, $color1); // хосты $y2_host = (int) ($image - $image * $per_host[$i] + 7); imageLine($img, $x1, $y1_host, $x2, $y2_host, $color2); if ($hits_data[$i] != 0 && $i == $max_index) { imageTTFtext($img, 6, 0, $x2 - 17, $y2_hits - 3, $color_red, BASEDIR . "gallery/font/font.ttf", "max"); imageTTFtext($img, 6, 0, $x2 + 2, $y2_hits - 3, $color2, BASEDIR . "gallery/font/font.ttf", $hits_data[$i]); /* ImageString($img, 1, $x2-17, $y2_hits-10, "max", $color_red); ImageString($img, 1, $x2+2, $y2_hits-10, $hits_data[$i], $color2); */ imageLine($img, $x2 - 1, $y2_hits - 7, $x2 - 1, $y2_hits + 42, $color_red); } $y1_hits = $y2_hits; $y1_host = $y2_host; $x1 -= $coll; $x2 -= $coll; } Header("Content-type: image/gif"); ImageGIF($img); ImageDestroy($img);
$hcount = file_get_contents(DATADIR . "datacounter/hits.dat"); $hcount = explode("|", $hcount); $counter_hits = $hcount[1]; } $img = imageCreateFromGIF(BASEDIR . 'images/img/counter.gif'); $color = imagecolorallocate($img, 169, 169, 169); $color2 = imagecolorallocate($img, 102, 102, 102); if ($counter_online >= 0 && $counter_online < 10) { $pos = 66; } if ($counter_online >= 10 && $counter_online < 100) { $pos = 54; } if ($counter_online >= 100 && $counter_online < 1000) { $pos = 43; } imageTTFtext($img, 6, 0, 3, 16, $color, BASEDIR . "gallery/font/font4.ttf", $counter_host); imageTTFtext($img, 6, 0, 3, 22, $color, BASEDIR . "gallery/font/font4.ttf", $counter_hits); imageTTFtext($img, 12, 0, $pos, 22, $color2, BASEDIR . "gallery/font/font7.ttf", $counter_online); /* if ($counter_online >= 0 && $counter_online < 10) $pos = 66; if ($counter_online >= 10 && $counter_online< 100) $pos = 58; if ($counter_online >= 100 && $counter_online < 1000) $pos = 48; ImageString($img, 1, 4, 8, $counter_host, $color); ImageString($img, 1, 4, 15, $counter_hits, $color); ImageString($img, 6, $pos, 8, $counter_online, $color2); */ Header("Content-type: image/gif"); ImageGIF($img); ImageDestroy($img);
<?php define("WIDTH", 450); define("HEIGHT", 100); define("F_SIZE", 40); define("F_ANGLE", 0); define("F_FONT", "verdana.ttf"); $img = imagecreate(WIDTH, HEIGHT); $white = imagecolorallocate($img, 255, 255, 255); $black = imagecolorallocate($img, 0, 0, 0); $start_x = 10; $start_y = (int) HEIGHT / 2; $text = "PHP Developer's Handbook"; imagerectangle($img, 0, 0, WIDTH - 1, HEIGHT - 1, $black); imageTTFtext($img, F_SIZE, F_ANGLE, $start_x, $start_y, $black, F_FONT, $text); header("Content-Type: image/png"); imagepng($img);
derivativeFX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with derivativeFX. If not, see <http://www.gnu.org/licenses/>. */ $language = $_GET['lang']; include "language.php"; //********************* DATENBANK include "/home/luxo/public_html/contributions/logindata.php"; //pw & bn einbinden $dblink = @mysql_connect($databankname, $userloginname, $databasepw); //Allgemein (TS-Database) mysql_select_db("u_luxo", $dblink); //Zurückstellen $ct = mysql_query("SELECT COUNT(*) FROM derivativefx", $dblink); $ct_Array = @mysql_fetch_row($ct); $anz = $ct_Array["0"]; //*********************IMAGE header("Content-type: image/png"); $img = imagecreatefrompng("derivativeFX_small.png"); imageAlphaBlending($img, true); imageSaveAlpha($img, true); $font = "/home/luxo/public_html/derivativeFX/font.ttf"; $red = imagecolorallocate($img, 225, 0, 0); $spruch = sprintf($lng['x']['imgu'], $anz); imageTTFtext($img, 15, 14, 10, 85, $red, $font, $spruch); imagepng($img);
$x2 = $x1 - 3; $y1_hits = (int) ($image - $image * $per_hit[0] + 7); $y1_host = (int) ($image - $image * $per_host[0] + 7); $counth = count($hits_data); if ($counth > 24) { $counth = 24; } for ($i = 1; $i < $counth; $i++) { // хиты $y2_hits = (int) ($image - $image * $per_hit[$i] + 7); imageLine($img, $x1 + 1, $y1_hits, $x2, $y2_hits, $color1); // хосты $y2_host = (int) ($image - $image * $per_host[$i] + 7); imageLine($img, $x1 + 1, $y1_host, $x2, $y2_host, $color2); if ($hits_data[$i] != 0 && $i == $max_index) { imageTTFtext($img, 6, 0, 40, $y2_hits - 3, $color_red, BASEDIR . '/assets/fonts/font.ttf', 'max. ' . $maxhost . ' / ' . $maxhit); /** * ImageString($img, 1, $x2-17, $y2_hits-10, "max", $color_red); * ImageString($img, 1, $x2+2, $y2_hits-10, $hits_data[$i], $color2); */ imageLine($img, $x2 - 1, $y2_hits - 2, $x2 - 1, $y2_hits + 42, $color_red); } $y1_hits = $y2_hits; $y1_host = $y2_host; $x1 -= $coll + 2; $x2 -= $coll + 2; } //Header("Content-type: image/gif"); ImageGIF($img, BASEDIR . $imagecache); ImageDestroy($img); }