diff --git a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php index d2c816c..e24cce6 100644 --- a/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php +++ b/homepage/redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php @@ -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); ?> + 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
datetimepageIduserHashuserAgentString
".$pagehitsEntry['timeStamp']."".$pagehitsEntry['pageId']."".substr($pagehitsEntry['userHash'], 0, 5)."...
".$pagehitsEntry['date']."".$pagehitsEntry['time']."".urldecode($pagehitsEntry['pageId'])."".substr($pagehitsEntry['userHash'], 0, 5)."..." ). + "".$pagehitsEntry['userAgentString']."
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..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'] .= 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){ 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/Makefiles/Makefile.ftpUpload b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload index 23f2d1e..c00c6ac 100644 --- a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload +++ b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload @@ -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 diff --git a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest index 743d6f5..9cee755 100644 --- a/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest +++ b/homepage/redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest @@ -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 diff --git a/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php index 17a0401..07e3d81 100644 --- a/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php +++ b/homepage/redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php @@ -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; - + + - + $vidEntry ){ echo( - "