Add markdown editor

Add markdown editor so anyone can test it. Fix explode on tags.
This commit is contained in:
Danang Probo Sayekti 2014-01-20 12:57:08 +07:00
commit e829ae974f
22 changed files with 4398 additions and 5 deletions

View file

@ -207,11 +207,16 @@ function get_tag($tag, $page, $perpage){
foreach ($posts as $index => $v) {
$url = $v['filename'];
if( strpos($url, "$tag") !== false){
$str = explode('_', $url);
if($tag === $str[1]){
$tmp[] = $v;
}
}
if(empty($tmp)) {
not_found();
}
return $tmp = get_posts($tmp, $page, $perpage);
}
@ -225,11 +230,16 @@ function get_archive($req, $page, $perpage){
foreach ($posts as $index => $v) {
$url = $v['filename'];
if( strpos($url, "$req") !== false){
$str = explode('_', $url);
if( strpos($str[0], "$req") !== false ){
$tmp[] = $v;
}
}
if(empty($tmp)) {
not_found();
}
return $tmp = get_posts($tmp, $page, $perpage);
}
@ -890,9 +900,6 @@ function get_static_path(){
$tmp = array();
// Create a new instance of the markdown parser
$md = new MarkdownParser();
foreach($posts as $index => $v){
$post = new stdClass;