From 9c2af1f3bf031dcae9e393c6e0f112ef15f1a725 Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 5 Dec 2018 12:55:32 +0100 Subject: [PATCH 1/5] =?UTF-8?q?-=20Einschr=C3=A4nkung=20auf=20einzelne=20S?= =?UTF-8?q?eiten,=20Tage=20und=20userHashes=20=09modified:=20=20=20redesig?= =?UTF-8?q?n2018/markdownExperiment/admin/phpcount/phpcountLog.php=20-=20v?= =?UTF-8?q?ergeblicher=20Versuch=20die=20fehlerhafte=20Anzeige=20bei=20dea?= =?UTF-8?q?ktiviertem=20JS=20zu=20beheben=20=09modified:=20=20=20redesign2?= =?UTF-8?q?018/markdownExperiment/phpLib/imgGallery/index.php.tmpl=20-=20A?= =?UTF-8?q?npassungen=20von=20Hand=20f=C3=BCr=20einzelne=20Spezialf=C3=A4l?= =?UTF-8?q?le=20(@todo=20eifachere=20Individualkonfiguration)=20=09modifie?= =?UTF-8?q?d:=20=20=20redesign2018/markdownExperiment/src/Makefiles/Makefi?= =?UTF-8?q?le.ftpUpload=20=09modified:=20=20=20redesign2018/markdownExperi?= =?UTF-8?q?ment/src/Makefiles/Makefile.vidstabTest=20-=20Konzept=20einer?= =?UTF-8?q?=20neuen=20Videogalerie=20=09modified:=20=20=20redesign2018/mar?= =?UTF-8?q?kdownExperiment/src/galleryHelper/getVideoDurationJson.py=20=09?= =?UTF-8?q?new=20file:=20=20=20redesign2018/markdownExperiment/src/gallery?= =?UTF-8?q?Helper/videoGallery.tmpl.php=20=09new=20file:=20=20=20redesign2?= =?UTF-8?q?018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.p?= =?UTF-8?q?hp=20=09new=20file:=20=20=20redesign2018/markdownExperiment/src?= =?UTF-8?q?/galleryHelper/yamlRead.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/phpcount/phpcountLog.php | 61 ++-- .../phpLib/imgGallery/index.php.tmpl | 9 +- .../src/Makefiles/Makefile.ftpUpload | 38 ++- .../src/Makefiles/Makefile.vidstabTest | 31 +- .../src/galleryHelper/getVideoDurationJson.py | 2 +- .../src/galleryHelper/videoGallery.tmpl.php | 266 ++++++++++++++++++ .../galleryHelper/videoGalleryVue.tmpl.php | 210 ++++++++++++++ .../src/galleryHelper/yamlRead.py | 1 + 8 files changed, 566 insertions(+), 52 deletions(-) create mode 100644 homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php create mode 100644 homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.php create mode 100644 homepage/redesign2018/markdownExperiment/src/galleryHelper/yamlRead.py diff --git a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php index d2c816c..09e8820 100644 --- a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php +++ b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php @@ -13,47 +13,70 @@ 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); - + $dailyHitsQuery->execute(); + $dailyHitsList = $dailyHitsQuery->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); - +*/ + $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 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); ?> + RESET +
- -" ); -?> + +
datetimes
".$nodupesEntry['date']."".$nodupesEntry['anz']."
", array_column($dailyHitsList, 'date') ) );?>
", array_column($dailyHitsList, 'anz') ) );?>
+
- -" ); -?> -
Seitetimes
".$uniqueHitsEntry['pageid']."".$uniqueHitsEntry['hitcount']."
- - + " ); + echo( "\t\t\t\t". + "". + "". + "". + "" ); ?>
timeStamppageIduserHash
datetimepageIduserHash
".$pagehitsEntry['timeStamp']."".$pagehitsEntry['pageId']."".substr($pagehitsEntry['userHash'], 0, 5)."...
".$pagehitsEntry['date']."".$pagehitsEntry['time']."".urldecode($pagehitsEntry['pageId'])."".substr($pagehitsEntry['userHash'], 0, 5)."...
diff --git a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl index 1106973..f637c54 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl +++ b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl @@ -3,6 +3,9 @@ require_once($basePath."/config/phpcount.config.php"); require_once($basePath."/config/cwsvJudo.config.php"); + + include_once("config.inc.php"); + require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php"); function startsWith($haystack, $needle){ @@ -314,14 +317,8 @@ return $retVal; 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, diff --git a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload index 064ed7e..e10898c 100644 --- a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload +++ b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload @@ -1,15 +1,27 @@ +# Upload der Videogalleriedateien auf einen Webspace und Eintragen in +# die "Videodatenbank" + include Makefile.cfg -ftpServer = ftpupload.net -ftpUser = unaux_22935783 -ftpPassword = eeloor0D +#ftpServer = ftpupload.net +#ftpUser = unaux_22935783 +#ftpPassword = eeloor0D +#httpUrlBase = http://cwsvjudo-media-2018.unaux.com/ -ftpPathBase = /htdocs + +ftpServer = cwsvjudo.bplaced.net +ftpUser = cwsvjudo +ftpPassword = ***REMOVED*** +httpUrlBase = http://cwsvjudo.bplaced.net.net/ + +#ftpPathBase = /htdocs +ftpPathBase = /www ftpFilePath = videoalben/videoalben.2018 vidGalIndexPhp = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryTemplates/indexHier.php dryRun = --dry-run timeHandling= --only-newer +lftpNetLimitRate = 0 vidGalInsertScript = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/vidGalInsert.py @@ -20,14 +32,14 @@ all: .PHONY: ftpUpload ftpUpload: - lftp -e 'set net:limit-rate 25600; mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR); mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails; mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/webm; put $(vidGalIndexPhp) -o $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/index.php; put videos/config.inc.php -o $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/config.inc.php; mirror $(dryRun) $(timeHandling) -R videos/thumbnails $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails; mirror $(dryRun) $(timeHandling) -R videos/webm $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/webm; quit; ' \ + lftp -e 'set net:limit-rate $(lftpNetLimitRate); mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR); mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails; mkdir -f $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/webm; put $(vidGalIndexPhp) -o $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/index.php; put videos/config.inc.php -o $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/config.inc.php; mirror $(dryRun) $(timeHandling) -R videos/thumbnails $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails; mirror $(dryRun) $(timeHandling) -R videos/webm $(ftpPathBase)/$(ftpFilePath)/$(VID_GAL_DIR)/webm; quit; ' \ -u $(ftpUser),$(ftpPassword) ftp://$(ftpServer) -# for file in videos/webm/*; do \ -# filename=$${file##*/}; \ -# $(vidGalInsertScript) \ -# --shiaiYamlFile=./shiaiData.yaml \ -# --vidUrl="http://cwsvjudo-media-2018.unaux.com/$(ftpFilePath)/$(VID_GAL_DIR)/webm/$${filename}" \ -# --posterUrl="http://cwsvjudo-media-2018.unaux.com/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails/$${filename%.*}.jpg" \ -# --checkSum=$${filename%.*};\ -# done;\ + for file in videos/webm/*; do \ + filename=$${file##*/}; \ + $(vidGalInsertScript) \ + --shiaiYamlFile=./shiaiData.yaml \ + --vidUrl="$(httpUrlBase)/$(ftpFilePath)/$(VID_GAL_DIR)/webm/$${filename}" \ + --posterUrl="$(httpUrlBase)/$(ftpFilePath)/$(VID_GAL_DIR)/thumbnails/$${filename%.*}.jpg" \ + --checkSum=$${filename%.*};\ + done;\ diff --git a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest index 16dd26b..19280cb 100644 --- a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest +++ b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest @@ -1,8 +1,8 @@ FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe -#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 @@ -18,10 +18,10 @@ 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)) -targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/))) -targetSourceDir = videos/aufnahmen/ -sourceVideos = $(wildcard videos/.forCompressing/*.video) +defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/))) +targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories)) +sourceVideos = $(wildcard videos/.forCompressing/*.video) vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos))) firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos))) @@ -35,7 +35,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) @@ -57,7 +60,7 @@ thumbnails: $(jpegThumbs) echo: @echo $(webmVideos) @echo $(firstPassLogs) - @echo $(targetSourceDir) + @echo $(targetSourceDirectories) # Erzeugen der Targets @@ -87,13 +90,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",nlmeans=s=6:p=5:r=7,$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \ + -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 \ @@ -114,13 +118,13 @@ videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf # -b:v $(VID_CODEC_BITRATE) \ # Second Pass $(FFMPEG) -i $< \ - -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 \ + -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \ -codec:v $(VID_CODEC) \ -pass 2 \ -passlogfile "$(basename $<).firstPassLog" \ -deadline best \ -b:v $(shell /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \ - -aspect 16:9 \ + -aspect $(ffmpegDisplayAspectRatio)\ -threads 1 \ -speed 0 \ -tile-columns 0 \ @@ -136,8 +140,9 @@ 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 $(GUETZLI) --quality 90 "$<" "$@" - diff --git a/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py b/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py index c529732..02322bf 100644 --- a/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py +++ b/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py @@ -21,7 +21,7 @@ def probe(vid_file_path): @vid_file_path : The absolute (full) path of the video file, string. ''' if type(vid_file_path) != str: - raise Exception('Gvie ffprobe a full file path of the video') + raise Exception('Give ffprobe a full file path of the video') return command = ["ffprobe", diff --git a/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php new file mode 100644 index 0000000..19613ae --- /dev/null +++ b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php @@ -0,0 +1,266 @@ +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){ + $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(); +?> + + + + <?php echo $wkName?> - Videoalbum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zur Galerieübersicht + +
+ +
+ + +

+ - Videoalbum +

+ +

+ [ Videos] +

+ +

+ Auf die jeweiligen Bilder klicken um das Video anzuwählen. +

+ +
+ + + $vidEntry ){ + echo( + "" + ); +} +?> + + + + + + + + + diff --git a/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.php b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.php new file mode 100644 index 0000000..b2391f7 --- /dev/null +++ b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.php @@ -0,0 +1,210 @@ +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(); +?> + + + + <?php echo $wkName?> - Videoalbum + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zur Galerieübersicht + +
+ +
+ + +

+ - Videoalbum +

+ +

+ [ Videos] +

+ +

+ Auf die jeweiligen Bilder klicken um das Video anzuwählen. +

+ +
+ + +
+ +
+
+ + + diff --git a/homepage/redesign2018/markdownExperiment/src/galleryHelper/yamlRead.py b/homepage/redesign2018/markdownExperiment/src/galleryHelper/yamlRead.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/homepage/redesign2018/markdownExperiment/src/galleryHelper/yamlRead.py @@ -0,0 +1 @@ + From 7c9f4b8baa72e19057d2ebc4f14154adc481aa81 Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 9 Jan 2019 07:31:52 +0100 Subject: [PATCH 2/5] Erweiterungen am Wettkampkalender: - wettkampfkalenderlose Events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - neue Funktion zur Ausführung einer DatenbankAbfrage modified: markdownExperiment/phpLib/cwsvJudo/miscAssis.php - URL der Wettkämpfe um Wetkampfname erweitert modified: markdownExperiment/phpLib/cwsvJudo/wkKalender.php - events haben jetzt ein eigenes Datum und nehmen es nicht mehr aus dem zugeordneten Wettkampf (für die events ohne zugehörigen Eintrag im Wettkampfkalender) modified: markdownExperiment/wkParticipo/addEvent.php modified: markdownExperiment/wkParticipo/admin/addEvent.php - In der Adminansicht eines Events können jetzt auch Starter eintfernt werden; @todo: Was noch fehlt ist die Behandlung der Fahrten! modified: markdownExperiment/wkParticipo/admin/showEvent.php - dbQuery wurde in cwsvJudoe/miscAssis eingepflegt. modified: markdownExperiment/wkParticipo/lib/wkParticipo-userAttribute.php --- .../phpLib/cwsvJudo/miscAssis.php | 44 ++++++++++++++++++- .../phpLib/cwsvJudo/wkKalender.php | 2 +- .../wkParticipo/addEvent.php | 8 ++-- .../wkParticipo/admin/addEvent.php | 13 ++++-- .../wkParticipo/admin/showEvent.php | 36 ++++++++++++++- .../lib/wkParticipo-userAttribute.php | 41 ----------------- 6 files changed, 93 insertions(+), 51 deletions(-) diff --git a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php index ec8f622..e89e127 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php +++ b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php @@ -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() . "
"; + 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; +} + ?> diff --git a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php index 4a9e3be..52bbbf9 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php +++ b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php @@ -200,7 +200,7 @@ $htmlWkTableString = ""; str_replace("mannschaft", "mann­schaft", $wk['Veranstaltung']); $htmlWkTableString .= - "". + "". "". "". "
diff --git a/homepage/redesign2018/markdownExperiment/wkParticipo/admin/addEvent.php b/homepage/redesign2018/markdownExperiment/wkParticipo/admin/addEvent.php index 70c161f..708d233 100644 --- a/homepage/redesign2018/markdownExperiment/wkParticipo/admin/addEvent.php +++ b/homepage/redesign2018/markdownExperiment/wkParticipo/admin/addEvent.php @@ -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!
"; // print_r($message); @@ -67,6 +68,7 @@ "". ""; // $message['notice'] .= "eventWkDatum: ".$eventWkResult['Datum']."
"; + $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 @@
Eventdaten
/>
+
+ + /> +
/> diff --git a/homepage/redesign2018/markdownExperiment/wkParticipo/admin/showEvent.php b/homepage/redesign2018/markdownExperiment/wkParticipo/admin/showEvent.php index 97e68c5..4a55cca 100644 --- a/homepage/redesign2018/markdownExperiment/wkParticipo/admin/showEvent.php +++ b/homepage/redesign2018/markdownExperiment/wkParticipo/admin/showEvent.php @@ -1,4 +1,11 @@ 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 @@
  • type:
  • fahrtId:
  • +
    +
  • +
  • "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() . "
    "; - 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) ) From 75a4d9b3d48d4c1bd327868c87cefa4ca36d64de Mon Sep 17 00:00:00 2001 From: marko Date: Wed, 9 Jan 2019 13:13:35 +0100 Subject: [PATCH 3/5] =?UTF-8?q?Zumindest=20vorr=C3=BCbergehend=20den=20Use?= =?UTF-8?q?rAgent=20mitloggen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Erweiterung des hitcounters um den UserAgentString modified: markdownExperiment/admin/phpcount/phpcountLog.php new file: markdownExperiment/src/phpLibs/phpCount/phpcount.php - Es ist inzwischen schon weit genug vom ursprünglichen entfernt, das Repository wird nicht mehr weiterentwickelt, also brauchen wir es auch nicht mehr deleted: markdownExperiment/phpLib/phpcount --- .../admin/phpcount/phpcountLog.php | 15 +- .../markdownExperiment/phpLib/phpcount | 1 - .../src/phpLibs/phpCount/phpcount.php | 353 ++++++++++++++++++ 3 files changed, 358 insertions(+), 11 deletions(-) delete mode 160000 homepage/redesign2018/markdownExperiment/phpLib/phpcount create mode 100644 homepage/redesign2018/markdownExperiment/src/phpLibs/phpCount/phpcount.php diff --git a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php index 09e8820..e24cce6 100644 --- a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php +++ b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php @@ -18,13 +18,7 @@ try{ ); $dailyHitsQuery->execute(); $dailyHitsList = $dailyHitsQuery->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); -*/ + $whereClauses=array(); if($_GET['userHash']) $whereClauses[]="userHash='".$_GET['userHash']."'"; @@ -36,7 +30,7 @@ try{ $whereClause = join(" AND ", $whereClauses); $pagehitsQuery = $dbConnection->prepare( - "SELECT DATE(timeStamp) as date, TIME(timestamp) as time, pageId, userHash FROM `phpcount_pageHits` ". + "SELECT DATE(timeStamp) as date, TIME(timestamp) as time, pageId, userHash, userAgentString FROM `phpcount_pageHits` ". ($whereClause?"WHERE ".$whereClause." ":""). "ORDER BY timeStamp DESC;" ); @@ -70,13 +64,14 @@ catch(PDOException $db_error){
    - + ". "". "". "". - "" ); + ""; ?>
    datetimepageIduserHash
    datetimepageIduserHashuserAgentString
    ".$pagehitsEntry['date']."".$pagehitsEntry['time']."".urldecode($pagehitsEntry['pageId'])."".substr($pagehitsEntry['userHash'], 0, 5)."...
    ".substr($pagehitsEntry['userHash'], 0, 5)."..." ). + "".$pagehitsEntry['userAgentString']."
    diff --git a/homepage/redesign2018/markdownExperiment/phpLib/phpcount b/homepage/redesign2018/markdownExperiment/phpLib/phpcount deleted file mode 160000 index f1d3b54..0000000 --- a/homepage/redesign2018/markdownExperiment/phpLib/phpcount +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1d3b543d2175a81e95d1233c249cbaba6fd34d4 diff --git a/homepage/redesign2018/markdownExperiment/src/phpLibs/phpCount/phpcount.php b/homepage/redesign2018/markdownExperiment/src/phpLibs/phpCount/phpcount.php new file mode 100644 index 0000000..fbd46b3 --- /dev/null +++ b/homepage/redesign2018/markdownExperiment/src/phpLibs/phpCount/phpcount.php @@ -0,0 +1,353 @@ +. +*/ + +/* + * 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(""); + } + 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(); + } +} From b6b4ace76cf6e9614aa044b727385ff50434d038 Mon Sep 17 00:00:00 2001 From: marko Date: Thu, 10 Jan 2019 11:15:27 +0100 Subject: [PATCH 4/5] Hotfix an der GalerieSchabone, mal wieder wegen derDateinamen Changes to be committed: modified: index.php.tmpl --- .../phpLib/imgGallery/index.php.tmpl | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl index f637c54..99f153c 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl +++ b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl @@ -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){ From 29bb5c6fadcbe03211060a265ab3d02102f229c8 Mon Sep 17 00:00:00 2001 From: marko Date: Fri, 11 Jan 2019 13:51:59 +0100 Subject: [PATCH 5/5] Erweiterung des Wettkampfkalenders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - der Wettkampfkalender hat in der Jahresansicht oben nun zwei Buttons, mit denen die Jahre vor- und zurückgeblättert werden kann modified: wkKalender.php --- .../phpLib/cwsvJudo/wkKalender.php | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php index 52bbbf9..499ca29 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php +++ b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/wkKalender.php @@ -200,7 +200,7 @@ $htmlWkTableString = ""; str_replace("mannschaft", "mann­schaft", $wk['Veranstaltung']); $htmlWkTableString .= - "
    ". + "". "". "". "
    "; + + if(in_array((intval($_GET["jahr"])-1), $jahre)){ + $siteData['mainContent'].= + "".(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])-1:"").""; + } + else $siteData['mainContent'].=""; +// var_dump($_GET, $jahre); + if(in_array((intval($_GET["jahr"])+1), $jahre)){ + $siteData['mainContent'].= + "".(is_positive_integer($_GET["jahr"])?intval($_GET["jahr"])+1:"").""; + } + else $siteData['mainContent'].=""; + $siteData['mainContent'].= + "
    "; } else{ $siteData['mainContent'] .=