toDB($_POST['newsfeed_name']); $feed['newsfeed_description'] = $tp->toDB($_POST['newsfeed_description']); $feed['newsfeed_image'] = $tp->toDB($_POST['newsfeed_image'])."::".intval($_POST['newsfeed_showmenu'])."::".intval($_POST['newsfeed_showmain']); $feed['newsfeed_url'] = $tp->toDB($_POST['newsfeed_url']); $feed['newsfeed_active'] = intval($_POST['newsfeed_active']); $feed['newsfeed_updateint'] = intval($_POST['newsfeed_updateint']); $feed['newsfeed_data'] = ''; // Start with blank data feed $feed['newsfeed_timestamp'] = 0; // This should force an immediate update if (isset($_POST['createFeed'])) { if ($sql->insert('newsfeed',$feed)) { $admin_log->logArrayAll('NEWSFD_01', $feed); $mes->addSuccess(LAN_CREATED); } else { $mes->addError(LAN_CREATED_FAILED.': '.$sql->mySQLerror); } } elseif (isset($_POST['updateFeed'])) { if ($sql->insert('newsfeed',$feed, " WHERE newsfeed_id=".intval($_POST['newsfeed_id']))) { $admin_log->logArrayAll('NEWSFD_02', $feed); $mes->addSuccess(LAN_UPDATED); } else { $mes->addInfo(LAN_NO_CHANGE.': '.$sql->mySQLerror); } } $e107->ecache->clear(NEWSFEED_LIST_CACHE_TAG); // This should actually clear all the newsfeed data in one go } else { $mes->addError(LAN_REQUIRED_BLANK); } } $ns->tablerender($caption, $mes->render() . $text); if($action == "delete") { $sql->db_Delete('newsfeed', 'newsfeed_id='.$id); $admin_log->log_event('NEWSFD_03','ID: '.$id,E_LOG_INFORMATIVE,''); $mes->addSuccess(LAN_DELETED); } $ns->tablerender($caption, $mes->render() . $text); if($headline_total = $sql->db_Select("newsfeed")) { $nfArray = $sql->rows(); $text = " \n"; $active = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21); foreach($nfArray as $newsfeed) { extract($newsfeed); // FIXME $text .= " "; } $text .= "
".LAN_ID." ".LAN_NAME." ".NFLAN_26." ".NFLAN_12." ".LAN_OPTIONS."
$newsfeed_id $newsfeed_name ".($newsfeed_updateint ? $newsfeed_updateint : "3600")." ".$active[$newsfeed_active]." ".ADMIN_EDIT_ICON." ".ADMIN_DELETE_ICON."
"; } else { $mes->addInfo(NFLAN_41); } $ns->tablerender(NFLAN_07, $mes->render(). $text); if($action == "edit") { if($sql->select("newsfeed", "*", "newsfeed_id=$id")) { $row = $sql->fetch(); extract($row); // FIX list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image); } } else { unset($newsfeed_showmenu, $newsfeed_showmain, $newsfeed_name, $newsfeed_url, $newsfeed_image, $newsfeed_description, $newsfeed_updateint, $newsfeed_active); } $text = "
\n
".LAN_NAME." ".$frm->text('newsfeed_name', $newsfeed_name, '200')."
".LAN_URL." ".$frm->text('newsfeed_url', $newsfeed_url, '250')."".NFLAN_10."
".NFLAN_11." ".$frm->text('newsfeed_image', $newsfeed_image, '200') /* TODO imagepicker? */."".NFLAN_17."
".LAN_DESCRIPTION." ".$frm->text('newsfeed_description', $newsfeed_description, '200')."".NFLAN_37."
".NFLAN_18." ".$frm->number('newsfeed_updateint',($newsfeed_updateint ? $newsfeed_updateint : 3600),5)."".NFLAN_19."
".NFLAN_12." "; $array = array(NFLAN_13,NFLAN_14,NFLAN_20,NFLAN_21); $text .= $frm->radio('newsfeed_active', $array, ($newsfeed_active ? $newsfeed_active : 0), true, NFLAN_22)."
".NFLAN_45." ".$frm->number('newsfeed_showmenu', $newsfeed_showmenu ,5)."".NFLAN_47."
".NFLAN_46." ".$frm->number('newsfeed_showmain', $newsfeed_showmain ,5)."".NFLAN_47."
".$frm->admin_button(($action == "edit" ? "updateFeed" : "createFeed"),($action == "edit" ? LAN_UPDATE : LAN_CREATE),'update')."
".($action == "edit" ? "" : "")."
"; $ns->tablerender(NFLAN_09, $mes->render() . $text); require_once(e_ADMIN."footer.php"); ?>