| 1 | <?php |
|---|
| 2 | include_once('.'.DIRECTORY_SEPARATOR.'auth.php'); |
|---|
| 3 | define("JLOG_ADMIN", true); |
|---|
| 4 | require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php'); |
|---|
| 5 | require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php'); |
|---|
| 6 | |
|---|
| 7 | $get = strip($_GET); |
|---|
| 8 | $post = strip($_POST); |
|---|
| 9 | |
|---|
| 10 | $c['meta']['title'] = $l['admin']['change_headline']; |
|---|
| 11 | $c['main'] = output_admin_menu(); |
|---|
| 12 | $c['main'] .= "<h2>".$l['admin']['change_headline']."</h2>"; |
|---|
| 13 | |
|---|
| 14 | if($get['action'] == "trash" AND $post['trash'] == $l['admin']['yes']) { |
|---|
| 15 | $c['main'] .= "<p>".trash_blog($get['id'])."</p>"; |
|---|
| 16 | include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php'); |
|---|
| 17 | } |
|---|
| 18 | elseif ($get['action'] == "trash" AND empty($post['trash'])) { |
|---|
| 19 | $c['main'] .= " |
|---|
| 20 | <form method='post' id='entryform' action='".$_SERVER['SCRIPT_NAME']."?id=".$get['id']."&action=trash' accept-charset='UTF-8'> |
|---|
| 21 | <p>".$l['admin']['rearly_delete']." <input class='send' type='submit' name='trash' value='".$l['admin']['yes']."' /> |
|---|
| 22 | ".add_session_id_input_tag()." |
|---|
| 23 | <a href='".JLOG_PATH."/admin/'>".$l['admin']['no']."</a></p> |
|---|
| 24 | </form>"; |
|---|
| 25 | $form_input = get_blog($get['id']); |
|---|
| 26 | $c['main'] .= preview_output($form_input); |
|---|
| 27 | $c['title'] = $l['admin']['delete_blogentry']; |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | else { |
|---|
| 31 | if(isset($get['id'])) $form_input = get_blog($get['id']); |
|---|
| 32 | elseif (isset($_POST)) $form_input = $post; |
|---|
| 33 | else $c['main'] .= $l['admin']['error_occurred']; |
|---|
| 34 | |
|---|
| 35 | if($post['form_submitted'] == $l['admin']['preview']) { |
|---|
| 36 | $c['main'] .= error_output(check_input($form_input)); |
|---|
| 37 | $c['main'] .= preview_output($form_input); |
|---|
| 38 | $c['main'] .= form_output($form_input); |
|---|
| 39 | } |
|---|
| 40 | elseif($post['form_submitted'] == $l['admin']['publish']) { |
|---|
| 41 | // Put data to database |
|---|
| 42 | if(!check_input($form_input)) { |
|---|
| 43 | $c['main'] .= "<p>".update_blog($form_input)."</p>"; |
|---|
| 44 | include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php'); |
|---|
| 45 | } |
|---|
| 46 | else { |
|---|
| 47 | // show preview and form |
|---|
| 48 | $c['main'] .= error_output(check_input($form_input)); |
|---|
| 49 | $c['main'] .= form_output($form_input); |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | else { |
|---|
| 53 | // show form |
|---|
| 54 | $c['main'] .= form_output($form_input); |
|---|
| 55 | } |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php'); |
|---|
| 59 | echo $body; |
|---|
| 60 | ?> |
|---|