diff --git a/system/admin/admin.php b/system/admin/admin.php index d74f5b6..c44c2b9 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -249,16 +249,18 @@ function get_recent_posts() { function get_recent_pages() { if (isset($_SESSION['user'])) { $posts = get_static_post(null); - krsort($posts); - - echo ''; - echo ''; - foreach($posts as $p) { - echo ''; - echo ''; - echo ''; - echo ''; + if(!empty($posts)) { + krsort($posts); + + echo '
TitleOperations
' . $p->title . 'Edit Delete
'; + echo ''; + foreach($posts as $p) { + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
TitleOperations
' . $p->title . 'Edit Delete
'; } - echo ''; } } diff --git a/system/includes/functions.php b/system/includes/functions.php index 601f495..0d7d8b8 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -304,43 +304,46 @@ function get_profile($profile, $page, $perpage){ function get_bio($author){ $names = get_author_names(); + + if(!empty($names)) { - $tmp = array(); - - foreach($names as $index => $v){ - $post = new stdClass; - - // Replaced string - $replaced = substr($v, 0,strrpos($v, '/')) . '/'; - - // Author string - $str = explode('/', $replaced); - $profile = $str[count($str)-2]; - - if($author === $profile){ - // Profile URL - $url = str_replace($replaced,'',$v); - $post->url = site_url() . 'author/' . $profile; + $tmp = array(); + + foreach($names as $index => $v){ + $post = new stdClass; - // Get the contents and convert it to HTML - $content = MarkdownExtra::defaultTransform(file_get_contents($v)); - - // Extract the title and body - $arr = explode('t-->', $content); - if(isset($arr[1])) { - $post->title = str_replace('', $content); + if(isset($arr[1])) { + $post->title = str_replace('', $content); + if(isset($arr[1])) { + $post->title = str_replace('', $content); - if(isset($arr[1])) { - $post->title = str_replace('