include("inc/standard.php");
if (($fotoID == "") && ($random == "")) {
$fotoPara = " where ".$basic." order by fDate desc";
$firstTime = 1;
}
elseif (($fotoID == "") && ($random != "")) {
$fotoPara = " where ".$basic." order by rand()";
}
else {
$fotoPara = " where ".$basic." and date_format(fDate, '%Y%m%d') = ".$fotoID;
}
$selectFoto = "select fID, date_format(fDate, '%W, %d-%m-%Y'), fDate, date_format(fDate, '%Y%m%d'), frUserID, fComment
from bbPhoto".$fotoPara;
$fotoData = @mysql_query($selectFoto,$dbh);
$photoID = @mysql_result($fotoData, 0, 0);
$photoDate = @mysql_result($fotoData, 0, 1);
$photoFile = @mysql_result($fotoData, 0, 2);
$fotoID = @mysql_result($fotoData, 0, 3);
$photoComment = @mysql_result($fotoData, 0, 5);
// Calculate dimensions of photo
$photoSizeData = $userPhotoPath.$photoFile."_s.jpg";
$photoSize = getimagesize($photoSizeData);
$photoWidth = $photoSize[0];
$photoWidthHalf = $photoSize[0]/2 - 40;
$photoHeight = $photoSize[1] - 14;
$photoNavPosPrev = 0;
$photoNavIconPrev = 10;
$photoNavPosNext = $photoSize[0]/2 + 30;
$photoNavIconNext = $photoSize[0]/2 - 90;
// Select Last Photo
$selectLastFoto = "select date_format(fDate, '%Y%m%d'), fID, frUserID
from bbPhoto
where ".$basic."
order by fDate
desc";
$lastFotoData = @mysql_query($selectLastFoto,$dbh);
$lastFoto = @mysql_result($lastFotoData, 0, 0);
// Select Next Photo
$selectNextFoto = "select date_format(fDate, '%Y%m%d'), fID, frUserID
from bbPhoto
where ".$basic." and date_format(fDate, '%Y%m%d') > ".$fotoID." order by fDate asc";
$nextFotoData = @mysql_query($selectNextFoto,$dbh);
$nextFoto = @mysql_result($nextFotoData, 0, 0);
// Select Next Random Photo
if ($random != "") {
$selectRandomFoto = "select fID, date_format(fDate, '%Y%m%d')
from bbPhoto
where ".$basic." order by rand()";
$randomFotoData = @mysql_query($selectRandomFoto,$dbh);
$randomFoto = @mysql_result($randomFotoData, 0, 1);
}
// Select Previous Photo
$selectPrevFoto = "select date_format(fDate, '%Y%m%d'), fID, frUserID
from bbPhoto
where ".$basic." and date_format(fDate, '%Y%m%d') < ".$fotoID." order by fDate desc";
$prevFotoData = @mysql_query($selectPrevFoto,$dbh);
$prevFoto = @mysql_result($prevFotoData, 0, 0);
// Select First Photo
$selectFirstFoto = "select date_format(fDate, '%Y%m%d'), fID, frUserID
from bbPhoto
where ".$basic."
order by fDate
asc";
$firstFotoData = @mysql_query($selectFirstFoto,$dbh);
$firstFoto = @mysql_result($firstFotoData, 0, 0);
// Load Comments
$select_comment = "select fID as CommentID, fName as Name, fWebsite as Website, fComment as Kommentar, frFotoID, date_format(fCreated, '%d.%m.%Y at %H:%i') as Datum, fCreated, frUserID
from bbGuestbook
where frFotoID = ".$photoID."
order by fCreated
desc";
$comment_data = @mysql_query($select_comment,$dbh);
$comment_check_data = @mysql_query($select_comment,$dbh);
$comment_check = @mysql_result($comment_check_data, 0, 0);
include("inc/nav.php");
?>
endif; ?>">
if ($firstTime != ""): ?>
endif; ?>
if ($testServer != ""): ?>
Variablentester: $_SERVER['SERVER_NAME']:
endif; ?>
|
|
if ($photoComment != ""): ?>
|
|
endif; ?>
if ($random == ""): ?>
if ($nextFoto != ""): ?>
endif; ?>
if ($fotoID != $firstFoto): ?>
endif; ?>
else: ?>
if (($fotoID != "") && ($random != "0")): ?>
endif; ?>
endif; ?>
if ($end == ""): ?>
endif; ?>
if ($end != ""): ?>
endif; ?>
|
|
if ($fotoID != $firstFoto): ?>
if ($random == ""): ?>
First
/ Previous
else: ?>
if (($fotoID != "") && ($random != "0")): ?>
Previous
endif; ?>
endif; ?>
endif; ?>
|
if (($comment_check != "") && ($comment == "")): ?>Show comments elseif (($comment_check != "") && ($comment == "1")): ?>Hide comments endif; ?> |
if ($nextFoto != ""): ?>
if ($random == ""): ?>
Next
/ Last
else: ?>
Next random photo
endif; ?>
endif; ?>
|
|
if (($comment_check != "") && ($comment == "1")): ?>
endif; ?>
if ($copyrightFooter != ""):?>
endif; ?>
|