- ein adminBereich
neue Datei: admin/newsAdmin.php neue Datei: admin/phpcount/phpcountLog.php - die Originale der Wappen neue Datei: graphiken/cwsvJudoLogoWappen.xcf neue Datei: graphiken/cwsvLogoWappen.xcf - Entwicklung einer Galerieansicht innerhalb des reDesigns2018 neue Datei: yaml/galerie.subNav.yaml neue Datei: md/galerie.md - Erweiterung des Templates geändert: pandocTemplate/cwsvJudo.html5.pandocTemplate - zu Testzwecken das Originaltemplate neue Datei: pandocTemplate/html5.pandocTemplate - redirectFunktion für die Galerien neue Datei: phpLib/cwsvJudo/galleryRedirector.php
This commit is contained in:
267
homepage/redesign2018/markdownExperiment/admin/newsAdmin.php
Normal file
267
homepage/redesign2018/markdownExperiment/admin/newsAdmin.php
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Laden von Konfigurationsdaten
|
||||||
|
require_once("config.inc.php");
|
||||||
|
|
||||||
|
require_once($basePath."/bonus/db.inc");
|
||||||
|
|
||||||
|
require_once($basePath."/ressourcen/phpLib/cwsvJudo/newsLib.php");
|
||||||
|
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
|
||||||
|
|
||||||
|
require_once($basePath."/ressourcen/phpLib/parsedown/Parsedown.php");
|
||||||
|
|
||||||
|
|
||||||
|
$Parsedown = new Parsedown();
|
||||||
|
|
||||||
|
$defaultPromoImg['url'] = "http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png";
|
||||||
|
$defaultPromoImg['width'] = "207";
|
||||||
|
$defaultPromoImg['height'] = "256";
|
||||||
|
|
||||||
|
|
||||||
|
/// Auslesen des Newsarrays
|
||||||
|
if( empty($_POST['nachrichtenPromoImgUrl']) )
|
||||||
|
//$newsArticle['promoImg'] = $defaultPromoImg;
|
||||||
|
$newsArticle['promoImg'] = null;
|
||||||
|
else{
|
||||||
|
$newsArticle['promoImg']['url'] = $_POST['nachrichtenPromoImgUrl'];
|
||||||
|
$promoImgPath = $basePath.urldecode(parse_url( $newsArticle['promoImg']['url'] )['path']);
|
||||||
|
if(file_exists( $promoImgPath ) ){
|
||||||
|
// $newsArticle['promoImg']['width'] = getimagesize( $promoImgPath )[0];
|
||||||
|
// $newsArticle['promoImg']['height'] = getimagesize( $promoImgPath )[1];
|
||||||
|
list(
|
||||||
|
$newsArticle['promoImg']['width'],
|
||||||
|
$newsArticle['promoImg']['height']
|
||||||
|
) = array_slice( getimagesize( $promoImgPath ), 0, 2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$newsArticle['promoImg'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// print_r($newsArticle['promoImg']);
|
||||||
|
// echo(json_encode($newsArticle['promoImg']));
|
||||||
|
// print_r(json_decode(json_encode($newsArticle['promoImg'])));
|
||||||
|
|
||||||
|
// @todo Validierung!
|
||||||
|
$newsArticle['datum'] = !empty($_POST['nachrichtenDatum']) ? $_POST['nachrichtenDatum'] : strftime ( "%F" );
|
||||||
|
$newsArticle['betreff'] = !empty($_POST['nachrichtenBetreff']) ? $_POST['nachrichtenBetreff'] : "Kein Betreff!";
|
||||||
|
$newsArticle['text'] = !empty($_POST['nachrichtenText']) ? $_POST['nachrichtenText'] : "Kein Text!";
|
||||||
|
$newsArticle['autor'] = !empty($_POST['nachrichtenAutor']) ? $_POST['nachrichtenAutor'] : "Kein Autor!";
|
||||||
|
|
||||||
|
if( !empty($_POST['action']) ){
|
||||||
|
if( $_POST['action'] == "submitToDb" ){
|
||||||
|
|
||||||
|
try{
|
||||||
|
$dbConnection = new PDO('mysql:host='.$db_server.';dbname='.$db_name, $db_user, $db_password);
|
||||||
|
// set the PDO error mode to exception
|
||||||
|
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
|
||||||
|
// prepare sql and bind parameters
|
||||||
|
$stmt = $dbConnection->prepare("INSERT INTO cwsvjudo.nachrichtenDev (datum, betreff, nachricht, autor, promoImg) VALUES (:datum, :betreff, :nachricht, :autor, :promoImg)");
|
||||||
|
$stmt->bindParam(':datum', $newsArticle['datum']);
|
||||||
|
$stmt->bindParam(':betreff', iconv("UTF-8", "ISO-8859-1", $newsArticle['betreff']));
|
||||||
|
$stmt->bindParam(':nachricht', iconv("UTF-8", "ISO-8859-1", $Parsedown->text( $newsArticle['text'] )));
|
||||||
|
// $stmt->bindParam(':nachricht', $Parsedown->text( htmlspecialchars( $newsArticle['text'] ) ));
|
||||||
|
// $stmt->bindParam(':nachricht', iconv("UTF-8", "ISO-8859-1", $Parsedown->text($newsArticle['text'])));
|
||||||
|
$stmt->bindParam(':autor', $newsArticle['autor']);
|
||||||
|
$stmt->bindParam(':promoImg', $newsArticle['promoImg']['url']);
|
||||||
|
// insert a row
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
echo "New records created successfully";
|
||||||
|
}
|
||||||
|
catch(PDOException $e){
|
||||||
|
echo "Error: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
$dbConnection = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Nachrichtenadministration</title>
|
||||||
|
<style>
|
||||||
|
body{
|
||||||
|
background-color: #FF8100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noDisplay{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullWidth{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.newsPromoImage{
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.newsFooter{
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.newsSubmitForm{
|
||||||
|
width=100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.newsPreviewForm textarea{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="http://cwsvjudo.bplaced.net/pages/desktop2018/cwsvJudo-2018-news.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<?php echo(getHtmlNews(array(
|
||||||
|
'datum' => $newsArticle['datum'],
|
||||||
|
'betreff' => $newsArticle['betreff'],
|
||||||
|
'promoImg' => $newsArticle['promoImg']['url'],
|
||||||
|
'nachricht' => Parsedown::instance()->text($newsArticle['text']),
|
||||||
|
'autor' => $newsArticle['autor']
|
||||||
|
)));?>
|
||||||
|
<hr />
|
||||||
|
<form class="newsSubmitForm" action="newsAdmin.php" method="post" id="nachricht">
|
||||||
|
<input
|
||||||
|
id="nachrichtenDatum"
|
||||||
|
name="nachrichtenDatum"
|
||||||
|
type="hidden"
|
||||||
|
value="<?php echo($newsArticle['datum']);?>"
|
||||||
|
/>
|
||||||
|
<textarea class="noDisplay"
|
||||||
|
id="nachrichtenBetreff"
|
||||||
|
name="nachrichtenBetreff"
|
||||||
|
><?php echo( htmlentities($newsArticle['betreff']) );?></textarea>
|
||||||
|
<input
|
||||||
|
id="nachrichtenPromoImgUrl"
|
||||||
|
name="nachrichtenPromoImgUrl"
|
||||||
|
type="hidden"
|
||||||
|
value="<?php echo($newsArticle['promoImg']['url']);?>"
|
||||||
|
/>
|
||||||
|
<textarea class="noDisplay"
|
||||||
|
id="nachrichtenText"
|
||||||
|
name="nachrichtenText"
|
||||||
|
><?php echo( htmlentities($newsArticle['text']));//textarea ersetzt selbständig htmlEnt, ohne dass man es verhindern kann?></textarea>
|
||||||
|
<input
|
||||||
|
id="nachrichtenAutor"
|
||||||
|
name="nachrichtenAutor"
|
||||||
|
type="hidden"
|
||||||
|
value="<?php echo($newsArticle['autor']);?>"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
id="action"
|
||||||
|
name="action"
|
||||||
|
type="hidden"
|
||||||
|
value="submitToDb"
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<button type="submit">In Datenbank eintragen</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<form class="newsPreviewForm" action="newsAdmin.php" method="post" id="nachricht">
|
||||||
|
<label for="nachricht">Nachricht</label>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="nachrichtenDatum">Nachrichtendatum</label>
|
||||||
|
<input id="nachrichtenDatum" name="nachrichtenDatum" type="text" value="<?php echo( $newsArticle['datum'] );?>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="nachrichtenBetreff">Nachrichtenbetreff</label>
|
||||||
|
<!--Achtung: Textarea nimmt alle Zeilenumbrüche, Tabulatoren etc. mit! Also keine Quellcodeformatierung mit Einschüben. -->
|
||||||
|
<textarea id="nachrichtenBetreff" name="nachrichtenBetreff" rows="1" ><?php echo( htmlentities($newsArticle['betreff']) );?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="nachrichtenPromoImgUrl">Url des Nachrichtenbildes</label>
|
||||||
|
<input id="nachrichtenPromoImgUrl" name="nachrichtenPromoImgUrl" type="text" value="<?php echo( empty($newsArticle['promoImg'])?"":$newsArticle['promoImg']['url'] );?>"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="nachrichtenText">Nachrichtentext</label>
|
||||||
|
<textarea id="nachrichtenText" name="nachrichtenText" rows="12" ><?php echo( htmlentities($newsArticle['text']) );//textarea ersetzt selbständig htmlEnt, ohne dass man es verhindern kann?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="nachrichtenAutor">Nachrichtenautor</label>
|
||||||
|
<input id="nachrichtenAutor" name="nachrichtenAutor" type="text" value="<?php echo( $newsArticle['autor'] );?>" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button type="reset">Eingaben zurücksetzen</button>
|
||||||
|
<button type="submit">Vorschau</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
try{
|
||||||
|
$dbConnection = new PDO('mysql:host='.$db_server.';dbname='.$db_name, $db_user, $db_password);
|
||||||
|
// set the PDO error mode to exception
|
||||||
|
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
$newsList = getNews($dbConnection, array('limit'=>6));
|
||||||
|
}
|
||||||
|
catch(PDOException $e){
|
||||||
|
echo "Error: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
$dbConnection = null;
|
||||||
|
if(!empty($newsList))
|
||||||
|
foreach( $newsList as $news)
|
||||||
|
echo("<hr />".getHtmlNews($news));
|
||||||
|
else echo("Keine Nachrichten gefunden!")
|
||||||
|
?>
|
||||||
|
<!--
|
||||||
|
<div class="newsArtikel" >
|
||||||
|
<div class="newsPromoImg" >
|
||||||
|
<?php
|
||||||
|
if( filter_var($newsArticle['promoImg']['url'], FILTER_VALIDATE_URL) )
|
||||||
|
echo( "<img src=\"".$newsArticle['promoImg']['url']."\" />" );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="newsDatum" >
|
||||||
|
<?php
|
||||||
|
echo($newsArticle['datum']);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="newsBetreff" >
|
||||||
|
<?php
|
||||||
|
echo($newsArticle['betreff']);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="newsText" >
|
||||||
|
<?php
|
||||||
|
echo( $Parsedown->text( $newsArticle['text'] ) );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="newsAutor" >
|
||||||
|
<?php
|
||||||
|
echo( $newsArticle['autor'] );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<div>
|
||||||
|
<!--
|
||||||
|
<?php
|
||||||
|
print_r(parse_url( !empty($_POST['nachrichtenPromoImgUrl'])?$_POST['nachrichtenPromoImgUrl']:$defaultPromoImg['url']));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
print_r(getimagesize( $basePath.urldecode( parse_url( !empty($_POST['nachrichtenPromoImgUrl'])?$_POST['nachrichtenPromoImgUrl']:$defaultPromoImg['url'] )['path'] ) ) );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php if( empty($_POST) ) echo("No POST!"); else print_r($_POST);?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
<div><h1>POST</h1><?php var_dump($_POST);?></div>
|
||||||
|
<div><h1>News</h1><?php var_dump($newsArticle);?></div>
|
||||||
|
<div><?php print_r(parse_url( !empty($_POST['nachrichtenPromoImgUrl'])?$_POST['nachrichtenPromoImgUrl']:$defaultPromoImg['url']));?></div>
|
||||||
|
<div><?php print_r(getimagesize( $basePath.urldecode( parse_url( !empty($_POST['nachrichtenPromoImgUrl'])?$_POST['nachrichtenPromoImgUrl']:$defaultPromoImg['url'] )['path'] ) ) );?></div>
|
||||||
|
-->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
// getting a dbConnection
|
||||||
|
try{
|
||||||
|
$dbConnection = new PDO(
|
||||||
|
'mysql:host=localhost;dbname=cwsvjudo',
|
||||||
|
'cwsvjudo',
|
||||||
|
'Dee4oquu'
|
||||||
|
);
|
||||||
|
|
||||||
|
$nodupesQuery = $dbConnection->prepare(
|
||||||
|
"SELECT * FROM cwsvjudo.phpcount_nodupes;"
|
||||||
|
);
|
||||||
|
$nodupesQuery->execute();
|
||||||
|
$nodupesList = $nodupesQuery->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
catch(PDOException $db_error){
|
||||||
|
die( "Error!: " . $db_error->getMessage() );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<table>
|
||||||
|
<tr><th>ids_hash</th><th>time</th></tr>
|
||||||
|
<?php foreach($nodupesList as $nodupesEntry)
|
||||||
|
echo( "\t\t\t\t<tr><td>".$nodupesEntry['ids_hash']."</td><td>".date("r", $nodupesEntry['time'])."</tr>" );
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
Binary file not shown.
9
homepage/redesign2018/markdownExperiment/md/galerie.md
Normal file
9
homepage/redesign2018/markdownExperiment/md/galerie.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: Videos und Bilder der Judoka des Chemnitzer Freizeit- und Wohngebiets­sportverein e. V.
|
||||||
|
author: marko
|
||||||
|
keywords:
|
||||||
|
- Judo
|
||||||
|
- Bilder
|
||||||
|
- Videos
|
||||||
|
...
|
||||||
|
<iframe src=<?php echo("\"".getGalleryLink($_GET['galId'])."\"");?>>Hier sollte jetzt eigentlich die Galerie Nr. <?php echo( $_GET['galId'] );?> zu sehen sein...</iframe>
|
||||||
@@ -204,7 +204,7 @@ $body$
|
|||||||
title="HTML 5 Logo"
|
title="HTML 5 Logo"
|
||||||
class="charImg">
|
class="charImg">
|
||||||
</a>
|
</a>
|
||||||
<a class="touchLink" title="Möglichkeiten mit dem Chemnitzer Freizeit- und Wohngebietssportverein in Kontakt zu treten" href="<?php echo($$baseUrl);?>/pages/desktop/kontakt.php" >Kontakt</a>
|
<a class="touchLink" title="Möglichkeiten mit dem Chemnitzer Freizeit- und Wohngebietssportverein in Kontakt zu treten" href="<?php echo($$baseUrl);?>/kontakt" >Kontakt</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
$for(include-after)$
|
$for(include-after)$
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html$if(lang)$ lang="$lang$"$endif$>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="generator" content="pandoc">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
$for(author-meta)$
|
||||||
|
<meta name="author" content="$author-meta$">
|
||||||
|
$endfor$
|
||||||
|
$if(date-meta)$
|
||||||
|
<meta name="dcterms.date" content="$date-meta$">
|
||||||
|
$endif$
|
||||||
|
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
|
||||||
|
<style type="text/css">code{white-space: pre;}</style>
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
$if(quotes)$
|
||||||
|
<style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
|
||||||
|
$endif$
|
||||||
|
$if(highlighting-css)$
|
||||||
|
<style type="text/css">
|
||||||
|
$highlighting-css$
|
||||||
|
</style>
|
||||||
|
$endif$
|
||||||
|
$for(css)$
|
||||||
|
<link rel="stylesheet" href="$css$">
|
||||||
|
$endfor$
|
||||||
|
$if(math)$
|
||||||
|
$math$
|
||||||
|
$endif$
|
||||||
|
$for(header-includes)$
|
||||||
|
$header-includes$
|
||||||
|
$endfor$
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
$for(include-before)$
|
||||||
|
$include-before$
|
||||||
|
$endfor$
|
||||||
|
$if(title)$
|
||||||
|
<header>
|
||||||
|
<h1 class="title">$title$</h1>
|
||||||
|
$if(subtitle)$
|
||||||
|
<h1 class="subtitle">$subtitle$</h1>
|
||||||
|
$endif$
|
||||||
|
$for(author)$
|
||||||
|
<h2 class="author">$author$</h2>
|
||||||
|
$endfor$
|
||||||
|
$if(date)$
|
||||||
|
<h3 class="date">$date$</h3>
|
||||||
|
$endif$
|
||||||
|
</header>
|
||||||
|
$endif$
|
||||||
|
$if(toc)$
|
||||||
|
<nav id="$idprefix$TOC">
|
||||||
|
$toc$
|
||||||
|
</nav>
|
||||||
|
$endif$
|
||||||
|
$body$
|
||||||
|
$for(include-after)$
|
||||||
|
$include-after$
|
||||||
|
$endfor$
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
// Umleiten auf eine per query galId im $_GET gegebene Galerie
|
||||||
|
function galleryRedirector(){
|
||||||
|
require_once($_SERVER['DOCUMENT_ROOT']."/bonus/db.inc");
|
||||||
|
|
||||||
|
if(isset($_GET['galId'])){
|
||||||
|
$redirectLink = $baseDomain."/pages/desktop/verein.galerien.php";
|
||||||
|
|
||||||
|
try{
|
||||||
|
$db_connection = new PDO('mysql:host='.$db_server.';dbname='.$db_name, $db_user, $db_password);
|
||||||
|
|
||||||
|
if(is_positive_integer($_GET['galId'])){
|
||||||
|
// mögliche Werte für das jahr herausfinden
|
||||||
|
$query="SELECT url FROM wkGalerien WHERE id = \"".$_GET['galId']."\" ORDER BY Datum ASC LIMIT 1;";
|
||||||
|
$ergebnis = $db_connection->query($query);
|
||||||
|
$galleryLink = $ergebnis->fetchAll();
|
||||||
|
header("Location: ".$baseDomain.$galleryLink[0]['url']);
|
||||||
|
exit();
|
||||||
|
//die("Location(".$_GET['galId']."): ".$galleryLink[0]['url']);
|
||||||
|
}
|
||||||
|
$db_connection = NULL;
|
||||||
|
}
|
||||||
|
catch(PDOException $db_error){
|
||||||
|
print "Error!: " . $db_error->getMessage() . "<br/>";
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
subNav:
|
||||||
|
- *galerien
|
||||||
|
- *training
|
||||||
|
- *verein
|
||||||
|
- *wkKalender
|
||||||
|
...
|
||||||
Reference in New Issue
Block a user