C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gallery\index.php


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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
# ~~~~~~~~~~~~~~~~~~~~~~
# arnep.de PhotoGallerie
# ~~~~~~~~~~~~~~~~~~~~~~
# Version: 0.1.20030917
# Homepage: http://scripte.arnep.de
# Author: Arne Pottharst
# (c) Copyleft arnep.de
#     This Script was published under GPL (GNU Public License),
#     see http://www.gnu.org/copyleft/

// Konfiguration
// Hier das Script einstellen, damit alles laeuft!

// Titel der Seite
$title 'Meine Photo-Gallerie';

// Anzahl der Photos, die in einer Reihe angezeigt werden
$photos_in_row 4;

// Verzeichnis für Thumbnails, evtl. Praefix angeben
// Graesse der Thumbnails: 112 Pixel breit oder 112 Pixel hoch (laengste Seite!)
$thumbdir 't/';

// Verzeichnis für normale Bilder, evtl. Praefix angeben
$imgdir "n/";

// Kommentardateien
// Array( '#HTML-Color' => 'filename' );
// filename: Endung .txt nicht angeben, aber als .txt-Datei speichern!
// Es koennen mehrere Kommentare angegeben werden, diese werden untereinander ausgegeben

$comments = Array('#dddddd' => 'comments');

// ENDE der Konfiguration

###############################################################################

$show $_GET["show"];

// Funktion zum Anzeigen der Bilder, erzeugt eine Tabelle mit "Negativ"-Hintergrund (film.gif)
function Bild($nr,$comment=""){
    global 
$thumbdir;
    
$size GetImageSize ($thumbdir.$nr.'.jpg');
    
$comment addslashes(strip_tags($comment));
    if (
$size[0] == 112 || $size[0] == 113)
        {
$vspace=24;$hspace=16;} //25,16
    
else
        {
$vspace=5;$hspace=40;} //5,35
    
echo "<table height=\"141\" width=\"163\" background=\"film.gif\"><tr><td valign=\"top\"><a href=\"?show=$nr\"><img vspace=\"$vspace\" hspace=\"$hspace\" src=\"${thumbdir}${nr}.jpg\" $size[3] border=\"0\" alt=\"$comment\" title=\"$comment\"></a></td></tr></table>";
#    echo "<div style='position:relative;border:1px solid black;height:141px;width:163px;background:url(film.gif);margin:10px;'><div style='border:1px solid red;width:120px;'><a href=\"?show=$nr\"><img src=\"${thumbdir}${nr}.jpg\" $size[3] border=\"0\" alt=\"$comment\" title=\"$comment\" style='paddin g-top:{$paddingtop}px;paddi ng-left:{$paddingleft}px;'></a></div></div>";
}

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="arnep.de PhotoGallerie (http://arnep.de/scripte/photos/">
<title><?php echo $title; if (isset($show)){ echo " | Photo No. ".$show; } ?></title>
<style type="text/css">
<!--
body {
 font-family: Verdana, sans-serif;
}
q {
 text-align: left;
 border-style:solid;
 border-width:thin;
 padding: 5px;
 font-size: 12pt;
 width: 450px;
 display:block;
}
//-->
</style>
</head>
<h1 align="center"><?php echo $title?></h1>
<p align="center">
<?php
$images 
file("photos.txt");
preg_match("/([^ ]+) (.*)/",$images[0],$first_image);
$first_image $first_image[1];
if (isset(
$show)) echo '<a href=".">Photo-&Uuml;bersicht</a> | <b>Kommentare</b>';
             else echo 
'<b>Photo-&Uuml;bersicht</b> | <a href="?show='.$first_image.'">Kommentare</a>';

if (isset(
$show)){
    
$count count($images);

    while(list(
$linenum,$line)=each($images))
    {
        
preg_match("/([^ ]+) (.*)/",$line,$out);
        if (
$out[1] == $show)
        {
            
$num $linenum;
            
$comment $out[2];
            
$htmlcomment strip_tags($comment);
        }
    }

    
preg_match("/([^ ]+) (.*)/",$images[$num-1],$out);
    
$last $out[1];
    
preg_match("/([^ ]+) (.*)/",$images[$num+1],$out);
    
$next $out[1];

    echo 
"<p align=\"center\">";
    if (
$last!="") { echo '<a href="?show='.$last.'">&lt;&lt;</a> | ';}
    echo 
"<b>Photo No. $show</b>";
    if (
$next!="") { echo ' | <a href="?show='.$next.'">&gt;&gt;</a>';}
    echo 
"</p>";

} else {
  echo 
"<p align=\"center\"><b>Alle Photos</b></p>\n";
}

?>
<table align="center"><tr><td align="center">

<?
if (isset($show)) {
    
$size = @GetImageSize ("${imgdir}${show}.jpg");
    
$size[0] = $size[0]*5;
    
$size[1] = $size[1]*5;
    echo 
"<img src=\"n/$show.jpg\" $size[3] border=\"1\" alt=\"$htmlcomment\" title=\"$htmlcomment\"><br>";
    echo 
"<p align=\"center\" class=\"copy\">$comment</p>";
    
//Links zum vorherigen/nächsten Photo ausgeben
    
echo "<p align=\"center\">";
    if (
$last!="") { echo '<a href="?show='.$last.'">&lt;&lt;</a> | ';}
    echo 
"<a href=\".\">Photo-&Uuml;bersicht</a>";
    if (
$next!="") { echo ' | <a href="?show='.$next.'">&gt;&gt;</a>';}
    echo 
"</p>";

    
//Kommentare ausgeben
    
while(list($color,$name)=each($comments))
    {
        if (
$comment = @file("${name}.txt"))
        while(list(
$linenum,$line)=each($comment))
        {
            
preg_match("/([^ ]+) (.*)/",$line,$out);
            if (
$out[1] == $show)
            {
                echo 
"<q style=\"background:$color\" title=\"\">".trim($out[2])."</q>";
                break;
            }
        }
    }

} else {
    
// Ausgabe der Bilderübersicht, Gesamtanzahl durch Anzahl der Spalten teilen, ist etwas kompliziert ;-)
    
$images file("photos.txt");
    
$count count($images)+2;
    for (
$j 0$j $photos_in_row$j++)
    {
        for (
$i $j$i $count$i += $photos_in_row)
        {
            
$line $images[$i];
            
preg_match("/([^ ]+) (.*)/",$line,$out);
            if (
$out[1] != "")
            {
                
Bild($out[1],$out[2]);
            }
        }
        echo 
"</td><td align=\"center\" valign=\"top\">\n";
    }
}
?>

</td></tr></table>

<hr>
<p align="center">Made using <a href="http://arnep.de/scripte/photos/">arnep.de PhotoGallerie</a>.

</p>
<?
// Preloader: läd das vorhergehende und nächste Bild in ein 1x1 großes <img>
if ($last != "") { echo "<img src=\"${imgdir}${last}.jpg\" height=\"1\" width=\"1\" alt=\"\" border=\"0\">"; }
if (
$next != "") { echo "<img src=\"${imgdir}${next}.jpg\" height=\"1\" width=\"1\" alt=\"\" border=\"0\">"; }
?>


</body>
</html>