wip from ATB
This commit is contained in:
@ -131,34 +131,34 @@ class Posts extends DatabaseModel {
|
||||
}
|
||||
$draft = '';
|
||||
$authorName = self::$user->getUsername( $instance->author );
|
||||
|
||||
$cleanPost = Sanitize::contentShort( $instance->content );
|
||||
$postSpace = explode( ' ', $cleanPost );
|
||||
$wordsArray = explode( ' ', $cleanPost );
|
||||
$postLine = explode( "\n", $cleanPost );
|
||||
// summary by words: 100
|
||||
$spaceSummary = implode( ' ', array_splice( $postSpace, 0, 100 ) );
|
||||
// summary by lines: 5
|
||||
$spaceSummary = implode( ' ', array_splice( $wordsArray, 0, 100 ) );
|
||||
$lineSummary = implode( "\n", array_splice( $postLine, 0, 5 ) );
|
||||
if ( strlen( $spaceSummary ) < strlen( $lineSummary ) ) {
|
||||
$contentSummaryNoLink = $spaceSummary;
|
||||
$contentSummary = $spaceSummary;
|
||||
if ( count( $postSpace, 1 ) <= 100 ) {
|
||||
if ( count( $wordsArray, 1 ) >= 100 ) {
|
||||
$contentSummaryNoLink = $contentSummary;
|
||||
$contentSummary .= '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '">Read More</a>';
|
||||
$contentSummary .= '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none">Read More</a>';
|
||||
}
|
||||
} else {
|
||||
// @todo: need to refine this after testing
|
||||
$contentSummaryNoLink = $lineSummary;
|
||||
$contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '">Read More</a>';
|
||||
$contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none">Read More</a>';
|
||||
}
|
||||
$instance->contentSummaryNoLink = $contentSummaryNoLink;
|
||||
$instance->contentSummary = $contentSummary;
|
||||
|
||||
if ( isset( $params['stripHtml'] ) && $params['stripHtml'] === true ) {
|
||||
$instance->contentSummary = strip_tags( $instance->content );
|
||||
}
|
||||
if ( $instance->draft != '0' ) {
|
||||
$draft = ' <b>Draft</b>';
|
||||
}
|
||||
$instance->isDraft = $draft;
|
||||
$instance->authorName = $authorName;
|
||||
$instance->contentSummaryNoLink = $contentSummaryNoLink;
|
||||
$instance->contentSummary = $contentSummary;
|
||||
if ( isset( $params['stripHtml'] ) && $params['stripHtml'] === true ) {
|
||||
$instance->contentSummary = strip_tags( $instance->content );
|
||||
}
|
||||
if ( self::$comments !== false ) {
|
||||
$instance->commentCount = self::$comments->count( 'blog', $instance->ID );
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{LOOP}
|
||||
<article class="blog-post">
|
||||
<h2 class="blog-post-title mb-1">{title}</h2>
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}">{authorName}</a></p>
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a></p>
|
||||
<div class="well">
|
||||
{contentSummary}
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="blog-post">
|
||||
<h2 class="blog-post-title">{title}</h2>
|
||||
<hr>
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}">{authorName}</a></p>
|
||||
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none">{authorName}</a></p>
|
||||
{content}
|
||||
{ADMIN}
|
||||
<hr>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="card-body">
|
||||
<ol class="list-unstyled">
|
||||
{LOOP}
|
||||
<li><a href="{ROOT_URL}blog/post/{ID}">{title}</a></li>
|
||||
<li><a href="{ROOT_URL}blog/post/{ID}" class="text-decoration-none">{title}</a></li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li>No Posts to show</li>
|
||||
@ -13,6 +13,6 @@
|
||||
</ol>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{ROOT_URL}blog">View All</a>
|
||||
<a href="{ROOT_URL}blog" class="text-decoration-none">View All</a>
|
||||
</div>
|
||||
</div>
|
@ -2,7 +2,7 @@
|
||||
<h4 class="fst-italic">Archives</h4>
|
||||
<ul class="list-unstyled mb-0">
|
||||
{LOOP}
|
||||
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}">{monthText} {year}</a></li>
|
||||
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}" class="text-decoration-none">{monthText} {year}</a></li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li>None To Show</li>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<div class="col-8 mx-auto p-4 rounded shadow-sm mb-5 context-main-bg mt-4 container">
|
||||
<h2 class="text-center mb-4">Bug Report</h2>
|
||||
<hr>
|
||||
<p>Thank you for visiting our bug reporting page. We value our users' input highly and in an effort to better serve your needs, please fill out the form below to help us address this issue.</p>
|
||||
<p>We read each and every bug report submitted, and by submitting this form you allow us to send you a follow-up email.</p>
|
||||
<form action="" method="post">
|
||||
|
@ -28,7 +28,7 @@
|
||||
</li>
|
||||
{/LOOP}
|
||||
{ALT}
|
||||
<li class="list-group-item">
|
||||
<li class="list-group-item context-second-bg context-main mb-2">
|
||||
<div class="text-center">
|
||||
<p class="mb-0">Be the first to comment.</p>
|
||||
</div>
|
||||
|
@ -115,7 +115,7 @@ class Notification extends DatabaseModel {
|
||||
];
|
||||
if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
|
||||
new CustomException( 'notificationDelete' );
|
||||
Debug::error( "Bookmarks: $id not updated" );
|
||||
Debug::error( "Notifications: $id not updated" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1,11 +1,11 @@
|
||||
<div class="col-md-5 offset-md-1 mb-3">
|
||||
<h5>Subscribe to our newsletter</h5>
|
||||
<div class="d-flex flex-column flex-sm-row w-100 gap-2">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal"></form>
|
||||
<label for="newsletter1" class="visually-hidden">Email address</label>
|
||||
<input name="email" id="email" type="email" class="form-control" placeholder="Email address" autocomplete="email">
|
||||
<div class="col-md-5 offset-md-1 mb-3 text-center">
|
||||
<h5 class="">Subscribe</h5>
|
||||
<div class="d-flex flex-column flex-sm-row gap-2 justify-content-center mx-auto">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<label for="email" class="visually-hidden">Email address</label>
|
||||
<input name="email" id="email" type="email" class="form-control my-2" placeholder="Email address" autocomplete="email">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button class="btn btn-primary" name="submit" value="submit" type="submit">Subscribe</button>
|
||||
<button class="btn btn-primary my-2 w-100" name="submit" value="submit" type="submit">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user