Use traditional title

Use traditional input for title.
This commit is contained in:
Danang Probo Sayekti 2014-01-27 07:11:47 +07:00
commit 4e27072496
6 changed files with 66 additions and 23 deletions

View file

@ -156,13 +156,13 @@ function get_posts($posts, $page = 1, $perpage = 0){
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
// Extract the title and body
$arr = explode('</h1>', $content);
$arr = explode('t-->', $content);
if(isset($arr[1])) {
$post->title = str_replace('<h1>','',$arr[0]);
$post->title = str_replace('<!--t','',$arr[0]);
$post->body = $arr[1];
}
else {
$post->title = 'Untitled: ' . date('l jS \of F Y', $post->date);
$post->title = ' Untitled: ' . date('l jS \of F Y', $post->date);
$post->body = $arr[0];
}
@ -322,9 +322,9 @@ function get_bio($author){
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
// Extract the title and body
$arr = explode('</h1>', $content);
$arr = explode('t-->', $content);
if(isset($arr[1])) {
$post->title = str_replace('<h1>','',$arr[0]);
$post->title = str_replace('<!--t','',$arr[0]);
$post->body = $arr[1];
}
else {
@ -374,9 +374,9 @@ function get_static_post($static){
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
// Extract the title and body
$arr = explode('</h1>', $content);
$arr = explode('t-->', $content);
if(isset($arr[1])) {
$post->title = str_replace('<h1>','',$arr[0]);
$post->title = str_replace('<!--t','',$arr[0]);
$post->body = $arr[1];
}
else {
@ -452,13 +452,13 @@ function get_keyword($keyword){
$post->tagb = implode(' » ', $bc);
// Extract the title and body
$arr = explode('</h1>', $content);
$arr = explode('t-->', $content);
if(isset($arr[1])) {
$post->title = str_replace('<h1>','',$arr[0]);
$post->title = str_replace('<!--t','',$arr[0]);
$post->body = $arr[1];
}
else {
$post->title = 'Untitled: ' . date('l jS \of F Y', $post->date);
$post->title = ' Untitled: ' . date('l jS \of F Y', $post->date);
$post->body = $arr[0];
}