Merge branch 'newblog'

This commit is contained in:
fredtempez 2019-02-24 19:26:09 +01:00
commit c0c6bf3813
12 changed files with 111 additions and 55 deletions

View File

@ -263,7 +263,7 @@ class common {
'58e11d09e5aff' => [ '58e11d09e5aff' => [
'author' => 'Rémi', 'author' => 'Rémi',
'content' => 'Article bien rédigé et très pertinent, bravo !', 'content' => 'Article bien rédigé et très pertinent, bravo !',
'createdOn' => 1421786100, 'createdOn' => 1421748000,
'userId' => '' 'userId' => ''
] ]
], ],

View File

@ -10,9 +10,15 @@
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*/ */
/**
* Police des icônes
*/
@import url(https://use.fontawesome.com/releases/v5.7.2/css/all.css);
/** /**
* Éléments génériques * Éléments génériques
*/ */
html, html,
body { body {

View File

@ -1437,7 +1437,7 @@ class UploadHandler
$magicianObj -> saveImage($targetFile); $magicianObj -> saveImage($targetFile);
} }
$thumbResult = create_img($targetFile, $targetFileThumb, 122, 91); $thumbResult = create_img($targetFile, $targetFileThumb, 266, 200);
if ( $thumbResult!==true) if ( $thumbResult!==true)
{ {

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ class blog extends common {
public static $users = []; public static $users = [];
const BLOG_VERSION = '1.1'; const BLOG_VERSION = '1.2';
/** /**
* Édition * Édition

View File

@ -4,6 +4,7 @@
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
margin-top: 15px;
} }
#blogArticleCommentShow { #blogArticleCommentShow {
cursor: text; cursor: text;
@ -11,11 +12,16 @@
#blogArticleOr { #blogArticleOr {
padding: 10px; padding: 10px;
} }
/* Modif CroqueWeb */ .blogDate {
font-size:0.8em;
font-style: italic;
color: grey;
margin-left: 10px;
}
@media (max-width: 767px) { @media (max-width: 767px) {
#blogArticlePicture { #blogArticlePicture {
height:150px; height:150px;
max-width: 100%;} max-width: 100%;}
} }
/* fin modif croqueweb */

View File

@ -1,26 +1,26 @@
<!-- <div class="blogDate">
code d'origine <i class="far fa-calendar-alt"></i>
<div id="blogArticlePicture" style="background-image:url('<?php echo helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']); ?>');"></div> <?php echo utf8_encode(strftime('- %d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
--> à <?php echo utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
<?php if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) { </div>
echo '<div><img src="'.helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']).'"></div>';
} <?php if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) {
?> echo '<div id="blogArticlePicture" style="background-image:url(' . helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']) . ');"></div>';
} ?>
<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'content']); ?> <?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'content']); ?>
<!-- <h4 class="textAlignRight"> --> <!-- <h4 class="textAlignRight"> -->
<p class="signature"> <p class="signature">
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'firstname']); ?> <?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'firstname']); ?>
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'lastname']); ?> <?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'lastname']); ?>
<?php echo utf8_encode(strftime('- %d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
à <?php echo utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
<!-- </h4> --> <!-- </h4> -->
</p> </p>
<div class="clearBoth"></div> <div class="clearBoth"></div>
<h2 id="comment"> <h3 id="comment">
<?php $commentsNb = count($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); ?> <?php $commentsNb = count($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); ?>
<?php echo $commentsNb . ' ' . ($commentsNb > 1 ? 'commentaires' : 'commentaire'); ?> <?php echo $commentsNb . ' ' . ($commentsNb > 1 ? 'commentaires' : 'commentaire'); ?>
</h2> </h3>
<?php if($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'closeComment'])): ?> <?php if($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'closeComment'])): ?>
<p>Les commentaires sont fermés pour cet article.</p> <p>Les commentaires sont fermés pour cet article.</p>
<?php else: ?> <?php else: ?>

View File

@ -1,18 +1,35 @@
.blogPicture { .blogPicture {
float: left; float: center;
margin: 10px 20px 0 0;
} }
.blogPicture img {
width: 100%;
height: auto;
}
.blogPicture:hover { .blogPicture:hover {
opacity: .7; opacity: .7;
} }
.block:after { .row:after {
content: " "; content: " ";
display: table; display: table;
clear: both; clear: both;
} }
.blogComment { .blogComment {
padding-right: 10px;
float: right; float: right;
} }
.blogTitle {
background-color: #ECEFF1;
padding: 5px;
}
.blogContent {
float: left;
}
.blogDate {
font-size:0.8em;
font-style: italic;
color: grey;
margin-left: 10px;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.blogContent { .blogContent {
display: none; display: none;

View File

@ -1,35 +1,36 @@
<?php if($module::$articles): ?> <?php if($module::$articles): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php foreach($module::$articles as $articleId => $article): ?> <?php foreach($module::$articles as $articleId => $article): ?>
<div class="block"> <div class="row">
<h4> <div class="col3">
<!-- Le <?php echo date('d M Y à H:i', $article['publishedOn']); ?> --> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
Le <?php echo utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?> <img src="<?php echo helper::baseUrl(false) . 'site/file/thumb/' . $article['picture']; ?>">
à <?php echo utf8_encode(strftime('%H:%M', $article['publishedOn'])); ?> </a>
</div>
<div class="col9">
<h1 class="blogTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<?php echo $article['title']; ?>
</a>
</h1>
<div class="blogComment"> <div class="blogComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php echo count($article['comment']); ?> <?php echo count($article['comment']); ?>
</a> </a>
<?php echo template::ico('comment', 'left'); ?> <?php echo template::ico('comment', 'left'); ?>
</div>
<div class="blogDate">
<i class="far fa-calendar-alt"></i>
<?php echo utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?>
</div> </div>
</h4> <p class="blogContent">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture"> <?php echo helper::subword(strip_tags($article['content']), 0, 300); ?>...
<img src="<?php echo helper::baseUrl(false) . 'site/file/thumb/' . $article['picture']; ?>"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
</a> </p>
<h2> </div>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<?php echo $article['title']; ?>
</a>
</h2>
<p class="blogContent">
<?php echo helper::subword(strip_tags($article['content']), 0, 150); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
</p>
<p class="signature">
<?php echo $this->getData(['user', $article['userId'], 'firstname']) . ' ' . $this->getData(['user', $article['userId'], 'lastname']); ?>
</p>
</div> </div>
<hr />
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ class news extends common {
false => 'Brouillon', false => 'Brouillon',
true => 'Publié' true => 'Publié'
]; ];
const NEWS_VERSION = '1.1'; const NEWS_VERSION = '1.2';
public static $users = []; public static $users = [];

View File

@ -0,0 +1,23 @@
.newsTitle {
background-color: #ECEFF1;
padding:5px;
}
.newsContent {
clear: left;
margin-left: 10px;
padding: 5px;
}
.newsDate {
font-size:0.8em;
font-style: italic;
color: grey;
margin-left:10px;
float: left;
}
.newsSignature {
margin-right:10px;
float:right;
font-size:0.8em;
font-style: italic;
color: grey;
}

View File

@ -2,18 +2,21 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php foreach($module::$news as $newsId => $news): ?> <?php foreach($module::$news as $newsId => $news): ?>
<div class="block"> <h1 class="newsTitle">
<h4> <?php echo $news['title']; ?>
Le <?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?> </h1>
à <?php echo utf8_encode(strftime('%H:%M', $news['publishedOn'])); ?> <div class="newsDate">
</h4> <i class="far fa-calendar-alt"></i>
<h2><?php echo $news['title']; ?></h2> <?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
<?php echo $news['content']; ?>
<p class="signature">
<?php echo $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
</p>
<div class="clearBoth"></div>
</div> </div>
<div class="newsSignature">
<?php echo $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
</div>
<div class="newsContent">
<?php echo $news['content']; ?>
</div>
<div class="clearBoth"></div>
<hr />
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div> </div>