Übernahme des redesign2018-Zweiges

This commit is contained in:
marko
2018-06-30 11:20:39 +02:00
parent f3bce58dbb
commit 09fc579fd8
34 changed files with 2956 additions and 200 deletions

View File

@@ -0,0 +1,42 @@
<?php
/// Ausgabe einer newsTabelle
function echoNewsTableHtml($someOptions){
global $cwsvJudoConfig;
global $basePath;
// Sammlung von Fehlermeldungen o.ä.
$message = array();
//require_once($basePath."/bonus/db.inc");
//include_once($basePath."/config/db.inc");
$limit = is_positive_integer($someOptions['limit'])?$someOptions['limit']:1;
/// Eine Datenbankverbindung (über pdo) erstellen
try{
$db_connection = new PDO(
"mysql:host=".$cwsvJudoConfig["db"]["host"].";".
"dbname=".$cwsvJudoConfig["db"]["name"],
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
}
catch(PDOException $db_error){
$messages['errors'][] = "Error: " . $db_error->getMessage();
}
// News abfragen
// @todo: woher das limit nehmen?
$newsList = getNews($db_connection, array('limit'=>$limit));
if( is_array( $newsList ) || is_object( $newsList ) )
foreach($newsList as $news)
echo( getHtmlNews($news, "headingLevel=2")."<hr />" );
else
$messages['errors'][] = "Fehler: Keine Neuigkeiten gefunden!";
// @todo: besser machen!
if(!empty($messages))
var_dump($messages);
return;
}