Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
$filename = 'register.php';
require('./global.php');
if (isset($_REQUEST['key_number'])) $key_number = intval($_REQUEST['key_number']);
else $key_number = 0;
$result = $db->query_first("SELECT key_string FROM bb".$n."_register_keys WHERE key_number = " . $key_number);
if (!$result['key_string']) exit;
$hash = $result['key_string'];
header("Content-type: image/png");
// format def
$width = 280;
$height = 90;
// create image
$imageTemp = imageCreate($width, $height);
// set background color
$background = imageColorAllocate($imageTemp, 255, 255, 255);
imageFill($imageTemp, 0, 0, $color);
// define font color
$colorBlack = imageColorAllocate($imageTemp, 0, 0, 0);
// draw key
$x = 10;
for ($i = 0; $i < 6; $i++) {
$y = mt_rand(40, 70);
$x += mt_rand(5, 10);
imagettftext($imageTemp, 28, 0, $x, $y, $colorBlack, './acp/lib/jimteachf', $hash[$i]);
$x += 35;
}
// morph image on y-axis
/*$imageTemp2 = imageCreate($width, $height);
$posY = 0;
$chunkX = 1;
for ($i = 0 ; $i <= $width; $i += $chunkX) {
$posY += mt_rand(-1, 1);
imageCopy($imageTemp2, $imageTemp, $i, $posY, $i, 0, $chunkX, $height);
}
imageCopy($imageTemp, $imageTemp2, 0, 0, 0, 0, $width, $height);
*/
// morph image on x-axis
$imageTemp2 = imageCreate($width, $height);
$posX = 0;
$chunkY = 1;
$random = 0;
for ($i = 0 ; $i <= $height; $i += $chunkY) {
$posX += mt_rand(-1, 1);
imageCopy($imageTemp2, $imageTemp, $posX, $i, 0, $i, $width, $chunkY);
}
// blur image
$image = imageCreateTrueColor($width, $height);
$background = imageColorAllocate($image, 255, 255, 255);
imageFill($image, 0, 0, $background);
$distance = 1;
imageCopyMerge($image, $imageTemp2, 0, 0, 0, $distance, $width, $height-$distance, 70);
imageCopyMerge($imageTemp2, $image, 0, 0, $distance, 0, $width-$distance, $height, 70);
imageCopyMerge($image, $imageTemp2, 0, $distance, 0, 0, $width, $height, 70);
imageCopyMerge($imageTemp2, $image, $distance, 0, 0, 0, $width, $height, 70);
// draw border
imageLine($image, 0, 0, $width - 1, 0, $colorBlack);
imageLine($image, $width - 1, 0, $width - 1, $height - 1, $colorBlack);
imageLine($image, 0, $height - 1, $width - 1, $height - 1, $colorBlack);
imageLine($image, 0, 0, 0, $height - 1, $colorBlack);
// show image
imagePng($image);
?>