RSS fixes, Micro theme improves

This commit is contained in:
Diego Najar 2017-10-07 21:49:41 +02:00
parent 57a9a13152
commit 92f6cc299e
8 changed files with 50 additions and 12 deletions

View File

@ -89,6 +89,9 @@ define('PROFILE_IMG_WIDTH', 400);
define('PROFILE_IMG_HEIGHT', 400); define('PROFILE_IMG_HEIGHT', 400);
define('PROFILE_IMG_QUALITY', 100); // 100% define('PROFILE_IMG_QUALITY', 100); // 100%
// Password length
define('PASSWORD_LENGTH', 6);
// Password salt length // Password salt length
define('SALT_LENGTH', 8); define('SALT_LENGTH', 8);

View File

@ -522,8 +522,8 @@ function createUser($args) {
} }
// Password length // Password length
if( strlen($args['new_password']) < 6 ) { if( Text::length($args['new_password']) < PASSWORD_LENGTH ) {
Alert::set($Language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL); Alert::set($Language->g('Password must be at least '.PASSWORD_LENGTH.' characters long'), ALERT_STATUS_FAIL);
return false; return false;
} }

View File

@ -61,7 +61,12 @@ class Login {
$password = trim($password); $password = trim($password);
if (empty($username) || empty($password)) { if (empty($username) || empty($password)) {
Log::set(__METHOD__.LOG_SEP.'Username or password empty. Username: '.$username.' - Password: '.$password); Log::set(__METHOD__.LOG_SEP.'Username or password empty. Username: '.$username);
return false;
}
if (Text::length($password)<PASSWORD_LENGTH) {
Log::set(__METHOD__.LOG_SEP.'Password lenght less than required.');
return false; return false;
} }

View File

@ -14,6 +14,12 @@ class pluginOpenGraph extends Plugin {
{ {
global $Language; global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
$html .= '</div>';
/*
$html = '<div>'; $html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>'; $html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<select name="defaultImage">'; $html .= '<select name="defaultImage">';
@ -26,6 +32,7 @@ class pluginOpenGraph extends Plugin {
$html .= '</select>'; $html .= '</select>';
$html .= '</div>'; $html .= '</div>';
*/
return $html; return $html;
} }
@ -64,7 +71,7 @@ class pluginOpenGraph extends Plugin {
default: default:
$content = ''; $content = '';
// The image it's from the first page // The image it's from the first page
if(isset($pages[0]) ) { if (isset($pages[0]) ) {
$og['image'] = $pages[0]->coverImage($absolute=true); $og['image'] = $pages[0]->coverImage($absolute=true);
$content = $pages[0]->content(); $content = $pages[0]->content();
} }
@ -86,12 +93,13 @@ class pluginOpenGraph extends Plugin {
if ($src!==false) { if ($src!==false) {
$og['image'] = $src; $og['image'] = $src;
} else { } else {
$og['image'] = DOMAIN_UPLOADS.$this->getValue('defaultImage'); if (Text::isNotEmpty($this->getValue('defaultImage'))) {
$og['image'] = $this->getValue('defaultImage');
}
} }
} }
$html .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL; $html .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL;
return $html; return $html;
} }

View File

@ -57,7 +57,7 @@ class pluginRSS extends Plugin {
$xml .= '<item>'; $xml .= '<item>';
$xml .= '<title>'.$page->title().'</title>'; $xml .= '<title>'.$page->title().'</title>';
$xml .= '<link>'.$page->permalink().'</link>'; $xml .= '<link>'.$page->permalink().'</link>';
$xml .= '<description>'.$page->contentBreak().'</description>'; $xml .= '<description>'.Sanitize::html($page->contentBreak()).'</description>';
$xml .= '<pubDate>'.$page->dateRaw('r').'</pubDate>'; $xml .= '<pubDate>'.$page->dateRaw('r').'</pubDate>';
$xml .= '<guid isPermaLink="false">'.$page->uuid().'</guid>'; $xml .= '<guid isPermaLink="false">'.$page->uuid().'</guid>';
$xml .= '</item>'; $xml .= '</item>';

View File

@ -14,6 +14,12 @@ class pluginTwitterCards extends Plugin {
{ {
global $Language; global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
$html .= '</div>';
/*
$html = '<div>'; $html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>'; $html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<select name="defaultImage">'; $html .= '<select name="defaultImage">';
@ -26,6 +32,7 @@ class pluginTwitterCards extends Plugin {
$html .= '</select>'; $html .= '</select>';
$html .= '</div>'; $html .= '</div>';
*/
return $html; return $html;
} }
@ -80,7 +87,9 @@ class pluginTwitterCards extends Plugin {
if ($src!==false) { if ($src!==false) {
$og['image'] = $src; $og['image'] = $src;
} else { } else {
$og['image'] = DOMAIN_UPLOADS.$this->getValue('defaultImage'); if (Text::isNotEmpty($this->getValue('defaultImage'))) {
$og['image'] = $this->getValue('defaultImage');
}
} }
} }

View File

@ -5201,7 +5201,7 @@ tbody.collapse.in {
.pagination > li > span { .pagination > li > span {
position: relative; position: relative;
float: left; float: left;
padding: 14px 12px; padding: 5px 10px;
line-height: 1.42857; line-height: 1.42857;
text-decoration: none; text-decoration: none;
color: #e32929; color: #e32929;

View File

@ -20,3 +20,16 @@
</article> </article>
<?php endforeach ?> <?php endforeach ?>
</section> </section>
<!-- Pagination -->
<ul class="pagination">
<?php
if (Paginator::showPrev()) {
echo '<li><a href="'.Paginator::prevPageUrl().'">'.$L->get('Next').'</a></li>';
}
if (Paginator::showNext()) {
echo '<li><a href="'.Paginator::nextPageUrl().'">'.$L->get('Previuos').'</a></li>';
}
?>
</ul>