Gallerien in der Wettkampfeinzelansicht, Makefile für den ftpUpload

einer Videogallerie und Userattribute im Wettkampfplaner

Changes to be committed:

- Erweiterung der Wettkampfeinzelansicht um die (evtl. vorhandenen)
Galerien
 - modified:   phpLib/cwsvJudo/wkKalender.php
 - modified:   src/css/cwsvJudo-2018-mainNav.css
 - modified:   src/css/cwsvJudo-2018-wkKalender.css
- Makefile für das Hochladen einer Videogalerie
 - new file:   src/Makefiles/Makefile.ftpUpload
- Gehören mit zu den Gallerientemplates
 - new file:   src/galleryTemplates/indexHier.php
 - new file:   src/galleryTemplates/indexInArbeit.php
- Userattribute im Wettkampfplaner (war liegengeblieben)
 - new file:   wkParticipo/lib/wkParticipo-userAttribute.php
This commit is contained in:
marko
2018-11-06 10:21:53 +01:00
parent 00a50e2f0c
commit 2b7ab02db4
7 changed files with 246 additions and 11 deletions

View File

@@ -485,7 +485,8 @@ function wkBoxMediaGalleryHtml($wkGals){
if(empty($wkGals)) return "";
$retHtml = "";
$retHtml .= "<div class=\"galImgList\">";
$retHtml .= "<div class=\"wkBoxMediaGallery\">";
foreach($wkGals as $wkGal){
$retHtml.=
@@ -511,7 +512,7 @@ foreach($wkGals as $wkGal){
$retHtml .= "</a>";
}
$retHtml .= "</div>"; // Ende galImgList
$retHtml .= "</div>"; // Ende wkBoxMediaGallery
return $retHtml;
}

View File

@@ -0,0 +1,18 @@
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
.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 -R --ignore-time videos/thumbnails $(ftpPathBase)/$(VID_GAL_DIR)/thumbnails; mirror -R --ignore-time videos/webm $(ftpPathBase)/$(VID_GAL_DIR)/webm;quit' -u $(ftpUser),$(ftpPassword) ftp://$(ftpServer)

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

@@ -822,3 +822,16 @@
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

@@ -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

@@ -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>