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' => [
'author' => 'Rémi',
'content' => 'Article bien rédigé et très pertinent, bravo !',
'createdOn' => 1421786100,
'createdOn' => 1421748000,
'userId' => ''
]
],

View File

@ -10,9 +10,15 @@
* @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
*/
html,
body {

View File

@ -1437,7 +1437,7 @@ class UploadHandler
$magicianObj -> saveImage($targetFile);
}
$thumbResult = create_img($targetFile, $targetFileThumb, 122, 91);
$thumbResult = create_img($targetFile, $targetFileThumb, 266, 200);
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 = [];
const BLOG_VERSION = '1.1';
const BLOG_VERSION = '1.2';
/**
* Édition

View File

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

View File

@ -1,26 +1,26 @@
<!--
code d'origine
<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 if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) {
echo '<div><img src="'.helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']).'"></div>';
}
?>
<div class="blogDate">
<i class="far fa-calendar-alt"></i>
<?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']))); ?>
</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']); ?>
<!-- <h4 class="textAlignRight"> -->
<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']), '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> -->
</p>
<div class="clearBoth"></div>
<h2 id="comment">
<h3 id="comment">
<?php $commentsNb = count($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); ?>
<?php echo $commentsNb . ' ' . ($commentsNb > 1 ? 'commentaires' : 'commentaire'); ?>
</h2>
</h3>
<?php if($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'closeComment'])): ?>
<p>Les commentaires sont fermés pour cet article.</p>
<?php else: ?>

View File

@ -1,18 +1,35 @@
.blogPicture {
float: left;
margin: 10px 20px 0 0;
float: center;
}
.blogPicture img {
width: 100%;
height: auto;
}
.blogPicture:hover {
opacity: .7;
}
.block:after {
.row:after {
content: " ";
display: table;
clear: both;
}
.blogComment {
padding-right: 10px;
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) {
.blogContent {
display: none;

View File

@ -1,35 +1,36 @@
<?php if($module::$articles): ?>
<div class="row">
<div class="col12">
<?php foreach($module::$articles as $articleId => $article): ?>
<div class="block">
<h4>
<!-- Le <?php echo date('d M Y à H:i', $article['publishedOn']); ?> -->
Le <?php echo utf8_encode(strftime('%d %B %Y', $article['publishedOn'])); ?>
à <?php echo utf8_encode(strftime('%H:%M', $article['publishedOn'])); ?>
<?php foreach($module::$articles as $articleId => $article): ?>
<div class="row">
<div class="col3">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
<img src="<?php echo helper::baseUrl(false) . 'site/file/thumb/' . $article['picture']; ?>">
</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">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
<?php echo count($article['comment']); ?>
</a>
<?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>
</h4>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
<img src="<?php echo helper::baseUrl(false) . 'site/file/thumb/' . $article['picture']; ?>">
</a>
<h2>
<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>
<p class="blogContent">
<?php echo helper::subword(strip_tags($article['content']), 0, 300); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a>
</p>
</div>
</div>
<hr />
<?php endforeach; ?>
</div>
</div>

View File

@ -32,7 +32,7 @@ class news extends common {
false => 'Brouillon',
true => 'Publié'
];
const NEWS_VERSION = '1.1';
const NEWS_VERSION = '1.2';
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="col12">
<?php foreach($module::$news as $newsId => $news): ?>
<div class="block">
<h4>
Le <?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
à <?php echo utf8_encode(strftime('%H:%M', $news['publishedOn'])); ?>
</h4>
<h2><?php echo $news['title']; ?></h2>
<?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>
<h1 class="newsTitle">
<?php echo $news['title']; ?>
</h1>
<div class="newsDate">
<i class="far fa-calendar-alt"></i>
<?php echo utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
</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; ?>
</div>
</div>