diff --git a/system/admin/admin.php b/system/admin/admin.php index 953a28d..42ada8c 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -180,20 +180,20 @@ function add_page($title, $url, $content) { } -function delete_post($file) { +function delete_post($file, $destination) { $deleted_content = $file; if(!empty($deleted_content)) { unlink($deleted_content); - $redirect = site_url() . 'admin/posts'; + $redirect = site_url() . $destination; header("Location: $redirect"); } } -function delete_page($file) { +function delete_page($file, $destination) { $deleted_content = $file; if(!empty($deleted_content)) { unlink($deleted_content); - $redirect = site_url() . 'admin'; + $redirect = site_url() . $destination; header("Location: $redirect"); } } @@ -224,23 +224,19 @@ function edit_profile($title, $content, $user) { function get_recent_posts() { if (isset($_SESSION['user'])) { - $posts = get_profile($_SESSION['user'], 1, 5); - if(!empty($posts)) { - - echo '
| Title | Published | Tag | Operations | |
|---|---|---|---|---|
| ' . $p->title . ' | '; + echo '' . $p->title . ' | '; echo '' . date('d F Y', $p->date) . ' | '; echo '' . $p->tag . ' | '; echo 'Edit Delete | '; echo '
| Title | Operations | |
|---|---|---|
| ' . $p->title . ' | '; + echo '' . $p->title . ' | '; echo 'Edit Delete | '; echo '