fotogallery

Gesponsorde koppelingen

PHP script bestanden

  1. fotogallery

« Lees de omschrijving en reacties

DEZE PAGINA NOEMT: Fotopagina.php

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?PHP
        
//Thumbs (DIT MOETEN THUMB FOTO'S ZIJN)

//Tellen van de foto's in de map

$handle = opendir("images/foto/"); //Je map
$i = 0;
while(false !== ($b = readdir($handle))) {
if(!is_dir($b) && $b != "." && $b != "..") {
   $i++;
}
}

closedir($handle);

//Pagina checken
if($_GET['page']) {
    $start=$_GET['page']*30; //30 = aantal foto's per pagina!
    
} else {
    $start=0;
    
}



//For-loop --> Links maken
for($q=$start; $q < 30, $q < $i; $q=$q+3) //30 = aantal foto's per pagina!
{
    
//Creating the link
$n1        = $q+1;
$n2        = $q+2;
$n3        = $q+3;

$link    = "<img src=images/foto/foto"; //Je map

$G1        = array($link, $n1, ".gif>");
$G2        = array($link, $n2, ".gif>");
$G3        = array($link, $n3, ".gif>");

$foto1     = implode('', $G1);
$foto2     = implode('', $G2);
$foto3     = implode('', $G3);


//Tonen van de thumbs
PRINT <<<ENDHTML
<table>
<tr>
    <td align=center> <a href=Fotopagina2.php?enlarge=$n1>$foto1            </a>    </td>
    <td align=center> <a href=Fotopagina2.php?enlarge=$n2>$foto2            </a>    </td>
    <td align=center> <a href=Fotopagina2.php?enlarge=$n3>$foto3            </a>    </td>
</tr>
</table>
ENDHTML
;

}



//For-loop --> aantal pagina's
for($page = 0; $page < ceil(($i)/30); $page++) { //30 = aantal foto's per pagina
    $r=$page+1;
    
print <<<ENDHTML
    <a href=Fotopagina.php?page=$page>$r</a>|
ENDHTML
;
}


?>




DEZE NOEMT: Fotopagina2.php

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?PHP
        
//Grotere foto's (Hier moet je de foto's groter laten zien)
if($_GET['enlarge']) {
    
    //Verander de link in de array mocht dit nodig zijn!
    
    //maken van de link

    $number     =     $_GET['enlarge'];
    $create        =    array("<img src=images/foto/foto", $number, ".gif>");
    $greatpic     =    implode('', $create);
        
    
    //volgende en vorige foto
    $vorige     =    $number-1;
    $volgende    =    $number+1;
    
    
    //Tonen van foto's
echo"
    <table width=500px>
    <tr>
        <td align=center> $greatpic </td>
    </tr>
    </table>
    <table width=500px;>
    <tr>
        <td align=left>        <a href=Fotopagina2.php?enlarge=$previous>Vorige</a></td>
        <td align=center>    <a href=Fotopagina.php>Terug naar de thumbpagina</a></td>
        <td align=right>    <a href=Fotopagina2.php?enlarge=$next>Volgende</a></td>
    </tr>
    </table>
    "
;
    }

    
?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.