Hallo,
ich wollte mal fragen ob mir jemand den Fehler beseitigen kann? Ich habe keine Ahnung von PHP und habe nur etwas rumgespielt und nun erhalte ich einen Fehler:
Code:
ich wollte mal fragen ob mir jemand den Fehler beseitigen kann? Ich habe keine Ahnung von PHP und habe nur etwas rumgespielt und nun erhalte ich einen Fehler:
Parse error: syntax error, unexpected '}' in /var/www/html/web574/html/host/myimages.php on line 108
Code:
Code:
<?require_once("header.php");
if(!$userid)
{
header("Location: login.php");
exit;
}
$limit = $_REQUEST['limit'];
if ($limit == "") {
$limit = 10;
}
$start = $_REQUEST['start'];
if ($start == "") {
$start = 0;
}
$sort = $_REQUEST['sort'];
if ($sort == "") {
$sort = "added";
}
$tn = $_REQUEST['tn'];
if ($tn == "") {
$tn = 0;
}
$details = $_REQUEST['details'];
if ($details == "") {
$details = 1;
}
$totalcount = 0;
$query = "SELECT count(filename) as ct from images where userid=$userid";
$result = mysql_query($query) or die("Query failed 1.");
while ($line = mysql_fetch_array($result)) {
$totalcount = $line[ct];
}
mysql_free_result($result);
$displaystart = $start + 1;
$displayend = ($start + $limit > $totalcount ? $totalcount : $start + $limit);
if ($displayend == $totalcount) {
$nextset = 0;
} else {
$nextset = ($totalcount - $displayend > $limit ? $limit: ($totalcount - $displayend));
}
if ($details) {
$query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath, i.added as add_dt, i.ip as ip, i.filesize as filesize, sum(ih.kb) as bandwidth, count( ih.filename ) as ctr from images i left outer join imagehits ih on i.filename = ih.filename where i.userid=$userid group by filename order by " . $sort . " desc limit " . $start . "," . $limit;
} else {
$query = "select i.filename as filename, i.tn_filename as tn_filename, i.filepath as filepath from images i left outer join imagehits ih on i.filename = ih.filename where i.userid=$userid group by filename order by " . $sort . " desc limit " . $start . "," . $limit;
}
$result = mysql_query($query) or die("Query failed 2.");
?>
<div id="inhaltbox">
<h1>Optionen</h1>
<form name="images" id="images" action="<?= $_SERVER['PHP_SELF'] ?>" method="post" style="margin-bottom: 0px;">
<div align="center" style="color: #000080;">
Bilder Zeigen: <input type="text" name="limit" value="<?= $limit ?>" size="3" maxlength="4"> Sortieren nach: <select name="sort" size="1"><option value="filename" <?= ($sort == "filename" ? "selected" : "") ?>>Image Name</option><option value="added" <?= ($sort == "added" ? "selected" : "") ?>>Datum & Zeit</option><option value="ip" <?= ($sort == "ip" ? "selected" : "") ?>>IP Addresse</option><option value="filesize" <?= ($sort == "filesize" ? "selected" : "") ?>>Datei Größe</option><option value="ctr" <?= ($sort == "ctr" ? "selected" : "") ?>>Views</option><option value="bandwidth" <?= ($sort == "bandwidth" ? "selected" : "") ?>>Bandwidth</option></select> Zeige Details: <select name="details" size="1"><option value="1" <?= ($details == "1" ? "selected" : "") ?>>Ja</option><option value="0" <?= ($details == "0" ? "selected" : "") ?>>Nein</option></select> <input type="submit" name="btn" value="Zeigen">
</div>
<div id="inhaltbox">
<h1>Deine Bilder</h1>
<div class="klappbox">
<h2>Zeige Bilder <?= $displaystart ?> bis <?= $displayend ?> von <?= $totalcount ?></h2>
<br />
<? if ($start > 0) { ?><a style="color: #0000cd;" href="<?= $PHP_SELF ?>?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start - $limit?>&tn=<?= $tn ?>&details=<?= $details ?>">Previous <?= $limit ?></a> - <? } ?><? if ($nextset > 0) { ?><a style="color: #0000cd;" href="<?= $PHP_SELF ?>?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start + $limit?>&tn=<?= $tn ?>&details=<?= $details ?>">Next <?= $nextset ?></a><? } ?>
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr valign="top">
<td align="center" id="<?=$line[filename]?>">
<img src="<?=$line[filepath].$line[tn_filename] ?>" border="0"><br />
<input type="checkbox" name="chk[]" value="<?= $line[filename] ?>">
<p><a href="view-<?= $line[filename] ?>">Bild anzeigen</a></p>
</td><td style="font-size: 10pt; font-style: italic; padding-left: 25px;">
<? if ($details) { ?>
<table border="0">
<tr>
<td>Alle Bilder makieren:</td>
<td><input type="checkbox" onClick="check_all('chk','images')"></td>
</tr>
<tr>
<td>Bildername:</td>
<td><?=$line[filename]?></td>
</tr>
<tr>
<td>Uploaded</td>
<td><?= date("d/m/Y h:i:s A", $line[add_dt]) ?></td>
</tr>
<?
$band=$line[bandwidth];
$bandwidthmb = ($band / 1048576) ;
//$bandwidthmb = ($band / 1024) ;
$filesizekb = ($line[filesize] / 1024) ;
?>
<tr>
<td>Dateigröße</td>
<td><?= number_format($filesizekb)?></td>
</tr>
<tr>
<td>Angesehen</td>
<td><a href="referers.php?limit=<?= $limit ?>&sort=<?= $sort ?>&start=<?= $start ?>&tn=<?= $tn ?>&details=<?= $details ?>&filename=<?= $line[filename] ?>"><?= number_format($line[ctr]) ?>x</a></td>
</tr>
<tr>
<td>Bandwidth M</td>
<td><?= number_format($bandwidthmb) ?></td>
</tr>
</table><? $i++;} ?></td>
</tr>
</tbody></table>
<hr>
<? } else { ?>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr>
<?
$ctr = 0;
while ($line = mysql_fetch_array($result)) {
$ctr++;
?>
<td valign="top" align="center"><div id="<?=$line[filename]?>"><a href="view-<?= $line[filename] ?>"><img src="<?=$line[filepath].$line[tn_filename] ?>" border="0"></a><br /><br /><input type="checkbox" name="deleteFN[]" value="<?= $line[filename] ?>"></div></td>
<?
if ($ctr % 5 == 0) {
?>
</tr>
<tr>
<?}}?>
</tr>
</table>
</div>
<? }
mysql_free_result($result);
mysql_close($link);
?>
<br />
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr bgcolor="#dcdcdc">
<td align="center" class="cell"><input type="button" name="btn" value="Delete" onClick="return deleteimage();"></td>
</tr>
</table>
</div>
</form>
</div>
</div>
<? require_once("footer.php"); ?>
Kommentar