|
From: Jon O. <jon...@us...> - 2008-02-08 23:45:26
|
Update of /cvsroot/mxbb/mx_slash/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15972/admin Modified Files: admin_slash.php admin_slash_cats.php admin_slash_import.php admin_slash_mods.php admin_slash_news.php Log Message: Removing trailing newlines... Index: admin_slash_cats.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/admin/admin_slash_cats.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** admin_slash_cats.php 30 Jan 2004 20:38:19 -0000 1.3 --- admin_slash_cats.php 8 Feb 2008 23:44:49 -0000 1.4 *************** *** 350,352 **** include($mx_root_path . 'admin/' . 'page_footer_admin.'.$phpEx); ! ?> --- 350,352 ---- include($mx_root_path . 'admin/' . 'page_footer_admin.'.$phpEx); ! ?> \ No newline at end of file Index: admin_slash_import.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/admin/admin_slash_import.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_slash_import.php 30 Jan 2004 20:38:19 -0000 1.6 --- admin_slash_import.php 8 Feb 2008 23:44:49 -0000 1.7 *************** *** 74,90 **** { global $db, $board_config; ! $sql = 'SELECT ! count('.TOPICS_TABLE.'.topic_id) from '.TOPICS_TABLE.' left join '.NEWS_PUBLISH_TABLE.' on '.TOPICS_TABLE.'.topic_id = '.NEWS_PUBLISH_TABLE.'.topic_id where '.NEWS_PUBLISH_TABLE.'.topic_id IS NULL'; ! if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Died in fetch number nonnews"); } ! $row = $db->sql_fetchrow($result); ! return $row[0]; } --- 74,90 ---- { global $db, $board_config; ! $sql = 'SELECT ! count('.TOPICS_TABLE.'.topic_id) from '.TOPICS_TABLE.' left join '.NEWS_PUBLISH_TABLE.' on '.TOPICS_TABLE.'.topic_id = '.NEWS_PUBLISH_TABLE.'.topic_id where '.NEWS_PUBLISH_TABLE.'.topic_id IS NULL'; ! if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Died in fetch number nonnews"); } ! $row = $db->sql_fetchrow($result); ! return $row[0]; } *************** *** 114,134 **** message_die(GENERAL_MESSAGE, $message); break; ! case 'add': $sql = 'SELECT topic_title from '.TOPICS_TABLE.' where topic_id='.$topic_id; ! if (!$result = $db->sql_query($sql)) { message_die(GENERAL_MESSAGE, "Error getting topic title"); } ! $row = $db->sql_fetchrow($result); ! $topic_title = $row['topic_title']; ! $template->set_filenames(array("body" => "admin/news_import_add.tpl")); ! $newsCategories = new NewsCategoryCollection(); ! $newsCategories->init(); if( $newsCategories->getNumberCategories() > 0 ) --- 114,134 ---- message_die(GENERAL_MESSAGE, $message); break; ! case 'add': $sql = 'SELECT topic_title from '.TOPICS_TABLE.' where topic_id='.$topic_id; ! if (!$result = $db->sql_query($sql)) { message_die(GENERAL_MESSAGE, "Error getting topic title"); } ! $row = $db->sql_fetchrow($result); ! $topic_title = $row['topic_title']; ! $template->set_filenames(array("body" => "admin/news_import_add.tpl")); ! $newsCategories = new NewsCategoryCollection(); ! $newsCategories->init(); if( $newsCategories->getNumberCategories() > 0 ) *************** *** 143,153 **** } } ! ! ! $hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="savenew">'; $hidden_form_fields .= '<input type="hidden" name="topic_id" value="'.$topic_id.'">'; $hidden_form_fields .= '<input type="hidden" name="post_id" value="'.$post_id.'">'; ! $template->assign_vars(array( 'S_NEWS_ACTION' => append_sid("admin_slash_import.php"), --- 143,153 ---- } } ! ! ! $hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="savenew">'; $hidden_form_fields .= '<input type="hidden" name="topic_id" value="'.$topic_id.'">'; $hidden_form_fields .= '<input type="hidden" name="post_id" value="'.$post_id.'">'; ! $template->assign_vars(array( 'S_NEWS_ACTION' => append_sid("admin_slash_import.php"), *************** *** 159,180 **** 'S_HIDDEN_FIELDS' => $hidden_form_fields ) ! ); ! ! $template->pparse("body"); ! break; ! case 'savenew': $tmp_news = new TempNewsPost(); ! $news_post = new NewsPost(); $news_post->init($tmp_news, '', ''); $news_post->setNewsCategory($news_category); $news_post->setPostId($post_id); ! $news_post->setTopicId($topic_id); ! $news_post->addNews(); ! ! $message = $lang['Import_Updated'] . "<br /><br />" . sprintf( $lang['Click_return_newsimport'], "<a href=\"" . append_sid("admin_slash_import.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); break; --- 159,180 ---- 'S_HIDDEN_FIELDS' => $hidden_form_fields ) ! ); ! ! $template->pparse("body"); ! break; ! case 'savenew': $tmp_news = new TempNewsPost(); ! $news_post = new NewsPost(); $news_post->init($tmp_news, '', ''); $news_post->setNewsCategory($news_category); $news_post->setPostId($post_id); ! $news_post->setTopicId($topic_id); ! $news_post->addNews(); ! ! $message = $lang['Import_Updated'] . "<br /><br />" . sprintf( $lang['Click_return_newsimport'], "<a href=\"" . append_sid("admin_slash_import.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); break; *************** *** 184,188 **** else { ! $sql = 'SELECT '.TOPICS_TABLE.'.topic_id, '.TOPICS_TABLE.'.topic_title, '.TOPICS_TABLE.'.topic_last_post_id, '.POSTS_TABLE.'.post_id --- 184,188 ---- else { ! $sql = 'SELECT '.TOPICS_TABLE.'.topic_id, '.TOPICS_TABLE.'.topic_title, '.TOPICS_TABLE.'.topic_last_post_id, '.POSTS_TABLE.'.post_id *************** *** 194,209 **** '.TOPICS_TABLE.'.topic_first_post_id = '.POSTS_TABLE.'.post_id AND '.NEWS_PUBLISH_TABLE.'.topic_id IS NULL'; ! $num_items = 10; $sql .= ' ORDER BY '.TOPICS_TABLE.'.topic_time DESC LIMIT ' . $start . ', ' . $num_items; ! $result = $db->sql_query($sql); ! $template->set_filenames(array( "body" => "admin/news_import.tpl") ); ! while ($row = $db->sql_fetchrow($result)) { --- 194,209 ---- '.TOPICS_TABLE.'.topic_first_post_id = '.POSTS_TABLE.'.post_id AND '.NEWS_PUBLISH_TABLE.'.topic_id IS NULL'; ! $num_items = 10; $sql .= ' ORDER BY '.TOPICS_TABLE.'.topic_time DESC LIMIT ' . $start . ', ' . $num_items; ! $result = $db->sql_query($sql); ! $template->set_filenames(array( "body" => "admin/news_import.tpl") ); ! while ($row = $db->sql_fetchrow($result)) { *************** *** 213,217 **** ) ); ! } $topics_count = get_number_nonnews(); --- 213,217 ---- ) ); ! } $topics_count = get_number_nonnews(); *************** *** 231,238 **** "S_NEWS_ACTION" => append_sid("admin_slash_import.$phpEx")) ); ! $template->pparse('body'); } ! ?> --- 231,238 ---- "S_NEWS_ACTION" => append_sid("admin_slash_import.$phpEx")) ); ! $template->pparse('body'); } ! ?> \ No newline at end of file Index: admin_slash.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/admin/admin_slash.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_slash.php 3 Nov 2003 22:11:53 -0000 1.4 --- admin_slash.php 8 Feb 2008 23:44:48 -0000 1.5 *************** *** 191,193 **** include('./page_footer_admin.'.$phpEx); ! ?> --- 191,193 ---- include('./page_footer_admin.'.$phpEx); ! ?> \ No newline at end of file Index: admin_slash_news.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/admin/admin_slash_news.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_slash_news.php 30 Jan 2004 20:38:19 -0000 1.6 --- admin_slash_news.php 8 Feb 2008 23:44:50 -0000 1.7 *************** *** 76,81 **** $start ); ! ! $num_items = count($news_items); $topics_count = fetch_news_count( $news_id ); --- 76,81 ---- $start ); ! ! $num_items = count($news_items); $topics_count = fetch_news_count( $news_id ); *************** *** 105,114 **** case 'edit': $template->set_filenames(array("body" => "admin/news_manage_edit.tpl")); ! //$newsObj = new NewsPost($_GET['news_id']); ! $newsCategories = new NewsCategoryCollection(); $newsCategories->init(); ! if( $newsCategories->getNumberCategories() > 0 ) { --- 105,114 ---- case 'edit': $template->set_filenames(array("body" => "admin/news_manage_edit.tpl")); ! //$newsObj = new NewsPost($_GET['news_id']); ! $newsCategories = new NewsCategoryCollection(); $newsCategories->init(); ! if( $newsCategories->getNumberCategories() > 0 ) { *************** *** 121,125 **** $news_select = $newsCategories->getSelectList(); } ! $template->assign_vars(array( 'L_NEWS_CATEGORY' => $lang['Select_News_Category'], --- 121,125 ---- $news_select = $newsCategories->getSelectList(); } ! $template->assign_vars(array( 'L_NEWS_CATEGORY' => $lang['Select_News_Category'], *************** *** 128,135 **** )); } ! $hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $hidden_form_fields .= '<input type="hidden" name="mode" value="save"><input type="hidden" name="news_id" value="'.$_GET['news_id'].'">'; ! $template->assign_vars(array( 'S_HIDDEN_FIELDS' => $hidden_form_fields, --- 128,135 ---- )); } ! $hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $hidden_form_fields .= '<input type="hidden" name="mode" value="save"><input type="hidden" name="news_id" value="'.$_GET['news_id'].'">'; ! $template->assign_vars(array( 'S_HIDDEN_FIELDS' => $hidden_form_fields, *************** *** 140,144 **** ) ); ! $template->pparse("body"); break; --- 140,144 ---- ) ); ! $template->pparse("body"); break; *************** *** 146,158 **** $new_category = $_GET['news_category']; $story = $_GET['news_id']; ! $newsStory = new NewsPost($story); $newsStory->setNewsCategory($new_category); $newsStory->updateCategory(); ! $return_message = $lang['News_Update'] . "<br /><br />" . sprintf($lang['Click_return_newsadmin'], "<a href=\"" . append_sid("admin_slash_news.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! message_die(GENERAL_MESSAGE, $return_message); ! break; --- 146,158 ---- $new_category = $_GET['news_category']; $story = $_GET['news_id']; ! $newsStory = new NewsPost($story); $newsStory->setNewsCategory($new_category); $newsStory->updateCategory(); ! $return_message = $lang['News_Update'] . "<br /><br />" . sprintf($lang['Click_return_newsadmin'], "<a href=\"" . append_sid("admin_slash_news.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); ! message_die(GENERAL_MESSAGE, $return_message); ! break; *************** *** 164,168 **** "body" => "admin/news_manage.tpl") ); ! for ($i = 0; $i < $num_items; $i++) { --- 164,168 ---- "body" => "admin/news_manage.tpl") ); ! for ($i = 0; $i < $num_items; $i++) { *************** *** 174,178 **** ) ); ! } --- 174,178 ---- ) ); ! } *************** *** 192,199 **** "S_NEWS_ACTION" => append_sid("admin_slash_news.$phpEx")) ); ! $template->pparse('body'); } ! ?> --- 192,199 ---- "S_NEWS_ACTION" => append_sid("admin_slash_news.$phpEx")) ); ! $template->pparse('body'); } ! ?> \ No newline at end of file Index: admin_slash_mods.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/admin/admin_slash_mods.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_slash_mods.php 30 Jan 2004 20:38:19 -0000 1.5 --- admin_slash_mods.php 8 Feb 2008 23:44:49 -0000 1.6 *************** *** 75,81 **** { case 'delete': ! NewsModerator::deleteModerator($mod_id); ! $message = $lang['News_Deleted'] . "<br /><br />" . sprintf($lang['Click_return_newsadmin'], "<a href=\"" . append_sid("admin_slash_news.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); --- 75,81 ---- { case 'delete': ! NewsModerator::deleteModerator($mod_id); ! $message = $lang['News_Deleted'] . "<br /><br />" . sprintf($lang['Click_return_newsadmin'], "<a href=\"" . append_sid("admin_slash_news.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); *************** *** 86,90 **** "body" => "admin/news_mods_add.tpl") ); ! $s_hidden_fields = '<input type="hidden" name="mode" value="savenew">'; $template->assign_vars(array( 'S_ACTION' => append_sid("admin_slash_mods.php"), --- 86,90 ---- "body" => "admin/news_mods_add.tpl") ); ! $s_hidden_fields = '<input type="hidden" name="mode" value="savenew">'; $template->assign_vars(array( 'S_ACTION' => append_sid("admin_slash_mods.php"), *************** *** 94,111 **** ) ); ! $template->pparse("body"); break; case 'savenew': $username = $_POST['username']; ! $mod = new NewsModerator(); $mod->NewsModeratorName($username); $mod->addModerator(); ! $message = $lang['Mod_Added'] . "<br /><br />" . sprintf($lang['Click_return_newsmod'], "<a href=\"" . append_sid("admin_slash_mods.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); ! default: break; --- 94,111 ---- ) ); ! $template->pparse("body"); break; case 'savenew': $username = $_POST['username']; ! $mod = new NewsModerator(); $mod->NewsModeratorName($username); $mod->addModerator(); ! $message = $lang['Mod_Added'] . "<br /><br />" . sprintf($lang['Click_return_newsmod'], "<a href=\"" . append_sid("admin_slash_mods.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); message_die(GENERAL_MESSAGE, $message); ! default: break; *************** *** 118,140 **** "body" => "admin/news_mods.tpl") ); ! $sql = 'select count(user_id) from '.NEWS_MODS_TABLE; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $num_mods = $row[0]; ! ! if ($num_mods < 1) { ! echo "No Mods added."; } ! else { $sql = 'select * from '.NEWS_MODS_TABLE; $result = $db->sql_query($sql); ! $mod_arr = array(); while ($row = $db->sql_fetchrow($result)) { ! $template->assign_block_vars('news_mods', array( 'MOD' => NewsModerator::get_username($row['user_id']), --- 118,140 ---- "body" => "admin/news_mods.tpl") ); ! $sql = 'select count(user_id) from '.NEWS_MODS_TABLE; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $num_mods = $row[0]; ! ! if ($num_mods < 1) { ! echo "No Mods added."; } ! else { $sql = 'select * from '.NEWS_MODS_TABLE; $result = $db->sql_query($sql); ! $mod_arr = array(); while ($row = $db->sql_fetchrow($result)) { ! $template->assign_block_vars('news_mods', array( 'MOD' => NewsModerator::get_username($row['user_id']), *************** *** 144,149 **** } } ! ! $template->assign_vars(array( --- 144,149 ---- } } ! ! $template->assign_vars(array( *************** *** 159,166 **** "S_NEWS_ACTION" => append_sid("admin_slash_mods.php?mode=add")) ); ! $template->pparse('body'); } ! ?> --- 159,166 ---- "S_NEWS_ACTION" => append_sid("admin_slash_mods.php?mode=add")) ); ! $template->pparse('body'); } ! ?> \ No newline at end of file |