Browse Source

Improvements

pull/189/head
Danang Probo Sayekti 10 years ago
parent
commit
01c3a98824
2 changed files with 8 additions and 7 deletions
  1. +1
    -0
      system/admin/admin.php
  2. +7
    -7
      system/htmly.php

+ 1
- 0
system/admin/admin.php View File

@ -458,6 +458,7 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
$post_date = date('Y-m-d-H-i-s', $time); $post_date = date('Y-m-d-H-i-s', $time);
$post_title = $title; $post_title = $title;
$post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tags)); $post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tags));
$post_tag = rtrim($post_tag, ',');
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if (!empty($source)) { if (!empty($source)) {
$post_content = '<!--t ' . $post_title . ' t-->' . "\n\n" . $content . "\n\n" . 'Source: <a target="_blank" href="' . $source . '">' . $title . '</a>'; $post_content = '<!--t ' . $post_title . ' t-->' . "\n\n" . $content . "\n\n" . 'Source: <a target="_blank" href="' . $source . '">' . $title . '</a>';


+ 7
- 7
system/htmly.php View File

@ -997,7 +997,7 @@ get('/:static', function ($static) {
'bodyclass' => 'inpage', 'bodyclass' => 'inpage',
'breadcrumb' => '<a href="' . 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',
'is_page' => is_page(true), 'is_page' => is_page(true),
)); ));
} }
@ -1094,7 +1094,7 @@ get('/:static/edit', function ($static) {
'bodyclass' => 'editpage', 'bodyclass' => 'editpage',
'breadcrumb' => '<a href="' . 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',
)); ));
} else { } else {
$login = site_url() . 'login'; $login = site_url() . 'login';
@ -1173,7 +1173,7 @@ get('/:static/delete', function ($static) {
'bodyclass' => 'deletepage', 'bodyclass' => 'deletepage',
'breadcrumb' => '<a href="' . 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',
)); ));
} else { } else {
$login = site_url() . 'login'; $login = site_url() . 'login';
@ -1220,7 +1220,7 @@ get('/:static/:sub', function ($static, $sub) {
'bodyclass' => 'inpage', 'bodyclass' => 'inpage',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $father_post[0]->url . '">' . $father_post[0]->title . '</a> &#187; ' . $post->title, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $father_post[0]->url . '">' . $father_post[0]->title . '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'staticpage',
'type' => 'subPage',
'is_subpage' => is_subpage(true), 'is_subpage' => is_subpage(true),
)); ));
}); });
@ -1254,7 +1254,7 @@ get('/:static/:sub/edit', function ($static, $sub) {
'bodyclass' => 'editpage', 'bodyclass' => 'editpage',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $post->url . '">' . $post->title . '</a> &#187; ', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $post->url . '">' . $post->title . '</a> &#187; ',
'p' => $page, 'p' => $page,
'type' => 'staticpage',
'type' => 'subPage',
)); ));
} else { } else {
$login = site_url() . 'login'; $login = site_url() . 'login';
@ -1344,7 +1344,7 @@ get('/:static/:sub/delete', function ($static, $sub) {
'bodyclass' => 'deletepage', 'bodyclass' => 'deletepage',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $post->url . '">' . $post->title . '</a>' . $page->title, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $post->url . '">' . $post->title . '</a>' . $page->title,
'p' => $page, 'p' => $page,
'type' => 'staticpage',
'type' => 'subPage',
)); ));
} else { } else {
$login = site_url() . 'login'; $login = site_url() . 'login';
@ -1418,7 +1418,7 @@ get('/:year/:month/:name', function ($year, $month, $name) {
'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, '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',
'is_post' => is_post(true), 'is_post' => is_post(true),
)); ));


Loading…
Cancel
Save