diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 33e71bd3b..ea20fd17a 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $ -| $Revision: 1.12 $ -| $Date: 2008-03-18 00:38:53 $ +| $Revision: 1.13 $ +| $Date: 2008-05-18 16:34:16 $ | $Author: e107coders $ +---------------------------------------------------------------+ @@ -194,25 +194,19 @@ if (isset($_POST['update_category'])) { if (isset($_POST['save_prefs'])) { $pref['newsposts'] = $_POST['newsposts']; - // ##### ADDED FOR NEWS ARCHIVE -------------------------------------------------------------------- - $pref['newsposts_archive'] = $_POST['newsposts_archive']; + $pref['newsposts_archive'] = $_POST['newsposts_archive']; $pref['newsposts_archive_title'] = $tp->toDB($_POST['newsposts_archive_title']); - // ##### END -------------------------------------------------------------------------------------- - - $pref['news_cats'] = $_POST['news_cats']; - $pref['nbr_cols'] = $_POST['nbr_cols']; - $pref['subnews_attach'] = $_POST['subnews_attach']; - $pref['subnews_resize'] = $_POST['subnews_resize']; - $pref['subnews_class'] = $_POST['subnews_class']; - $pref['subnews_htmlarea'] = $_POST['subnews_htmlarea']; - $pref['subnews_hide_news'] = $_POST['subnews_hide_news']; - $pref['news_subheader'] = $tp->toDB($_POST['news_subheader']); - /* - changes by jalist 22/01/2005: - added pref to render new date header - */ - $pref['news_newdateheader'] = $_POST['news_newdateheader']; - $pref['news_unstemplate'] = $_POST['news_unstemplate']; + $pref['news_cats'] = $_POST['news_cats']; + $pref['nbr_cols'] = $_POST['nbr_cols']; + $pref['subnews_attach'] = $_POST['subnews_attach']; + $pref['subnews_resize'] = $_POST['subnews_resize']; + $pref['subnews_class'] = $_POST['subnews_class']; + $pref['subnews_htmlarea'] = $_POST['subnews_htmlarea']; + $pref['subnews_hide_news'] = $_POST['subnews_hide_news']; + $pref['news_subheader'] = $tp->toDB($_POST['news_subheader']); + $pref['news_newdateheader'] = $_POST['news_newdateheader']; + $pref['news_unstemplate'] = $_POST['news_unstemplate']; + $pref['news_editauthor'] = $_POST['news_editauthor']; save_prefs(); $e107cache->clear("news.php"); @@ -230,11 +224,13 @@ if ($action == "create") { $preset = $pst->read_preset("admin_newspost"); //only works here because $_POST is used. if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit_news']) { - if ($sql->db_Select("news", "*", "news_id='$id' ")) { + if ($sql->db_Select("news", "*", "news_id='$id' ")) + { $row = $sql->db_Fetch(); extract($row); $_POST['news_title'] = $news_title; $_POST['data'] = $news_body; + $_POST['news_author'] = $row['news_author']; $_POST['news_extended'] = $news_extended; $_POST['news_allow_comments'] = $news_allow_comments; $_POST['news_class'] = $news_class; @@ -280,7 +276,7 @@ exit; class newspost { - function show_existing_items($action, $sub_action, $sort_order, $from, $amount) + function show_existing_items($action, $sub_action, $sort_order, $from, $amount) { // ##### Display scrolling list of existing news items --------------------------------------------------------------------------------------------------------- global $sql, $ns, $tp, $imode; @@ -290,11 +286,11 @@ class newspost if ($sort_order != 'asc') $sort_order = 'desc'; $sort_link = $sort_order == 'asc' ? 'desc' : 'asc'; // Effectively toggle setting for headings - if (isset($_POST['searchquery'])) + if (isset($_POST['searchquery'])) { $query = "news_title REGEXP('".$_POST['searchquery']."') OR news_body REGEXP('".$_POST['searchquery']."') OR news_extended REGEXP('".$_POST['searchquery']."') ORDER BY news_datestamp DESC"; - } - else + } + else { $query = "ORDER BY ".($sub_action ? $sub_action : "news_datestamp")." ".strtoupper($sort_order)." LIMIT {$from}, {$amount}"; } @@ -338,15 +334,15 @@ class newspost "; } $text .= ""; - } - else + } + else { $text .= "