B
Blümchen
Hallo,
ok hier mal der ganze Code:
Gruß Blümchen
ok hier mal der ganze Code:
PHP:
<?php
@include('funktionen.inc.php'); //bindet die Datei für die Funktionen ein
$d = $_GET['d'];
$c = $_GET['c'];
$u = $_GET['u'];
?>
<html>
<head>
<title>Bilder</title>
<script type="text-javascript">
function showPic(i) {
var win;
win = window.open("picture.php?b="+i,"bild"+i,"width=550,height=600,scrollbars=no,status=no,toolbar=no");
win.focus();
}
</script>
<style type="text/css">
body, td, div, a { font-family:Arial; font-size:9pt; color:#000000; }
div { padding:5px; }
input { font-family:Arial; font-size:8pt; }
a:link { text-decoration:none; }
a:visited { text-decoration:none; }
a:hover { text-decoration:underline; }
a:active { text-decoration:none; }
.datum {
font-weight: bold;
text-decoration: underline; }
</style>
</head>
<body scroll="auto">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table border="0" cellpadding="4" cellspacing="2">
<?php
if ($d == "" || $c == "") {
$sql = @mysql_query("SELECT * FROM tblbilder ORDER BY datum DESC",$link);
if (@mysql_num_rows($sql) > 0) {
while ($tmp = @mysql_fetch_array($sql)) {
$datum = $tmp[datum];
print "<tr>";
print "<td colspan=3 class=\"datum\">".date("d.m.Y",$tmp[datum])."</td>";
print "</tr>";
$sql1 = @mysql_query("SELECT * FROM tblbilder WHERE datum='$datum' ORDER BY kategorie ASC",$link);
if (@mysql_num_rows($sql1) > 0) {
while ($tmp1 = @mysql_fetch_array($sql1)) {
$kds = holeDS("tblkategorien","id",$tmp1[kategorie]);
$cat = $tmp1[kategorie];
print "<tr>";
print "<td valign=top style=\"padding-left: 15px\"><a href=\"?d=".$datum."&c=".$cat."\">".$kds[kategorie]."</a></td>"; if (@mysql_num_rows($sql2) > 0) {
while ($tmp2 = @mysql_fetch_array($sql2)) {
$uds = holeDS("tbluser","id",$tmp2[benutzer]);
$anz = countBilder($datum,$cat,$tmp2[benutzer]);
if ($anz > 0) {
print "";
if ($uds[nickname] != "") print $uds[nickname];
else print $uds[vorname]." ".$uds[nachname];
print "</a>";
print " ".$anz."<br>";
}
}
}
print "</td>";
print "</tr>";
}
}
}
}
}
elseif ($u == "") {
$sql = @mysql_query("SELECT * FROM tblbilder WHERE datum='$d' AND kategorie='$c' ORDER BY benutzer ASC",$link);
if (@mysql_num_rows($sql) > 0) {
$x = 0;
while ($tmp = @mysql_fetch_array($sql)) {
if ( ( ( $x ) %5 ) == 0) {
print "</tr><tr>";
}
print "<td><a href=\"javascript:showPic(".$tmp[id].");\" title=\"Bild anzeigen\">";
$info = getimagesize($path.$tmp[bild]);
if ($info[0] == "" || $info[0] > 120) print "<img src=\"".$path.$tmp[bild]."\" width=\"120px\" border=\"0\" alt=\"Bild anzeigen\" galleryimg=\"no\">";
else print "<img src=\"".$path.$tmp[bild]."\" border=\"0\" alt=\"Bild anzeigen\" galleryimg=\"no\">";
print "</a></td>";
$x++;
}
}
}
else {
$sql = @mysql_query("SELECT * FROM tblbilder WHERE datum='$d' AND kategorie='$c' AND benutzer='$u' ORDER BY bild ASC",$link);
print "<tr>";
print "<td colspan=2>[ <a href=\"?\">zurück zur Übersicht</a> ]</td>";
print "</tr>";
if (@mysql_num_rows($sql) > 0) {
while ($tmp = @mysql_fetch_array($sql)) {
$split = explode("-",$tmp[bild]);
$num = substr($split[1],0,-4);
$uds = holeDS("tbluser","id",$tmp[benutzer]);
if ($uds[nickname] != "") $user = $uds[nickname];
else $user = $uds[vorname]." ".$uds[nachname];
print "<tr>";
print "<td valign=top>Bild ".$num."<br>von ".$user."</td>";
print "<td valign=top><a href=\"javascript:showPic(".$tmp[id].");\" title=\"Bild anzeigen\">";
$info = getimagesize($path.$tmp[bild]);
if ($info[0] == "" || $info[0] > 120) print "<img src=\"".$path.$tmp[bild]."\" width=\"120px\" border=\"0\" alt=\"Bild anzeigen\" galleryimg=\"no\">";
else print "<img src=\"".$path.$tmp[bild]."\" border=\"0\" alt=\"Bild anzeigen\" galleryimg=\"no\">";
print "</a></td>";
print "</tr>";
}
}
else {
print "<td align=center><font color=#CC3333>Es wurden noch keine Bilder in diese Kategorie eingetragen.</td>";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Gruß Blümchen