Merge /media/sdb1/gitRepositories/judo into promoInfo
This commit is contained in:
@@ -0,0 +1,419 @@
|
|||||||
|
<?php
|
||||||
|
// lima-city verlangt dies um die Fehler zu erkennen
|
||||||
|
// funktioniert aber nicht!
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
/// Eine allgemeine Vorlage für die Bildergallerien
|
||||||
|
///
|
||||||
|
/// @toDo: weitere Beschreibung
|
||||||
|
// @toDo: wofür brauchte ich diese Funktion?
|
||||||
|
|
||||||
|
////
|
||||||
|
// Funktionsdefinitionen
|
||||||
|
////
|
||||||
|
|
||||||
|
/// Check if expression is positive integer
|
||||||
|
function is_positive_integer($str){
|
||||||
|
return (is_numeric($str) && $str > 0 && $str == round($str));
|
||||||
|
}
|
||||||
|
|
||||||
|
function myUrlEncode($string) {
|
||||||
|
$entities = array( '%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
|
||||||
|
$replacements = array( '!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
|
||||||
|
//return str_replace($entities, $replacements, urlencode($string));
|
||||||
|
return str_replace($entities, $replacements, rawurlencode($string));
|
||||||
|
}
|
||||||
|
|
||||||
|
function startsWith($haystack, $needle){
|
||||||
|
$length = strlen($needle);
|
||||||
|
return (substr($haystack, 0, $length) === $needle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abfrage der ausgewählten Bilder einer Galerie
|
||||||
|
function getPickedImages($aMysqlConn, $aGalId){
|
||||||
|
$retPickedImages = array();
|
||||||
|
/// Erstmal bisher ausgewählte Bilder abfragen ...
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM cwsvjudo.galImgPicker WHERE galId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// die($queryPickedImages);
|
||||||
|
|
||||||
|
$resultsPickedImages = $aMysqlConn->query($queryPickedImages);
|
||||||
|
|
||||||
|
/// @todo Wie kann ich hier sinnvoll einen Fehler zurückliefern? Nullpointer?
|
||||||
|
if( !$resultsPickedImages ){
|
||||||
|
$retMessage['error'] .= "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
die( "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $resultsPickedImages->fetch_assoc() ){
|
||||||
|
$retPickedImages = array_merge($retPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//echo("retPickedImages: ");print_r($retPickedImages); die();
|
||||||
|
return array_unique( $retPickedImages );
|
||||||
|
}/// Ende getPickedImages
|
||||||
|
|
||||||
|
/// Hilfsfunktion zum Anpassen der htmlDescription
|
||||||
|
function descrName($aName){
|
||||||
|
$retVal = "Bilder der Judoka des Chemnitzer WSV beim Wettkampf ".$aName;
|
||||||
|
if( strpos($aName, "Sommerabschlussgrillen") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV beim ".$aName;
|
||||||
|
if( strpos($aName, "Jahrendefeier") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV bei der ".$aName;
|
||||||
|
return $retVal;
|
||||||
|
}/// Ende descrName
|
||||||
|
|
||||||
|
/// Wählt aus den Gallerybildern eine Anzahl zum anzeigen aus
|
||||||
|
function displayImagesList($galleryData, $options = array() ){
|
||||||
|
if( is_positive_integer( $options['imageLimit']) )
|
||||||
|
return array_rand( $shiaiGalleryData['images'], $options['imageLimit']);
|
||||||
|
return $shiaiGalleryData['images'];
|
||||||
|
// folgend nur die alte Bildauswahl mit Favourites (zum Abschreiben bei
|
||||||
|
// zukünftigen Erweiterungen)
|
||||||
|
|
||||||
|
///// Überschreiben der imgList mit den ausgewählten Bildern
|
||||||
|
//$allImgList = $imgList; // Sicherungskopie
|
||||||
|
|
||||||
|
//if( count($pickedImages) > 24 )
|
||||||
|
//$pickedImages = array_rand( $pickedImages, 24);
|
||||||
|
//else{
|
||||||
|
//$restImages = array_diff( $allImgList, $pickedImages );
|
||||||
|
//foreach( array_rand( $restImages, min(24, count($restImages))-count($pickedImages) ) as $k ) {
|
||||||
|
//$pickedImages[] = $restImages[$k];
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
//$imgList = $pickedImages;
|
||||||
|
//// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
///// @todo ein Sortieren nach dem ursprünglichen Index fehlt
|
||||||
|
//usort($imgList, function($a, $b) use($allImgList){return array_search($a, $allImgList) > array_search($b, $allImgList);} );
|
||||||
|
//$imgList = array_values( $imgList );// Zum reNummerieren
|
||||||
|
//// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
//if( $showAllMode == "true") $imgList = $allImgList;
|
||||||
|
|
||||||
|
//$imgInfos = array();
|
||||||
|
//foreach( $imgList as $imgName ){
|
||||||
|
//if(startsWith($imgName, "images/")){
|
||||||
|
//array_push( $imgInfos, @getimagesize(str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgName))));
|
||||||
|
//}
|
||||||
|
//else{
|
||||||
|
//array_push( $imgInfos, @getimagesize("thumbs/".str_replace(".jpg", ".png", $imgName)));
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////
|
||||||
|
// Main
|
||||||
|
////
|
||||||
|
|
||||||
|
$basePath = $_SERVER['DOCUMENT_ROOT'];
|
||||||
|
$requestPath = $_SERVER['REQUEST_URI'];
|
||||||
|
|
||||||
|
if( $_GET['showAll'] == "true" )
|
||||||
|
$showAllMode = "true";
|
||||||
|
else
|
||||||
|
$showAllMode = "false";
|
||||||
|
|
||||||
|
|
||||||
|
// eine allgemeine Konfigurationsdatei
|
||||||
|
if( file_exists("config.inc.php") )
|
||||||
|
include_once("config.inc.php");
|
||||||
|
|
||||||
|
// für's erste werden die Verzeichnisse direkt aufgerufen
|
||||||
|
// - @toDo: Das letzte muss kein Verzeichnis sein!
|
||||||
|
// - @toDo: Fehlerbehandlung??
|
||||||
|
// - für's erste gehen wir davon aus, dass ein korrektes Verzeichnis
|
||||||
|
// übergeben wurde
|
||||||
|
$dirBreadcrumbs = explode( "/", $_SERVER["REQUEST_URI"] );
|
||||||
|
if( $dirBreadcrumbs[1] != "photoalben" ){
|
||||||
|
echo("warning: wrong path!\n");
|
||||||
|
var_dump($_SERVER);
|
||||||
|
var_dump($dirBreadcrumbs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Wettkampfname und Wettkampfdatum wurden früher™ mal in der
|
||||||
|
// 'config.inc.php' des Galerieordners
|
||||||
|
if(file_exists($requestPath."config.inc.php")){
|
||||||
|
include_once($requestPath."config.inc.php");
|
||||||
|
if($wkName)
|
||||||
|
$shiaiGalleryData['name'] = $wkName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// So soll es mal werden: Die Daten der Galerie in einer jsonDatei
|
||||||
|
if(file_exists($requestPath."/shiaiGallery.json"))
|
||||||
|
$shiaiGalleryData = json_decode(
|
||||||
|
get_file_contents( $requestPath."shiaiGallery.json"),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Sollte jetzt die Galerie noch leer sein, dann ist anzunehmen,
|
||||||
|
// dass noch keine definiert wurden (weder per json, noch durch
|
||||||
|
// inc.php). Damit nie nichts angezeigt wird, laden wir sie aus dem
|
||||||
|
// Verzeichnis.
|
||||||
|
// @toDo: Übergangslösung! Es sollte möglich sein, eine leere Galerie
|
||||||
|
// zu erzeugen. Es sollte ein allgemeinerer ImageSuchAlgorithmus her!
|
||||||
|
if( empty( $shiaiGalleryData['images'] ) ){
|
||||||
|
$imgList = glob( $basePath.$requestPath."images/*.jpg" );
|
||||||
|
// Wie es scheint ist sind die Dateinamen auf dem bplaced in "ISO-8859-1"
|
||||||
|
// Die Dateinamen auf dem Server (so wie sie die glob-Funktion
|
||||||
|
// liefert) müssen nicht in "UTF-8" sein! deshalb eine
|
||||||
|
// Konvertierung, denn das htmlDokument soll dann in "UTF-8" sein.
|
||||||
|
array_walk(
|
||||||
|
$imgList,
|
||||||
|
function (&$value, $key, $basePath) {
|
||||||
|
$value = iconv( "ISO-8859-1", "UTF-8", $value);
|
||||||
|
// @toDo: evtl. hier schon die Dateinamen urlEncoden ?
|
||||||
|
// $value=implode('/', array_map('myUrlEncode', explode('/', $value)));
|
||||||
|
$value = str_replace($basePath, "", $value);
|
||||||
|
},
|
||||||
|
$basePath
|
||||||
|
);
|
||||||
|
|
||||||
|
$shiaiGalleryData['images'] = array_map(
|
||||||
|
function($value){
|
||||||
|
return array(
|
||||||
|
'imgSrc' => $value,
|
||||||
|
'tbnSrc' => str_replace( "/images/", "/thumbs/", str_replace( ".jpg", ".png", $value))
|
||||||
|
);
|
||||||
|
},
|
||||||
|
$imgList
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($shiaiGalleryData);
|
||||||
|
//exit();
|
||||||
|
|
||||||
|
|
||||||
|
if( $showAllMode == "true" ){
|
||||||
|
$imgList = displayImagesList($shiaiGalleryData['images']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$imgList = displayImagesList($shiaiGalleryData['images'], array('imagesLimit'=>24));
|
||||||
|
|
||||||
|
array_walk(
|
||||||
|
$imgList,
|
||||||
|
function (&$value, $key, $basePath) {
|
||||||
|
// $value = iconv( "ISO-8859-1", "UTF-8", $value);
|
||||||
|
// @toDo: evtl. hier schon die Dateinamen urlEncoden ?
|
||||||
|
$value['imgSrc']=implode('/', array_map('myUrlEncode', explode('/', $value['imgSrc'])));
|
||||||
|
$value['tbnSrc']=implode('/', array_map('myUrlEncode', explode('/', $value['tbnSrc'])));
|
||||||
|
// $value = str_replace($basePath, "", $value);
|
||||||
|
},
|
||||||
|
$basePath
|
||||||
|
);
|
||||||
|
|
||||||
|
if( empty($shiaiGalleryData['name']) )
|
||||||
|
$shiaiGalleryData['name'] = "ohne Namen";
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<title><?php echo $wkName?> - Bilderalbum<?php echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");?></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="description" content="
|
||||||
|
<?php
|
||||||
|
echo descrName($wkName);
|
||||||
|
echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");
|
||||||
|
?>
|
||||||
|
">
|
||||||
|
<meta name="keywords" content="Album, Fotos">
|
||||||
|
|
||||||
|
<!-- favIcon und Co nach der empfehlung von https://github.com/audreyr/favicon-cheat-sheet -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" sizes="16x16 32x32 48x48 64x64" href="/ressourcen/graphiken/logos/favicon/favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-152.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-180.png" />
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
|
<link rel="canonical" href="http://cwsvjudo.bplaced.net<?php echo $_SERVER['REQUEST_URI']?>" />
|
||||||
|
|
||||||
|
<!--https://github.com/aFarkas/lazysizes-->
|
||||||
|
<script src="/ressourcen/jsLib/lazysizes.min.js" async=""></script>
|
||||||
|
<style>
|
||||||
|
.no-js img.lazyload {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- BluimpGallery Zeug -->
|
||||||
|
<link rel="stylesheet" href="/ressourcen/blueimpGallery/css/blueimp-gallery.min.css">
|
||||||
|
<script src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.smallFont{font-size: small;}
|
||||||
|
.centerText{text-align: center;}
|
||||||
|
.navButton{
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-color: white;
|
||||||
|
border-style: outset;
|
||||||
|
border-radius: 1em;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: .5em;
|
||||||
|
padding-right: .5em;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body style="color: #000000; background-color: #FFAE00" >
|
||||||
|
<a title="Galerien der Judoka des Chemnitzer WSV" href="http://cwsvjudo.bplaced.net/galerien">Zur Galerieübersicht</a>
|
||||||
|
<?php
|
||||||
|
/// Eine kleine Messagebox
|
||||||
|
if( !empty($messages) ){
|
||||||
|
?>
|
||||||
|
<div style="border: 1px solid black">
|
||||||
|
<?php
|
||||||
|
if( !empty( $messages['info'] ) ) echo( $messages['info'] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
/// Ende MessageBox
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h1 class="centerText" >
|
||||||
|
Photoalbum [<b><?php echo $shiaiGalleryData['name'];?></b>]
|
||||||
|
</h1>
|
||||||
|
<?php
|
||||||
|
if( $showAllMode == "true" ){
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
[<?php echo count($shiaiGalleryData['images'])?> Bilder]
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
?>
|
||||||
|
<!--
|
||||||
|
<a href=<?php echo( "\"?galId=".(empty($galleryId)?"0":$galleryId)."&showAll=true".($chooseMode=="true"?"&chooseMode=true":"")."\"");?>><div class="navButton" style="width: 100%;">Alle Bilder einblenden </div></a>
|
||||||
|
-->
|
||||||
|
<a href="/?showAll=true"><div class="navButton" style="width: 100%;">Alle Bilder einblenden </div></a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
Auf die jeweiligen Bilder klicken um eine größere Ansicht zu bekommen.
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.galImgList{
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Vorerst verworfen
|
||||||
|
//if( $chooseMode == "true" ){
|
||||||
|
//echo( "<form action=\"http://cwsvjudo.bplaced.net/ressourcen/phpLib/imgGallery/imgPicker.php\" method=\"post\">" );
|
||||||
|
//echo( "<input type=\"hidden\" name=\"galId\" value=\"".$galleryId."\" />" );
|
||||||
|
//}
|
||||||
|
?>
|
||||||
|
<div id="links" class="galImgList">
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
// echo( "<div ".( ($chooseMode=="true")?"style=\"border: 1px solid black;\"":"" ).">" );
|
||||||
|
//if( $chooseMode == "true" ){
|
||||||
|
//echo("<label>");
|
||||||
|
//echo( "<input type=\"checkbox\" name=\"pickedImages[]\" value=\"".$imgList[$imgIndex]."\" />" );
|
||||||
|
//}
|
||||||
|
echo "<img class=\"lazyload\" ".
|
||||||
|
"id=\"Image".( $imgIndex )."\" ".
|
||||||
|
"data-src=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
// $imgInfos[$imgIndex][3]." ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $wkName )." Bild ".( $imgIndex +1 )." von ".( $imgSize )."\" ".
|
||||||
|
"onclick=\"startGalleryShow(" . $imgIndex . ");\"".
|
||||||
|
" />";
|
||||||
|
// if( $chooseMode == "true" ) echo( "</label>" );
|
||||||
|
echo("</div>");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div><!-- Ende galImgList -->
|
||||||
|
<?php
|
||||||
|
//if( $chooseMode == "true" ){
|
||||||
|
//echo( "<button type=\"submit\">Eingaben absenden</button>" );
|
||||||
|
//echo( "</form>" );
|
||||||
|
//}
|
||||||
|
?>
|
||||||
|
<noscript>
|
||||||
|
<div id="links" class="galImgList">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo
|
||||||
|
"\t\t\t\t<span>".
|
||||||
|
"<a href=\"view.php?index=".( $imgIndex )."\" >".
|
||||||
|
"<img id=\"Image".( $imgIndex + 1)."\" ".
|
||||||
|
//"src=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
"src=\"".$imgList[$imgIndex]['tbnSrc']."\" ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $shiaiGalleryData['name'] )." Bild ".( $imgIndex + 1 )." von ".( $imgSize )."\" ".
|
||||||
|
"/>".
|
||||||
|
"</a>".
|
||||||
|
"</span>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
<!-- BluimpGalerry Lightbox Version -->
|
||||||
|
<!-- The Gallery as lightbox dialog, should be a child element of the document body -->
|
||||||
|
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
|
||||||
|
<div class="slides"></div>
|
||||||
|
<h2 class="title"><?php echo $wkName?></h2>
|
||||||
|
<a class="prev">‹</a>
|
||||||
|
<a class="next">›</a>
|
||||||
|
<a class="close">×</a>
|
||||||
|
<a class="play-pause"></a>
|
||||||
|
<ol class="indicator"></ol>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js"></script>
|
||||||
|
<!--
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/jquery.blueimp-gallery.min.js"></script>
|
||||||
|
-->
|
||||||
|
<script>
|
||||||
|
function startGalleryShow(startIndex = 0){
|
||||||
|
var imgList = [
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
// echo "\"".( $imgList[ $imgIndex ] )."\", ";
|
||||||
|
echo "\"".( $imgList[ $imgIndex ]['imgSrc'] )."\", ";
|
||||||
|
}
|
||||||
|
?>];
|
||||||
|
var gallery = blueimp.Gallery(
|
||||||
|
imgList,
|
||||||
|
{
|
||||||
|
onslide: function (index, slide) {
|
||||||
|
var pageUrl = encodeURIComponent( window.location.href ) + "?index=" + index.toString();
|
||||||
|
var pageTitle = document.title + " [" + index.toString() + "]";
|
||||||
|
},
|
||||||
|
startSlideshow: true,
|
||||||
|
stretchImages: true,
|
||||||
|
index: startIndex,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
startGalleryShow();
|
||||||
|
};
|
||||||
|
// startGalleryShow();
|
||||||
|
</script>
|
||||||
|
<hr/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
// Daten der Datenbank laden
|
||||||
|
require_once($_SERVER['DOCUMENT_ROOT']."/bonus/db.inc");
|
||||||
|
|
||||||
|
/// Hinzufügen eines Eintrages
|
||||||
|
function addPickedImages($aMysqlConn, $aGalId, $anUserId, $somePickedImages){
|
||||||
|
$retMessage = array();
|
||||||
|
$galPickedImages = array();
|
||||||
|
/// Erstmal bisher ausgewählte Bilder abfragen ...
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM cwsvjudo.galImgPicker WHERE galId = '%s' AND userId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId),
|
||||||
|
$aMysqlConn->real_escape_string($anUserId)
|
||||||
|
);
|
||||||
|
|
||||||
|
$resultsPickedImages = $aMysqlConn->query($queryPickedImages);
|
||||||
|
if( !$resultsPickedImages ){
|
||||||
|
$retMessage['error'] .= "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
}
|
||||||
|
/// @todo Eigentlich sollte hier ja nur ein Ergebnis zurückgeliefert werden, das sollte auch überprüft werden
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $resultsPickedImages->fetch_assoc() ){
|
||||||
|
$galPickedImages = array_merge($galPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @todo Anzahl der ausgewählten Bilder auf 6 beschränken
|
||||||
|
if( empty($galPickedImages) ){
|
||||||
|
if( count($galPickedImages) < 6 ){
|
||||||
|
$queryAddImages = sprintf(
|
||||||
|
"INSERT INTO cwsvjudo.galImgPicker (galId, userId, pickedImages) values ('%s', '%s', '%s');",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId),
|
||||||
|
$aMysqlConn->real_escape_string($anUserId),
|
||||||
|
$aMysqlConn->real_escape_string(join(",", $somePickedImages))
|
||||||
|
);
|
||||||
|
|
||||||
|
$resultAddImages = $aMysqlConn->query($queryAddImages);
|
||||||
|
if( $resultAddImages ){
|
||||||
|
$retMessage['info'] .= "(".join(",", $somePickedImages).") ausgewählt!<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$retMessage['error'] .= "Fehler: Konnte die Query '".$queryAddImages."' nicht ausführen ('".$aMysqlConn->error."')!<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$retMessage['error'] .= "Fehler: Es dürfen maximal 6 Bilder ausgewählt werden<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$retMessage['error'] .= "Fehler: Es wurden bereits Bilder ausgewählt (".join(",", $galPickedImages).")!<br />";
|
||||||
|
$retMessage['error'] .= "Neue Auswahl: (".join(",", $somePickedImages).")<br />";
|
||||||
|
$retMessage['error'] .= "<form action=\"http://cwsvjudo.bplaced.net/ressourcen/phpLib/imgGallery/imgPicker.php\" method=\"post\">";
|
||||||
|
$retMessage['error'] .= " <input type=\"hidden\" name=\"galId\" value=\"".$galleryId."\" />";
|
||||||
|
foreach($somePickedImages as $img){
|
||||||
|
$retMessage['error'] .= " <input type=\"hidden\" name=\"pickedImages[]\" value=\"".$img."\" />";
|
||||||
|
}
|
||||||
|
$retMessage['error'] .= " <button type=\"submit\">Bisherige Auswahl überschreiben!</button>";
|
||||||
|
$retMessage['error'] .= "</form>";
|
||||||
|
}
|
||||||
|
return $retMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Ändern eines bereits erstellten Eintrages
|
||||||
|
function changePickedImages($aMysqlConn, $aGalId, $anUserId, $somePickedImages){
|
||||||
|
|
||||||
|
$retMessage = array();
|
||||||
|
$galPickedImages = array();
|
||||||
|
|
||||||
|
/// Erstmal bisher ausgewählte Bilder abfragen ...
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM cwsvjudo.galImgPicker WHERE galId = '%s' AND userId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId),
|
||||||
|
$aMysqlConn->real_escape_string($anUserId)
|
||||||
|
);
|
||||||
|
|
||||||
|
$resultsPickedImages = $aMysqlConn->query($queryPickedImages);
|
||||||
|
if( !$resultsPickedImages ){
|
||||||
|
$retMessage['error'] .= "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
}
|
||||||
|
/// @todo Eigentlich sollte hier ja nur ein Ergebnis zurückgeliefert werden, das sollte auch überprüft werden
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $resultsPickedImages->fetch_assoc() ){
|
||||||
|
$galPickedImages = array_merge($galPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( empty($galPickedImages) )
|
||||||
|
$retMessage['error'] .= "Fehler: Kein Eintrag zum Ändern gefunden!";
|
||||||
|
else{
|
||||||
|
if( count($galPickedImages) < 6 ){
|
||||||
|
$queryAddImages = sprintf(
|
||||||
|
"UPDATE cwsvjudo.galImgPicker pickedImages = '%s' WHERE galId = '%s' AND userId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string(join(",", $somePickedImages)),
|
||||||
|
$aMysqlConn->real_escape_string($aGalId),
|
||||||
|
$aMysqlConn->real_escape_string($anUserId)
|
||||||
|
);
|
||||||
|
|
||||||
|
$resultAddImages = $aMysqlConn->query($queryAddImages);
|
||||||
|
if( $resultAddImages ){
|
||||||
|
$retMessage['info'] .= "Gewählten Bilder auf (".join(",", $somePickedImages).") geändert!<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$retMessage['error'] .= "Fehler: Konnte die Query '".$queryAddImages."' nicht ausführen ('".$aMysqlConn->error."')!<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$retMessage['error'] .= "Fehler: Es dürfen maximal 6 Bilder ausgewählt werden<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $retMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$loginStatus = "false";
|
||||||
|
$galleryId = "0";
|
||||||
|
$galPickedImages = array();
|
||||||
|
|
||||||
|
// Falls der serverseitige Logincookie nicht gesetzt ist ...
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id();
|
||||||
|
if( empty($_SESSION['login']) ){
|
||||||
|
$loginStatus = "false";
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus ist nur möglich, wenn man angemeldet ist!<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$loginStatus = "true";
|
||||||
|
/// @todo Testen, ob eine intZahl vorliegt
|
||||||
|
/// @todo Testen, ob wir in der richtigen Galerie sind
|
||||||
|
if( !empty($_POST['galId'] ) ) $galleryId = $_POST['galId'];
|
||||||
|
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus für Galerie ".$galleryId." ist aktiv!<br />";
|
||||||
|
|
||||||
|
// Datenbankverbindung herstellen
|
||||||
|
/// @todo Ist die Db-Verbindung dann global?
|
||||||
|
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
||||||
|
|
||||||
|
if($mysqlConn->connect_error){
|
||||||
|
$message['error'] .= "Fehler: Datenbankverbindung fehlgeschlagen: " . $mysqlConn->connect_error . "<br />";
|
||||||
|
}
|
||||||
|
else{/// bereits gewählte Bilder abfragen
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM galImgPicker WHERE galId = '%s' AND userId = '%s';",
|
||||||
|
$mysqlConn->real_escape_string($galleryId),
|
||||||
|
$mysqlConn->real_escape_string($_SESSION['user']['userId'])
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
$pickedImagesResults = $mysqlConn->query($queryPickedImages);
|
||||||
|
if( !$pickedImagesResults ){
|
||||||
|
$messages['error'] .= "Fehler bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
}
|
||||||
|
/// @todo Eigentlich sollte hier ja nur ein Ergebnis zurückgeliefert werden
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $pickedImagesResults->fetch_assoc() ){
|
||||||
|
//print_r($pickedImagesResult);
|
||||||
|
//print_r($pickedImagesResult['pickedImages']);
|
||||||
|
$galPickedImages = array_merge($galPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$addRetMessages = addPickedImages($mysqlConn, $galleryId, $_SESSION['user']['userId'], $_POST['pickedImages']);
|
||||||
|
|
||||||
|
$mysqlConn->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<div style="border: 1px solid black">
|
||||||
|
<?php
|
||||||
|
if( !empty( $messages['error'] ) ) echo( $messages['error'] );
|
||||||
|
if( !empty( $messages['info'] ) ) echo( $messages['info'] );
|
||||||
|
if( !empty( $addRetMessages['error'] ) ) echo( $addRetMessages['error'] );
|
||||||
|
if( !empty( $addRetMessages['info'] ) ) echo( $addRetMessages['info'] );
|
||||||
|
if( !empty( $addRetMessages['warning'] ) ) echo( $addRetMessages['warning'] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php //print_r($_POST);?>
|
||||||
|
<?php //print_r($messages);?>
|
||||||
|
<?php //print_r($addRetMessages);?>
|
||||||
|
<?php //print_r($galPickedImages);?>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
<?php
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
// eine allgemeine Konfigurationsdatei
|
||||||
|
@include_once("config.inc.php"); // durch das @ wird die Warnung unterdrückt, falls die Datei nicht vorhanden ist.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$basePath = "/users/cwsvjudo/www";
|
||||||
|
|
||||||
|
// require_once($basePath."/config/phpcount.config.php");
|
||||||
|
// require_once($basePath."/config/cwsvJudo.config.php");
|
||||||
|
|
||||||
|
|
||||||
|
// require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
|
||||||
|
|
||||||
|
function myUrlEncode($string) {
|
||||||
|
$entities = array( '%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
|
||||||
|
$replacements = array( '!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
|
||||||
|
//return str_replace($entities, $replacements, urlencode($string));
|
||||||
|
return str_replace($entities, $replacements, rawurlencode($string));
|
||||||
|
}
|
||||||
|
|
||||||
|
function startsWith($haystack, $needle){
|
||||||
|
$length = strlen($needle);
|
||||||
|
return (substr($haystack, 0, $length) === $needle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abfrage der ausgewählten Bilder einer Galerie
|
||||||
|
function getPickedImages($aMysqlConn, $aGalId){
|
||||||
|
$retPickedImages = array();
|
||||||
|
/// Erstmal bisher ausgewählte Bilder abfragen ...
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM cwsvjudo.galImgPicker WHERE galId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// die($queryPickedImages);
|
||||||
|
|
||||||
|
$resultsPickedImages = $aMysqlConn->query($queryPickedImages);
|
||||||
|
|
||||||
|
/// @todo Wie kann ich hier sinnvoll einen Fehler zurückliefern? Nullpointer?
|
||||||
|
if( !$resultsPickedImages ){
|
||||||
|
$retMessage['error'] .= "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
die( "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $resultsPickedImages->fetch_assoc() ){
|
||||||
|
$retPickedImages = array_merge($retPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//echo("retPickedImages: ");print_r($retPickedImages); die();
|
||||||
|
return array_unique( $retPickedImages );
|
||||||
|
}/// Ende getPickedImages
|
||||||
|
|
||||||
|
/// Hilfsfunktion zum Anpassen der htmlDescription
|
||||||
|
function descrName($aName){
|
||||||
|
$retVal = "Bilder der Judoka des Chemnitzer WSV beim Wettkampf ".$aName;
|
||||||
|
if( strpos($aName, "Sommerabschlussgrillen") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV beim ".$aName;
|
||||||
|
if( strpos($aName, "Jahrendefeier") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV bei der ".$aName;
|
||||||
|
return $retVal;
|
||||||
|
}/// Ende descrName
|
||||||
|
|
||||||
|
$loginStatus = "false";
|
||||||
|
$chooseMode = "false";
|
||||||
|
$showAllMode = "false";
|
||||||
|
$messages = array();
|
||||||
|
$galleryId = "0";
|
||||||
|
$pickedImages = array();
|
||||||
|
|
||||||
|
// Wie es scheint ist sind die Dateinamen auf bplaced in "ISO-8859-1"
|
||||||
|
array_walk(
|
||||||
|
$imgList,
|
||||||
|
function (&$value, $key) {
|
||||||
|
$value = iconv( "UTF-8", "ISO-8859-1",$value);
|
||||||
|
//$value = urlencode($value);
|
||||||
|
//$value = urlencode($value);
|
||||||
|
//$value = myUrlEncode($value);
|
||||||
|
//$value=implode('/', array_map('rawurlencode', explode('/', $value)));
|
||||||
|
$value=implode('/', array_map('myUrlEncode', explode('/', $value)));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
// foreach($imgList as $img){
|
||||||
|
// echo(" ".$img." startsWith images/ :".startsWith($img, "images/")."\n");
|
||||||
|
// }
|
||||||
|
|
||||||
|
/// Übergebene galleryId abfragen
|
||||||
|
if( !empty($_GET['galId'] ) ) $galleryId = $_GET['galId'];
|
||||||
|
/// @todo Woher erhalte ich die galleryID, wenn sie nicht übergeben wird?
|
||||||
|
|
||||||
|
/*
|
||||||
|
/// Nachschauen, ob alle Bilder gezeigt werden sollen
|
||||||
|
if( $_GET['showAll'] == "true" )
|
||||||
|
$showAllMode = "true";
|
||||||
|
// Testen, ob wir im Bilderauswahlmodus sind...
|
||||||
|
if($_GET['chooseMode'] == "true"){
|
||||||
|
$showAllMode = "true"; // Im Bildauswahlmodus sollten auch alle Bilder angezeigt werden
|
||||||
|
$chooseMode = "true";
|
||||||
|
// Falls ja, dann teste, ob man angemeldet ist
|
||||||
|
/// @todo brauche ich das, wenn ich nur testen will, ob bereits angemeldet ist? -> anscheinend ja!
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id();
|
||||||
|
// Falls der serverseitige Logincookie nicht gesetzt ist
|
||||||
|
if( empty($_SESSION['login']) ){
|
||||||
|
$loginStatus = "false";
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus ist nur möglich, wenn man angemeldet ist!<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$loginStatus = "true";
|
||||||
|
/// @todo Testen, ob eine intZahl vorliegt
|
||||||
|
/// @todo Testen, ob wir in der richtigen Galerie sind
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus für Galerie ".$galleryId." ist aktiv!<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
||||||
|
|
||||||
|
if($mysqlConn->connect_error){
|
||||||
|
$message['error'] .= "Fehler: Datenbankverbindung fehlgeschlagen: " . $mysqlConn->connect_error . "<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$pickedImages = getPickedImages( $mysqlConn, $galleryId );
|
||||||
|
$mysqlConn->close();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/// Überschreiben der imgList mit den ausgewählten Bildern
|
||||||
|
$allImgList = $imgList; // Sicherungskopie
|
||||||
|
//echo("imgList:");print_r($imgList);
|
||||||
|
// echo("pickedImages: "); print_r($pickedImages);
|
||||||
|
|
||||||
|
if( count($pickedImages) > 24 )
|
||||||
|
$pickedImages = array_rand( $pickedImages, 24);
|
||||||
|
else{
|
||||||
|
$restImages = array_diff( $allImgList, $pickedImages );
|
||||||
|
//echo("restImages: "); print_r($restImages);
|
||||||
|
//echo("count(restImages): ".count($restImages));
|
||||||
|
//echo("count(24-count($pickedImages)): ".(24-count($pickedImages)));
|
||||||
|
foreach( array_rand( $restImages, min(24, count($restImages))-count($pickedImages) ) as $k ) {
|
||||||
|
$pickedImages[] = $restImages[$k];
|
||||||
|
}
|
||||||
|
// echo("pickedImages: "); print_r($pickedImages);
|
||||||
|
}
|
||||||
|
$imgList = $pickedImages;
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
/// @todo ein Sortieren nach dem ursprünglichen Index fehlt
|
||||||
|
usort($imgList, function($a, $b) use($allImgList){return array_search($a, $allImgList) > array_search($b, $allImgList);} );
|
||||||
|
$imgList = array_values( $imgList );// Zum reNummerieren
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
if( $showAllMode == "true") $imgList = $allImgList;
|
||||||
|
|
||||||
|
$imgInfos = array();
|
||||||
|
foreach( $imgList as $imgName ){
|
||||||
|
if(startsWith($imgName, "images/")){
|
||||||
|
array_push( $imgInfos, @getimagesize(str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgName))));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
array_push( $imgInfos, @getimagesize("thumbs/".str_replace(".jpg", ".png", $imgName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<title><?php echo $wkName?> - Bilderalbum<?php echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");?></title>
|
||||||
|
<?php //PHPCount::AddHit($wkName." Bilderalbum");?>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="description" content="
|
||||||
|
<?php
|
||||||
|
echo descrName($wkName);
|
||||||
|
echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");
|
||||||
|
?>
|
||||||
|
">
|
||||||
|
<meta name="keywords" content="Album, Fotos">
|
||||||
|
|
||||||
|
<!-- favIcon und Co nach der empfehlung von https://github.com/audreyr/favicon-cheat-sheet -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" sizes="16x16 32x32 48x48 64x64" href="/ressourcen/graphiken/logos/favicon/favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-152.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-180.png" />
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
|
<link rel="canonical" href="http://cwsvjudo.bplaced.net<?php echo $_SERVER['REQUEST_URI']?>" />
|
||||||
|
|
||||||
|
<!--https://github.com/aFarkas/lazysizes-->
|
||||||
|
<script src="/ressourcen/jsLib/lazysizes.min.js" async=""></script>
|
||||||
|
<style>
|
||||||
|
.no-js img.lazyload {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- BluimpGallery Zeug -->
|
||||||
|
<link rel="stylesheet" href="/ressourcen/blueimpGallery/css/blueimp-gallery.min.css">
|
||||||
|
<script src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.smallFont{font-size: small;}
|
||||||
|
.centerText{text-align: center;}
|
||||||
|
.navButton{
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-color: white;
|
||||||
|
border-style: outset;
|
||||||
|
border-radius: 1em;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: .5em;
|
||||||
|
padding-right: .5em;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body style="color: #000000; background-color: #FFAE00" >
|
||||||
|
<a title="Galerien der Judoka des Chemnitzer WSV" href="http://cwsvjudo.bplaced.net/galerien">Zur Galerieübersicht</a>
|
||||||
|
<?php
|
||||||
|
/// Eine kleine Messagebox
|
||||||
|
if( !empty($messages) ){
|
||||||
|
?>
|
||||||
|
<div style="border: 1px solid black">
|
||||||
|
<?php
|
||||||
|
if( !empty( $messages['info'] ) ) echo( $messages['info'] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
/// Ende MessageBox
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h1 class="centerText" >
|
||||||
|
Photoalbum [<b><?php echo $wkName?></b>]
|
||||||
|
</h1>
|
||||||
|
<?php
|
||||||
|
if( $showAllMode == "true" ){
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
[<?php echo count($imgList)?> Bilder]
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
?>
|
||||||
|
<a href=<?php echo( "\"?galId=".(empty($galleryId)?"0":$galleryId)."&showAll=true".($chooseMode=="true"?"&chooseMode=true":"")."\"");?>><div class="navButton" style="width: 100%;">Alle Bilder einblenden </div></a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
Auf die jeweiligen Bilder klicken um eine größere Ansicht zu bekommen.
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.galImgList{
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo( "<form action=\"http://cwsvjudo.bplaced.net/ressourcen/phpLib/imgGallery/imgPicker.php\" method=\"post\">" );
|
||||||
|
echo( "<input type=\"hidden\" name=\"galId\" value=\"".$galleryId."\" />" );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div id="links" class="galImgList">
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo( "<div ".( ($chooseMode=="true")?"style=\"border: 1px solid black;\"":"" ).">" );
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo("<label>");
|
||||||
|
echo( "<input type=\"checkbox\" name=\"pickedImages[]\" value=\"".$imgList[$imgIndex]."\" />" );
|
||||||
|
}
|
||||||
|
echo "<img class=\"lazyload\" ".
|
||||||
|
"id=\"Image".( $imgIndex )."\" ".
|
||||||
|
"data-src=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
$imgInfos[$imgIndex][3]." ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $wkName )." Bild ".( $imgIndex +1 )." von ".( $imgSize )."\" ".
|
||||||
|
"onclick=\"startGalleryShow(" . $imgIndex . ");\"".
|
||||||
|
" />";
|
||||||
|
if( $chooseMode == "true" ) echo( "</label>" );
|
||||||
|
echo("</div>");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div><!-- Ende galImgList -->
|
||||||
|
<?php
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo( "<button type=\"submit\">Eingaben absenden</button>" );
|
||||||
|
echo( "</form>" );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<noscript>
|
||||||
|
<div id="links" class="galImgList">
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
//echo("imgList: ");print_r($imgList);
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo
|
||||||
|
"\t\t\t\t<span>".
|
||||||
|
"<a href=\"view.php?index=".( $imgIndex )."\" >".
|
||||||
|
"<img id=\"Image".( $imgIndex + 1)."\" ".
|
||||||
|
"src=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $wkName )." Bild ".( $imgIndex + 1 )." von ".( $imgSize )."\" ".
|
||||||
|
"/>".
|
||||||
|
"</a>".
|
||||||
|
"</span>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
<!-- BluimpGalerry Lightbox Version -->
|
||||||
|
<!-- The Gallery as lightbox dialog, should be a child element of the document body -->
|
||||||
|
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
|
||||||
|
<div class="slides"></div>
|
||||||
|
<h2 class="title"><?php echo $wkName?></h2>
|
||||||
|
<a class="prev">‹</a>
|
||||||
|
<a class="next">›</a>
|
||||||
|
<a class="close">×</a>
|
||||||
|
<a class="play-pause"></a>
|
||||||
|
<ol class="indicator"></ol>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/jquery.blueimp-gallery.min.js"></script>
|
||||||
|
<script>
|
||||||
|
function startGalleryShow(startIndex = 0){
|
||||||
|
var imgList = [
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo "\"".( $imgList[ $imgIndex ] )."\", ";
|
||||||
|
}
|
||||||
|
?>];
|
||||||
|
var gallery = blueimp.Gallery(
|
||||||
|
imgList,
|
||||||
|
{
|
||||||
|
onslide: function (index, slide) {
|
||||||
|
var pageUrl = encodeURIComponent( window.location.href ) + "?index=" + index.toString();
|
||||||
|
var pageTitle = document.title + " [" + index.toString() + "]";
|
||||||
|
},
|
||||||
|
startSlideshow: true,
|
||||||
|
stretchImages: true,
|
||||||
|
index: startIndex,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
startGalleryShow();
|
||||||
|
};
|
||||||
|
// startGalleryShow();
|
||||||
|
</script>
|
||||||
|
<hr/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
<?php
|
||||||
|
// Daten der Datenbank laden
|
||||||
|
require_once($_SERVER['DOCUMENT_ROOT']."/bonus/db.inc");
|
||||||
|
|
||||||
|
function startsWith($haystack, $needle){
|
||||||
|
$length = strlen($needle);
|
||||||
|
return (substr($haystack, 0, $length) === $needle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abfrage der ausgewählten Bilder einer Galerie
|
||||||
|
function getPickedImages($aMysqlConn, $aGalId){
|
||||||
|
$retPickedImages = array();
|
||||||
|
/// Erstmal bisher ausgewählte Bilder abfragen ...
|
||||||
|
$queryPickedImages = sprintf(
|
||||||
|
"SELECT * FROM cwsvjudo.galImgPicker WHERE galId = '%s';",
|
||||||
|
$aMysqlConn->real_escape_string($aGalId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// die($queryPickedImages);
|
||||||
|
|
||||||
|
$resultsPickedImages = $aMysqlConn->query($queryPickedImages);
|
||||||
|
|
||||||
|
/// @todo Wie kann ich hier sinnvoll einen Fehler zurückliefern? Nullpointer?
|
||||||
|
if( !$resultsPickedImages ){
|
||||||
|
$retMessage['error'] .= "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />";
|
||||||
|
die( "Fehler ('".$aMysqlConn->error."') bei Datenbankabfrage '".$queryPickedImages."'<br />");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
while( $pickedImagesResult = $resultsPickedImages->fetch_assoc() ){
|
||||||
|
$retPickedImages = array_merge($retPickedImages, explode(',', $pickedImagesResult['pickedImages']) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//echo("retPickedImages: ");print_r($retPickedImages); die();
|
||||||
|
return array_unique( $retPickedImages );
|
||||||
|
}/// Ende getPickedImages
|
||||||
|
|
||||||
|
/// Hilfsfunktion zum Anpassen der htmlDescription
|
||||||
|
function descrName($aName){
|
||||||
|
$retVal = "Bilder der Judoka des Chemnitzer WSV beim Wettkampf ".$aName;
|
||||||
|
if( strpos($aName, "Sommerabschlussgrillen") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV beim ".$aName;
|
||||||
|
if( strpos($aName, "Jahrendefeier") >= 0 ) $retVal = "Bilder der Judoka des Chemnitzer WSV bei der ".$aName;
|
||||||
|
return $retVal;
|
||||||
|
}/// Ende descrName
|
||||||
|
|
||||||
|
$loginStatus = "false";
|
||||||
|
$chooseMode = "false";
|
||||||
|
$showAllMode = "false";
|
||||||
|
$messages = array();
|
||||||
|
$galleryId = "0";
|
||||||
|
$pickedImages = array();
|
||||||
|
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
// foreach($imgList as $img){
|
||||||
|
// echo(" ".$img." startsWith images/ :".startsWith($img, "images/")."\n");
|
||||||
|
// }
|
||||||
|
|
||||||
|
/// Übergebene galleryId abfragen
|
||||||
|
if( !empty($_GET['galId'] ) ) $galleryId = $_GET['galId'];
|
||||||
|
/// @todo Woher erhalte ich die galleryID, wenn sie nicht übergeben wird?
|
||||||
|
|
||||||
|
/// Nachschauen, ob alle Bilder gezeigt werden sollen
|
||||||
|
if( $_GET['showAll'] == "true" )
|
||||||
|
$showAllMode = "true";
|
||||||
|
|
||||||
|
// Testen, ob wir im Bilderauswahlmodus sind...
|
||||||
|
if($_GET['chooseMode'] == "true"){
|
||||||
|
$showAllMode = "true"; // Im Bildauswahlmodus sollten auch alle Bilder angezeigt werden
|
||||||
|
$chooseMode = "true";
|
||||||
|
// Falls ja, dann teste, ob man angemeldet ist
|
||||||
|
/// @todo brauche ich das, wenn ich nur testen will, ob bereits angemeldet ist? -> anscheinend ja!
|
||||||
|
session_start();
|
||||||
|
session_regenerate_id();
|
||||||
|
// Falls der serverseitige Logincookie nicht gesetzt ist
|
||||||
|
if( empty($_SESSION['login']) ){
|
||||||
|
$loginStatus = "false";
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus ist nur möglich, wenn man angemeldet ist!<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$loginStatus = "true";
|
||||||
|
/// @todo Testen, ob eine intZahl vorliegt
|
||||||
|
/// @todo Testen, ob wir in der richtigen Galerie sind
|
||||||
|
$messages['info'] .= "Info: Der Bilderauswahlmodus für Galerie ".$galleryId." ist aktiv!<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
|
||||||
|
|
||||||
|
if($mysqlConn->connect_error){
|
||||||
|
$message['error'] .= "Fehler: Datenbankverbindung fehlgeschlagen: " . $mysqlConn->connect_error . "<br />";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$pickedImages = getPickedImages( $mysqlConn, $galleryId );
|
||||||
|
$mysqlConn->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Überschreiben der imgList mit den ausgewählten Bildern
|
||||||
|
$allImgList = $imgList; // Sicherungskopie
|
||||||
|
//echo("imgList:");print_r($imgList);
|
||||||
|
// echo("pickedImages: "); print_r($pickedImages);
|
||||||
|
|
||||||
|
if( count($pickedImages) > 24 )
|
||||||
|
$pickedImages = array_rand( $pickedImages, 24);
|
||||||
|
else{
|
||||||
|
$restImages = array_diff( $allImgList, $pickedImages );
|
||||||
|
//echo("restImages: "); print_r($restImages);
|
||||||
|
//echo("count(restImages): ".count($restImages));
|
||||||
|
//echo("count(24-count($pickedImages)): ".(24-count($pickedImages)));
|
||||||
|
foreach( array_rand( $restImages, min(24, count($restImages))-count($pickedImages) ) as $k ) {
|
||||||
|
$pickedImages[] = $restImages[$k];
|
||||||
|
}
|
||||||
|
// echo("pickedImages: "); print_r($pickedImages);
|
||||||
|
}
|
||||||
|
$imgList = $pickedImages;
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
/// @todo ein Sortieren nach dem ursprünglichen Index fehlt
|
||||||
|
usort($imgList, function($a, $b) use($allImgList){return array_search($a, $allImgList) > array_search($b, $allImgList);} );
|
||||||
|
$imgList = array_values( $imgList );// Zum reNummerieren
|
||||||
|
// echo("imgList: "); print_r($imgList);
|
||||||
|
|
||||||
|
if( $showAllMode == "true") $imgList = $allImgList;
|
||||||
|
|
||||||
|
$imgInfos = array();
|
||||||
|
foreach( $imgList as $imgName ){
|
||||||
|
if(startsWith($imgName, "images/")){
|
||||||
|
array_push( $imgInfos, getimagesize(str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgName))));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
array_push( $imgInfos, getimagesize("thumbs/".str_replace(".jpg", ".png", $imgName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<title><?php echo $wkName?> - Bilderalbum<?php echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");?></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="description" content="
|
||||||
|
<?php
|
||||||
|
echo descrName($wkName);
|
||||||
|
echo( !empty($showAllMode)?($showAllMode == "true" ? " - alle Bilder" : "") : "");
|
||||||
|
?>
|
||||||
|
">
|
||||||
|
<meta name="keywords" content="Album, Fotos">
|
||||||
|
<!-- BluimpGallery Zeug -->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="/ressourcen/blueimpGallery/css/blueimp-gallery.css">
|
||||||
|
<link rel="stylesheet" href="/ressourcen/blueimpGallery/css/blueimp-gallery-indicator.css">
|
||||||
|
<link rel="stylesheet" href="/ressourcen/blueimpGallery/css/blueimp-gallery-video.css">
|
||||||
|
|
||||||
|
<!-- favIcon und Co nach der empfehlung von https://github.com/audreyr/favicon-cheat-sheet -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" sizes="16x16 32x32 48x48 64x64" href="/ressourcen/graphiken/logos/favicon/favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-152.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-180.png" />
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
|
<link rel="canonical" href="http://cwsvjudo.bplaced.net<?php echo $_SERVER['REQUEST_URI']?>" />
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/ressourcen/jsLib/jquery-3.1.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/ressourcen/jsLib/jquery.lazyload.min.js"></script>
|
||||||
|
<style>
|
||||||
|
.lazy{ display: none;}
|
||||||
|
.smallFont{font-size: small;}
|
||||||
|
.centerText{text-align: center;}
|
||||||
|
.navButton{
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-color: white;
|
||||||
|
border-style: outset;
|
||||||
|
border-radius: 1em;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: .5em;
|
||||||
|
padding-right: .5em;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body style="color: #000000; background-color: #FFAE00" >
|
||||||
|
<?php
|
||||||
|
require_once( $_SERVER['DOCUMENT_ROOT'].'/ressourcen/phpLib/is_mobile.php');
|
||||||
|
if(is_mobile()) echo "<a title=\"Galerien der Judoka des Chemnitzer WSV\" href=\"/pages/mobile/verein.wettkampfgalerien.php\">Zur Galerieübersicht</a>";
|
||||||
|
else echo "<a title=\"Galerien der Judoka des Chemnitzer WSV\" href=\"/pages/desktop/verein.galerien.php\">Zur Galerieübersicht</a>";
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
/// Eine kleine Messagebox
|
||||||
|
if( !empty($messages) ){
|
||||||
|
?>
|
||||||
|
<div style="border: 1px solid black">
|
||||||
|
<?php
|
||||||
|
if( !empty( $messages['info'] ) ) echo( $messages['info'] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
// echo("pickedImages: "); print_r($pickedImages);
|
||||||
|
/// Ende MessageBox
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h1 class="centerText" >
|
||||||
|
Photoalbum [<b><?php echo $wkName?></b>]
|
||||||
|
</h1>
|
||||||
|
<?php
|
||||||
|
if( $showAllMode == "true" ){
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
[<?php echo count($imgList)?> Bilder]
|
||||||
|
</p>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
?>
|
||||||
|
<a href=<?php echo( "\"?galId=".(empty($galleryId)?"0":$galleryId)."&showAll=true".($chooseMode=="true"?"&chooseMode=true":"")."\"");?>><div class="navButton" style="width: 100%;">Alle Bilder einblenden </div></a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p class="centerText smallFont">
|
||||||
|
Auf die jeweiligen Bilder klicken um eine größere Ansicht zu bekommen.
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.galImgList{
|
||||||
|
/*flex: auto;*/
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- The container for the list of example images -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo( "<form action=\"http://cwsvjudo.bplaced.net/ressourcen/phpLib/imgGallery/imgPicker.php\" method=\"post\">" );
|
||||||
|
echo( "<input type=\"hidden\" name=\"galId\" value=\"".$galleryId."\" />" );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div id="links" class="galImgList">
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo( "<div ".( ($chooseMode=="true")?"style=\"border: 1px solid black;\"":"" ).">" );
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo("<label>");
|
||||||
|
echo( "<input type=\"checkbox\" name=\"pickedImages[]\" value=\"".$imgList[$imgIndex]."\" />" );
|
||||||
|
}
|
||||||
|
echo "<img class=\"lazy\" ".
|
||||||
|
"id=\"Image".( $imgIndex )."\" ".
|
||||||
|
// "data-original=\"./thumbs/".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images/", "", str_replace(".jpg", ".png", $imgName)):str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
// "data-original=\"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex])."\" ".
|
||||||
|
"data-original=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
$imgInfos[$imgIndex][3]." ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $wkName )." Bild ".( $imgIndex +1 )." von ".( $imgSize )."\" ".
|
||||||
|
"onclick=\"startGalleryShow(" . $imgIndex . ");\"".
|
||||||
|
" />";
|
||||||
|
echo "<noscript><a href=\"view.php?index=".( $imgIndex )."\" >".
|
||||||
|
"<img id=\"Image".( $imgIndex + 1)."\" ".
|
||||||
|
"src=\"".( startsWith( $imgList[$imgIndex], "images/")?str_replace("images", "thumbs", str_replace(".jpg", ".png", $imgList[$imgIndex])):"./thumbs/".str_replace(".jpg", ".png", $imgList[$imgIndex]) )."\" ".
|
||||||
|
"alt=\"[".( $imgIndex )."/".( $imgSize )."]\" ".
|
||||||
|
"title=\"".( $wkName )." Bild ".( $imgIndex + 1 )." von ".( $imgSize )."\" ".
|
||||||
|
"/></a></noscript>";
|
||||||
|
if( $chooseMode == "true" ) echo( "</label>" );
|
||||||
|
echo("</div>");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div><!-- Ende galImgList -->
|
||||||
|
<?php
|
||||||
|
if( $chooseMode == "true" ){
|
||||||
|
echo( "<button type=\"submit\">Eingaben absenden</button>" );
|
||||||
|
echo( "</form>" );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
$(function() {
|
||||||
|
$("img.lazy").show().lazyload();
|
||||||
|
// $("img.lazy").lazyload();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- BluimpGalerry Lightbox Version -->
|
||||||
|
<!-- The Gallery as lightbox dialog, should be a child element of the document body -->
|
||||||
|
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
|
||||||
|
<div class="slides"></div>
|
||||||
|
<h2 class="title"><?php echo $wkName?></h2>
|
||||||
|
<a class="prev">‹</a>
|
||||||
|
<a class="next">›</a>
|
||||||
|
<a class="close">×</a>
|
||||||
|
<a class="play-pause"></a>
|
||||||
|
<ol class="indicator"></ol>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js"></script>
|
||||||
|
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/jquery.blueimp-gallery.min.js"></script>
|
||||||
|
<script>
|
||||||
|
function startGalleryShow(startIndex = 0){
|
||||||
|
var imgList = [
|
||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
for( $imgIndex = 0; $imgIndex < $imgSize; ++$imgIndex){
|
||||||
|
echo "\"".( $imgList[ $imgIndex ] )."\", ";
|
||||||
|
}
|
||||||
|
?>];
|
||||||
|
var gallery = blueimp.Gallery(
|
||||||
|
imgList,
|
||||||
|
{
|
||||||
|
onslide: function (index, slide) {
|
||||||
|
var counterUrl = "/expCounter/counter.php";
|
||||||
|
var pageUrl = encodeURIComponent( window.location.href ) + "?index=" + index.toString();
|
||||||
|
var pageTitle = document.title + " [" + index.toString() + "]";
|
||||||
|
var callUrl = counterUrl + "?jscode_version=1.2&chCounter_mode=js&status=active&visible=0&page_title=" + pageTitle + "&page_url=" + pageUrl;
|
||||||
|
|
||||||
|
var xmlHttp = new XMLHttpRequest();
|
||||||
|
xmlHttp.open("GET", callUrl, true); // true for asynchronous
|
||||||
|
xmlHttp.send(null);
|
||||||
|
},
|
||||||
|
startSlideshow: true,
|
||||||
|
stretchImages: true,
|
||||||
|
index: startIndex,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
startGalleryShow();
|
||||||
|
};
|
||||||
|
// startGalleryShow();
|
||||||
|
</script>
|
||||||
|
<hr/>
|
||||||
|
<!--Beginn der Einbindung des Counters-->
|
||||||
|
<?php
|
||||||
|
$chCounter_template = <<<TEMPLATE
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Besucher online: {V_VISITORS_CURRENTLY_ONLINE}</td>
|
||||||
|
<td>Besucher bisher: {V_PAGE_VIEWS_THIS_PAGE}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
TEMPLATE;
|
||||||
|
$chCounter_page_title = "Photoalbum ".$wkName;
|
||||||
|
$chCounter_visible=1; include( $_SERVER['DOCUMENT_ROOT'].'/expCounter/counter.php');?>
|
||||||
|
<!--Ende der Einbindung des Counters-->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
$imgSize = count( $imgList );
|
||||||
|
assert( $imgSize > 0, "Bilder leider nicht verfügbar!");
|
||||||
|
$currIndex = intval( $_GET["index"] );
|
||||||
|
if( $currIndex < 0 ) $currIndex = 0;
|
||||||
|
if( $currIndex >= $imgSize) $currIndex = $imgSize-1;
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<title><?php echo $wkName;?> Einzelansicht [<?php echo $currIndex;?>/<?php echo $imgSize;?>]</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!-- Leute mit aktiviertem JavaScript sollen die BlueImpGallery gezeigt bekommen -->
|
||||||
|
<?php
|
||||||
|
echo "window.location = \"index.php?index=".$currIndex."\"";
|
||||||
|
?>
|
||||||
|
</script>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="description" content="Die Judoka des Chemnitzer WSV beim Wettkampf <?php echo $wkName;?> (Bild [<?php echo($currIndex);?>/<?php echo $imgSize;?>])">
|
||||||
|
<meta name="keywords" content="Judo, <?php echo $wkName;?>, Bilder, Photos, Album, Galerie, Wettkampf, CWSV, Chemnitz, ">
|
||||||
|
|
||||||
|
<!-- favIcon und Co nach der empfehlung von https://github.com/audreyr/favicon-cheat-sheet -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" sizes="16x16 32x32 48x48 64x64" href="/ressourcen/graphiken/logos/favicon/favicon.ico">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-152.png" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/ressourcen/graphiken/logos/apple-touch-icon/apple-touch-icon-180.png" />
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
|
<link rel="canonical" href="http://cwsvjudo.bplaced.net<?php echo $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_QUERY']?>" />
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFAE00">
|
||||||
|
<h1><?php echo $wkName;?></h1>
|
||||||
|
<!-- Variante für die Leute ohne JavaScript (Anfang)-->
|
||||||
|
<noscript>
|
||||||
|
<table style="margin-left:auto;margin-right:auto;">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a href="index.php">
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_topb.png" id="ntop" alt="Album" title="Album">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="view.php?index=0">
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_firstb.png" id="nfirst" alt="Zum Anfang" title="Zum Anfang">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $currIndex-10 >= 0 ? $currIndex - 10 : 0)."\"";?>>
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_prev10b.png" id="nprev10" alt="10 Bilder zurück" title="10 Bilder zurück">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $currIndex-1 >= 0 ? $currIndex - 1 : 0)."\"";?>>
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_prevb.png" id="nprev" alt="Bild zurück" title="Bild zurück">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $currIndex+1 < $imgSize ? $currIndex + 1 : $imgSize-1)."\"";?>>
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_nextb.png" id="nnext" alt="Bild vor" title="Bild vor">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $currIndex+10 < $imgSize ? $currIndex + 10 : $imgSize-1)."\"";?>>
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_next10b.png" id="nnext10" alt="10 Bilder vor" title="10 Bilder vor">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $imgSize-1 )."\""?>>
|
||||||
|
<img src="/ressourcen/graphiken/imgGal/nav_lastb.png" id="nlast" alt="Zum Ende" title="Zum Ende">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span id="image_name1"><?php echo $imgList[$currIndex]?></span>(<span id="image_num1"><?php echo $currIndex+1?></span>/<?php echo $imgSize;?>)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<a href=<?php echo "\"view.php?index=".( $currIndex+1 < $imgSize ? $currIndex + 1 : $imgSize-1)."\"";?>>
|
||||||
|
<img src=<?php echo "\"".$imgList[$currIndex]."\" alt=\"".$imgList[$currIndex]."\" id=\"main_image\" width=\"100%\""?>>
|
||||||
|
</a>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</noscript>
|
||||||
|
<!-- Ende der Variante für die Leute ohne JavaScript -->
|
||||||
|
|
||||||
|
<!--Beginn der Einbindung des Counters-->
|
||||||
|
<?php
|
||||||
|
$chCounter_page_title = $wkName." Einzelansicht [".$currIndex."/".$imgSize."]";
|
||||||
|
$chCounter_visible=0;
|
||||||
|
include( $_SERVER['DOCUMENT_ROOT'].'/expCounter/counter.php');?>
|
||||||
|
<!--Ende der Einbindung des Counters-->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user