#################################################################
## MOD Title: Slash News Mod
## MOD Author: CodeMonkeyX < nickyoungso@yahoo.com > (Nicholas Young-Soares) http://www.codemonkeyx.net
## MOD Description: Allows you to assign a news category to any new topic. The
##                  topic can then be displayed as news with a category graphic
##                  like Slashdot.
## MOD Version: 1.0.1
##
## Installation Level: Intermediate
## Installation Time: ~20 Minutes
## Files To Edit: 
##               posting.php,
##               viewforum.php,
##               viewtopic.php,
##               functions_post.php,
##               auth.php,
##               constants.php,
##               functions.php,
##               admin_ug_auth.php,
##               posting_body.tpl,
##               viewforum_body.tpl,
##               page_header.php,
##               overal_header.tpl
## Included Files: 
##               admin_news.php,
##               admin_news_cats.php,
##               functions_news.php,
##               news_body.tpl,
##               news_cat_edit_body.tpl,
##               news_cat_list_body.tpl,
##               news_config_body.tpl,
##               news_200_rss_body.tpl,
##               lang_news.php,
##               news_rss.php,
##               news_topics_body.tpl,
##               news_viewnews.php,
##               news_viewtopics.php
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
##
## Author Notes:
##
##  - Installation Overview:
##      0. BACK UP YOU FORUMS AND DATABASE!!!
##
##      1. Install the mod by following the commands in this file.
##
##      2. Upload some images to use as categories into "images/news".
##
##      3. Create a news posters group, and give them the permission to
##         post news in the forums you want them to.
##         Then add some users to the groups.
##
##      4. From the Admin Control Panel goto the Categories section under
##         News Admin and add some news Categories.
##
##      5. From the Admin Control Panel goto the Configuration section under
##         News Admin and enter your configuration.
##
##  - Upgrade Instructions:
##      There have been quite a few changes since the last beta version that
##      was released. So again you will have to un-install the previous version
##      of the news mod, before you install this version.
##      
##      The templates have changed a little now as well, so if you have made
##      custom templates be sure to check them over to insure that they still
##      work as expected. If they do not then use the default templates as a
##      guide.
##
##      Some good news is that there are no changes to the database structure
##      since BETA6, so your old data should be fine. All you have to do is 
##      add four entries to the phpbb_config table. You can do that by executing
##      the following four SQL commands.
##
##      INSERT INTO phpbb_config ( config_name , config_value ) VALUES ( 'news_rss_item_count', '15' );
##      INSERT INTO phpbb_config ( config_name , config_value ) VALUES ( 'news_rss_show_abstract', '1' );
##      INSERT INTO phpbb_config ( config_name , config_value ) VALUES ( 'news_base_url', '' );
##      INSERT INTO phpbb_config ( config_name , config_value ) VALUES ( 'news_index_file', 'news_index.php' );
##
##  - Getting Started:
##      This mod is pretty stright forward to use, as long as it is installed
##      correctly. When you goto post a message in a "News Enabled" forum you
##      will see a selection box under the message title input box. If you 
##      leave that selection as a "Regular Post" then the post will be just
##      like any other forum post. But if you give it a News Category then it
##      will be considered a News Post.
##     
##      You can view News Posts via the "news_viewnews.php" file. Which gets
##      the News Posts from the forum database, and displays them using the
##      forums templates.
##
##      If you want to change a posts category, or make it a regular post again,
##      then you can simply edit the post and select "Regular Post" from the 
##      selection box.
##
##      - Moving The Index File
##        In version 1.0.1 it is now easier to move the news index file to
##        another location. Just follow a few simple steps.
##          1. Move your news_index.php file to the desired location.
##          2. Rename it to whatever you like.
##          3. In the News Configuration Panel update the "News Mod Base URL"
##             and "News Mod Index File" fields to reflect the new location
##             of the news index file.
##          4. Update "news_index.php" and "templates/subSilver/news.tpl" to
##             fit in with the rest of your site.
##         Remember "news_index.php" is mainly there as a example of what
##         you can do.
##  
##  - Credits
##
##    - Big Thanks to n0ax for his help with adding Pagination, Read More
##      addon's, and the Turkish translation.
##
##    - Thanks a lot TC and lmame for your work in translating the laguage files 
##      for this mod!!!.
##
##    - Thanks to Ca5ey for his Fetch All mods which helped me develop some of 
##      functions in this mod.
##
##    - Credit should also goto acydburn for his great work on the attachment mod.
##      I used that mod to guide me with this mods writing, and used his database
##      install script.
##
#################################################################
##
## MOD History:
##
##  2003-10-3 - Version 1.0.1
##    - Skipped version 1.0.0 because I wanted to add more 
##      functionality, and not just bug fixes.
##    - Complete rewrite of the front end code. It is now
##      much easier to maintain.
##    - Now it is much easier to move the new index page out
##      of the phpBB root directory.
##    - Much better trim functionality:
##      + Now you can use the '<!--break--> delimeter to select 
##        exactly where a post will be trimmed. All the text before
##        the '<!--break--> will be included in the trimmed body.
##      + If no delimiter is found then the smart bbcode trimmer
##        will attempt to trim the post, with out leaving any
##        open bbcode tags.
##    - FIXED: News Category selections are now kept when 
##      previewing a post. (Thanks Wimpy).
##    - Added includes/news.php
##    - Added includes/news_common.php
##    - Added includes/news_data.php
##    - Added template/subSilver/news.tpl
##    - Added news_index.php
##    - Removed functions_news.php, news_viewnews.php, news_body.tpl,
##      news_topics_body.tpl, and news_viewtopics.php.
##    - Added the user group admin changes back to the install instructions
##      so admins have more control of permissions.
##    - Overhalled new_rss.php to take advantage of the new API.
##
##  2003-08-06 - Version 1.0.0 BETA6
##    - install.txt
##        - Spent some time trying to make it "Mod Template" complient.
##        - Added install overview, and getting start instructions to the
##          "Author Notes" section.
##        - General Clean up.
##    - readme_first.txt
##        - Removed file.
##    - mod_table_inst.php
##        - Added these file to simplify installation.
##        - Credit to acydburn, who I borrowed these from.
##    - admin_forumauth.php
##        - Removed all modifications to this file.
##          This makes the install and administration much simplier.
##          Now all authentication is done through user groups.
##    - news_config_body.tpl
##        - Fixed a problem where "news_title_trim" field was not being
##          saved to the database.
##    - functions_post.php
##        - Fixed a problem where $news_category was not getting set.
##
##  2003-07-23 - Version 1.0.0 BETA5
##    - admin_news_cats.php
##        - Removed a function call to phpbb_realpath function, which
##          may have been causing some users problems when administrating
##          news categories.
##
##  2003-05-03 - Version 1.0.0 BETA4
##    - General
##        - Removed copyrighted images.
##
##  2003-03-26 - Version 1.0.0 BETA3
##    - Language Files
##        - Thanks to a few great guys :) the mod now supports several
##          languages:
##            - Chinese Simplified   - translation by TC
##            - Chinese Traditional  - translation by TC
##            - German               - translation by TC
##            - Japanese             - translation by TC
##
##    - n0ax
##        - Turkish translation.
##        - Dark background category images.
##
##    - n0ax and CodeMonkeyX
##        - Added Pagination functionality.
##        - Added Full News post viewing.
##        - Added 'fetch_news_count' function.
##        - Added 'fetch_news_post' function.
##
##    - General
##        - Changed a few files to try to make the mod fully complient
##          with the phpBB Mod Requirements.
##        - Added many new category images. (Thanks TC)
##        - Added "News Admin" section to the admin panel.
##        - Added 'admin_news.php' and 'news_config_body.tpl'
##          this new admin panel allow the forum admin a lot
##          more contol over the mod.
##        - Added 'lang_news.php'
##        - Fixed some typos in the install instuctions for
##          overall_header.tpl.
##        - Removed install language install instructions.
##
##    - readme_first.txt
##        - Updated the overall installation procedure to include new
##          changes.
##
##    - admin_news_cats.php
##        - Modified so that "Catagories" is placed under the "News Admin"
##          in the admin control panel.
##
##    - function_news.php
##        - Added function "fetch_news_count". (n0ax)
##        - Added parameter to "fetch_news_posts". (n0ax)
##
##    - news_rss.php
##        - Updated to read configuration from database.
##
##    - news_viewnews.php
##        - Added Pagination functionality. (n0ax)
##        - Fixed problem where "news_id" was not getting passed.
##        - Updated to read configuration from database.
##
##  2003-02-21 - Version 1.0.0 BETA2
##    - readme_first.txt
##        - Added a short description on how to configure news_rss.php
##    - news_rss.php
##        - Added more configuration options to make it easier to adapt this
##          script to different sites.
##        - Switched to rss V2.0.
##    - admin_news_cats.php
##        - Fixed a problem where a warning message is displayed if no news
##          catagories are in the "news" directory.
##    - posting.php
##        - Fixed a problem where news was not getting posted with some versions
##          of php.
##
##  2003-01-26 - Version 1.0.0 BETA
##    - Overall Changes
##        - Fixed spelling errors.
##        - Added a news link to the forum menu.
##        - General code cleaning.
##        - Renamed "viewnews.php" to "news_viewnews.php"
##        - Added "news_viewtopics.php"
##        - Added "news_topics_body.tpl"
##        - Added more language entries.
##        - Other cosmetic changes.
##    - admin_news_cats.php
##        - Added topic and post count to News Admin panel.
##        - Updated the Edit and Add control panels, so that
##          image lists are sorted.
##        - Fixed delete functionality. Now when you delete a
##          news category all the topics with that news_id
##          have their news_id set to zero.
##        - Added max length to input boxes, so large strings
##          are not inserted into database.
##    - functions_news.php
##        - Added "fetch_recent_news( )"
##        - Added "fetch_recent_categories( )"
##        - Added "fetch_categories( )"
##    - news_viewnews.php and news_body.tpl
##        - Updated to display recent categories, and a link to the
##          view all categories page.
##
##  2003-01-22 - Version 0.1.1
##    - Overall Changes
##        - Updated SQL commands so that "auth_news" field in phpbb_forums defualts
##          to private permission. This should save a lot of time when setting up
##          forums.
##        - Added "news_rss.php" and "rss_body.tpl" which provide a RDF file
##          of the latest news posts. Useful for syndcation of your news on other sites.
##        - Added new high quality news category images (in the news sub-folder.)
##        - Fixed some problems with SQL queries that do not allow for more than 30 categories.
##    - functions_news.php
##        - Updated with the correct smiles path.
##        - Updated dates now uses the forum defualt date format.
##        - Added a new paramater "parse_body" which determines if the message
##          should go through the bbcode parser. (Needed for rss add on).
##        - Added new function "fetch_recent_topics" which just returns the most
##          recent news titles, with no post text, or user infromation.
##        - Fixed problem where topic dates are not displayed from guests.
##    - viewnews.php
##        - Added the ability to only display news posts from a specified category.
##          i.e. "viewnews.php?news_id=4" only displays news from that category.
##        - news_body.tpl
##        - Revamped, now fits in with forum theme much better.
##        - Made news category links clickable, they link to pages that only display
##          news in the same categoy.
##
##  2003-01-20 - Version 0.1.0
##    - First public development release.
##
##  Version 0.0.6
##    - Changed defualts in simple forum permissions the same way as sticky
##      and announcements.
##    - Added more language entries.
##    - Added 'allow_news' and 'news_path' to board configuration.
##    - Updated 'function_news.php' with path variables from board config.
##    - Updated 'posting.php' with path variables from board config.
##    - Updated and checked install instructions.
##    - Plus general code clean up.
##
##  Version 0.0.5
##    - Added 'lang' entries to 'lang_main.php' and 'lang_admin.php'.
##    - Added 'functions_news.php'.
##    - Updated 'viewnews.php' to take advantage of functions_news.php.
##
##  Version 0.0.4
##    - Added 'viewnews.php' this shows that the news tables are working.
##
##  Version 0.0.3
##    - Added 'News Categories View' to admin panel.
##    - Added 'News Categories Add' to admin panel.
##    - Added 'News Categories Edit' to admin panel.
##    - Added 'News Categories Delete' to admin panel.
##
##  Version 0.0.2
##    - Added 'News' section to forum permission control panel.
##    - Added 'News' section to group permission control panel.
##
##  Version 0.0.1
##    - Initial version.
##    - Added database changes.
##    - Added news category dropbox in newtopic posting.
##    - Added news category submitting.
##    - Added news category posting to database.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

# 
# Database Installation: Installing the News Mod Database
#
# Upload these Files, they are only needed for installation: 
#	
#	root/install/mod_table_inst.php              -> install/mod_table_inst.php
#	root/install/schemas/attach_mysql_schema.sql -> install/schemas/attach_mysql_schema.sql
#	root/install/schemas/attach_mysql_basic.sql  -> install/schemas/attach_mysql_basic.sql
#
# Now we want to create the tables, therefore we run mod_table_inst.php 
# (http://www.yoursite.com/phpBB2/install/mod_table_inst.php)
# Please be sure to enter the correct URL, the mod_table_inst.php file 
# has to be placed within the install folder.
#

#
#-----[ COPY ]------------------------------------------
#
copy root/admin/admin_news_cats.php to admin/admin_news_cats.php
copy root/admin/admin_news.php to admin/admin_news.php
copy root/includes/functions_news.php to includes/functions_news.php
copy root/templates/subSilver/news_200_rss_body.tpl to templates/subSilver/news_200_rss_body.tpl
copy root/templates/subSilver/news_body.tpl to templates/subSilver/news_body.tpl
copy root/templates/subSilver/admin/news_cat_edit_body.tpl to templates/subSilver/admin/news_cat_edit_body.tpl
copy root/templates/subSilver/admin/news_cat_list_body.tpl to templates/subSilver/admin/news_cat_list_body.tpl
copy root/templates/subSilver/admin/news_config_body.tpl to templates/subSilver/admin/news_config_body.tpl
copy root/language/lang_english/lang_news.php to language/lang_english/lang_news.php
copy root/news_rss.php to news_rss.php
copy root/templates/subSilver/news_topics_body.tpl to templates/subSilver/news_topics_body.tpl
copy root/news_viewnews.php to news_viewnews.php
copy root/news_viewtopics.php to news_viewtopics.php

#
#-----[ OPEN ]------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------
#
$params = array('submit' => 'post', 'confirm' => 'confirm', 'preview' => 'preview', 'delete' => 'delete', 'poll_delete' => 'poll_delete', 'poll_add' => 'add_poll_option', 'poll_edit' => 'edit_poll_option', 'mode' => 'mode');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$params = array('submit' => 'post',

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 'news_category' => 'news_category',

#
#-----[ FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 t.news_id,

#
#-----[ FIND ]------------------------------------------
#
		$post_data['edit_poll'] = false;
	}

#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN cmx_slash_news_mod
	if( $board_config['allow_news'] && $post_data['first_post'] &&  $is_auth['auth_post'] && 
		($is_auth['auth_news'] || ( $is_auth['auth_mod'] && $mode == 'editpost') ) )
	{
		if( $mode == 'editpost' )
		{
			$post_data['news_id'] = $post_info['news_id'];
		}
		else
		{
			$post_data['news_id'] = 0;
		}
		$post_data['disp_news'] = true;
	}
	else
	{
		$post_data['disp_news'] = false;
	}
// END cmx_slash_news_mod

#
#-----[ FIND ]------------------------------------------
#
// --------------------
//  What shall we do?
//

#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN cmx_slash_news_mod
//
// Get News Categories.
//
if( $userdata['session_logged_in'] && $post_data['disp_news'] )
{
	if ( $mode == 'edit' && empty($post_id) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_post_id']);
	}

 	$sql = 'SELECT n.* FROM ' . NEWS_TABLE . ' n WHERE 1 ORDER BY n.news_category';

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain news data', '', __LINE__, __FILE__, $sql);
	}

	$news_sel = array();
	$news_cat = array();
	while ( $row = $db->sql_fetchrow($result) )
	{
		if( ($news_category > 0 && $news_category == $row['news_id']) || 
		    ($post_data['news_id'] > 0 && $post_data['news_id'] == $row['news_id']) )
		{
				$news_sel = $row;
		}
		
		if( $post_data['news_id'] != 0 && $post_data['news_id'] == $row['news_id'] )
		{
			$news_sel = $row;
		}
		$news_cat[] = $row;
	}
	
	if( $post_data['news_id'] == 0 && $news_category == 0)
	{
		$boxstring = '<option value="0">' . $lang['Regular_Post'] . '</option>';
	}
	else
	{
		$boxstring = '<option value="' . $news_sel['news_id'] .'">' . $news_sel['news_category'] . ' (' . $lang['Current_Selection'] . ')</option>';
		$boxstring .= '<option value="0">' . $lang['Regular_Post'] . '</option>';
	} 

	if( count( $news_cat ) > 0 )
	{
		for( $i = 0; $i < count( $news_cat ); $i++ )
		{
			if( $news_cat[$i]['news_id'] != $post_data['news_id'] )
			{
				$boxstring .= '<option value="' . $news_cat[$i]['news_id'] . '">' . $news_cat[$i]['news_category'] . '</option>';
			}
		}

		$template->assign_block_vars('switch_news_cat', array(
			'L_NEWS_CATEGORY' => $lang['Select_News_Category'],
			'S_NAME' => 'news_category',
			'S_CATEGORY_BOX' => $boxstring
		));
	}
}
// END cmx_slash_news_mod


#
#-----[ FIND ]------------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);

#
#-----[ IN-LINE FIND ]------------------------------------------
#
);

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, $news_category

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN cmx_mod
		$news_label = ( $topic_rowset[$i]['news_id'] > 0 ) ? $lang['News'] . ':' : '';
// END cmx_mod

#
#-----[ FIND ]------------------------------------------
#
'LAST_POST_IMG' => $last_post_url,

#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN cmx_mod
			'L_NEWS' => $news_label,
// END cmx_mod

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$message = make_clickable($message);

#
#-----[ AFTER, ADD ]------------------------------------------
#
	// BEGIN CMX News Mod
	// Strip out the <!--break--> delimiter.
	$delim = htmlspecialchars( '<!--break-->' );
	$pos = strpos( $message, $delim );
	if( ($pos !== false) && ($pos < strlen( $message )) ) {
		$message = substr_replace( $message, html_entity_decode($delim), $pos, strlen($delim) );
	}
	// END CMX News Mod
  
#
#-----[ OPEN ]------------------------------------------
#
includes/auth.php

#
#-----[ FIND ]------------------------------------------
#
$a_sql = 'a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate';

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$a_sql = 'a.auth_view, a.auth_read,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 a.auth_news,

#
#-----[ FIND ]------------------------------------------
#
$auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$auth_fields = array('auth_view', 'auth_read',

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 'auth_news',

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
define('NEWS_TABLE', $table_prefix.'news');

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

# 
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#

	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_news.' . $phpEx);

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)

#
#-----[ IN-LINE FIND ]------------------------------------------
#
)

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, &$news_category

#
#-----[ FIND ]------------------------------------------
#
global $userdata, $user_ip;

#
#-----[ AFTER, ADD ]------------------------------------------
#
// BEGIN cmx_slash_news_mod
	if( isset( $news_category ) && is_numeric( $news_category ) )
	{
		$news_id = intval( $news_category );
	}
	else
	{
		$news_id = 0;
	}
// END cmx_slash_news_mod

#
#-----[ FIND ]---------------------------------------------
# around line 268
$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

#
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 268 (directly in that line)
(topic_title, topic_poster, topic_time, forum_id,

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------
#
 news_id,

#
#-----[ FIND ]---------------------------------------------
# around line 268
$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

#
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 268 (directly in that line)
$current_time, $forum_id,

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------
#
 $news_id,

#
#-----[ FIND ]---------------------------------------------
# around line 268
$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, $news_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";

#
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 268 (directly in that line)
"UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject',

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------
#
 news_id = $news_id,

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
'L_FAQ' => $lang['FAQ'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_NEWS' => $lang['News'],

#
#-----[ FIND ]------------------------------------------
#
'U_FAQ' => append_sid('faq.'.$phpEx),

#
#-----[ AFTER, ADD ]------------------------------------------
#
'U_NEWS' => append_sid($board_config['news_base_url'] . $board_config['news_index_file']),

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forumauth.php

#
#-----[ FIND ]------------------------------------------
#
//                View      Read      Post      Reply     Edit     Delete    Sticky   Announce    Vote      Poll

#
#-----[ IN-LINE FIND ]------------------------------------------
#
Post

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
     News

#
#-----[ FIND ]------------------------------------------
#
	0  => array(AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG),

#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	0  => array(AUTH_ALL, AUTH_ALL, AUTH_ALL,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_MOD,

#
#-----[ FIND ]------------------------------------------
#
	1  => array(AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG),
  
#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	1  => array(AUTH_ALL, AUTH_ALL, AUTH_REG,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_MOD,

#
#-----[ FIND ]------------------------------------------
#
	2  => array(AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG),

#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	2  => array(AUTH_REG, AUTH_REG, AUTH_REG,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_MOD,

#
#-----[ FIND ]------------------------------------------
#
	3  => array(AUTH_ALL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_MOD, AUTH_ACL, AUTH_ACL),
  
#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	3  => array(AUTH_ALL, AUTH_ACL, AUTH_ACL,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_ACL,

#
#-----[ FIND ]------------------------------------------
#
	4  => array(AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_MOD, AUTH_ACL, AUTH_ACL),
  
#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	4  => array(AUTH_ACL, AUTH_ACL, AUTH_ACL,
  
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_ACL,

#
#-----[ FIND ]------------------------------------------
#
	5  => array(AUTH_ALL, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD),
  
#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	5  => array(AUTH_ALL, AUTH_MOD, AUTH_MOD,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_MOD,

#
#-----[ FIND ]------------------------------------------
#
	6  => array(AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD),
  
#
#-----[ IN-LINE FIND ]---------------------------------------------
#
	6  => array(AUTH_MOD, AUTH_MOD, AUTH_MOD,

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 AUTH_MOD,

#
#-----[ FIND ]------------------------------------------
#
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post',

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 'auth_news',

#
#-----[ FIND ]------------------------------------------
#
	'auth_post' => $lang['Post'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'auth_news' => $lang['News'],

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_ug_auth.php

#
#-----[ FIND ]------------------------------------------
#
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post',

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 'auth_news',

#
#-----[ FIND ]------------------------------------------
#
'auth_post' => $lang['Post'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'auth_news' => $lang['News'],

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
	<tr>
	  <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
	  <td class="row2" width="78%"> <span class="gen">
		<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
		</span> </td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	<!-- BEGIN switch_news_cat -->
	<tr>
	  <td class="row1" width="22%"><span class="gen"><b>{switch_news_cat.L_NEWS_CATEGORY}</b></span></td>
	  <td class="row2" width="78%">
	  <select name="{switch_news_cat.S_NAME}">
	  {switch_news_cat.S_CATEGORY_BOX}
	  </select>
	  </td>
	</tr>
	<!-- END switch_news_cat -->

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]---------------------------------------------
# around line 26.
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />

#
#-----[ IN-LINE FIND ]---------------------------------------------
# around line 26.

{topicrow.TOPIC_TYPE}

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
{topicrow.L_NEWS}

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
# around line 235
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp;

#
#-----[ IN-LINE FIND ]------------------------------------------
# around line 235
<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
&nbsp; &nbsp;<a href="{U_NEWS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_NEWS}" hspace="3" />{L_NEWS}</a>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
