From 716a7c66c309af32f94064c500c43f72836100de Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 25 Feb 2013 11:29:38 -0800 Subject: [PATCH] Closes #107 - Submitnews issue --- e107_admin/newspost.php | 77 +++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 471d6145f..88a06d052 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -258,36 +258,66 @@ class news_sub_form_ui extends e_admin_form_ui $submitnews_title = $row->get('submitnews_title'); $submitnews_file = $row->get('submitnews_file'); $submitnews_item = $row->get('submitnews_item'); + + // $text .= ""; - $text .= ""; - $text .= $tp->toHTML($submitnews_title,FALSE,'emotes_off, no_make_clickable'); + + $text .= ""; + $text .= $tp->toHTML($submitnews_title,FALSE,'emotes_off, no_make_clickable'); $text .= ''; - $text .= "'; + + return $text; + + } // Override the default Options field. function options($parms, $value, $id, $attributes) { - + if($attributes['mode'] == 'read') { + $text = "
"; $approved = $this->getController()->getListModel()->get('submitnews_auth'); // approved; if($approved == 0) { - $text = $this->submit_image('submitnews['.$id.']', 1, 'execute', NWSLAN_58); + //$text = $this->submit_image('submitnews['.$id.']', 1, 'execute', NWSLAN_58); + $text = "".ADMIN_EXECUTE_ICON.""; // NWSLAN_103; } else // Already submitted; @@ -296,7 +326,7 @@ class news_sub_form_ui extends e_admin_form_ui } $text .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete'.$delcls)); - + $text .= "
"; return $text; } } @@ -405,10 +435,10 @@ class news_admin_ui extends e_admin_ui function createPage() { // print_a($_POST); - if(isset($_POST['submitnews'])) + if(isset($_GET['sub'])) { - $id = key($_POST['submitnews']); - + $id = intval($_GET['sub']); + $this->loadSubmitted($id); } else @@ -464,22 +494,23 @@ class news_admin_ui extends e_admin_ui $sql = e107::getDb(); $tp = e107::getParser(); - if ($sql->db_Select("submitnews", "*", "submitnews_id=".intval($id), TRUE)) + if ($sql->select("submitnews", "*", "submitnews_id=".intval($id))) { + //list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch(); - $row = $sql->db_Fetch(); + $row = $sql->fetch(); $_POST['news_title'] = $row['submitnews_title']; $_POST['news_body'] = $row['submitnews_item']; $_POST['cat_id'] = $row['submitnews_category']; - if (defsettrue('e_WYSIWYG')) - { - if (substr($_POST['news_body'],-7,7) == '[/html]') $_POST['news_body'] = substr($_POST['news_body'],0,-7); - if (substr($_POST['news_body'],0,6) == '[html]') $_POST['news_body'] = substr($_POST['news_body'],6); - $_POST['news_body'] .= "
".NWSLAN_49." {$row['submitnews_name']}"; - $_POST['news_body'] .= ($row['submitnews_file'])? "

": ''; - } - else + // if (defsettrue('e_WYSIWYG')) + // { + // if (substr($_POST['news_body'],-7,7) == '[/html]') $_POST['news_body'] = substr($_POST['news_body'],0,-7); + // if (substr($_POST['news_body'],0,6) == '[html]') $_POST['news_body'] = substr($_POST['news_body'],6); + // $_POST['news_body'] .= "
".NWSLAN_49." {$row['submitnews_name']}"; + // $_POST['news_body'] .= ($row['submitnews_file'])? "

": ''; + // } + // else { $_POST['news_body'] .= "\n[[b]".NWSLAN_49." {$row['submitnews_name']}[/b]]";