function dg_est_reading_time()
{
    $mycontent = article_html();
    $word = str_word_count(strip_tags($mycontent));
    $m = floor($word / 175);
    $s = floor($word % 175 / (175 / 60));
    if ($m >= 1) {
        return $est = $m . ' min' . ($m == 1 ? '' : 's');
    } elseif ($s <= 59) {
        return $est = $s . ' second' . ($s == 1 ? '' : 's');
    }
}
Beispiel #2
0
function article_show(&$smarty, $tmp, $setting, &$html, $lv = 0, &$limit)
{
    if ($setting['shownode'] && $lv != 0) {
        if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
            if ($tmp['info']['homepage'] == 'true') {
                $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'i', 'arg0' => $tmp['info']['node_id']));
            } else {
                $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'l', 'arg0' => $tmp['info']['node_id']));
            }
        }
        $html[] = article_html($lv, $url, $tmp['info']['node_name']);
    }
    if (!$setting['shownode']) {
        if ($limit <= 0) {
            return;
        }
        #$tmp['article'] = array_slice( $tmp['article'], 0, $setting['limit'] );
    }
    if ($tmp['article']) {
        if ($setting['styleart']) {
            $tmp_lv = $setting['shownode'] ? $setting['lv'] + 1 : 2;
        } else {
            $tmp_lv = $lv + 1;
        }
        foreach ($tmp['article'] as $row) {
            if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
                $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'index', 'arg0' => $row['article_id']));
            }
            $key = $row[$setting['order_type']];
            while (true) {
                if (!isset($html[$key])) {
                    break;
                }
                $key++;
            }
            if ($limit > 0) {
                $html[$key] = article_html($tmp_lv, $url, $row['title']);
            }
            $limit--;
        }
    }
    if ($tmp['child']) {
        foreach ($tmp['child'] as $row) {
            article_show($smarty, $row, $setting, $html, $lv + 1, $limit);
        }
    }
}
Beispiel #3
0
					<h1>
						<a href="<?php 
    echo article_url();
    ?>
" title="<?php 
    echo article_title();
    ?>
"><?php 
    echo article_title();
    ?>
</a>
					</h1>

					<div class="content">
						<?php 
    echo article_html();
    ?>
					</div>

					<footer>
						Posted <time datetime="<?php 
    echo date(DATE_W3C, article_time());
    ?>
"><?php 
    echo relative_time(article_time());
    ?>
</time> by <?php 
    echo article_author('real_name');
    ?>
.
					</footer>
Beispiel #4
0
<?php

defined('IN_CMS') or die('No direct access allowed.');
$home = is_postspage();
$url = isset($url) && !$home ? $url : article_url();
$title = isset($title) && !$home ? $title : article_title();
$time = isset($time) && !$home ? $time : article_time();
$excerpt = isset($excerpt) && !$home ? $excerpt : trim(article_description());
$excerpt = $excerpt == "" ? false : $excerpt;
$content = isset($content) && !$home ? $content : article_html();
$image = isset($image) && !$home ? $image : article_custom_field('img', false);
$isArticle = isset($isArticle) && $isArticle;
$uurl = urlencode(full_url());
$utitle = urlencode($title);
$tags = array("theme_url" => theme_url());
foreach ($tags as $s => $r) {
    $content = str_replace("{" . $s . "}", $r, $content);
}
?>
<li class="<?php 
if (isset($first) && $first) {
    echo "showContent";
}
if (!$time) {
    echo " noFooter";
}
echo is_single() ? " single" : " multiple";
?>
">
	<header tabindex="-1">
		<!--<a href="<?php 
Beispiel #5
0
		<?php 
    echo comment_form_input_text();
    ?>
</label></p>
		
		<p><?php 
    echo comment_form_button();
    ?>
</p>
	</form>
</section>

<?php 
}
?>

<section class="footnote">
	<p>This article is my <?php 
echo numeral(article_id() + 1);
?>
 oldest. It is <?php 
echo count_words(article_html());
?>
 words long. 
	<?php 
echo article_custom_field('attribution');
?>
</p>
</section>