diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 142652d1e..1a672f5f4 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -1254,6 +1254,22 @@ class admin_newspost $sql = e107::getDb(); $count = $sql->db_Delete("news","news_id IN (".implode(",",$ids).") "); } + + function batch_subdelete($ids, $value) + { + $sql = e107::getDb(); + $count = $sql->db_Delete("submitnews","submitnews_id IN (".implode(",",$ids).") "); + } + + function batch_subcategory($ids, $value) + { + if(!isset($this->news_categories[$value])) + { + $this->noPermissions(); + } + $sql = e107::getDb(); + $count = $sql->db_Update("submitnews","submitnews_category = ".$value." WHERE submitnews_id IN (".implode(",",$ids).") "); + } function batch_sticky($ids, $value) { @@ -2429,12 +2445,24 @@ class admin_newspost function show_submitted_news() - { - + { + + //TODO - image upload path should be e_MEDIA and using generic upload handler on submitnews.php. + $e107 = e107::getInstance(); $frm = e107::getForm(); - - if ($e107->sql->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) + $tp = e107::getParser(); + $sql = e107::getDb(); + + $newsCat = array(); + $sql->db_Select('news_category'); + while($row = $sql->db_Fetch()) + { + $newsCat[$row['category_id']] = $tp->toHTML($row['category_name'],FALSE,'TITLE'); + } + + + if ($sql->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) { $text .= "
@@ -2442,20 +2470,30 @@ class admin_newspost ".NWSLAN_47." + - + + + + + + - + + + + + "; - while ($row = $e107->sql->db_Fetch()) + while ($row = $sql->db_Fetch()) { $buttext = ($row['submitnews_auth'] == 0)? NWSLAN_58 : NWSLAN_103; @@ -2464,18 +2502,30 @@ class admin_newspost $text .= " + + + "; + $text .= $tp->toHTML($row['submitnews_title'],FALSE,'TITLE'); + $text .= ''; + // $text .= [ '.NWSLAN_104.' '.$submitnews_name.' '.NWSLAN_108.' '.date('D dS M y, g:ia', $submitnews_datestamp).']
'; + $text .= " + + "; + + $text .= " + + + + + "; } + + $text .= " -
  ID ".NWSLAN_57."".LAN_OPTIONS."".LAN_DATE."".LAN_AUTHOR."".NWSLAN_6."".NWSLAN_123."".LAN_OPTIONS."
{$row['submitnews_id']} - ".$e107->tp->toHTML($row['submitnews_title'], FALSE, "TITLE")."
".$e107->tp->toHTML($row['submitnews_item'])." -
".date('D jS M, Y, g:ia', $row['submitnews_datestamp'])."ipDecode($row['submitnews_ip'])."'>".$row['submitnews_name']."".$newsCat[$row['submitnews_category']]."".($row['submitnews_auth'] == 0 ? "-" : ADMIN_TRUE_ICON)." -
".NWSLAN_123.": ".(($row['submitnews_auth'] == 0) ? LAN_NO : LAN_YES)."
-
".LAN_DATE.": ".date("D dS M y, g:ia", $row['submitnews_datestamp'])."
-
".NWSLAN_124.": {$row['submitnews_name']}
-
".NWSLAN_125.": {$row['submitnews_email']}
-
".NWSLAN_126.": ".$e107->ipDecode($row['submitnews_ip'])."
-
-
+
+ ".$frm->admin_button("category_view_{$row['submitnews_id']}", NWSLAN_27, 'action', '', array('id'=>false, 'other'=>"onclick=\"expandit('submitted_".$row['submitnews_id']."')\""))." ".$frm->admin_button("category_edit_{$row['submitnews_id']}", $buttext, 'action', '', array('id'=>false, 'other'=>"onclick=\"document.location='".e_SELF."?create.sn.{$row['submitnews_id']}'\""))." ".$frm->admin_button("delete[sn_{$row['submitnews_id']}]", LAN_DELETE, 'delete', '', array('id'=>false, 'title'=>$e107->tp->toJS(NWSLAN_38." [".LAN_NEWS_45.": {$row['submitnews_id']} ]")))."
@@ -2483,10 +2533,23 @@ class admin_newspost
+ "; + $text .= "
"; + $text .= e107::getForm()->batchoptions(array( + 'subdelete_selected' => LAN_DELETE, + 'subcategory' => array('Modify Category', $newsCat) + )); + + + $text .= "
+ + +
"; }