Browse Source

Improve blog

pull/189/head
Danang Probo Sayekti 10 years ago
parent
commit
a99b71ef07
2 changed files with 6 additions and 3 deletions
  1. +3
    -0
      config/config.ini.example
  2. +3
    -3
      system/includes/functions.php

+ 3
- 0
config/config.ini.example View File

@ -10,6 +10,9 @@ blog.tagline = "Just another HTMLy blog"
blog.description = "Proudly powered by HTMLy, a databaseless blogging platform." blog.description = "Proudly powered by HTMLy, a databaseless blogging platform."
blog.copyright = "(c) Your name." blog.copyright = "(c) Your name."
; Show the /blog url as the blog homepage
blog.enable = "false"
; Social account ; Social account
social.twitter = "https://twitter.com" social.twitter = "https://twitter.com"
social.facebook = "https://www.facebook.com" social.facebook = "https://www.facebook.com"


+ 3
- 3
system/includes/functions.php View File

@ -1477,12 +1477,12 @@ function generate_rss($posts)
if (!empty($rssLength)) { if (!empty($rssLength)) {
if (strlen(strip_tags($p->body)) < config('rss.char')) { if (strlen(strip_tags($p->body)) < config('rss.char')) {
$string = preg_replace('/\s\s+/', ' ', strip_tags($p->body)); $string = preg_replace('/\s\s+/', ' ', strip_tags($p->body));
$body = $string . '...' . ' <a class="readmore" href="' . $p->url . '">more</a>';
$body = $string . '...';
} else { } else {
$string = preg_replace('/\s\s+/', ' ', strip_tags($p->body)); $string = preg_replace('/\s\s+/', ' ', strip_tags($p->body));
$string = substr($string, 0, config('rss.char')); $string = substr($string, 0, config('rss.char'));
$string = substr($string, 0, strrpos($string, ' ')); $string = substr($string, 0, strrpos($string, ' '));
$body = $string . '...' . ' <a class="readmore" href="' . $p->url . '">more</a>';
$body = $string . '...';
} }
} else { } else {
$body = $p->body; $body = $p->body;
@ -1795,7 +1795,7 @@ function Zip($source, $destination, $include_dir = false)
function is_index() function is_index()
{ {
$req = $_SERVER['REQUEST_URI']; $req = $_SERVER['REQUEST_URI'];
if (strpos($req, '/archive/') !== false || strpos($req, '/tag/') !== false || strpos($req, '/search/') !== false || $req == site_path() . '/' || strpos($req, site_path() . '/?page') !== false) {
if (strpos($req, '/archive/') !== false || strpos($req, '/tag/') !== false || strpos($req, '/search/') !== false || strpos($req, '/blog') !== false || $req == site_path() . '/' || strpos($req, site_path() . '/?page') !== false) {
return true; return true;
} else { } else {
return false; return false;


Loading…
Cancel
Save