Merge branch 'redesign2018' of /media/sdb1/gitRepositories/judo into redesign2018

Conflicts:
	homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload
	homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php
This commit is contained in:
marko
2019-01-24 05:18:24 +01:00
15 changed files with 793 additions and 111 deletions

View File

@@ -13,47 +13,65 @@ try{
$cwsvJudoConfig["db"]["password"]
);
$nodupesQuery = $dbConnection->prepare(
"SELECT COUNT(*) AS anz, DATE(FROM_UNIXTIME( time )) as date FROM `phpcount_nodupes` GROUP BY date ORDER BY date DESC"
$dailyHitsQuery = $dbConnection->prepare(
"SELECT COUNT(*) AS anz, DATE(timeStamp) as date FROM `phpcount_pageHits` GROUP BY date ORDER BY date DESC;"
);
$nodupesQuery->execute();
$nodupesList = $nodupesQuery->fetchAll(PDO::FETCH_ASSOC);
$uniqueHitsQuery = $dbConnection->prepare(
"SELECT pageid, hitcount FROM `phpcount_hits` WHERE isunique=1 ORDER BY hitcount DESC"
);
$uniqueHitsQuery->execute();
$uniqueHitsList = $uniqueHitsQuery->fetchAll(PDO::FETCH_ASSOC);
$dailyHitsQuery->execute();
$dailyHitsList = $dailyHitsQuery->fetchAll(PDO::FETCH_ASSOC);
$whereClauses=array();
if($_GET['userHash'])
$whereClauses[]="userHash='".$_GET['userHash']."'";
if($_GET['date'])
$whereClauses[]="DATE(timestamp)='".$_GET['date']."'";
if($_GET['pageId'])
$whereClauses[]="pageId='".urldecode($_GET['pageId'])."'";
$whereClause = join(" AND ", $whereClauses);
$pagehitsQuery = $dbConnection->prepare(
"SELECT timeStamp, pageId, userHash FROM `phpcount_pageHits` ORDER BY timeStamp DESC;"
"SELECT DATE(timeStamp) as date, TIME(timestamp) as time, pageId, userHash, userAgentString FROM `phpcount_pageHits` ".
($whereClause?"WHERE ".$whereClause." ":"").
"ORDER BY timeStamp DESC;"
);
$pagehitsQuery->execute();
$pagehitsList = $pagehitsQuery->fetchAll(PDO::FETCH_ASSOC);
// var_dump($_GET);
if($_GET['action']=="deleteHitter"){
//var_dump($_GET['action']);
$deleteHitterQuery = $dbConnection->prepare(
"DELETE FROM `phpcount_pageHits` WHERE userHash=:userHash;"
);
$deleteHitterQuery->bindParam(':userHash', $_GET['userHash']);
if($deleteHitterQuery->execute());
else echo("FEHLER\n");
}
}
catch(PDOException $db_error){
die( "Error!: " . $db_error->getMessage() );
}
//var_dump($dailyHitsList);
?>
<html>
<body>
<img src="visitorCount.phplot.php" />
<a href="?">RESET</a>
<?php if(isset($_GET['userHash']))?><form action="./phpcountLog.php"><input type="hidden" name="userHash" id="userHash" value="<?php echo($_GET['userHash']);?>"><input type="hidden" name="action" id="action" value="deleteHitter"><button type="submit">DeleteHitter</button></form>
<table>
<tr><th>date</th><th>times</th></tr>
<?php foreach($nodupesList as $nodupesEntry)
echo( "\t\t\t\t<tr><td>".$nodupesEntry['date']."</td><td>".$nodupesEntry['anz']."<td></tr>" );
?>
<tr><th><?php echo( join( "</th><th>", array_column($dailyHitsList, 'date') ) );?></th></tr>
<tr><td><?php echo( join( "</td><td>", array_column($dailyHitsList, 'anz') ) );?></td></tr>
</table>
<hr />
<table>
<tr><th>Seite</th><th>times</th></tr>
<?php foreach($uniqueHitsList as $uniqueHitsEntry)
echo( "\t\t\t\t<tr><td>".$uniqueHitsEntry['pageid']."</td><td>".$uniqueHitsEntry['hitcount']."<td></tr>" );
?>
</table>
<table>
<tr><th>timeStamp</th><th>pageId</th><th>userHash</th></tr>
<tr><th>date</th><th>time</th><th>pageId</th><th>userHash</th><th>userAgentString</th></tr>
<?php foreach($pagehitsList as $pagehitsEntry)
echo( "\t\t\t\t<tr><td>".$pagehitsEntry['timeStamp']."</td><td>".$pagehitsEntry['pageId']."</td><td>".substr($pagehitsEntry['userHash'], 0, 5)."...<td></tr>" );
echo( "\t\t\t\t<tr>".
"<td><a href=\"?date=".$pagehitsEntry['date']."\">".$pagehitsEntry['date']."</a></td>".
"<td>".$pagehitsEntry['time']."</td>".
"<td><a href=\"?pageId=".urlencode( $pagehitsEntry['pageId'] )."\">".urldecode($pagehitsEntry['pageId'])."</a></td>".
"<td><a href=\"?userHash=".$pagehitsEntry['userHash']."\">".substr($pagehitsEntry['userHash'], 0, 5)."...</a><td>" ).
"<td>".$pagehitsEntry['userAgentString']."</a><td></tr>";
?>
</table>
</body>

View File

@@ -23,7 +23,7 @@ global $cwsvJudoConfig;
// Datenbankverbindung bereit stellen
try{
$db_connection = new PDO(
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8',
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
@@ -161,4 +161,46 @@ function toAscii($str, $replace=array(), $delimiter='-') {
return $clean;
}
function dbQuery($aDbConnection, $aQueryString, $aBindArray = array(), $someOptions = array( "dbCharset" => "ISO-8859-1", "outCharset" => "UTF-8" ) ){
//echo("Doing ".$aQueryString);
var_dump($aBindArray);
if( empty($someOptions['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1";
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
/// als UTF8 in latin1(?) gespeichert.
try{
$pdoStatement = $aDbConnection->prepare( $aQueryString );
foreach( $aBindArray as $bindName => $bind ){
$pdoStatement->bindValue(
$bindName,
$bind['value'],
(isset($bind['data_type'])?$bind['data_type']:PDO::PARAM_STR)
);
}
$pdoStatement->execute();
$ret = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
return null;
}
//var_dump($ret);
// Zeichensatzkonvertierung
if( is_array($ret) ){
foreach($ret as &$entry){
array_walk(
$entry,
function (&$value, $key, $someOptions) {
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
},
$someOptions
);
}
}
return $ret;
}
?>

View File

@@ -200,7 +200,7 @@ $htmlWkTableString = "";
str_replace("mannschaft", "mann&shy;schaft", $wk['Veranstaltung']);
$htmlWkTableString .=
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."\"><tr>".
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."/".toAscii( html_entity_decode( $wk['Veranstaltung'] ))."-am-".$wk['Datum']."\"><tr>".
"<script type=\"application/ld+json\">".$wkJsonSd."</script>".
"<td data-title=\"Datum\" class=\"noWrap\">".
"<time class=\"kalenderDatum\" datetime=".$wk['Datum'].">".
@@ -340,7 +340,7 @@ return
"\"startDate\": \"".$wk['Datum']."\",".
"\"endDate\": \"".$wk['Datum']."\",".
// "\"url\": \"http://cwsvjudo.bplaced.net/pages/desktop/verein.wettkampfkalender.php?wkId=".$wk['lfdeNr']."\",".
"\"url\": \"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."/".toAscii( html_entity_decode( $wk['Veranstaltung'] ))."\",".
"\"url\": \"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."/".toAscii( html_entity_decode( $wk['Veranstaltung'] ))."-am-".$wk['Datum']."\",".
"\"description\": \"Judo-Wettkampf der Altersklasse(n) ".nicerAkList( $wk['Altersklassen'] )."\",".
"\"performer\": {".
"\"@type\": \"PerformingGroup\"\,".
@@ -442,13 +442,34 @@ function wkTableHtml(){
array_push($jahre, $row["DATE_FORMAT( Datum, '%Y')"]);
}
// ist das übergebene jahr ein gültiges?
$jahr = $_GET["jahr"];
$jahr = is_positive_integer($_GET["jahr"])?$_GET["jahr"]:NULL;
if($jahr){
if(in_array($jahr, $jahre)){
$minDate = $jahr."-01-01";
$maxDate = $jahr."-12-31";
$siteData['mainContent'] .=
"<h2>Wettkampfkalender ".$jahr."</h2>";
$siteData['mainContent'].=
"<div style=\"display:flex;justify-content:space-between;\">";
if(in_array((intval($_GET["jahr"])-1), $jahre)){
$siteData['mainContent'].=
"<a class=\"touchLink\" href=\"http://cwsvjudo.bplaced.net/wkKalender?jahr=".
(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])-1:"").
"\">".(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])-1:"")."</a>";
}
else $siteData['mainContent'].="<a></a>";
// var_dump($_GET, $jahre);
if(in_array((intval($_GET["jahr"])+1), $jahre)){
$siteData['mainContent'].=
"<a class=\"touchLink\" href=\"http://cwsvjudo.bplaced.net/wkKalender?jahr=".
(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])+1:"").
"\">".(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])+1:"")."</a>";
}
else $siteData['mainContent'].="<a></a>";
$siteData['mainContent'].=
"</div>";
}
else{
$siteData['mainContent'] .=

View File

@@ -8,6 +8,13 @@
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);
@@ -54,6 +61,19 @@ return $retVal;
$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){

Submodule homepage/redesign2018/markdownExperiment/phpLib/phpcount deleted from f1d3b543d2

View File

@@ -1,27 +1,27 @@
# Upload der Videogalleriedateien auf einen Webspace und Eintragen in
# die "Videodatenbank"
include Makefile.cfg
#ftpServer = ftpupload.net
#ftpUser = unaux_22935783
#ftpPassword = eeloor0D
#ftpPathBase = /htdocs
#ftpFilePath = videoalben/videoalben.2018
#httpUrlBase = http://cwsvjudo-media-2018.unaux.com/
ftpServer = cwsvjudo.bplaced.net
ftpUser = cwsvjudo
ftpPassword = ***REMOVED***
httpUrlBase = http://cwsvjudo.bplaced.net.net/
ftpPathBase = /www
ftpFilePath = videoalben/videoalben.2018
ftpPathBase = /www
vidGalIndexPhp = ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryTemplates/indexHier.php
dryRun = --dry-run
timeHandling= --only-newer
lftpNetLimitRate = 0
domain = cwsvJudo.dedyn.io
vidGalInsertScript = ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/vidGalInsert.py

View File

@@ -1,10 +1,10 @@
#FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
FFMPEG = ffmpeg
#GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
#FFMPEG = ffmpeg
GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
#GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli
#DEFAULT_FFMPEG = ffmpeg
DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
DEFAULT_FFMPEG = ffmpeg
#DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
# Für eine schnelle Komprimierung libvpx, sonst vp9
DEFAULT_VID_CODEC_HEIGHT = 360
@@ -20,13 +20,14 @@ VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_C
VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH))
VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC))
#VID_CODEC_DEADLINE := -deadline best
VID_CODEC_DEADLINE := -deadline realtime
defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
VID_CODEC_DEADLINE := -deadline best
#VID_CODEC_DEADLINE := -deadline realtime
targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/)))
targetSourceDir = videos/aufnahmen/
sourceVideos = $(wildcard videos/.forCompressing/*.video)
targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories))
sourceVideos = $(wildcard videos/.forCompressing/*.video)
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
@@ -40,7 +41,10 @@ ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:
ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos,
ffmpegVideoFilterDeinterlace = yadif,
ffmpegVideoFilterDenoise = hqdn3d,
ffmpegVideoFilterDenoise = nlmeans,
#ffmpegVideoFilterDenoise = hqdn3d,
ffmpegDisplayAspectRatio = 16:9
#ffmpegDisplayAspectRatio = 9:16
.SECONDARY: $(vidstabLogs) $(firstPassLogs)
@@ -92,13 +96,14 @@ videos/.forCompressing/%.trf: videos/.forCompressing/%.video
videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
# -b:v $(VID_CODEC_BITRATE) \
# -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",nlmeans=s=6:p=5:r=7,$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
# First Pass
$(FFMPEG) -i $< \
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \
-codec:v $(VID_CODEC) \
-pass 1 \
-passlogfile "$(basename $<).firstPassLog" \
-aspect 16:9 \
-aspect $(ffmpegDisplayAspectRatio) \
-threads 1 \
-speed 4 \
-tile-columns 0 \
@@ -123,9 +128,15 @@ videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf
-codec:v $(VID_CODEC) \
-pass 2 \
-passlogfile "$(basename $<).firstPassLog" \
<<<<<<< HEAD
-deadline best \
-b:v $(shell /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \
-aspect $(ffmpegDisplayAspectRatio)\
=======
$(VID_CODEC_DEADLINE) \
-b:v $(shell ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \
-aspect 16:9 \
>>>>>>> a763569bdbb2f100ce14b50dcb7828db4e6f4852
-threads 1 \
-speed 0 \
-tile-columns 0 \
@@ -141,9 +152,15 @@ videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf
videos/thumbnails/%.png: videos/.forCompressing/%.video
mkdir -p videos/thumbnails
# $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@"
$(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
# $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
# $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@"
$(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@"
videos/thumbnails/%.jpg: videos/thumbnails/%.png
<<<<<<< HEAD
$(GUETZLI) --quality 90 "$<" "$@"
=======
# $(GUETZLI) --quality 90 "$<" "$@"
convert "$<" "$@"
>>>>>>> a763569bdbb2f100ce14b50dcb7828db4e6f4852

View File

@@ -17,7 +17,7 @@ include_once("config.inc.php");
$vidQuery =
$cwsvJudoDbConnection->prepare(
"SELECT url FROM cwsvjudo.`shiai.videos` WHERE wkId = :wkId;"
"SELECT url, posterUrl FROM cwsvjudo.`shiai.videos` WHERE wkId = :wkId;"
);
$vidQuery->bindParam(':wkId', intval($wkId), PDO::PARAM_INT);
@@ -29,9 +29,10 @@ include_once("config.inc.php");
foreach( $wkVideos as $wkVid){
// $posterSrc = str_replace( ".webm", ".jpg", str_replace("webm/", "thumbnails/", $vid ) );
// $posterSize = getimagesize( $posterSrc );
// 'posterSrc' => $posterSrc,
$vidList[] = array(
'vidSrc' => $wkVid['url'],
// 'posterSrc' => $posterSrc,
'posterSrc' => $wkVid['posterUrl'],
// 'width' => $posterSize[0],
// 'height' => $posterSize[1]
);
@@ -72,13 +73,10 @@ return $retVal;
<link rel="canonical" href="http://cwsvjudo.bplaced.net<?php echo $_SERVER['REQUEST_URI']?>" />
<!--
<script type="text/javascript" src="/ressourcen/blueimpGallery/js/blueimp-gallery.min.js" async=""></script>
-->
<script type="text/javascript" src="<?php echo($urlBase)?>/ressourcen/blueimpGallery/js/blueimp-gallery.min.js" async=""></script>
<!--https://github.com/aFarkas/lazysizes-->
<!--
<script src="/ressourcen/jsLib/lazysizes.min.js" async=""></script>
-->
<script src="<?php echo($urlBase)?>/ressourcen/jsLib/lazysizes.min.js" async=""></script>
<style>
img.lazyload {
display: none;
@@ -108,6 +106,7 @@ return $retVal;
</head>
<body style="color: #000000; background-color: #FFAE00" >
<iframe style="width:100%;height:auto;" src="http://cwsvjudo-media-2018.unaux.com/videoalben/videoalben.2018/2018-11-24-RKPXXI-U7U9U11-Schlettau/"></iframe>
<a title="Galerien der Judoka des Chemnitzer WSV" href="/galerien">Zur Galerieübersicht</a>
<?php
/// Eine kleine Messagebox
@@ -182,9 +181,10 @@ return $retVal;
}
</style>
<?php
foreach( $vidList as $vidKey => $vidEntry ){
echo(
"<video controls preload=\"none\">".
"<video controls preload=\"none\" poster=\"".$vidEntry['posterSrc']."\">".
"<source src=\"".$vidEntry['vidSrc']."\" type=\"video/webm\">".
"Dieser Browser scheint das Video nicht abspielen zu können.".
"</video>"
@@ -202,7 +202,7 @@ foreach( $vidList as $vidKey => $vidEntry ){
// "src=\"".$vidEntry['posterSrc']."\"".
// "srcset=\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"".
"id=\"Video".( $vidKey )."\" ".
// "data-src=\"".( $vidEntry['posterSrc'] )."\" ".
"data-src=\"".( $vidEntry['posterSrc'] )."\" ".
// "width=\"".$vidEntry['width']."\" ".
// "height=\"".$vidEntry['height']."\" ".
"alt=\"[".( $vidKey + 1 )."/".( count($vidList) )."]\" ".
@@ -212,7 +212,7 @@ foreach( $vidList as $vidKey => $vidEntry ){
echo(
"<noscript>".
// "<video controls preload=\"none\" poster=\"".$vidEntry['posterSrc']."\" width=\"".$vidEntry['width']."\" height=\"".$vidEntry['height']."\">".
"<video controls preload=\"none\">".
"<video controls preload=\"none\" poster=\"".$vidEntry['posterSrc']."\">".
"<source src=\"".$vidEntry['vidSrc']."\" type=\"video/webm\">".
"Dieser Browser scheint das Video nicht abspielen zu können.".
"</video>".
@@ -225,6 +225,7 @@ foreach( $vidList as $vidKey => $vidEntry ){
<!-- 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>
@@ -241,7 +242,6 @@ foreach( $vidList as $vidKey => $vidEntry ){
<?php
foreach( $vidList as $vidEntry){
// echo "{href: '".$vidEntry['vidSrc']."', poster: '".$vidEntry['posterSrc']."', type: 'video/webm'},";
echo "{href: '".$vidEntry['vidSrc']."', type: 'video/webm'},";
}
?>
];
@@ -260,7 +260,8 @@ foreach( $vidList as $vidKey => $vidEntry ){
xmlHttp.send(null);
},
*/
startSlideshow: true,
preloadRange: 0,
startSlideshow: false,
stretchImages: true,
index: startIndex,
}
@@ -273,6 +274,6 @@ foreach( $vidList as $vidKey => $vidEntry ){
// startGalleryShow();
</script>
<hr/>
-->
</body>
</html>

View File

@@ -0,0 +1,210 @@
<?php
$basePath = "/users/cwsvjudo/www";
include_once("config.inc.php");
require_once($basePath."/config/phpcount.config.php");
require_once($basePath."/config/cwsvJudo.config.php");
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
$cwsvJudoDbConnection = getCwsvJudoDbConn();
$cwsvJudoDbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$wkId = $_GET['wkId'];
$vidQuery =
$cwsvJudoDbConnection->prepare(
"SELECT url, posterUrl FROM cwsvjudo.`shiai.videos` WHERE wkId = :wkId;"
);
$vidQuery->bindParam(':wkId', intval($wkId), PDO::PARAM_INT);
$vidQuery->execute();
$wkVideos = $vidQuery->fetchAll(PDO::FETCH_ASSOC);
$vidList = array();
foreach( $wkVideos as $wkVid){
// $posterSrc = str_replace( ".webm", ".jpg", str_replace("webm/", "thumbnails/", $vid ) );
// $posterSize = getimagesize( $posterSrc );
$vidList[] = array(
'vidSrc' => $wkVid['url'],
'posterSrc' => $wkVid['posterUrl'],
// 'width' => $posterSize[0],
// 'height' => $posterSize[1]
);
}
/// Hilfsfunktion zum Anpassen der htmlDescription
function descrName($aName){
$retVal = "Videos der Judoka des Chemnitzer WSV beim Wettkampf ".$aName;
if( strpos($aName, "Sommerabschlussgrillen") >= 0 ) $retVal = "Videos der Judoka des Chemnitzer WSV beim ".$aName;
if( strpos($aName, "Jahrendefeier") >= 0 ) $retVal = "Videos der Judoka des Chemnitzer WSV bei der ".$aName;
return $retVal;
}/// Ende descrName
$messages = array();
?>
<!DOCTYPE HTML>
<html lang="de">
<head>
<title><?php echo $wkName?> - Videoalbum</title>
<?php //PHPCount::AddHit($wkName." - Videoalbum");?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="<?php echo descrName($wkName);?>">
<meta name="keywords" content="Album, Videos">
<!-- 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="https://unpkg.com/vue@2.4.3/dist/vue.js"></script>
<script type="text/javascript" src="https://unpkg.com/vue-gallery"></script>
<script type="text/javascript" src="https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery.js"></script>
<script type="text/javascript" src="https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery-youtube.js"></script>
<script type="text/javascript" src="https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery-video.js"></script>
<script type="text/javascript" src="https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery-fullscreen.js"></script>
<script type="text/javascript" src="https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-helper.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/blueimp-gallery@2.27.0/css/blueimp-gallery.min.css">
<style type="text/css">
.image {
float: left;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
border: 1px solid #ebebeb;
margin: 5px;
}
</style>
<script type="text/javascript">
window.onload=function(){
new Vue({
el: '#app',
data: function () {
return {
images: [
{
title: 'A YouYube video',
href: 'https://www.youtube.com/watch?v=hNdlUHBJDKs',
type: 'text/html',
youtube: 'hNdlUHBJDKs',
poster: 'https://img.youtube.com/vi/hNdlUHBJDKs/maxresdefault.jpg'
},
{
title: 'A YouYube video 2',
href: 'https://www.youtube.com/watch?v=s5iUsaPPtnk',
type: 'text/html',
youtube: 's5iUsaPPtnk',
poster: 'https://img.youtube.com/vi/s5iUsaPPtnk/maxresdefault.jpg'
},
<?php
//foreach( $vidList as $vidKey => $vidEntry ){
// echo(
// "{href: '".$vidEntry['vidSrc']."', poster: '".$vidEntry['posterSrc']."', type: 'video/webm'},"
// );
//}
?>
{
title: 'Image',
href: 'https://dummyimage.com/1600/ffffff/000000',
type: 'image/jpeg',
poster: 'https://dummyimage.com/350/ffffff/000000'
}
],
index: null
};
},
components: {
'gallery': VueGallery
}
});
}
</script>
<!--https://github.com/aFarkas/lazysizes-->
<script src="<?php echo($urlBase)?>/ressourcen/jsLib/lazysizes.min.js" async=""></script>
<style>
img.lazyload {
display: none;
}
</style>
<style>
body{box-sizing: border-box; margin: 0;}
.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="/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
}
?>
<h1 class="centerText" >
<?php echo($wkName);?> - Videoalbum
</h1>
<p class="centerText smallFont">
[<?php echo count($vidList)?> Videos]
</p>
<p class="centerText smallFont">
Auf die jeweiligen Bilder klicken um das Video anzuwählen.
</p>
<hr/>
<!--vueGallery-->
<div id="app">
<gallery
:images="images"
:index="index"
:options="{youTubeVideoIdProperty: 'youtube', youTubePlayerVars: undefined, youTubeClickToPlay: true}"
@close="index = null"
></gallery>
<div
class="image"
v-for="image, imageIndex in images"
@click="index = imageIndex"
:style="{ backgroundImage: 'url(' + image.poster + ')', width: '300px', height: '200px' }"
></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,353 @@
<?php
/*
* phpcount.php Ver.1.1- An "anoymizing" hit counter.
* Copyright (C) 2013 Taylor Hornby
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This PHP Class provides a hit counter that is able to track unique hits
* without recording the visitor's IP address in the database. It does so by
* recording the hash of the IP address and page name.
*
* By hashing the IP address with page name as salt, you prevent yourself from
* being able to track a user as they navigate your site. You also prevent
* yourself from being able to recover anyone's IP address without brute forcing
* through all of the assigned IP address blocks in use by the internet.
*
* Contact: havoc AT defuse.ca
* WWW: https://defuse.ca/
*
* USAGE:
* In your script, use reqire_once() to import this script, then call the
* functions like PHPCount::AddHit(...); See each function for help.
*
* NOTE: You must set the database credentials in the InitDB method.
*/
//global $phpcountConfig;
//var_dump($phpcountConfig);
class PHPCount
{
/*
* Defines how many seconds a hit should be rememberd for. This prevents the
* database from perpetually increasing in size. Thirty days (the default)
* works well. If someone visits a page and comes back in a month, it will be
* counted as another unique hit.
*/
const HIT_OLD_AFTER_SECONDS = 2592000; // default: 30 days.
// Don't count hits from search robots and crawlers.
const IGNORE_SEARCH_BOTS = true;
// Don't count the hit if the browser sends the DNT: 1 header.
const HONOR_DO_NOT_TRACK = false;
private static $IP_IGNORE_LIST = array(
'127.0.0.1',
);
private static $DB = false;
private static function InitDB()
{
global $phpcountConfig;
//var_dump($phpcountConfig);
if(self::$DB)
return;
try
{
// TODO: Set the database login credentials.
//echo("<!--");
//var_dump($phpcountConfig);
self::$DB = new PDO(
'mysql:host='.$phpcountConfig["db"]["host"] .';dbname='.$phpcountConfig["db"]["name"],
$phpcountConfig["db"]["user"], // Username
$phpcountConfig["db"]["password"]//, // Password
//array(PDO::ATTR_PERSISTENT => true)
);
//echo("-->");
}
catch(Exception $e)
{
self::$DB = false;
echo("Failed to connect to phpcount database (".$e->getMessage().")\n");
// die('Failed to connect to phpcount database ('.$e->getMessage().')');
}
}
public static function setDBAdapter($db)
{
self::$DB = $db;
return $db;
}
/*
* Adds a hit to a page specified by a unique $pageID string.
*/
public static function AddHit($pageID)
{
if(self::IGNORE_SEARCH_BOTS && self::IsSearchBot())
return false;
if(in_array($_SERVER['REMOTE_ADDR'], self::$IP_IGNORE_LIST))
return false;
if(
self::HONOR_DO_NOT_TRACK &&
isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] == "1"
) {
return false;
}
self::InitDB();
self::Cleanup();
if(self::UniqueHit($pageID))
{
self::CountHit($pageID, true);
self::LogHit($pageID);
}
self::CountHit($pageID, false);
self::LogPageHit($pageID);
return true;
}
/*
* Returns (int) the amount of hits a page has
* $pageID - the page identifier
* $unique - true if you want unique hit count
*/
public static function GetHits($pageID, $unique = false){
global $phpcountConfig;
self::InitDB();
try{
$q = self::$DB->prepare(
'SELECT hitcount FROM '.$phpcountConfig["db"]["hitsTable"].'
WHERE pageid = :pageid AND isunique = :isunique'
);
$q->bindParam(':pageid', $pageID);
$q->bindParam(':isunique', $unique);
$q->execute();
}
catch(Exeption $e){
echo("Failed to getHits from phpcount database (".$e->getMessage().")\n");
return -1;
}
if(($res = $q->fetch()) !== FALSE)
{
return (int)$res['hitcount'];
}
else
{
//die("Missing hit count from database!");
return 0;
}
}
/*
* Returns the total amount of hits to the entire website
* When $unique is FALSE, it returns the sum of all non-unique hit counts
* for every page. When $unique is TRUE, it returns the sum of all unique
* hit counts for every page, so the value that's returned IS NOT the
* amount of site-wide unique hits, it is the sum of each page's unique
* hit count.
*/
public static function GetTotalHits($unique = false){
global $phpcountConfig;
self::InitDB();
$q = self::$DB->prepare(
'SELECT hitcount FROM '.$phpcountConfig["db"]["hitsTable"].' WHERE isunique = :isunique'
);
$q->bindParam(':isunique', $unique);
$q->execute();
$rows = $q->fetchAll();
$total = 0;
foreach($rows as $row)
{
$total += (int)$row['hitcount'];
}
return $total;
}
/*====================== PRIVATE METHODS =============================*/
private static function IsSearchBot()
{
// Of course, this is not perfect, but it at least catches the major
// search engines that index most often.
$keywords = array(
'bot',
'spider',
'spyder',
'crawlwer',
'walker',
'search',
'yahoo',
'holmes',
'htdig',
'archive',
'tineye',
'yacy',
'yeti',
);
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
foreach($keywords as $keyword)
{
if(strpos($agent, $keyword) !== false)
return true;
}
return false;
}
private static function UniqueHit($pageID){
global $phpcountConfig;
$ids_hash = self::IDHash($pageID);
$q = self::$DB->prepare(
'SELECT `time` FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE ids_hash = :ids_hash'
);
$q->bindParam(':ids_hash', $ids_hash);
$q->execute();
if(($res = $q->fetch()) !== false)
{
if($res['time'] > time() - self::HIT_OLD_AFTER_SECONDS)
return false;
else
return true;
}
else
{
return true;
}
}
private static function LogHit($pageID){
global $phpcountConfig;
$ids_hash = self::IDHash($pageID);
$q = self::$DB->prepare(
'SELECT `time` FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE ids_hash = :ids_hash'
);
$q->bindParam(':ids_hash', $ids_hash);
$q->execute();
$curTime = time();
if(($res = $q->fetch()) !== false)
{
$s = self::$DB->prepare(
'UPDATE '.$phpcountConfig["db"]["nodupesTable"].' SET `time` = :time WHERE ids_hash = :ids_hash'
);
$s->bindParam(':time', $curTime);
$s->bindParam(':ids_hash', $ids_hash);
$s->execute();
}
else
{
$s = self::$DB->prepare(
'INSERT INTO '.$phpcountConfig["db"]["nodupesTable"].' (ids_hash, `time`)
VALUES( :ids_hash, :time )'
);
$s->bindParam(':time', $curTime);
$s->bindParam(':ids_hash', $ids_hash);
$s->execute();
}
}
private static function LogPageHit($pageId){
global $phpcountConfig;
try{
$q = self::$DB->prepare(
'INSERT INTO '.$phpcountConfig["db"]["pagehitsTable"].' (userHash, pageId, userAgentString) VALUES (:idsHash, :pageId, :userAgentString);'
);
$q->bindParam(':idsHash', self::userHash());
$q->bindParam(':pageId', $pageId);
$q->bindParam(':userAgentString', $_SERVER['HTTP_USER_AGENT']);
$q->execute();
}
catch(Exeption $e){
echo("Failed to logPageHits to phpcount database (".$e->getMessage().")\n");
return -1;
}
return 0;
}
private static function CountHit($pageID, $unique){
global $phpcountConfig;
//echo("DEBUG: Counting Hit on ".$pageID."\n");
try{
$q = self::$DB->prepare(
"INSERT INTO ".$phpcountConfig["db"]["hitsTable"]." (pageid, isunique, hitcount) VALUES (:pageid, :isunique, 1) " .
"ON DUPLICATE KEY UPDATE hitcount = hitcount + 1"
);
$q->bindParam(':pageid', $pageID);
$unique = $unique ? '1' : '0';
$q->bindParam(':isunique', $unique);
$q->execute();
}
catch(Exception $e){
die('phpcount failed to CountHit ('.$e->getMessage().')');
}
}
private static function IDHash($pageID)
{
$visitorID = $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'];
return hash("SHA256", $pageID . $visitorID);
}
private static function userHash()
{
$visitorID = $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'];
return hash("SHA256", $visitorID);
}
private static function Cleanup(){
global $phpcountConfig;
$last_interval = time() - self::HIT_OLD_AFTER_SECONDS;
$q = self::$DB->prepare(
'DELETE FROM '.$phpcountConfig["db"]["nodupesTable"].' WHERE `time` < :time'
);
$q->bindParam(':time', $last_interval);
$q->execute();
$q = self::$DB->prepare(
'DELETE FROM '.$phpcountConfig["db"]["pageHitsTable"].' WHERE `timeStamp` < :time'
);
$q->bindParam(':time', $last_interval);
$q->execute();
}
}

View File

@@ -3,7 +3,7 @@
require_once('../local/wkParticipoConf.php.inc');
$message = array();
if(!empty($_POST)){
if( empty($_POST['f']['wkId']) || empty($_POST['f']['meldefrist']) ){
if( empty($_POST['f']['wkId']) || empty($_POST['f']['meldefrist']) || empty($_POST['f']['datum']) ){
$message['error'] = 'Es wurden nicht alle Felder ausgefüllt.';
}
else{
@@ -12,12 +12,13 @@
$message['error'] = 'Datenbankverbindung fehlgeschlagen: ' . $mysqli->connect_error;
}
$query = sprintf(
"INSERT INTO wkParticipo_Events (wkId, meldefrist)
SELECT * FROM (SELECT '%s', '%s') as new_event
"INSERT INTO wkParticipo_Events (wkId, datum, meldefrist)
SELECT * FROM (SELECT '%s', '%s', '%s') as new_event
WHERE NOT EXISTS (
SELECT wkId FROM wkParticipo_Events WHERE wkId = '%s'
) LIMIT 1;",
$mysqli->real_escape_string($_POST['f']['wkId']),
$mysqli->real_escape_string($_POST['f']['datum']),
$mysqli->real_escape_string($_POST['f']['meldefrist']),
$mysqli->real_escape_string($_POST['f']['wkId'])
);
@@ -55,6 +56,7 @@
<fieldset>
<legend>Benutzerdaten</legend>
<div><label for="wkId">wkId</label> <input type="text" name="f[wkId]" id="wkId"<?php echo isset($_POST['f']['wkId']) ? ' value="' . htmlspecialchars($_POST['f']['wkId']) . '"' : '' ?> /></div>
<div><label for="datum">datum</label> <input type="text" name="f[datum]" id="datum" <?php echo isset($_POST['f']['datum']) ? ' value="' . htmlspecialchars($_POST['f']['datum']) . '"' : '' ?> /></div>
<div><label for="meldefrist">meldefrist</label> <input type="text" name="f[meldefrist]" id="meldefrist" <?php echo isset($_POST['f']['meldefrist']) ? ' value="' . htmlspecialchars($_POST['f']['meldefrist']) . '"' : '' ?> /></div>
</fieldset>
<fieldset>

View File

@@ -10,6 +10,7 @@
$message['wkData'] = "";
$eventWkId = isset($_POST['f']['wkId']) ? $_POST['f']['wkId'] : "";
$eventMeldefrist = isset($_POST['f']['date']) ? $_POST['f']['date'] : "";
$eventMeldefrist = isset($_POST['f']['meldefrist']) ? $_POST['f']['meldefrist'] : "";
// echo $_POST['f']['wkId']; echo $eventWkId; echo $eventMeldefrist; die();
@@ -38,7 +39,7 @@
if(!empty($_POST)){
// print_r($_POST);
if( empty($_POST['f']['wkId']) || empty($_POST['f']['meldefrist']) ){
if( empty($_POST['f']['wkId']) || empty($_POST['f']['date']) || empty($_POST['f']['meldefrist']) ){
// echo $_POST['f']['wkId']." aber ".$_POST['f']['meldefrist'];
$message['notice'] .= "Alle Felder ausfüllen und abschicken!<br />";
// print_r($message);
@@ -67,6 +68,7 @@
"</ul></li>".
"</ul>";
// $message['notice'] .= "eventWkDatum: ".$eventWkResult['Datum']."<br />";
$date=$eventWkResult['Datum'];
$meldefrist = date(
"Y-m-d",
strtotime(
@@ -93,12 +95,13 @@
}
else{
$query = sprintf(
"INSERT INTO wkParticipo_Events (wkId, meldefrist)
SELECT * FROM (SELECT '%s', '%s') as new_event
"INSERT INTO wkParticipo_Events (wkId, date, meldefrist)
SELECT * FROM (SELECT '%s', '%s', '%s') as new_event
WHERE NOT EXISTS (
SELECT wkId FROM wkParticipo_Events WHERE wkId = '%s'
) LIMIT 1;",
$mysqli->real_escape_string($_POST['f']['wkId']),
$mysqli->real_escape_string($_POST['f']['date']),
$mysqli->real_escape_string($_POST['f']['meldefrist']),
$mysqli->real_escape_string($_POST['f']['wkId'])
);
@@ -148,6 +151,10 @@
<fieldset>
<legend>Eventdaten</legend>
<div><label for="wkId">wkId</label> <input type="text" name="f[wkId]" id="wkId"<?php echo isset($_POST['f']['wkId']) ? ' value="' . htmlspecialchars($_POST['f']['wkId']) . '"' : "";?> /></div>
<div>
<label for="date">date</label>
<input type="text" name="f[date]" id="date" <?php echo $date != "" ? "value=\"".htmlspecialchars($date)."\" " : "";?> />
</div>
<div>
<label for="meldefrist">meldefrist</label>
<input type="text" name="f[meldefrist]" id="meldefrist" <?php echo $meldefrist != "" ? "value=\"".htmlspecialchars($meldefrist)."\" " : "";?> />

View File

@@ -1,4 +1,11 @@
<?php
$basePath = "/users/cwsvjudo/www";
require_once($basePath."/config/cwsvJudo.config.php");
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
require_once('../local/wkParticipoConf.php.inc');
require_once('../auth.php');
require_once('../local/db.php.inc');
@@ -16,7 +23,6 @@
}
else{
if( (string)(int)$_POST['f']['eventId'] == $_POST['f']['eventId'] ){
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
if ($mysqlConn->connect_error) {
$sqlMessage['error'] .= 'Datenbankverbindung fehlgeschlagen: ' . $mysqlConn->connect_error;
@@ -33,7 +39,30 @@
}
}
}
else $message['error'] = "Fehler: eventId ist kein Int (".$_POST['f']['eventId'].")";
//var_dump($_POST);
if( $_POST['action'] == "deleteStarter" ){
try{
$dbConnection = new PDO(
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
if($_POST['action']=="deleteStarter"){
echo("DELETE FROM `wkParticipo_Starter` WHERE id=:starterId;");
$deleteStarterQuery = $dbConnection->prepare(
"DELETE FROM `wkParticipo_Starter` WHERE id=:starterId;"
);
$deleteStarterQuery->bindParam(':starterId', $_POST['starterId'], PDO::PARAM_INT);
if($deleteStarterQuery->execute());
else echo("FEHLER\n");
}
}
catch(PDOException $db_error){
die( "Error!: " . $db_error->getMessage() );
}
}
else echo("NoActionDeleteStarter\n");
}
}
?>
@@ -132,6 +161,9 @@
<li>type: <?php echo($startTyp[$starter['type']]);?></li>
<li>fahrtId: <?php echo $starter['fahrtId']; ?></li>
<li>
<form action="./showEvent.php" method="post"><input type="hidden" name="starterId" id="starterId" value="<?php echo($starter['id']);?>"><input type="hidden" name="action" id="action" value="deleteStarter"><input type="hidden" name="f[eventId]" value="<?php echo($starter['eventId']);?>" /><button type="submit">Austragen</button></form>
</li>
<li>
<?php
if(empty($starter['fahrtId'])){
//$fahrten = array();

View File

@@ -9,47 +9,6 @@ $basePath = "/users/cwsvjudo/www";
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
function dbQuery($aDbConnection, $aQueryString, $aBindArray = array(), $someOptions = array( "dbCharset" => "ISO-8859-1", "outCharset" => "UTF-8" ) ){
//echo("Doing ".$aQueryString);
var_dump($aBindArray);
if( empty($someOptions['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1";
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
/// als UTF8 in latin1(?) gespeichert.
try{
$pdoStatement = $aDbConnection->prepare( $aQueryString );
foreach( $aBindArray as $bindName => $bind ){
$pdoStatement->bindValue(
$bindName,
$bind['value'],
(isset($bind['data_type'])?$bind['data_type']:PDO::PARAM_STR)
);
}
$pdoStatement->execute();
$ret = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
return null;
}
//var_dump($ret);
// Zeichensatzkonvertierung
if( is_array($ret) ){
foreach($ret as &$entry){
array_walk(
$entry,
function (&$value, $key, $someOptions) {
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
},
$someOptions
);
}
}
return $ret;
}
function array2htmlTableString($anArray){
$ret = "";
if( !is_array($anArray) )