Wasserzeichen hinzufügen (PHP)

Alidey

Aktives Mitglied
Thread Starter
Dabei seit
08.10.2003
Beiträge
616
Reaktionspunkte
0
Hallo,
at the moment benutze ich folgendes, simples Skript zur Darstellung von Fotos:

PHP:
<?php

  $tblWidth = "350";
  $tblHeight = "350";
  $rowHeight = "10";
  $showDirectoryIndex = TRUE;
  $showHomepage = TRUE;
  $allowedXtension = array("jpg", "gif");

  $curdir = getcwd();
  $dir = opendir($curdir);
  $file = ".";
  if( !isset($showPic) ) {
    $showPic = 0;
  }

  if($showDirectoryIndex) {
    $DirectoryIndex = "&nbsp;DirectoryIndex&nbsp;";
  } else {
    $DirectoryIndex = "&nbsp;";
  }
  
  if($showHomepage) {
    $Homepage = "&nbsp;Homepage&nbsp;";
  } else {
    $Homepage = "&nbsp;";
  }
  
  while(false !== ($file = readdir($dir))) {
    $xtension = explode(".",$file);
    $xtension = strtolower($xtension[count($xtension) - 1]);
    if( $file != "." && $file != ".." && in_array($xtension, $allowedXtension) ) {
      $picName[] = $file;
	}
  }
   
   sort($picName, SORT_STRING);
   $NrFiles = count($picName);
   
?>




<html>

<body class=slideshow>

<table width="<?php echo $tblWidth; ?>" border="0" cellspacing="0" cellpadding="4" align="center" >
<tr>
    <td width="15%" height="<?php echo $rowHeight; ?>" align="center">
	  
	  <?php if( $showPic > 0 ) {
	    $PrevPic = $showPic - 1;
	   ?>
	  <a href="<?php echo "$PHP_SELF?showPic=$PrevPic" ?>">Zur&uuml;ck</a>
	  <?php } ?>
	</td>
    <td width="15%" height="<?php echo $rowHeight; ?>" align="center">
	  
	  <?php if( $showPic > 0 ) {
	  ?>
	  <a href="<?php echo "$PHP_SELF" ?>">Erstes</a>
	  <?php } ?>
	  
	</td>
    <td width="40%" height="<?php echo $rowHeight; ?>" align="center" class="counter">
	  
	  <?php
	    echo "(Bild " . ($showPic + 1) . " von " . count($picName) . ")";
	  ?>
	  
	</td>
    <td width="15%" height="<?php echo $rowHeight; ?>" align="center">
	 
	  <?php if( $showPic != count($picName) - 1 ) {
	    $LastPic = count($picName) - 1;
	  ?>
	  <a href="<?php echo "$PHP_SELF?showPic=$LastPic" ?>">Letztes</a>
	  <?php } ?>
	  
	</td>
    <td width="15%" height="<?php echo $rowHeight; ?>" align="center">
	  <?php
	    if( $showPic != count($picName) - 1 ) {
		  $NextPic = $showPic + 1;
		 ?>
	  <a href="<?php echo "$PHP_SELF?showPic=$NextPic" ?>">Weiter</a>
	  <?php } ?>
	 
	</td>
</tr>
</table>
<table width="<?php echo $tblWidth; ?>" border="0" height="<?php echo $tblHeight; ?>" cellspacing="0" cellpadding="4" align="center">
<tr>
    <td align="center" valign="top"><img src="<?php echo $picName[$showPic] ?>" alt="<?php echo $picName[$showPic] ?>" border="0"></td>

</tr>
</table>

Dabei werden einfach alle Fotos aus einem Ordner ausgelesen und nacheinander dargestellt.

Was ich jetzt gerne hätte:
Dass das PHP-Skript automatisch unten recht ein kleines Wasserzeichen, einfach nur eine URL einblendet. Hab irgendwo mal gehört dass das geht, bin damit aber total überfordert. Könnte mit vielleicht ein netter Macuser unter die Arme greifen?


Vielen Dank!


ALIdey
 
Zurück
Oben Unten