Location: PHPKode > projects > Fretsweb > fretsweb-1.2/fretsweb/news.php
<?php

/*
Fretsweb - A Frets on Fire chart server
Copyright (C) 2009  Daan Sprenkels

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 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.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


// Include the common file
require_once "admin/common.php";

// Send headers for content-type
header('Content-Type: text/html; charset=utf-8');

// Include language
require_once "lang/$language.php";


// Write the header
print_header($lang['news']);


// Write the newsfeed link
echo '<h5 align="center"><a href="feed.php">RSS-feed</a></h5>';


// Write the news
echo '<dl>';
// If the feed is disable, set a default of 4, yea just show them
if($feed == 0)
{
	$feedp = 4;
}
else
{
	$feedp = $feed;
}
$sql = "SELECT `title`, `text`, `time` FROM `contest_news` WHERE `priority` >= '$feedp' ORDER BY `time` DESC LIMIT 64";
$query = mysql_query($sql);
while($row = mysql_fetch_assoc($query))
{
	echo '<dt>' . sprintf($lang['name_at_time:'], $row['title'], $row['time']) . '</dt>';
	echo '<dd>' . str_replace("\n", "<br>", $row['text']) . '</dd>';
}
echo '</dl>';


// Write footer
echo "</div>";
include "admin/pagefooter.php";
echo "
</div>
</body>
</html>";


// Close database link
mysql_close( $db_link );

?>
Return current item: Fretsweb