Lid |
|
Wat moet er veranderd worden? Tis nogal dringend ook want moet binne de 4 dage nog actief zijn. :'( :(
Dit is het probleem:
http://goalball...mp;photo=0
En dit is de code:
<h3 class="title">General Images</h3>
<hr NOSHADE>
<div align="center">
<br><br><br>
<table width="500" border="0" cellspacing="0" cellpadding="4" class="officials">
<tr>
<th class="tbl_hoofd"><div align="center">General Images </div></th></tr><tr>
<td>
<?
$files = "../fotoalbum/general";
$perpagina = 20;
$w = 100;
$h = 70;
/**
* Add a watermerk to an image
*
* @param string $image The path of the image
* @param string $watermerk The path of the watermerk image
* @param bool $transparency The transparancy level of the image
* @param int $wposition The amount of pixels the watermerk should be placed from the left of the image
* @param int $hposition The amount of pixels the watermerk should be placed from the top of the image
* @return bool
* @access public
*/
function AddWatermark ($image, $watermerk, $transparency = 16, $wposition = 0, $hposition = 0)
{
/**
* Check if the image and the watermerk image exist
*/
if (!file_exists ($image))
return trigger_error ('Could not add watermerk to image ' . $_IMG['IMGName'] . ', image file does not exist');
if (!file_exists ($watermerk))
return trigger_error ('Could not add watermerk to image ' . $_IMG['IMGName'] . ', watermerk file does not exist');
/**
* Store the information in an array for easy use
*/
$_IMG = array ();
$_IMG['transparency'] = $transparency;
$_IMG['image'] = $image;
$_IMG['watermerk'] = $watermerk;
$_IMG['wposition'] = $wposition;
$_IMG['hposition'] = $hposition;
$_EXT = array ();
$_EXT['image'] = end (explode ('.', strtolower ($_IMG['image'])));
$_EXT['watermerk'] = end (explode ('.', strtolower ($_IMG['watermerk'])));
/**
* Make sure we use the correct things
*/
switch ($_EXT['image'])
{
case 'jpg':
$_IMG['iinfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg');
break;
case 'gif':
$_IMG['iinfo'] = array ('image/gif', 'imagecreatefromgif', 'imagegif');
break;
case 'png':
$_IMG['iinfo'] = array ('image/png', 'imagecreatefrompng', 'imagepng');
break;
default:
$_IMG['iinfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg');
break;
}
switch ($_EXT['watermerk'])
{
case 'jpg':
$_IMG['winfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg');
break;
case 'gif':
$_IMG['winfo'] = array ('image/gif', 'imagecreatefromgif', 'imagegif');
break;
case 'png':
$_IMG['winfo'] = array ('image/png', 'imagecreatefrompng', 'imagepng');
break;
default:
$_IMG['winfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg');
break;
}
/**
* Create the images
*/
$_IMG['image_mark'] = $_IMG['winfo'][1] ($_IMG['watermerk']);
$_IMG['image_image'] = $_IMG['iinfo'][1] ($_IMG['image']);
/**
* Set the correct widht/height etc...
*/
$_IMG['image_imagew'] = imagesx ($_IMG['image_image']);
$_IMG['image_imageh'] = imagesy ($_IMG['image_image']);
$_IMG['image_markw'] = imagesx ($_IMG['image_mark']);
$_IMG['image_markh'] = imagesy ($_IMG['image_mark']);
/**
* Make sure we use the correct position of the watermerk
*/
if ($_IMG['hposition'] == 0)
$_IMG['hposition'] = ($_IMG['image_imageh'] - $_IMG['image_markh']);
if ($_IMG['wposition'] == 0)
$_IMG['wposition'] = 5;
/**
* Create the watermerk
*/
imagecopymerge ($_IMG['image_image'], $_IMG['image_mark'], $_IMG['wposition'], $_IMG['hposition'], 0, 0, $_IMG['image_markw'], $_IMG['image_markh'], $_IMG['transparency']);
/**
* Set the correct content header
*/
header ('Content-Type: ' . $_IMG['iinfo'][0]);
/**
* Create the image
*/
$_IMG['iinfo'][2] ($_IMG['image_image'], '', 100);
/**
* Destroy the image
*/
imagedestroy ($_IMG['image_image']);
/**
* Return true
*/
return true;
}
//Hieronder niets wijzigen!
?>
<style>
img.foto
{
border: 1px solid black;
}
</style>
<?
echo "<center>";
$dir = opendir($files);
while ($open = readdir($dir))
{
if (($open != "..") AND ($open != "."))
{
$point1 = explode('.', $open);
$point2 = count($point1);
$point = strtoupper($point1[$point2-1]);
if (($point == "JPG") OR ($point == "JPEG") OR ($point == "GIF"))
{
$photos[] = "$open";
}
}
}
$aantal = count($photos);
if($aantal == 0)
{
echo "Er zijn geen foto's gevonden!";
}
else
{
if (!isset($photo))
{
if (!isset($p))
{
$p = 1;
}
$paginas = ceil(($aantal / $perpagina));
$show[max] = ($p * $perpagina);
$show[min] = $show[max] - $perpagina;
if ($show[max] > $aantal)
{
$show[max] = $aantal;
}
for ($c = $show[min]; $c < $show[max]; $c++)
{
echo "<a href=\"?pagina=general&photo=$c\" name=\"$c\"><img class=\"foto\" src=\"".$files."/".$photos[$c]."\" height=\"$h\" width=\"$w\"></a> ";
}
echo "<br><br>| ";
for ($b = 1; $b < ($paginas+1); $b++)
{
if ($p == $b)
{
echo "<b>$b</b> | ";
}
else
{
echo "<a href=\"?pagina=general&p=$b\">$b</a> | ";
}
}
echo "<br>Totaal $aantal foto's!";
}
else
{
if (!empty($photos[$photo]))
{
$p = ceil((($photo+1) / $perpagina));
$nav = "| <a href=\"?pagina=general&p=$p#$photo\">Terug</a>";
if ($photo != 0)
{
$nav .= " | <a href=\"?pagina=general&photo=".($photo-1)."\">Vorige</a>";
}
if (($photo+1) != $aantal)
{
$nav .= " | <a href=\"?pagina=general&photo=".($photo+1)."\">Volgende</a>";
}
$nav .= " |";
echo "<img class=\"foto\" src=\"".AddWatermark ($files."/".$photos[$photo], "../fotoalbum/watermerk.png")."\"><br><br>$nav";
}
else
{
echo "Deze foto is niet gevonden!";
}
}
}
?>
</tr><tr><th class="tbl_voet">(images Andre De Paepe)</th></tr></table>
</div>
<h3 class="title">General Images</h3> <hr NOSHADE> <div align="center"> <br><br><br> <table width="500" border="0" cellspacing="0" cellpadding="4" class="officials"> <tr> <th class="tbl_hoofd"><div align="center">General Images </div></th></tr><tr> <td> <? $files = "../fotoalbum/general"; $perpagina = 20; $w = 100; $h = 70; /** * Add a watermerk to an image * * @param string $image The path of the image * @param string $watermerk The path of the watermerk image * @param bool $transparency The transparancy level of the image * @param int $wposition The amount of pixels the watermerk should be placed from the left of the image * @param int $hposition The amount of pixels the watermerk should be placed from the top of the image * @return bool * @access public */ function AddWatermark ($image, $watermerk, $transparency = 16, $wposition = 0, $hposition = 0) { /** * Check if the image and the watermerk image exist */ return trigger_error ('Could not add watermerk to image ' . $_IMG['IMGName'] . ', image file does not exist'); return trigger_error ('Could not add watermerk to image ' . $_IMG['IMGName'] . ', watermerk file does not exist'); /** * Store the information in an array for easy use */ $_IMG['transparency'] = $transparency; $_IMG['image'] = $image; $_IMG['watermerk'] = $watermerk; $_IMG['wposition'] = $wposition; $_IMG['hposition'] = $hposition; /** * Make sure we use the correct things */ switch ($_EXT['image']) { case 'jpg': $_IMG['iinfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg'); break; case 'gif': $_IMG['iinfo'] = array ('image/gif', 'imagecreatefromgif', 'imagegif'); break; case 'png': $_IMG['iinfo'] = array ('image/png', 'imagecreatefrompng', 'imagepng'); break; default: $_IMG['iinfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg'); break; } switch ($_EXT['watermerk']) { case 'jpg': $_IMG['winfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg'); break; case 'gif': $_IMG['winfo'] = array ('image/gif', 'imagecreatefromgif', 'imagegif'); break; case 'png': $_IMG['winfo'] = array ('image/png', 'imagecreatefrompng', 'imagepng'); break; default: $_IMG['winfo'] = array ('image/jpeg', 'imagecreatefromjpeg', 'imagejpeg'); break; } /** * Create the images */ $_IMG['image_mark'] = $_IMG['winfo'][1] ($_IMG['watermerk']); $_IMG['image_image'] = $_IMG['iinfo'][1] ($_IMG['image']); /** * Set the correct widht/height etc... */ $_IMG['image_imagew'] = imagesx ($_IMG['image_image']); $_IMG['image_imageh'] = imagesy ($_IMG['image_image']); $_IMG['image_markw'] = imagesx ($_IMG['image_mark']); $_IMG['image_markh'] = imagesy ($_IMG['image_mark']); /** * Make sure we use the correct position of the watermerk */ if ($_IMG['hposition'] == 0) $_IMG['hposition'] = ($_IMG['image_imageh'] - $_IMG['image_markh']); if ($_IMG['wposition'] == 0) $_IMG['wposition'] = 5; /** * Create the watermerk */ imagecopymerge ($_IMG['image_image'], $_IMG['image_mark'], $_IMG['wposition'], $_IMG['hposition'], 0, 0, $_IMG['image_markw'], $_IMG['image_markh'], $_IMG['transparency']); /** * Set the correct content header */ header ('Content-Type: ' . $_IMG['iinfo'][0]); /** * Create the image */ $_IMG['iinfo'][2] ($_IMG['image_image'], '', 100); /** * Destroy the image */ imagedestroy ($_IMG['image_image']); /** * Return true */ return true; } //Hieronder niets wijzigen! ?> <style> img.foto { border: 1px solid black; } </style> <? { if (($open != "..") AND ($open != ".")) { $point2 = count($point1); if (($point == "JPG") OR ($point == "JPEG") OR ($point == "GIF")) { $photos[] = "$open"; } } } $aantal = count($photos); if($aantal == 0) { echo "Er zijn geen foto's gevonden!"; } else { { { $p = 1; } $paginas = ceil(($aantal / $perpagina)); $show[max] = ($p * $perpagina); $show[min] = $show[max] - $perpagina; if ($show[max] > $aantal) { } for ($c = $show[min]; $c < $show[max]; $c++) { echo "<a href=\"?pagina=general&photo=$c\" name=\"$c\"><img class=\"foto\" src=\"".$files."/".$photos[$c]."\" height=\"$h\" width=\"$w\"></a> "; } for ($b = 1; $b < ($paginas+1); $b++) { if ($p == $b) { } else { echo "<a href=\"?pagina=general&p=$b\">$b</a> | "; } } echo "<br>Totaal $aantal foto's!"; } else { if (!empty($photos[$photo])) { $p = ceil((($photo+1) / $perpagina)); $nav = "| <a href=\"?pagina=general&p=$p#$photo\">Terug</a>"; if ($photo != 0) { $nav .= " | <a href=\"?pagina=general&photo=".($photo-1)."\">Vorige</a>"; } if (($photo+1) != $aantal) { $nav .= " | <a href=\"?pagina=general&photo=".($photo+1)."\">Volgende</a>"; } $nav .= " |"; echo "<img class=\"foto\" src=\"".AddWatermark ($files."/".$photos[$photo], "../fotoalbum/watermerk.png")."\"><br><br>$nav"; } else { echo "Deze foto is niet gevonden!"; } } } ?> </tr><tr><th class="tbl_voet">(images Andre De Paepe)</th></tr></table> </div>
|