Browse Source

Refactoring

Clean up the codes.
pull/31/merge
Danang Probo Sayekti 11 years ago
parent
commit
306ccb11ee
8 changed files with 175 additions and 219 deletions
  1. +1
    -10
      system/admin/views/layout.html.php
  2. +72
    -144
      system/htmly.php
  3. +91
    -41
      system/includes/functions.php
  4. +2
    -4
      themes/clean/main.html.php
  5. +2
    -2
      themes/clean/post.html.php
  6. +3
    -12
      themes/default/layout.html.php
  7. +2
    -4
      themes/default/main.html.php
  8. +2
    -2
      themes/default/post.html.php

+ 1
- 10
system/admin/views/layout.html.php View File

@ -1,16 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title><?php echo $title; ?></title>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta content='htmly' name='generator'/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<meta name="description" content="<?php echo $description; ?>" />
<link rel="sitemap" href="<?php echo site_url() ?>sitemap.xml" />
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link rel="alternate" type="application/rss+xml" title="<?php echo config('blog.title')?> Feed" href="<?php echo site_url()?>feed/rss" />
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" /> <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<?php if (publisher() == true):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?> <?php if (publisher() == true):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>


+ 72
- 144
system/htmly.php View File

@ -26,29 +26,25 @@ get('/index', function () {
$total = ''; $total = '';
$tl = blog_tagline();
if($tl){ $tagline = ' - ' . $tl;} else {$tagline = '';}
if(empty($posts) || $page < 1){ if(empty($posts) || $page < 1){
// a non-existing page // a non-existing page
render('no-posts',array( render('no-posts',array(
'title' => config('blog.title'),
'canonical' => site_url(),
'description' => config('blog.description'),
'head_contents' => head_contents(blog_title() . $tagline, blog_description(), site_url()),
'bodyclass' => 'noposts', 'bodyclass' => 'noposts',
)); ));
die; die;
} }
$tl = config('blog.tagline');
if($tl){ $tagline = ' - ' . $tl;} else {$tagline = '';}
render('main',array( render('main',array(
'title' => config('blog.title') . $tagline,
'head_contents' => head_contents(blog_title() . $tagline, blog_description(), site_url()),
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'canonical' => config('site.url'),
'description' => config('blog.description'),
'bodyclass' => 'infront', 'bodyclass' => 'infront',
'breadcrumb' => '', 'breadcrumb' => '',
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
@ -70,12 +66,10 @@ post('/login', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('login',array( render('login',array(
'head_contents' => head_contents('Login - ' . blog_title(), 'Login page on ' .blog_title(), site_url()),
'error' => '<ul>' . $log . '</ul>', 'error' => '<ul>' . $log . '</ul>',
'title' => 'Login - ' . config('blog.title'),
'canonical' => config('site.url'),
'description' => 'Login page on ' .config('blog.title'),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Login'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Login'
)); ));
} }
} }
@ -91,14 +85,12 @@ post('/login', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('login',array( render('login',array(
'head_contents' => head_contents('Login - ' . blog_title(), 'Login page on ' .blog_title(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Login - ' . config('blog.title'),
'username' => $user, 'username' => $user,
'password' => $pass, 'password' => $pass,
'canonical' => config('site.url'),
'description' => 'Login page on ' .config('blog.title'),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Login'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Login'
)); ));
} }
@ -139,13 +131,11 @@ get('/:year/:month/:name', function($year, $month, $name){
} }
render('post',array( render('post',array(
'title' => $current->title .' - ' . config('blog.title'),
'head_contents' => head_contents($current->title .' - ' . blog_title(), $description = get_description($current->body), $current->url),
'p' => $current, 'p' => $current,
'authorinfo' => '<div class="author-info"><h4>by <strong>' . $bio->title . '</strong></h4>' . $bio->body . '</div>', 'authorinfo' => '<div class="author-info"><h4>by <strong>' . $bio->title . '</strong></h4>' . $bio->body . '</div>',
'canonical' => $current->url,
'description' => $description = get_description($current->body),
'bodyclass' => 'inpost', 'bodyclass' => 'inpost',
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title,
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title,
'prev' => has_prev($prev), 'prev' => has_prev($prev),
'next' => has_next($next), 'next' => has_next($next),
'type' => 'blogpost', 'type' => 'blogpost',
@ -171,22 +161,18 @@ get('/:year/:month/:name/edit', function($year, $month, $name){
if($user === $current->author || $role === 'admin') { if($user === $current->author || $role === 'admin') {
render('edit-post',array( render('edit-post',array(
'title' => $current->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Edit post - ' . blog_title(), blog_description(), site_url()),
'p' => $current, 'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
'bodyclass' => 'editpost', 'bodyclass' => 'editpost',
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
)); ));
} }
else { else {
render('denied',array( render('denied',array(
'title' => $current->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Edit post - ' . blog_title(), blog_description(), site_url()),
'p' => $current, 'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
'bodyclass' => 'denied', 'bodyclass' => 'denied',
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
)); ));
} }
} }
@ -228,17 +214,15 @@ post('/:year/:month/:name/edit', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('edit-post',array( render('edit-post',array(
'head_contents' => head_contents('Edit post - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Edit post - ' . config('blog.title'),
'oldfile' => $oldfile, 'oldfile' => $oldfile,
'postTitle' => $title, 'postTitle' => $title,
'postTag' => $tag, 'postTag' => $tag,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
'canonical' => config('site.url'),
'description' => 'Adit post on ' .config('blog.title'),
'bodyclass' => 'editpost', 'bodyclass' => 'editpost',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Edit post'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Edit post'
)); ));
} }
@ -264,22 +248,18 @@ get('/:year/:month/:name/delete', function($year, $month, $name){
if($user === $current->author || $role === 'admin') { if($user === $current->author || $role === 'admin') {
render('delete-post',array( render('delete-post',array(
'title' => $current->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Delete post - ' . blog_title(), blog_description(), site_url()),
'p' => $current, 'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
'bodyclass' => 'deletepost', 'bodyclass' => 'deletepost',
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
)); ));
} }
else { else {
render('denied',array( render('denied',array(
'title' => $current->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Delete post - ' . blog_title(), blog_description(), site_url()),
'p' => $current, 'p' => $current,
'canonical' => $current->url,
'description' => $description = get_description($current->body),
'bodyclass' => 'deletepost', 'bodyclass' => 'deletepost',
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
'breadcrumb' => '<span typeof="v:Breadcrumb"><a property="v:title" rel="v:url" href="' . site_url() . '">' .config('breadcrumb.home'). '</a></span> &#187; '. $current->tagb . ' &#187; ' . $current->title
)); ));
} }
} }
@ -320,30 +300,26 @@ get('/author/:profile', function($profile){
if(empty($posts) || $page < 1){ if(empty($posts) || $page < 1){
render('profile',array( render('profile',array(
'title' => 'Profile for: '. $bio->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Profile for: '. $bio->title .' - ' . blog_title(), 'Profile page and all posts by ' . $bio->title . ' on ' . blog_title() . '.', site_url() . 'author/' . $profile),
'page' => $page, 'page' => $page,
'posts' => null, 'posts' => null,
'bio' => $bio->body, 'bio' => $bio->body,
'name' => $bio->title, 'name' => $bio->title,
'canonical' => config('site.url') . '/author/' . $profile,
'description' => 'Profile page and all posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
'bodyclass' => 'inprofile', 'bodyclass' => 'inprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
die; die;
} }
render('profile',array( render('profile',array(
'title' => 'Profile for: '. $bio->title .' - ' . config('blog.title'),
'head_contents' => head_contents('Profile for: '. $bio->title .' - ' . blog_title(), 'Profile page and all posts by ' . $bio->title . ' on ' . blog_title() . '.', site_url() . 'author/' . $profile),
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'bio' => $bio->body, 'bio' => $bio->body,
'name' => $bio->title, 'name' => $bio->title,
'canonical' => config('site.url') . '/author/' . $profile,
'description' => 'Profile page and all posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
'bodyclass' => 'inprofile', 'bodyclass' => 'inprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
}); });
@ -355,11 +331,9 @@ get('/edit/profile', function(){
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('edit-profile',array( render('edit-profile',array(
'title' => 'Edit profile - ' . config('blog.title'),
'canonical' => config('site.url') . '/profile',
'description' => 'Edit profile.',
'head_contents' => head_contents('Edit profile - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Edit profile',
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Edit profile',
)); ));
} }
else { else {
@ -388,14 +362,12 @@ post('/edit/profile', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('edit-profile',array( render('edit-profile',array(
'head_contents' => head_contents('Edit profile - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Edit profile - ' . config('blog.title'),
'postTitle' => $title, 'postTitle' => $title,
'postContent' => $content, 'postContent' => $content,
'canonical' => config('site.url'),
'description' => 'Edit profile on ' .config('blog.title'),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Edit profile'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Edit profile'
)); ));
} }
@ -423,26 +395,22 @@ get('/admin/posts', function () {
// a non-existing page // a non-existing page
render('no-posts',array( render('no-posts',array(
'title' => config('blog.title'),
'canonical' => site_url(),
'description' => config('blog.description'),
'head_contents' => head_contents('All blog posts - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'noposts', 'bodyclass' => 'noposts',
)); ));
die; die;
} }
$tl = config('blog.tagline');
$tl = blog_tagline();
if($tl){ $tagline = ' - ' . $tl;} else {$tagline = '';} if($tl){ $tagline = ' - ' . $tl;} else {$tagline = '';}
render('posts-list',array( render('posts-list',array(
'title' => config('blog.title') . $tagline,
'head_contents' => head_contents('All blog posts - ' . blog_title(), blog_description(), site_url()),
'heading' => 'All blog posts', 'heading' => 'All blog posts',
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'canonical' => config('site.url'),
'description' => config('blog.description'),
'bodyclass' => 'all-posts', 'bodyclass' => 'all-posts',
'breadcrumb' => '', 'breadcrumb' => '',
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
@ -450,9 +418,7 @@ get('/admin/posts', function () {
} }
else { else {
render('denied',array( render('denied',array(
'title' => config('blog.title'),
'canonical' => config('site.url'),
'description' => config('blog.description'),
'head_contents' => head_contents('All blog posts - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'denied', 'bodyclass' => 'denied',
'breadcrumb' => '', 'breadcrumb' => '',
)); ));
@ -492,32 +458,28 @@ get('/admin/mine', function(){
if(empty($posts) || $page < 1){ if(empty($posts) || $page < 1){
render('user-posts',array( render('user-posts',array(
'title' => 'All posts by: '. $bio->title .' - ' . config('blog.title'),
'head_contents' => head_contents('My blog posts - ' . blog_title(), blog_description(), site_url()),
'page' => $page, 'page' => $page,
'heading' => 'My posts', 'heading' => 'My posts',
'posts' => null, 'posts' => null,
'bio' => $bio->body, 'bio' => $bio->body,
'name' => $bio->title, 'name' => $bio->title,
'canonical' => config('site.url') . '/admin/posts',
'description' => 'All posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
'bodyclass' => 'userposts', 'bodyclass' => 'userposts',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
die; die;
} }
render('user-posts',array( render('user-posts',array(
'title' => 'All posts by: '. $bio->title .' - ' . config('blog.title'),
'head_contents' => head_contents('My blog posts - ' . blog_title(), blog_description(), site_url()),
'heading' => 'My posts', 'heading' => 'My posts',
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'bio' => $bio->body, 'bio' => $bio->body,
'name' => $bio->title, 'name' => $bio->title,
'canonical' => config('site.url') . '/admin/posts',
'description' => 'All posts by ' . $bio->title . ' on ' . config('blog.title') . '.',
'bodyclass' => 'userposts', 'bodyclass' => 'userposts',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Profile for: ' . $bio->title,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
} }
@ -563,11 +525,9 @@ get('/:static', function($static){
if(login()) { if(login()) {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('main', array( render('main', array(
'title' => 'Admin - ' . config('blog.title'),
'canonical' => config('site.url') . '/admin',
'description' => 'Admin page from ' . config('blog.title') . '.',
'head_contents' => head_contents('Admin - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'adminfront', 'bodyclass' => 'adminfront',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Admin'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Admin'
)); ));
} }
else { else {
@ -579,11 +539,9 @@ get('/:static', function($static){
elseif($static === 'login') { elseif($static === 'login') {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('login', array( render('login', array(
'title' => 'Login - ' . config('blog.title'),
'canonical' => config('site.url') . '/login',
'description' => 'Login page from ' . config('blog.title') . '.',
'head_contents' => head_contents('Login - ' . blog_title(), 'Login page from ' . blog_title() . '.', site_url() . '/login'),
'bodyclass' => 'inlogin', 'bodyclass' => 'inlogin',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Login'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Login'
)); ));
die; die;
} }
@ -591,11 +549,9 @@ get('/:static', function($static){
if(login()) { if(login()) {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('logout', array( render('logout', array(
'title' => 'Logout - ' . config('blog.title'),
'canonical' => config('site.url') . '/logout',
'description' => 'Logout page from ' . config('blog.title') . '.',
'head_contents' => head_contents('Logout - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'inlogout', 'bodyclass' => 'inlogout',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Logout'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Logout'
)); ));
} }
else { else {
@ -614,11 +570,9 @@ get('/:static', function($static){
$post = $post[0]; $post = $post[0];
render('static',array( render('static',array(
'title' => $post->title .' - ' . config('blog.title'),
'canonical' => $post->url,
'description' => $description = get_description($post->body),
'head_contents' => head_contents($post->title .' - ' . blog_title(), $description = get_description($post->body), $post->url),
'bodyclass' => 'inpage', 'bodyclass' => 'inpage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'staticpage', 'type' => 'staticpage',
)); ));
@ -641,11 +595,9 @@ get('/:static/edit', function($static){
$post = $post[0]; $post = $post[0];
render('edit-page',array( render('edit-page',array(
'title' => $post->title .' - ' . config('blog.title'),
'canonical' => $post->url,
'description' => $description = get_description($post->body),
'head_contents' => head_contents('Edit page - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'editpage', 'bodyclass' => 'editpage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'staticpage', 'type' => 'staticpage',
)); ));
@ -684,16 +636,14 @@ post('/:static/edit', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('edit-page',array( render('edit-page',array(
'head_contents' => head_contents('Edit page - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Edit page - ' . config('blog.title'),
'oldfile' => $oldfile, 'oldfile' => $oldfile,
'postTitle' => $title, 'postTitle' => $title,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
'canonical' => config('site.url'),
'description' => 'Edit page on ' .config('blog.title'),
'bodyclass' => 'editpage', 'bodyclass' => 'editpage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Edit page'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Edit page'
)); ));
} }
@ -714,11 +664,9 @@ get('/:static/delete', function($static){
$post = $post[0]; $post = $post[0];
render('delete-page',array( render('delete-page',array(
'title' => $post->title .' - ' . config('blog.title'),
'canonical' => $post->url,
'description' => $description = get_description($post->body),
'head_contents' => head_contents('Delete page - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'deletepage', 'bodyclass' => 'deletepage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'staticpage', 'type' => 'staticpage',
)); ));
@ -746,11 +694,9 @@ get('/add/post', function(){
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('add-post',array( render('add-post',array(
'title' => 'Add post - ' . config('blog.title'),
'canonical' => config('site.url') . '/add/post',
'description' => 'Add post on ' .config('blog.title'),
'head_contents' => head_contents('Add post - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'addpost', 'bodyclass' => 'addpost',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Add post'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Add post'
)); ));
} }
else { else {
@ -789,16 +735,14 @@ post('/add/post', function(){
} }
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('add-post',array( render('add-post',array(
'head_contents' => head_contents('Add post - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Add post - ' . config('blog.title'),
'postTitle' => $title, 'postTitle' => $title,
'postTag' => $tag, 'postTag' => $tag,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
'canonical' => config('site.url') . '/add/post',
'description' => 'Add post on ' .config('blog.title'),
'bodyclass' => 'addpost', 'bodyclass' => 'addpost',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Add post'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Add post'
)); ));
} }
@ -812,11 +756,9 @@ get('/add/page', function(){
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('add-page',array( render('add-page',array(
'title' => 'Add static page - ' . config('blog.title'),
'canonical' => config('site.url') . '/add/page',
'description' => 'Add static page on ' .config('blog.title'),
'head_contents' => head_contents('Add page - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'addpage', 'bodyclass' => 'addpage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Add page'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Add page'
)); ));
} }
else { else {
@ -850,15 +792,13 @@ post('/add/page', function(){
} }
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('add-page',array( render('add-page',array(
'head_contents' => head_contents('Add page - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Add page - ' . config('blog.title'),
'postTitle' => $title, 'postTitle' => $title,
'postUrl' => $url, 'postUrl' => $url,
'postContent' => $content, 'postContent' => $content,
'canonical' => config('site.url') . '/add/page',
'description' => 'Add page on ' .config('blog.title'),
'bodyclass' => 'addpage', 'bodyclass' => 'addpage',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Add page'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Add page'
)); ));
} }
@ -869,11 +809,9 @@ get('/admin/import',function(){
if(login()) { if(login()) {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('import', array( render('import', array(
'title' => 'Import feed - ' . config('blog.title'),
'canonical' => config('site.url') . '/import',
'description' => 'Import feed to ' . config('blog.title') . '.',
'head_contents' => head_contents('Import feed - ' . blog_title(), blog_description(), site_url()),
'bodyclass' => 'importfeed', 'bodyclass' => 'importfeed',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Import feed'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Import feed'
)); ));
} }
else { else {
@ -898,12 +836,10 @@ post('/admin/import', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('import',array( render('import',array(
'head_contents' => head_contents('Import feed - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $log . '</ul>', 'error' => '<ul>' . $log . '</ul>',
'title' => 'Import feed - ' . config('blog.title'),
'canonical' => config('site.url'),
'description' => 'Import feed on ' .config('blog.title'),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Import feed'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Import feed'
)); ));
} }
} }
@ -916,13 +852,11 @@ post('/admin/import', function() {
config('views.root', 'system/admin/views'); config('views.root', 'system/admin/views');
render('import',array( render('import',array(
'head_contents' => head_contents('Import feed - ' . blog_title(), blog_description(), site_url()),
'error' => '<ul>' . $message['error'] . '</ul>', 'error' => '<ul>' . $message['error'] . '</ul>',
'title' => 'Login - ' . config('blog.title'),
'url' => $url, 'url' => $url,
'canonical' => config('site.url'),
'description' => 'Login page on ' .config('blog.title'),
'bodyclass' => 'editprofile', 'bodyclass' => 'editprofile',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Login'
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Login'
)); ));
} }
@ -945,13 +879,11 @@ get('/tag/:tag',function($tag){
} }
render('main',array( render('main',array(
'title' => 'Posts tagged: ' . $tag .' - ' . config('blog.title'),
'head_contents' => head_contents('Posts tagged: ' . $tag .' - ' . blog_title(), 'All posts tagged: ' . $tag . ' on '. blog_title() . '.', site_url() . 'tag/' . $tag),
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'canonical' => config('site.url') . '/tag/' . $tag,
'description' => 'All posts tagged: ' . $tag . ' on '. config('blog.title') . '.',
'bodyclass' => 'intag', 'bodyclass' => 'intag',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Posts tagged: ' . $tag,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Posts tagged: ' . $tag,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
}); });
@ -991,13 +923,11 @@ get('/archive/:req',function($req){
} }
render('main',array( render('main',array(
'title' => 'Archive for: ' . $timestamp .' - ' . config('blog.title'),
'head_contents' => head_contents('Archive for: ' . $timestamp .' - ' . blog_title(), 'Archive page for: ' . $timestamp . ' on ' . blog_title() . '.', site_url() . 'archive/' . $req),
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'canonical' => config('site.url') . '/archive/' . $req,
'description' => 'Archive page for: ' . $timestamp . ' on ' . config('blog.title') . '.',
'bodyclass' => 'inarchive', 'bodyclass' => 'inarchive',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Archive for: ' . $timestamp,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Archive for: ' . $timestamp,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));
}); });
@ -1023,13 +953,11 @@ get('/search/:keyword', function($keyword){
} }
render('main',array( render('main',array(
'title' => 'Search results for: ' . $keyword . ' - ' . config('blog.title'),
'head_contents' => head_contents('Search results for: ' . $keyword . ' - ' . blog_title(), 'Search results for: ' . $keyword . ' on '. blog_title() . '.', site_url() . 'search/' . $keyword),
'page' => $page, 'page' => $page,
'posts' => $posts, 'posts' => $posts,
'canonical' => config('site.url') . '/search/' . $keyword,
'description' => 'Search results for: ' . $keyword . ' on '. config('blog.title') . '.',
'bodyclass' => 'insearch', 'bodyclass' => 'insearch',
'breadcrumb' => '<a href="' . config('site.url') . '">' .config('breadcrumb.home'). '</a> &#187; Search results for: ' . $keyword,
'breadcrumb' => '<a href="' . site_url() . '">' .config('breadcrumb.home'). '</a> &#187; Search results for: ' . $keyword,
'pagination' => has_pagination($total, $perpage, $page) 'pagination' => has_pagination($total, $perpage, $page)
)); ));


+ 91
- 41
system/includes/functions.php View File

@ -741,39 +741,42 @@ function get_teaser($text, $url) {
// Get thumbnail from image and Youtube. // Get thumbnail from image and Youtube.
function get_thumbnail($text) { function get_thumbnail($text) {
$teaserType = config('teaser.type');
if (strlen(strip_tags($text)) > config('teaser.char') && $teaserType === 'trimmed') {
libxml_use_internal_errors(true);
$default = config('default.thumbnail');
$dom = new DOMDocument();
$dom->loadHtml($text);
$imgTags = $dom->getElementsByTagName('img');
$vidTags = $dom->getElementsByTagName('iframe');
if ($imgTags->length > 0) {
$imgElement = $imgTags->item(0);
$imgSource = $imgElement->getAttribute('src');
return '<div class="thumbnail" style="background-image:url(' . $imgSource . ');"></div>';
}
elseif ($vidTags->length > 0) {
$vidElement = $vidTags->item(0);
$vidSource = $vidElement->getAttribute('src');
$fetch = explode("embed/", $vidSource);
if(isset($fetch[1])) {
$vidThumb = '//img.youtube.com/vi/' . $fetch[1] . '/default.jpg';
return '<div class="thumbnail" style="background-image:url(' . $vidThumb . ');"></div>';
if (config('img.thumbnail') == 'true') {
$teaserType = config('teaser.type');
if (strlen(strip_tags($text)) > config('teaser.char') && $teaserType === 'trimmed') {
libxml_use_internal_errors(true);
$default = config('default.thumbnail');
$dom = new DOMDocument();
$dom->loadHtml($text);
$imgTags = $dom->getElementsByTagName('img');
$vidTags = $dom->getElementsByTagName('iframe');
if ($imgTags->length > 0) {
$imgElement = $imgTags->item(0);
$imgSource = $imgElement->getAttribute('src');
return '<div class="thumbnail" style="background-image:url(' . $imgSource . ');"></div>';
} }
}
else {
if (!empty($default)) {
return '<div class="thumbnail" style="background-image:url(' . $default . ');"></div>';
elseif ($vidTags->length > 0) {
$vidElement = $vidTags->item(0);
$vidSource = $vidElement->getAttribute('src');
$fetch = explode("embed/", $vidSource);
if(isset($fetch[1])) {
$vidThumb = '//img.youtube.com/vi/' . $fetch[1] . '/default.jpg';
return '<div class="thumbnail" style="background-image:url(' . $vidThumb . ');"></div>';
}
}
else {
if (!empty($default)) {
return '<div class="thumbnail" style="background-image:url(' . $default . ');"></div>';
}
} }
} }
else {
}
else {
}
} }
} }
@ -832,7 +835,7 @@ function social(){
// Copyright // Copyright
function copyright(){ function copyright(){
$blogcp = config('blog.copyright');
$blogcp = blog_copyright();
$credit = 'Proudly powered by <a href="http://www.htmly.com" target="_blank">HTMLy</a>.'; $credit = 'Proudly powered by <a href="http://www.htmly.com" target="_blank">HTMLy</a>.';
if (!empty($blogcp)) { if (!empty($blogcp)) {
@ -845,7 +848,7 @@ function copyright(){
} }
// Disqus on post. // Disqus on post.
function disqus($title, $url){
function disqus($title=null, $url=null){
$disqus = config('disqus.shortname'); $disqus = config('disqus.shortname');
$script = <<<EOF $script = <<<EOF
<script type="text/javascript"> <script type="text/javascript">
@ -1011,8 +1014,8 @@ function generate_rss($posts){
$rssLength = config('rss.char'); $rssLength = config('rss.char');
$channel $channel
->title(config('blog.title'))
->description(config('blog.description'))
->title(blog_title())
->description(blog_description())
->url(site_url()) ->url(site_url())
->appendTo($feed); ->appendTo($feed);
@ -1285,20 +1288,20 @@ function generate_opml(){
$opml_data = array( $opml_data = array(
'head' => array( 'head' => array(
'title' => config('blog.title') . ' OPML File',
'ownerName' => config('blog.title'),
'ownerId' => config('site.url')
'title' => blog_title() . ' OPML File',
'ownerName' => blog_title(),
'ownerId' => site_url()
), ),
'body' => array( 'body' => array(
array( array(
'text' => config('blog.title'),
'description' => config('blog.description'),
'htmlUrl' => config('site.url'),
'text' => blog_title(),
'description' => blog_description(),
'htmlUrl' => site_url(),
'language' => 'unknown', 'language' => 'unknown',
'title' => config('blog.title'),
'title' => blog_title(),
'type' => 'rss', 'type' => 'rss',
'version' => 'RSS2', 'version' => 'RSS2',
'xmlUrl' => config('site.url') . '/feed/rss'
'xmlUrl' => site_url() . 'feed/rss'
) )
) )
); );
@ -1312,6 +1315,53 @@ function generate_json($posts){
return json_encode($posts); return json_encode($posts);
} }
// TRUE if the current page is the front page.
function is_front() {
$req = $_SERVER['REQUEST_URI'];
if($req == site_path() . '/') {
return true;
}
else {
return false;
}
}
// Return blog title
function blog_title() {
return config('blog.title');
}
// Return blog tagline
function blog_tagline() {
return config('blog.tagline');
}
// Return blog description
function blog_description() {
return config('blog.description');
}
// Return blog copyright
function blog_copyright() {
return config('blog.copyright');
}
function head_contents($title, $description, $canonical) {
$output = '';
$title = '<title>' . $title . '</title>';
$favicon = '<link href="' . site_url() . 'favicon.ico" rel="icon" type="image/x-icon"/>';
$charset = '<meta charset="utf-8" />';
$generator = '<meta content="htmly" name="generator"/>';
$xua = '<meta http-equiv="X-UA-Compatible" content="IE=edge" />';
$viewport = '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />';
$description = '<meta name="description" content="'. $description .'"/>';
$sitemap = '<link rel="sitemap" href="' . site_url() . 'sitemap.xml" />';
$canonical = '<link rel="canonical" href="' . $canonical . '" />';
$feed = '<link rel="alternate" type="application/rss+xml" title="'. blog_title() .' Feed" href="' . site_url() . 'feed/rss" />';
$output .= $title ."\n". $favicon ."\n". $charset ."\n". $generator ."\n". $xua ."\n". $viewport ."\n". $description ."\n". $sitemap ."\n". $canonical ."\n". $feed ."\n";
return $output;
}
// Return toolbar // Return toolbar
function toolbar() { function toolbar() {
$user = $_SESSION['user']; $user = $_SESSION['user'];


+ 2
- 4
themes/clean/main.html.php View File

@ -18,9 +18,7 @@
<h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2> <h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2>
<div class="date"><span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in <span itemprop="articleSection"><?php echo $p->tag ?></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div> <div class="date"><span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in <span itemprop="articleSection"><?php echo $p->tag ?></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div>
<div class="teaser-body" itemprop="articleBody"> <div class="teaser-body" itemprop="articleBody">
<?php if (config('img.thumbnail') == 'true'):?>
<?php echo get_thumbnail($p->body)?>
<?php endif;?>
<?php echo get_thumbnail($p->body)?>
<?php echo get_teaser($p->body, $p->url)?> <?php echo get_teaser($p->body, $p->url)?>
</div> </div>
</div> </div>
@ -36,6 +34,6 @@
<?php endif;?> <?php endif;?>
</div> </div>
<?php endif;?> <?php endif;?>
<?php if (disqus_count() == true):?>
<?php if (disqus_count()):?>
<?php echo disqus_count() ?> <?php echo disqus_count() ?>
<?php endif;?> <?php endif;?>

+ 2
- 2
themes/clean/post.html.php View File

@ -28,7 +28,7 @@
</div> </div>
<?php echo get_related($p->tag)?> <?php echo get_related($p->tag)?>
<div class="comments border"> <div class="comments border">
<?php if (disqus(null, null) == true):?>
<?php if (disqus()):?>
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
<?php endif;?> <?php endif;?>
</div> </div>
@ -41,7 +41,7 @@
<span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span> <span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span>
<?php endif;?> <?php endif;?>
</div> </div>
<?php if (disqus(null, null) == true):?>
<?php if (disqus()):?>
<?php echo disqus($p->title, $p->url) ?> <?php echo disqus($p->title, $p->url) ?>
<?php endif;?> <?php endif;?>
</div> </div>

+ 3
- 12
themes/default/layout.html.php View File

@ -1,19 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title><?php echo $title; ?></title>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8" />
<meta content='htmly' name='generator'/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" />
<meta name="description" content="<?php echo $description; ?>" />
<link rel="sitemap" href="<?php echo site_url() ?>sitemap.xml" />
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link rel="alternate" type="application/rss+xml" title="<?php echo config('blog.title')?> Feed" href="<?php echo site_url()?>feed/rss" />
<?php echo $head_contents ?>
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" /> <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<?php if (publisher() == true):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>
<?php if (publisher()):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> <![endif]-->
@ -63,6 +54,6 @@
</div> </div>
</div> </div>
</div> </div>
<?php if (analytics() == true):?><?php echo analytics() ?><?php endif;?>
<?php if (analytics()):?><?php echo analytics() ?><?php endif;?>
</body> </body>
</html> </html>

+ 2
- 4
themes/default/main.html.php View File

@ -18,9 +18,7 @@
<h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2> <h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2>
<div class="date"><span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in <span itemprop="articleSection"><?php echo $p->tag ?></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div> <div class="date"><span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in <span itemprop="articleSection"><?php echo $p->tag ?></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div>
<div class="teaser-body" itemprop="articleBody"> <div class="teaser-body" itemprop="articleBody">
<?php if (config('img.thumbnail') == 'true'):?>
<?php echo get_thumbnail($p->body)?>
<?php endif;?>
<?php echo get_thumbnail($p->body)?>
<?php echo get_teaser($p->body, $p->url)?> <?php echo get_teaser($p->body, $p->url)?>
</div> </div>
</div> </div>
@ -36,6 +34,6 @@
<?php endif;?> <?php endif;?>
</div> </div>
<?php endif;?> <?php endif;?>
<?php if (disqus_count() == true):?>
<?php if (disqus_count()):?>
<?php echo disqus_count() ?> <?php echo disqus_count() ?>
<?php endif;?> <?php endif;?>

+ 2
- 2
themes/default/post.html.php View File

@ -28,7 +28,7 @@
</div> </div>
<?php echo get_related($p->tag)?> <?php echo get_related($p->tag)?>
<div class="comments border"> <div class="comments border">
<?php if (disqus(null, null) == true):?>
<?php if (disqus()):?>
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
<?php endif;?> <?php endif;?>
</div> </div>
@ -41,7 +41,7 @@
<span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span> <span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span>
<?php endif;?> <?php endif;?>
</div> </div>
<?php if (disqus(null, null) == true):?>
<?php if (disqus()):?>
<?php echo disqus($p->title, $p->url) ?> <?php echo disqus($p->title, $p->url) ?>
<?php endif;?> <?php endif;?>
</div> </div>

Loading…
Cancel
Save