Location: PHPKode > projects > MyNews > mynews/news.php
<?php
// ----------------------------------------------------------------------
// MyNews
// Copyright (C) 2004 by Frank Mancuso Aka crash4o4
// https://sourceforge.net/projects/mynews/
// http://frankmancuso.ca
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: Frank Mancuso aka crash4o4
// Purpose of file:
// ----------------------------------------------------------------------



function news()
{
	include("mysql.php");
	include("config.php");
	include("bbcode.php");
	
	$db2 = new db;
	$db2->info['sql_host']		=	$conf['sql_host'];
	$db2->info['sql_user']		=	$conf['sql_user'];
	$db2->info['sql_pass']		=	$conf['sql_pass'];
	$db2->info['sql_db']		=	$conf['sql_db'];
	$db2->connect();
	
	$sql = "SELECT * FROM mynews_news WHERE Active='1' ORDER BY Post_Date DESC LIMIT 0,$News_Size ";
	$return = $db2->query($sql);
	
	while ( $row = mysql_fetch_array($return) )
	{?>
	
	<div style="width:450px;">
	<h3><?php echo @stripslashes($row[News_Title]); ?></h3>
	
	<p>
	<?php 
	$Text =  @stripslashes($row[News_Body]); 
	$mytext = BBcode($Text);
	echo $mytext;
	?>
	</p>
	
	<p>
	<?php
	@$News_Body_Extend = stripslashes($row[News_Body_Extend]);
	if ($News_Body_Extend != NULL )
	{
		echo "<p><a href=\"?news_id=$row[news_id]&Read=Full\">Read More</a></p>";
	}
	
	@$Read = $_GET[Read];
	
	if ($Read == "Full")
	{
		$Text2 = $row[News_Body_Extend];
		$mytext2 = BBcode($Text2);
		echo $mytext2;
	}
	?>
	</p>
	
	
	<p><b>Posted On:</b><?php echo @$row[Post_Date]; ?></p>
	<p>&nbsp;</p>
	</div>
	
	<?php }
	
} // end of function news



?>
Return current item: MyNews