Esempio n. 1
0
function appendClickablePreviewArticles($id, $title, $date, $author, $content, $link, $addSeparatorLine = false, $sizeLimit = 350)
{
    $contentText = limitHTMLText($content, $sizeLimit, true);
    //    $contentText = closetags(removeLastWord($contentText) . " …");
    $contentText = removeStyleAttribute($contentText);
    $printableDate = utf8_encode(strftime('%d %B %Y', article_time_given_date($date)));
    echo '<a class="hiddenLink articleLink" href="' . $link . '">';
    echo '<div class="articleContainer preview col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1 col-xs-12 col-sm-offset-0">
        <section class="content wrap" id="article-' . $id . '">';
    echo '<time class="date" datetime="' . date(DATE_W3C, strtotime($date)) . '">' . $printableDate . '</time>';
    echo '<h1 class="">' . $title . '</h1>';
    echo '<article >' . $contentText . '</article>';
    echo "</section>";
    if ($addSeparatorLine) {
        echo "<div class='centerLine'></div>";
    }
    echo "</div>";
    echo "</a>";
}
Esempio n. 2
0
function appendPreviewArticles($article, $sizeLimit = 350)
{
    $id = $article["id"];
    $title = $article["title"];
    $date = $article["created"];
    $date = utf8_encode(strftime('%d %B %Y', article_time_given_date($article['created'])));
    $author = $article["author"];
    $content = $article["html"];
    $link = $article["slug"];
    $contentText = limitHTMLText($content, $sizeLimit);
    $contentText = closetags(removeLastWord($contentText) . " …");
    $contentText = removeStyleAttribute($contentText);
    echo '<a href="/posts/' . $link . '" class="hidden-link article-link">
                    <div class="inner">
                        <div class="date">' . $date . '</div>
                        <div class="title">' . $title . '</div>
                        ' . $contentText . '
                    </div>
                </a>';
}