Merge branch 'mitglieder' of /media/sdb1/gitRepositories/judo into promoInfo

This commit is contained in:
marko
2018-12-18 10:04:36 +01:00
35 changed files with 14440 additions and 245 deletions

View File

@@ -114,6 +114,10 @@ body{
width:100%;
}
.valignMiddle{
vertical-align:middle;
}
/* Bilder in voller Breite */
.bigPicture{
width: 100%;

View File

@@ -45,7 +45,7 @@ ampTest: $(ampFiles)
build/css/cwsvJudo.css: $(cssFiles)
mkdir -p $(dir $@)
# cat $(cssFiles) > $@
# cat $^ > $@
# cat $(cssFiles) | cleancss -o $@
# cat $^ | ./node_modules/.bin/csso -o $@
cat $^ | csso -o $@

View File

@@ -4,6 +4,20 @@ function is_positive_integer($str){
return (is_numeric($str) && $str > 0 && $str == round($str));
}
function getPdoDbConnection($hostname, $dbName, $user, $password){
try{
$dbConnection = new PDO(
'mysql:host='.$hostname.';dbname='.$dbName,
$user,
$password
);
}
catch(PDOException $dbError){
echo( "Error whilst getting a dbConnection!: " . $dbError->getMessage() );
}
return $dbConnection;
}
function getCwsvJudoDbConn(){
global $cwsvJudoConfig;
// Datenbankverbindung bereit stellen

View File

@@ -11,7 +11,11 @@ function echoWkTitle(){
}
/// Einen Wettkampfnamen per ID abfragen
function getWkName( $wkId, $alternative="Judo-Wettkampf" ){
if( !is_positive_integer($wkId) ) return $alternative;
if( !is_positive_integer($wkId) ) return $alternative;
if( empty($optionsArray['dbCharset']) ) $optionsArray['dbCharset'] = "ISO-8859-1";
if( empty($optionsArray['outCharset']) ) $optionsArray['outCharset'] = "UTF-8";
// Datenbankverbindung bereit stellen
global $cwsvJudoConfig;
@@ -35,7 +39,7 @@ function getWkName( $wkId, $alternative="Judo-Wettkampf" ){
$pdoStatementForQuerryingWkById->execute();
$ret = $pdoStatementForQuerryingWkById->fetchAll(PDO::FETCH_ASSOC);
return $ret[0]['Veranstaltung'];
return iconv($optionsArray['dbCharset'], $optionsArray['outCharset'], $ret[0]['Veranstaltung']);
}
catch(PDOException $db_error){
// $siteData['errors'][] = "Error!: " . $db_error->getMessage();
@@ -191,9 +195,11 @@ $htmlWkTableString = "";
str_replace("randori", "­randori", $wk['Veranstaltung']);
$wk['Veranstaltung'] =
str_replace("spiele", "­spiele", $wk['Veranstaltung']);
$wk['Veranstaltung'] =
str_replace("mannschaft", "mann­schaft", $wk['Veranstaltung']);
$htmlWkTableString .=
"<tr>".
"<a href=\"http://cwsvjudo.bplaced.net/wkKalender/".$wk['lfdeNr']."\"><tr>".
"<script type=\"application/ld+json\">".$wkJsonSd."</script>".
"<td data-title=\"Datum\" class=\"noWrap\">".
"<time class=\"kalenderDatum\" datetime=".$wk['Datum'].">".
@@ -215,7 +221,7 @@ $htmlWkTableString = "";
"<td data-title=\"iCal\">".
"<a title=\"Termin für ".$wk['Veranstaltung']." in Kalender übernehmen\" href=\"/ressourcen/phpLib/calendar.php?wkID=".$wk['lfdeNr']."\">iCal</a>".
"</td>".
"</tr>\n";
"</tr></a>\n";
}
$htmlWkTableString .=
"</tbody>".
@@ -244,6 +250,8 @@ function nicerAkList($akArray){
$ret = join(' und ', $both);
return $ret;
}
/// Wettkampfdaten als json-formatierte strukturierte Event-Daten
function wkArray2jsonSdEvent($wk){
return
@@ -297,6 +305,23 @@ function wkTableHtml(){
"<div class=\"wkInfoBox\">".
"<script type=\"application/ld+json\">".wkArray2jsonSdEvent($wk)."</script>".
"<h2>".$wk['Veranstaltung']."</h2>".
wkBoxMediaGalleryHtml($wkGals);
/*
if( !empty($wkGals) ){
foreach($wkGals as $wkGal){
// Für den Fall einer ampSeite müssen die imgTags angepasst werden
if( strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false ){
$siteData['mainContent'] .=
"<li><a style=\"position:relative;display:block;\" href=\"".$wkGal['url']."\">".( !empty($wkGal['teaserBildUrl'])?("<amp-img layout=\"responsive\" width=\"200\" height=\"133\" class=\"valignMiddle\" src=\"".$wkGal['teaserBildUrl']."\" ></amp-img>"):"").("<div style=\"color:white;position:absolute;left:0;top:42%;\">".$wkGal['typ']."galerie</div>")."</a></li>";
}
else{
$siteData['mainContent'] .=
"<li><a style=\"position:relative;display:block;\" href=\"".$wkGal['url']."\">".( !empty($wkGal['teaserBildUrl'])?("<img class=\"valignMiddle\" src=\"".$wkGal['teaserBildUrl']."\" />"):"").("<div style=\"color:white;position:absolute;left:0;top:42%;\">".$wkGal['typ']."galerie</div>")."</a></li>";
}
}
}
*/
$siteData['mainContent'] .=
"<h3>Veranstaltungsdaten</h3>".
"<ul>".
"<li>Datum: <time datetime=".$wk['Datum'].">".strftime("%a, %d. %B %Y", strtotime($wk['Datum']))."</time></li>".
@@ -308,12 +333,6 @@ function wkTableHtml(){
"<li><a href =\"".$wk['Ausschreibung']."\"><div>Link zur Ausschreibung</div></a></li>".
"<li><a href =\"".$wk['Routenplaner'] ."\"><div>Link zum Routenplaner</div></a></li>".
"<li><a href =\"/ressourcen/phpLib/calendar.php?wkID=".$wk['lfdeNr']."\"><div>Termin in Kalender übernehmen</div></a></li>";
if( !empty($wkGals) ){
foreach($wkGals as $wkGal){
$siteData['mainContent'] .=
"<li><a href=\"".$wkGal['url']."\">".$wkGal['typ']."galerie</a></li>";
}
}
$siteData['mainContent'] .=
"</ul>".
"</nav>".
@@ -461,4 +480,41 @@ $wkInfoBoxHtml = "";
return $wkInfoBoxHtml;
}
function wkBoxMediaGalleryHtml($wkGals){
if(empty($wkGals)) return "";
$retHtml = "";
$retHtml .= "<div class=\"wkBoxMediaGallery\">";
foreach($wkGals as $wkGal){
$retHtml.=
"<a class=\"textoverlayedImage\" href=\"".$wkGal['url']."\">";
if(strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false)
$retHtml .= "<amp-img layout=\"responsive\" ";
else
$retHtml .= "<img class=\"valignMiddle\" ";
$retHtml .=
"width=\"200\" height=\"133\" class=\"valignMiddle\" src=\"".
$wkGal['teaserBildUrl']."\"";
if(strpos( $_SERVER['ORIG_PATH_TRANSLATED'], "pages/amp" ) !== false)
$retHtml .= "></amp-img>";
else
$retHtml .= "/>";
$retHtml .=
"<div><p>".$wkGal['typ']."galerie</p></div>";
$retHtml .= "</a>";
}
$retHtml .= "</div>"; // Ende wkBoxMediaGallery
return $retHtml;
}
?>

View File

@@ -58,7 +58,7 @@ return $retVal;
<!--https://github.com/aFarkas/lazysizes-->
<script src="/ressourcen/jsLib/lazysizes.min.js" async=""></script>
<style>
.no-js img.lazyload {
img.lazyload {
display: none;
}
</style>
@@ -128,10 +128,11 @@ return $retVal;
flex: auto;
width: 100%;
padding: 1vw 0;
flex-grow: unset;
}
.galImgList div img{
width: 100%;
height: auto;
height: auto;
}
.galImgList div video{
width: 100%;
@@ -162,7 +163,9 @@ return $retVal;
foreach( $vidList as $vidKey => $vidEntry ){
echo( "<div>" );
echo "<img class=\"lazyload\" ".
"src=\"".$vidEntry['posterSrc']."\"".
// Wir haben unsere eigen noscript-Alternative (die kein img mehr
// ist!), deshalb brauchen wir diesen empfohlenen Fallback nicht!
// "src=\"".$vidEntry['posterSrc']."\"".
// "srcset=\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\"".
"id=\"Video".( $vidKey )."\" ".
"data-src=\"".( $vidEntry['posterSrc'] )."\" ".

View File

@@ -0,0 +1,20 @@
include Makefile.cfg
ftpServer = ftpupload.net
ftpUser = unaux_22935783
ftpPassword = eeloor0D
ftpPathBase = /htdocs/videoalben/videoalben.2018
vidGalIndexPhp = /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryTemplates/indexHier.php
dryRun = --dry-run
timeHandling= --only-newer
.PHONY: all
all:
.PHONY: ftpUpload
ftpUpload:
lftp -e 'set net:limit-rate 25600; mkdir -f $(ftpPathBase)/$(VID_GAL_DIR); mkdir -f $(ftpPathBase)/$(VID_GAL_DIR)/thumbnails; mkdir -f $(ftpPathBase)/$(VID_GAL_DIR)/webm; put $(vidGalIndexPhp) -o $(ftpPathBase)/$(VID_GAL_DIR)/index.php; put videos/config.inc.php -o $(ftpPathBase)/$(VID_GAL_DIR)/config.inc.php; mirror $(dryRun) $(timeHandling) -R videos/thumbnails $(ftpPathBase)/$(VID_GAL_DIR)/thumbnails; mirror $(dryRun) $(timeHandling) -R videos/webm $(ftpPathBase)/$(VID_GAL_DIR)/webm; quit; ' \
-u $(ftpUser),$(ftpPassword) ftp://$(ftpServer)

View File

@@ -0,0 +1,11 @@
pngCompressed/%.png: %.png
mkdir -p pngCompressed
pngquant --speed 1 --force --output $@ $^
zopflipng -y --iterations=500 --filters=01234mepb --lossy_8bit --lossy_transparent $@ $@
pngCompressed/%.png: %.jpg
mkdir -p pngCompressed
convert $^ $(patsubst %.jpg,%.png,$^)
pngquant --speed 1 --force --output $@ $^
zopflipng -y --iterations=500 --filters=01234mepb --lossy_8bit --lossy_transparent $@ $@
rm -f $(patsubst %.jpg,%.png,$^)

View File

@@ -1,18 +1,42 @@
FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe
GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe
VID_CODEC_HEIGHT = 360
VID_CODEC_BITRATE = 500k
VID_CODEC = libvpx-vp9
#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
DEFAULT_VID_CODEC_WIDTH = -2
DEFAULT_VID_CODEC_BITRATE = 500k
DEFAULT_VID_CODEC = libvpx-vp9
# Standardwerte auf die benutzen Variablen schreiben, falls diese noch
# nicht (z.B. aus dem Terminal heraus oder über ein IncludeCfgFile)
# gesetzt worden sind
VID_CODEC_BITRATE := $(if $(VID_CODEC_BITRATE),$(VID_CODEC_BITRATE),$(DEFAULT_VID_CODEC_BITRATE))
VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_CODEC_HEIGHT))
VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH))
VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC))
sourceVideos = $(wildcard videos/.forCompressing/*.video)
targetSourceDir = videos/aufnahmen/
sourceVideos = $(wildcard videos/.forCompressing/*.video)
vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos)))
firstPassLogs = $(addsuffix .firstPassLog, $(basename $(sourceVideos)))
firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos)))
webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos)))))
jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos)))))
# das result= fehlt absichtlich
ffmpegVideoFilterVidstabDetect = vidstabdetect=shakiness=10:accuracy=15
# das input= fehlt absichtlich
ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:smoothing=30
ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos,
ffmpegVideoFilterDeinterlace = yadif,
ffmpegVideoFilterDenoise = hqdn3d,
.SECONDARY: $(vidstabLogs) $(firstPassLogs)
@@ -29,31 +53,45 @@ clean:
.PHONY: thumbnails
thumbnails: $(jpegThumbs)
.PHONY: echo
echo:
@echo $(webmVideos)
@echo $(firstPassLogs)
@echo $(targetSourceDir)
# Erzeugen der Targets
.PHONY: targets
targets:
for file in videos/aufnahmen/papaRomy/*.webm;\
mkdir -p videos/.forCompressing
# for file in videos/aufnahmen/papaRomy/*.webm;\
# do \
# checkSum=$$(sha512sum $${file});\
# ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\
# done;
for file in $(targetSourceDir)/*.*;\
do \
checkSum=$$(sha512sum $${file});\
ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\
done;
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
# Die Stabilisierungsberechnung:
# eventuell sollte hier die Skalierung vorgeschaltet werden...
videos/.forCompressing/%.trf: videos/.forCompressing/%.video
$(FFMPEG) -i $^ \
-filter:v vidstabdetect=result="$@" \
-filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabDetect):result="$@" \
-f null \
-
videos/.forCompressing/%.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf
# -b:v $(VID_CODEC_BITRATE) \
# First Pass
$(FFMPEG) -i $< \
-filter:v vidstabtransform=smoothing=30:input="$(basename $<).trf",nlmeans=s=6:p=5:r=7,scale=-2:$(VID_CODEC_HEIGHT):sws_flags=sinc,unsharp=5:5:0.8:3:3:0.4 \
-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 \
-codec:v $(VID_CODEC) \
-pass 1 \
-passlogfile "$(basename $<).firstPassLog" \
-b:v $(VID_CODEC_BITRATE) \
-aspect 16:9 \
-threads 1 \
-speed 4 \
-tile-columns 0 \
@@ -68,16 +106,19 @@ videos/.forCompressing/%.log: videos/.forCompressing/%.video videos/.forCompress
# target und dependencies müssen noch angepasst werden
# Die erste Abhängigkeit muss das quellVideo sein!
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.log
videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log
mkdir -p videos/webm
# -b:v $(VID_CODEC_BITRATE) \
# Second Pass
$(FFMPEG) -i $< \
-filter:v vidstabtransform=smoothing=30:input="$(basename $<).trf",nlmeans=s=6:p=5:r=7,scale=-2:$(VID_CODEC_HEIGHT),unsharp=5:5:0.8:3:3:0.4 \
-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 \
-codec:v $(VID_CODEC) \
-pass 2 \
-passlogfile "$(basename $<).firstPassLog" \
-deadline best \
-b:v $(VID_CODEC_BITRATE) \
-b:v $(shell /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \
-aspect 16:9 \
-threads 1 \
-speed 0 \
-tile-columns 0 \
@@ -92,14 +133,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 scale=-2:$(VID_CODEC_HEIGHT),fps=fps=1/600 "$@"
$(FFMPEG) -i "$<" -vf thumbnail,scale=-2:$(VID_CODEC_HEIGHT) -frames:v 1 "$@"
# $(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 "$@"
videos/thumbnails/%.jpg: videos/thumbnails/%.png
$(GUETZLI) --quality 90 "$<" "$@"
###
#$(FFMPEG) -i %1 -map 0 -c copy -c:v libvpx-vp9 -pass 1 -passlogfile "%~dpn1.log" -b:v 150K -threads 1 -deadline good -cpu-used 4 -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 24 -g 9600 -aq-mode 1 -sws_dither none -pix_fmt yuv420p10le -filter:v nlmeans=s=6:p=5:r=7,scale=w=428:h=240:force_original_aspect_ratio=decrease:sws_flags=area:sws_dither=none,crop=trunc(iw/2)*2:trunc(ih/2)*2:0:0 -an -f null NUL
#$(FFMPEG) -i %1 -map 0 -c copy -c:v libvpx-vp9 -pass 2 -passlogfile "%~dpn1.log" -b:v 150K -threads 1 -deadline good -cpu-used 1 -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 24 -g 9600 -aq-mode 1 -sws_dither none -pix_fmt yuv420p10le -filter:v nlmeans=s=6:p=5:r=7,scale=w=428:h=240:force_original_aspect_ratio=decrease:sws_flags=area:sws_dither=none,crop=trunc(iw/2)*2:trunc(ih/2)*2:0:0 -c:a libopus -b:a 32k -ac 2 -f webm "%~dpn1.webm"

View File

@@ -2,8 +2,8 @@
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: space-between;
font-family: 'Orbitron-Medium', sans-serif;
/* line-height: 1.6;*/
margin: .5em 0;
padding: 0;
border: 1px solid #a2a2a2;
@@ -45,20 +45,16 @@
}
/* =================================
Media Queries
==================================== */
/*
* Media Queries
*/
@media (min-width: 640px) {
#mainNav {
display: flex;
flex-direction: row;
align-items: flex-end;
/* align-items: flex-end;*/
}
#mainNav > a{
padding: .5em .5em;

View File

@@ -794,3 +794,44 @@
}
}
*/
/*
* Mit Text overlay-tes Bild
*/
.textoverlayedImage{
position: relative;
display: table;
}
.textoverlayedImage > img {
width: 100%;
height: auto;
}
.textoverlayedImage > div {
z-index: 99;
width: 70%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.textoverlayedImage > div > p{
text-align: center;
color: white;
font-weight: lighter;
line-height: 2;
padding: 0 10%;
}
/*
* Die Galerie der Galerien in der wkInfoBox
*/
.wkBoxMediaGallery{
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-items: center;
}
.wkBoxMediaGallery > *{
flex-basis:50%;
}

View File

@@ -38,13 +38,17 @@ html{
/*
* Body
*/
body{
background: #FFAE00;
font-family: arial, helvetica, sans-serif;
}
/* Container für eine einzelne News */
/*
* Container für eine einzelne News
*/
.newsBox{
border: solid 1px #000000;
padding: 1vmin;
@@ -113,6 +117,9 @@ body{
.fullWidth{
width:100%;
}
.valignMiddle{
vertical-align:middle;
}
/* Bilder in voller Breite */
.bigPicture{

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import sys
import subprocess
#ffprobe =
def getLength(filename):
result = subprocess.Popen(
["C:\\proggis\\media\\editoren\\ffmpeg-4.0.2-win64-static\\bin\\ffprobe.exe", filename],
stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
# print( result.stdout.readlines() )
# for x in result.stdout.readlines():
# print(x)
return [x for x in result.stdout.readlines() if b"Duration" in x]
#print( str( getLength(sys.argv[1]) ) )
getLength(sys.argv[1])

View File

@@ -0,0 +1,68 @@
#!/usr/bin/env python3
#
# Command line use of 'ffprobe':
#
# ffprobe -loglevel quiet -print_format json \
# -show_format -show_streams \
# video-file-name.mp4
#
# man ffprobe # for more information about ffprobe
#
import subprocess as sp
import json
import sys
def probe(vid_file_path):
''' Give a json from ffprobe command line
@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')
return
command = ["ffprobe",
"-loglevel", "quiet",
"-print_format", "json",
"-show_format",
"-show_streams",
vid_file_path
]
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.STDOUT)
out, err = pipe.communicate()
return json.loads(out)
def duration(vid_file_path):
''' Video's duration in seconds, return a float number
'''
_json = probe(vid_file_path)
if 'format' in _json:
if 'duration' in _json['format']:
return float(_json['format']['duration'])
if 'streams' in _json:
# commonly stream 0 is the video
for s in _json['streams']:
if 'duration' in s:
return float(s['duration'])
# if everything didn't happen,
# we got here because no single 'return' in the above happen.
raise Exception('I found no duration')
#return None
if __name__ == "__main__":
# video_file_path = "/tmp/tt1.mp4"
video_file_path = sys.argv[1]
durationInSec = duration(video_file_path)
rateInKbPerSec = (10 * 1024 * 1024 * 8)/( durationInSec * 1000 )
#print( duration(video_file_path) ) # 10.008
print( int(min(500, rateInKbPerSec)) )

View File

@@ -0,0 +1,7 @@
<?php
include_once("config.inc.php");
$wkName = empty($wkName) ? "<fehlender Wettkampfname>" : $wkName;
include_once( $_SERVER['DOCUMENT_ROOT']."/ressourcen/phpLib/videoGallery/videoGallery.tmpl.php" );
?>

View File

@@ -0,0 +1,20 @@
<?php
include_once("config.inc.php");
$basePath = "/users/cwsvjudo/www";
require_once($basePath."/config/phpcount.config.php");
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>In Arbeit</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php PHPCount::AddHit($wkName." - Videoalbum (Vorschau)");?>
</head>
<body>
<p>Die Videos des Wettkampfes <?php echo($wkName);?> sind momentan noch in Vorbereitung. Einfach später noch mal probieren.</p>
<img style="width:100%;" src="/ressourcen/graphiken/misc/staffeleiM%e4nnlein.jpg" />
<p>Wer ganz ungeduldig ist, kann ja schon mal <a href="./indexHier.php">kiebitzen</a>.</p>
</body>
</html>

View File

@@ -1,8 +1,18 @@
<?php
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once('../local/wkParticipoConf.php.inc');
require_once('../auth.php');
require_once('../local/db.php.inc');
require_once('../lib/wkParticipoLib.inc.php');
$basePath = "/users/cwsvjudo/www";
// require_once($basePath."/config/phpcount.config.php");
require_once($basePath."/config/cwsvJudo.config.php");
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
$pdoDbConn = getCwsvJudoDbConn();
?>
<!DOCTYPE html>
<html>

View File

@@ -169,10 +169,24 @@
</li>
<?php
}
echo("<table>");
echo("<tr><th>Name</th><th>Vorname</th><th>Masse</th><th>Platz</th><th>starterId</th><th>fahrtId</th></tr>");
foreach( $starterData as $starter ){
if($starter['type'] != $typeKey) continue;
echo("<tr>");
$userData = getUserData($mysqli, $starter['userId']);
echo("<td>".mb_convert_encoding($userData['name'], 'UTF-8', 'ISO-8859-1')."</td>");
echo("<td>".mb_convert_encoding($userData['vorname'], 'UTF-8', 'ISO-8859-1')."</td>");
echo("<td>".$starter['masse']."</td>");
echo("<td>".$starter['platz']."</td>");
echo("<td>".$starter['id']."</td>");
echo("<td>".$starter['fahrtId']."</td>");
echo("</tr>");
}
echo("</table>");
}
?>
</ul>
<?php
}
// $fahrtenData = array();
// $fahrtenData = getFahrtenForEvent($mysqli, $eventData['id']);

View File

@@ -5,6 +5,10 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once('./local/db.php.inc');
require_once('./lib/wkParticipoLib.inc.php');
$basePath = "/users/cwsvjudo/www";
require_once($basePath."/config/phpcount.config.php");
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
$sqlMessage = array();
$mysqlConn = @new mysqli($db_server, $db_user, $db_password, $db_name);
@@ -27,6 +31,8 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="wkParticipo.css">
<link rel="stylesheet" href="http://cwsvjudo.bplaced.net/ressourcen/css/cwsvJudoNavBar.css">
<?php PHPCount::AddHit("Wettkampfplaner (".htmlspecialchars($_SESSION['user']['username']).")");?>
</head>
<body>
<?php echo $login_status; ?>
@@ -189,7 +195,6 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
<hr />
<h2 id="wettkaempfen">Anstehende Wettkämpfe</h2>
Nicht wundern, dass hier eventuell etwas doppelt steht! Ich experimentiere gerade.
<?php
$wkEvents = getCommingWkEvents($mysqli, array('outCharset'=>"UTF-8") );
@@ -210,7 +215,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
$wkEvent,
getStarterForEvent($mysqlConn, $wkEvent['id']),
getFahrtenForEvent($mysqlConn, $wkEvent['id'])
)
)
);
?>
@@ -225,6 +230,24 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
<p>
Es gibt zwei verschiedene Fristen. Zum einen die Frist vom Veranstalter, bis wann ihm alle Starter gemeldet sein müssen und zum anderen eine Frist bis wann man einen Starter für einen geplanten Wettkampf bei uns im Planer einschreiben kann. Logischerweise muss vor der Meldung bekannt sein, wer gemeldet werden kann. Deshalb ist die Einschreibefrist des Wettkampfplaners vor der Meldefrist des Veranstalters. Üblicherweise wird mit Meldeschluss die Meldung an den Veranstalter geschickt. Aber nicht immer, z. B. wenn die Teilnehmerzahl beschränkt ist. Sollte mal die Einschreibefrist verstrichen sein und man möchte trotzdem noch jemanden einschreiben, kann dies in den meisten Fällen noch erfolgen indem man mit dem Übungsleiter Rücksprache hält bevor dieser die Meldung an den Veranstalter abschickt.
</p>
<h3>Altersklassen</h3>
<p>
<p>
Im Judo werden die Kämpfer gemäß ihrem Alter, der Masse und (meistens auch) nach ihrem Geschlecht in Gruppen eingeteilt um miteinander zu kämpfen. Weder die Einteilung in <emph>Alters-</emph> noch die in <emph>Gewichtsklassen</emph> ist dabei einheitlich. Da die Wettkämpfe immer jeweils nur für bestimmte Altersklassen und manchmal auch nur für entweder männlich oder weiblich veranstaltet werden, sollte immer auf der Ausschreibung nachgesehen werden, wie der Veranstalter die Altersklassen definiert.
</p>
<p>
Bezeichnet werden die Altersklassen im Judo meistens mit Ux, wobei x eine Zahl ist. Ux steht für unter x Jahre. Man ist unter x Jahre, wenn man im laufenden Kalenderjahr nicht mehr x Jahre alt wird. Eine Altersklasse geht normalerweise über zwei (teilweise auch drei) Jahrgänge. Zur U11 z.B. würden normalerweise all diejenigen gehören, die im laufenden Jahr 10 oder 9 (bei drei Jahrgängen auch 8) Jahre alt werden. Es gibt aber auch Wettkämpfe in denen die Altersklassen mehr Jahrgänge umfassen.
</p>
<p>Im Zweifelsfall kann man mich auch jederzeit fragen.</p>
<p>
Für offizielle, vom Verband ausgerichtete Wettkämpfe gibt es festgelegte Alters- und Gewichtsklassen:
<ul>
<li><a href='http://cwsvjudo.bplaced.net/JudoWiki/AkGk/Jvs2018'>Alters- und Gewichtsklassen des Judoverbandes Sachsen</a></li>
<li><a href='http://cwsvjudo.bplaced.net/JudoWiki/AkGk/Djb2018'>Alters- und Gewichtsklassen im Deutschen Judo Bundes</a></li>
</ul>
</p>
</p>
<h2 id="menue">Menü</h2>

View File

@@ -0,0 +1,180 @@
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors',1);
$basePath = "/users/cwsvjudo/www";
require_once($basePath."/config/cwsvJudo.config.php");
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) )
return "";
$ret .= "<table>";
foreach($anArray as $row){
if( !is_array($anArray) )
continue;
$ret .= "<tr>";
foreach( $row as $entry )
$ret .= "<td>".$entry."</td>";
$ret .= "</tr>";
}
$ret .= "</table>";
return $ret;
}
function giveUserAnUserAttribute($aDbConnection, $anUserId, $anAttributeId){
echo("Entering giveUserAnUserAttribute!");
try{
dbQuery(
$aDbConnection,
"INSERT INTO `wkParticipo_user<=>userAttributes` (userId, attributeId) VALUES (:userId, :attributeId);",
array(
':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
':attributeId'=>array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT)
)
);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
}
return;
}
#exit();
var_dump($_GET);
$actions = ["giveUserAnUserAttribute"];
$dbConn = getCwsvJudoDbConn();
$dbConn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
if(isset($_GET['action'])){
switch($_GET['action']){
case "giveUserAnUserAttribute":
//echo("Doing giveUserAnUserAttribute!");
try{
giveUserAnUserAttribute($dbConn, intval($_GET['userIdToGetAttribute']), intval($_GET['attributeIdToGet']));
}
catch(Exception $e){
print("UPS: ".$e->getMessage());
}
break;
default:
echo("Ungültige Aktion erwünscht!");
break;
}
}
$users =
dbQuery(
$dbConn,
"SELECT * FROM cwsvjudo.wkParticipo_Users;"
);
$userAttributes =
dbQuery(
$dbConn,
"SELECT * FROM cwsvjudo.wkParticipo_userAttributes;"
);
?>
<html>
<head>
</head>
<body>
<form>
<label>Action:
<select name="action">
<option disabled selected value> -- Aktion auswählen -- </option>
<?php
foreach($actions as $action)
echo("<option>".$action."</option>");
?>
</select>
</label>
<label>User:
<select name="userIdToGetAttribute">
<option disabled selected value> -- User auswählen -- </option>
<?php
foreach($users as $user)
echo("<option value=\"".$user['id']."\">".$user['loginName']."</option>");
?>
</select>
</label>
<label>Attribut:
<select name="attributeIdToGet">
<option disabled selected value> -- Attribut auswählen -- </option>
<?php
foreach($userAttributes as $userAttribute)
echo("<option value=\"".$userAttribute['id']."\">".$userAttribute['name']."</option>");
?>
</select>
</label>
<button type="submit">Eingaben absenden</button>
</form>
<h1>Attribute</h1>
<?php echo(array2htmlTableString($userAttributes));?>
<?php
foreach($userAttributes as $userAttribute){
$attributedUsers =
dbQuery(
$dbConn,
"SELECT * FROM wkParticipo_Users, `wkParticipo_user<=>userAttributes` WHERE wkParticipo_Users.id = `wkParticipo_user<=>userAttributes`.userId AND `wkParticipo_user<=>userAttributes`.attributeId=:attributeId;",
array(":attributeId"=>array('value'=>$userAttribute['id'], 'data_type'=>PDO::PARAM_INT))
);
echo( "<h2>".$userAttribute['name']."</h2>".array2htmlTableString($attributedUsers) );
}
?>
<h1>User</h1>
<?php echo(array2htmlTableString($users));?>
</body>
</html>

View File

@@ -1201,6 +1201,7 @@ return $url;
function htmlWkEvent($aWkEvent, $starters, $fahrten){
//var_dump($aWkEvent, $starters, $fahrten);
$retHtml = "";
if( empty($aWkEvent['Datum']) )
@@ -1209,6 +1210,10 @@ $retHtml = "";
foreach($fahrten as $fahrt)
$anzPlätze += $fahrt['plaetze'];
$anzahlKaempfer = array_count_values(array_column($starters, 'type'))['1'];
$anzahlZuschauer = array_count_values(array_column($starters, 'type'))['2'];
$heuteDateTime = DateTimeImmutable::createFromFormat("Y-m-d", date("Y-m-d"));
$einschreibeDateTime = DateTimeImmutable::createFromFormat("Y-m-d", $aWkEvent['meldefrist']);
@@ -1235,10 +1240,17 @@ $retHtml = "";
"</div>"
)."</dd>".
(!empty($_SESSION['login'])?
"<dt>angemeldete Starter</dt><dd>".(
empty($starters)?
"Noch hat sich niemand für diesen Wettkampf gemeldet!":
count($starters)
"<dt>eingeschriebene Starter</dt><dd>".(
( $anzahlKaempfer == 0 )?
"Noch hat sich niemand für diesen Wettkampf eingeschrieben!":
$anzahlKaempfer
)."</dd>"
:"").
(!empty($_SESSION['login'])?
"<dt>eingeschriebene Zuschauer</dt><dd>".(
( $anzahlZuschauer == 0 )?
"Noch will sich niemand diesen Wettkampf anschauen!":
$anzahlZuschauer
)."</dd>"
:"").
(empty($_SESSION['login'])?
@@ -1257,7 +1269,7 @@ $retHtml = "";
).
"</form></dd>"
).
"<dt" . ( ($anzPlätze<count($starters)) ? " style=\"color: red\"" : "" ) . ">Anzahl Mitfahrgelegenheiten</dt><dd>" . $anzPlätze . "</dd>".
"<dt" . ( ($anzPlätze<($anzKaempfer+$anzZuschauer)) ? " style=\"color: red\"" : "" ) . ">Anzahl Mitfahrgelegenheiten</dt><dd>" . $anzPlätze . "</dd>".
(empty($_SESSION['login'])?
"<dd>Das Anbieten von Mitfahrgelegenheiten ist nur eingeloggt möglich!</dd>"
:"<dd><form action=\"./addFahrt.php\" method=\"post\">".

View File

@@ -94,19 +94,21 @@
<h2>Einschreibungen:</h2>
<?php if( !empty($_SESSION['login']) ){
$wkEventStarterData = getEventsStarterData($mysqli, $eventData['id']);
?>
<?php $wkEventStarterData = getEventsStarterData($mysqli, $eventData['id']);?>
<li>Eingeschrieben:
<?php
$starters = getStarterForEvent($mysqli, $eventData['id']);
if( empty($starters) ){
$anzahlKaempfer = array_count_values(array_column($starters, 'type'))['1'];
$anzahlZuschauer = array_count_values(array_column($starters, 'type'))['2'];
// if( empty($starters) ){
if( ($anzahlKaempfer+$anzahlZuschauer) <= 0 ){
?>
Noch hat sich niemand für diesen Wettkampf gemeldet!
Noch will niemand zu diesem Wettkampf!
<?php
}
else{
echo count($starters);
echo($anzahlKaempfer+$anzahlZuschauer);
}
?>
<ul>
@@ -139,8 +141,9 @@
</ul>
</li>
<!--
<p>Es sind momentan <?php echo (count($wkEventStarterData) == 0 ? "keine" : count($wkEventStarterData));?> Starter eingeschrieben.</p>
-->
<?php
}
?>