imagefilledrectangle($img, 0, 0, 249, 59, $background); for ($g = 0; $g < 30; $g++) { $t = dss_rand(); $t = $t[0]; $ypos = rand(0, $height); $xpos = rand(0, $width); $kleur = imagecolorallocate($img, color("bgtekst"), color("bgtekst"), color("bgtekst")); imagettftext($img, size(), move(), $xpos, $ypos, $kleur, font(), $t); } $stukje = $width / (strlen($code) + 3); for ($j = 0; $j < strlen($code); $j++) { $tek = $code[$j]; $ypos = rand(35, 41); $xpos = $stukje * ($j + 1); $color2 = imagecolorallocate($img, color("tekst"), color("tekst"), color("tekst")); imagettftext($img, size(), move(), $xpos, $ypos, $color2, font(), $tek); } imagepng($img); imagedestroy($img); die; /** * Some functions :) * Also orginally written by mastercode.nl **/ /** * Function to create a random color * @auteur mastercode.nl * @param $type string Mode for the color * @return int **/ function color($type)
function test_file($filename) { return file_exists($filename) ? is_readable($filename) ? false : font('red', e(2)) : font('red', e(0)); }
function Lib_buildTabSections($NbSections, $section, $session, $page, $action, $mode) { global $taille_tableaux; if ($section == "") { $section = 0; } $IdLink = $section; // On affiche maximum 10 champs de navigation (outre << et >>)! $NbCases = $NbSections - $section > 12 ? 12 : $NbSections - $section + 2; $Tab = new Table(1, $NbCases); for ($i = 1; $i <= $NbCases - 2; $i++) { $link = new Link("main.php?session={$session}&page={$page}&action={$action}&mode={$mode}§ion={$IdLink}", font("{$IdLink}")); $Tab->addObject($link, 0, $i); $IdLink++; } $link = new Link("main.php?session={$session}&page={$page}&action={$action}&mode={$mode}§ion=0", font("<<")); $Tab->addObject($link, 0, 0); $Fin = $NbSections - 1; $link = new Link("main.php?session={$session}&page={$page}&action={$action}&mode={$mode}§ion={$Fin}", font(">>")); $Tab->addObject($link, 0, $NbCases - 1); return $Tab; }