include("inc/standard.php");
if (($fotoID == "") && ($random == "")) {
$fotoPara = " where ".$basic." order by fo.fDate desc";
$firstTime = 1;
}
elseif (($fotoID == "") && ($random != "")) {
$fotoPara = " where ".$basic." order by rand()";
}
else {
$fotoPara = " where ".$basic." and date_format(fo.fDate, '%Y%m%d') = ".$fotoID;
}
$selectFoto = "select fo.fID, date_format(fo.fDate, '%W, %d-%m-%Y'), fo.fFile, date_format(fo.fDate, '%Y%m%d'), fo.fPublic, fows.frFotoID, fows.frWebsiteID, fo.fComment, fo.fGmNorth, fo.fGmEast
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID".$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);
$webSiteID = @mysql_result($fotoData, 0, 6);
$photoComment = @mysql_result($fotoData, 0, 7);
$gmNorth = @mysql_result($fotoData, 0, 8);
$gmEast = @mysql_result($fotoData, 0, 9);
// Calculate dimensions of photo
$photoSizeData = $fotoFolder.$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(fo.fDate, '%Y%m%d'), fo.fID, fo.fPublic, fows.frFotoID, fows.frWebsiteID
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID
where ".$basic."
order by fo.fDate
desc";
$lastFotoData = @mysql_query($selectLastFoto,$dbh);
$lastFoto = @mysql_result($lastFotoData, 0, 0);
// Select Next Photo
$selectNextFoto = "select date_format(fo.fDate, '%Y%m%d'), fo.fID, fo.fPublic, fows.frFotoID, fows.frWebsiteID
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID
where ".$basic." and date_format(fo.fDate, '%Y%m%d') > ".$fotoID." order by fo.fDate asc";
$nextFotoData = @mysql_query($selectNextFoto,$dbh);
$nextFoto = @mysql_result($nextFotoData, 0, 0);
// Select Next Random Photo
if ($random != "") {
$selectRandomFoto = "select fo.fID, date_format(fo.fDate, '%Y%m%d'), fows.frFotoID, fows.frWebsiteID
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID
where ".$basic." order by rand()";
$randomFotoData = @mysql_query($selectRandomFoto,$dbh);
$randomFoto = @mysql_result($randomFotoData, 0, 1);
}
// Select Previous Photo
$selectPrevFoto = "select date_format(fo.fDate, '%Y%m%d'), fo.fID, fo.fPublic, fows.frFotoID, fows.frWebsiteID
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID
where ".$basic." and date_format(fo.fDate, '%Y%m%d') < ".$fotoID." order by fo.fDate desc";
$prevFotoData = @mysql_query($selectPrevFoto,$dbh);
$prevFoto = @mysql_result($prevFotoData, 0, 0);
// Select First Photo
$selectFirstFoto = "select date_format(fo.fDate, '%Y%m%d'), fo.fID, fo.fPublic, fows.frFotoID, fows.frWebsiteID
from tb_Foto fo
inner join tb_Foto_Website fows on fows.frFotoID = fo.fID
where ".$basic."
order by fo.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
from comGuestbook
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");
?>
if ($firstTime != ""): ?>
endif; ?>
if ($testServer != ""): ?>
Variablentester: $basicUserID:
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; ?>
|
if ($test == "") {
echo $userGoogleAnalytics;
}
?>