login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Foto gallerijen > Foto Album zonder reactiesysteem

Foto Album zonder reactiesysteem

Auteur: webbiexl - 02 september 2004 - 15:31 - Gekeurd door: Dennisvb - Hits: 16800 - Aantal punten: 1.78 (18 stemmen)




Hey dit is hetzelfde reactiesysteem als mijn vorige die ik heb gepost,
alleen heb ik het reactiesysteem eruit gehaald. Zo kunnen mensen
die op hun site wel php ondersteuning hebben maar geen MySQL ondersteuning
ook dit prachtige fotoalbum op hun site kwijt 

Functies van het Album.
Het album bestaat uit 2 delen.
- album.php
- albumlist.php

- albumlist.php
Dit is de pagina die je include op je indexpagina. Deze pagina verwijst naar de verschillende albums (mappen), en komt vervolgens uit op album.php waarover ik het volgende uit te leggen heb.

- album.php
Album.php werkt heel simpel.
Je moet je map met foto's uploaden naar je server. Deze map is direct al het album.
Het enige wat je moet doen om die op te roepen is de link te veranderen in albumlist.php.

Dit gaat als volgt

  1. <a href="?page=album&boek=Album1">Foto's bekijken</a>


Verander in de link hier boven 'Album1' in de naam van je map. Wil je bijvoorbeeld
'mijn verjaardag' als naam hebben noem dan de map 'mijn_verjaardag'. Het script zet _ automatisch om in spaties

Album.php verwerkt, dankzij veranderingen, alle foto's in de geplaatste mappen tot thumbnails. Deze thumbnails dienen als link om naar de foto zelf te gaan.

Ik hoop dat jullie er gebruik van zullen maken en laat ff weten wat je er van vindt!

grtz Webbie XL

Code:
Albumlist.php

  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  5. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  6. <meta name="ProgId" content="FrontPage.Editor.Document">
  7. <title>Foto Album</title>
  8. </head>
  9.  
  10. <body>Foto's<br>
  11. <table cellspacing="0" border="0" cellpadding="0" width="90%">
  12. <tr><td colspan="2"><hr></td></tr>
  13. <tr>
  14. <td rowspan="2" align="center" width="200"><a href="?page=album&boek=Album1"><img src="" height="100" alt="Album 1" border="0"></a></td>
  15. <td valign="top"><font face="Arial" size="2">Album 1<br>
  16. </font><font face="Arial" size="1">Foto's van bijvoorbeeld je schoonmoeder.</font><br>
  17. </td>
  18. </tr>
  19. <tr>
  20. <td valign="bottom"><a href="?page=album&boek=Album1">Foto's bekijken</a></td>
  21. </tr>
  22. <tr><td colspan="2"><hr></td></tr>
  23. <tr>
  24. <td rowspan="2" align="center" width="200"><a href="?page=album&boek=Album1"><img src="" height="100" alt="Album 2" border="0"></a></td>
  25. <td valign="top"><font face="Arial" size="2">Album 2<br>
  26. </font><font face="Arial" size="1">Foto's van bijvoorbeeld je zomervakantie.</font><br>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td valign="bottom"><a href="?page=album&boek=Album2">Foto's bekijken</a></td>
  31. </tr>
  32. <tr><td colspan="2"><hr></td></tr>
  33.  
  34.  
  35. </table>
  36.  
  37.  
  38. </body>
  39.  
  40. </html>


Album.php

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <?
  2.  
  3. if(is_dir($_GET['boek'])){
  4. // configuratie
  5. $aantalFotos = 18; // aantal fotos per pagina
  6. $originalPath = $_GET['boek']; //de map aangeroepen in de url
  7. $path = $_GET['boek']; // path naar de foto
  8.  
  9. $fotoArray = array();
  10.  
  11. $d = dir("$path");
  12.  
  13. while($entry=$d->read()) {
  14. if(eregi(".jpg|.jpeg|.gif|.bmp|.png", $entry)){
  15.  
  16. $foto = $path . "/" . $entry ;
  17. $fotoArray[] = $foto;
  18.  
  19. }
  20.  
  21. }
  22.  
  23. $d->close();
  24. $count = count($fotoArray);
  25.  
  26. $pathspatie = str_replace("_", "&nbsp;", $originalPath);
  27.  
  28.  
  29. ?>
  30.  
  31. <html>
  32. <head>
  33. <title>Fotos</title>
  34. </head>
  35.  
  36. <body>
  37.  
  38.  
  39. <table width="100%"><tr><td align="center" width="100%">
  40.  
  41. <?
  42.  
  43.  
  44. // 1 FOTO PER PAGINA
  45.  
  46. if((isset($_GET['fotoID'])) AND (intval($_GET['fotoID']>=0)) AND (intval($_GET['fotoID'] < $count))){
  47. $showFoto = intval($_GET['fotoID']);
  48.  
  49. echo "<table width='40%'><tr><td colspan='3' align='center'><b>" . $pathspatie . "</b>
  50. <br><br><small>Foto " . ($showFoto + 1) . " / " . $count . "</small></big></font> </td></tr><tr>";
  51.  
  52. echo "<tr><td colspan='3' align='center'><a href='" . $fotoArray[$showFoto] . "' target='_blanc'><img src='" . $fotoArray[$showFoto] . "' height='300' border='0'></a></td></tr>";
  53. echo "<tr><td width='40%'>";
  54. if($showFoto!=0){
  55. $prevFoto = ($showFoto - 1);
  56. echo "<a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&fotoID=" . $prevFoto . "'>prev</a> ";
  57. } // end if
  58. echo "</td><td width='33%'>";
  59. $pageNR = floor($_GET['fotoID'] / $aantalFotos);
  60. $pageNR = $pageNR * 18;
  61. echo "<a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&vanafFoto=" . $pageNR . "'>list</a> ";
  62. echo "</td><td align='right'>";
  63. if($showFoto!=($count -1)){
  64. $nextFoto = ($showFoto + 1);
  65. echo "<a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&fotoID=" . $nextFoto . "'>next</a> ";
  66. } // end if
  67. echo "</td></tr></table>";
  68.  
  69. }
  70.  
  71.  
  72. // X FOTOS PER PAGINA
  73.  
  74. else {
  75.  
  76. // configuratie
  77. $clm = 3; // Aantal kolommen
  78.  
  79.  
  80. $countFotos = count($fotoArray);
  81. $thumbPath = $path . "/"; //Path naar thumps
  82. $path2 = $path . "/";
  83.  
  84.  
  85.  
  86. echo "<br><table ><tr>";
  87.  
  88. echo "<td align='center' colspan='" . $clm . "'>";
  89.  
  90.  
  91. // navigatie
  92. $navigation;
  93. if($countFotos < ($aantalFotos + 1)){
  94. $begin = 0;
  95. $eind = $countFotos;
  96.  
  97. } // end if
  98. else {
  99.  
  100. $aantalPages = ceil($countFotos / $aantalFotos) ;
  101. for($i=1; $i < $aantalPages + 1; $i++){
  102. $pageNR = ($i - 1) * $aantalFotos;
  103.  
  104. if($pageNR==$_GET["vanafFoto"]){
  105. $navigation .= "<small><font color='#990000'>" . $i . "</font></small> ";
  106. }
  107. else {
  108. $navigation .= "<a href='?page=album&boek=" . $originalPath . "&vanafFoto=" . $pageNR . "'>" . $i . "</a> ";
  109. }
  110. } // end for
  111.  
  112.  
  113. if((isset($_GET['vanafFoto'])) AND (intval($_GET['vanafFoto']>=0)) AND (intval($_GET['vanafFoto'] < $countFotos))){
  114. $begin = intval($_GET['vanafFoto']);
  115.  
  116. if(($begin + $aantalFotos) <= $countFotos){
  117. $eind = ($begin + $aantalFotos);
  118. } // end if
  119. else {
  120. $eind = $countFotos;
  121. } // end else
  122.  
  123. } // end if
  124. else {
  125. $begin = 0;
  126. $eind = $aantalFotos;
  127. } // end else
  128.  
  129. $countFotos = count($fotoArray);
  130.  
  131.  
  132. // path naar echte foto
  133.  
  134. } // end else
  135.  
  136. echo "<table border='0' cellpadding='0' cellspacing='2'><tr><td ><b>" . $pathspatie . "</b> <small>(" . $count . ")</small>
  137. <br><br><center><small>Pictures " . ($begin + 1) . " - " . $eind . "</small></center></td></tr></table>";
  138.  
  139.  
  140.  
  141. if(($begin - $aantalFotos) >= 0){
  142. $navigation = "<a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&vanafFoto=" . ($begin - $aantalFotos) . "'><</a> " . $navigation;
  143. } // end if
  144.  
  145.  
  146. if(($begin + $aantalFotos) < $count){
  147. $navigation .= " <a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&vanafFoto=" . ($begin + $aantalFotos) . "'>></a>";
  148. } // end if
  149.  
  150. echo $navigation . "<br><br>";
  151. echo "</td></tr><tr>";
  152. $fotonr = 1;
  153. for($i=$begin; $i < $eind; $i++){
  154.  
  155.  
  156. $thumb = str_replace($path2, $thumbPath, $fotoArray[$i]);
  157.  
  158.  
  159. echo "<td align='center'><a href='" . $_SERVER['PHP_SELF'] . "?page=album&boek=" . $originalPath . "&fotoID=" . $i . "'><img border='0' src='" . $thumb . "' height='100'><br>";
  160.  
  161. echo "</td>";
  162. $fotonr++;
  163. if($fotonr == ($clm + 1)){
  164. echo "</tr>\n<tr>";
  165. $fotonr = 1;
  166. } // end if
  167.  
  168.  
  169.  
  170.  
  171. } // end for
  172. echo "</tr>";
  173.  
  174. echo "<td align='center' colspan='" . $clm . "'>";
  175.  
  176. echo $navigation;
  177.  
  178. echo "</td></tr><tr>";
  179.  
  180. echo "</table>";
  181.  
  182.  
  183. } // end else if
  184. } // end if
  185. else {
  186. echo "Dit fotoalbum bestaat niet";
  187. } // end else
  188.  
  189.  
  190.  
  191. ?>
  192. </td></tr></table>
  193.  
  194.  
  195.  
  196. </body>
  197. </html>
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (19)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.055s