Пример #1
0
     }
     $news_date_posting = gmmktime(gmdate('H'), gmdate('i'), gmdate('s'), $date_month, $date_day, $date_split[2]);
     $sql = "SELECT MAX(news_id) AS max_id\n\t\t\t\tFROM " . XS_NEWS_TABLE;
     $result = $db->sql_query($sql);
     $row = $db->sql_fetchrow($result);
     $max_id = $row['max_id'];
     $next_id = $max_id + 1;
     $sql = "INSERT INTO " . XS_NEWS_TABLE . " (news_id, news_date, news_text, news_display, news_smilies" . ")\n\t\t\t\tVALUES ('" . $next_id . "', '" . $news_date_posting . "', '" . $db->sql_escape($news_item) . "', '" . intval($_POST['news_display']) . "', '" . intval($_POST['news_smilies']) . "')";
     $result = $db->sql_query($sql);
     $db->clear_cache('xs_');
     $message = $lang['n_news_item_added'] . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
     break;
 case 'modnews':
     // Modify a news item in the DB
     $news_item = xsm_prepare_message($news_text);
     $news_date = request_post_var('news_date', '');
     $news_date = empty($news_date) ? create_date($date_format_ae, time(), $config['board_timezone']) : $news_date;
     $date_split = explode('/', $news_date);
     $date_month = $config['xs_news_dateformat'] == 1 ? $date_split[0] : $date_split[1];
     $date_day = $config['xs_news_dateformat'] == 1 ? $date_split[1] : $date_split[0];
     $date_error = $config['xs_news_dateformat'] == 1 ? 'mm/dd' : 'dd/mm';
     if (!checkdate($date_month, $date_day, $date_split[2])) {
         $message = str_replace('dd/mm', $date_error, $lang['xs_news_invalid_date']) . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
         message_die(GENERAL_MESSAGE, $message);
     }
     $news_date_posting = gmmktime(gmdate('H'), gmdate('i'), gmdate('s'), $date_month, $date_day, $date_split[2]);
     $sql = "UPDATE " . XS_NEWS_TABLE . "\n\t\t\t\tSET news_date = " . $news_date_posting . ", news_text = '" . $db->sql_escape($news_item) . "', news_display = " . intval($_POST['news_display']) . ", news_smilies = " . intval($_POST['news_smilies']) . "\n\t\t\t\tWHERE news_id = " . intval($_POST['id']);
     $result = $db->sql_query($sql);
     $db->clear_cache('xs_');
     $message = $lang['n_news_updated'] . '<br /><br />' . sprintf($lang['n_click_return_newslist'], '<a href="' . append_sid('admin_xs_news.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
Пример #2
0
     }
     $xml_feed = xsm_prepare_message($xml_feed);
     $sql = "SELECT MAX(xml_id) AS max_id\n\t\t\t\tFROM " . XS_NEWS_XML_TABLE;
     $result = $db->sql_query($sql);
     $row = $db->sql_fetchrow($result);
     $max_id = $row['max_id'];
     $next_id = $max_id + 1;
     $sql = "INSERT INTO " . XS_NEWS_XML_TABLE . " (xml_id, xml_title, xml_show, xml_feed, xml_is_feed, xml_width, xml_height, xml_font, xml_speed, xml_direction" . ")\n\t\t\t\tVALUES ('" . $next_id . "', '" . $db->sql_escape(request_post_var('xml_title', '', true)) . "', '" . intval($_POST['xml_show']) . "', '" . $db->sql_escape($xml_feed) . "', '" . intval($_POST['xml_is_feed']) . "', '" . $db->sql_escape(request_post_var('xml_width', '')) . "', '" . $db->sql_escape(request_post_var('xml_height', '')) . "', '" . $db->sql_escape(request_post_var('xml_font', '')) . "', '" . $db->sql_escape(request_post_var('xml_speed', '')) . "', '" . intval($_POST['xml_direction']) . "')";
     $result = $db->sql_query($sql);
     $db->clear_cache('xs_');
     $message = $lang['n_xml_news_item_added'] . '<br /><br />' . sprintf($lang['n_xml_click_return_newslist'], '<a href="' . append_sid('admin_xs_news_xml.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
     break;
 case 'modxml':
     // Modify a news ticker in the DB
     $xml_feed = xsm_prepare_message($xml_feed);
     $sql = "UPDATE " . XS_NEWS_XML_TABLE . "\n\t\t\t\tSET xml_title = '" . $db->sql_escape(request_post_var('xml_title', '', true)) . "', xml_show = " . intval($_POST['xml_show']) . ", xml_feed = '" . $db->sql_escape($xml_feed) . "', xml_is_feed = '" . intval($_POST['xml_is_feed']) . "', xml_width = '" . $db->sql_escape(request_post_var('xml_width', '')) . "', xml_height = '" . $db->sql_escape(request_post_var('xml_height', '')) . "', xml_font = '" . $db->sql_escape(request_post_var('xml_font', '')) . "', xml_speed = '" . $db->sql_escape(request_post_var('xml_speed', '')) . "', xml_direction = " . intval($_POST['xml_direction']) . "\n\t\t\t\tWHERE xml_id = " . intval($_POST['id']);
     $result = $db->sql_query($sql);
     $db->clear_cache('xs_');
     $message = $lang['n_xml_news_updated'] . '<br /><br />' . sprintf($lang['n_xml_click_return_newslist'], '<a href="' . append_sid('admin_xs_news_xml.' . PHP_EXT) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . PHP_EXT . '?pane=right') . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
     break;
 case 'deletexml':
     // Show form to delete a news item
     $xml_id = request_var('id', 0);
     $buttonvalue = $lang['Delete'];
     $newmode = 'deletexml';
     $xml_info = xsm_get_info('ticker', $xml_id);
     $name = $news_info['n_news_item'];
     if ($confirm) {
         $sql = "DELETE FROM " . XS_NEWS_XML_TABLE . "\n\t\t\t\t\tWHERE xml_id = {$xml_id}";