Просмотр файла id2764/upgrade/listnews.php

Размер файла: 2.42Kb
<?
include("configure.php");

$table_name = "ns_display";

$connection = @mysql_connect("$db_server", "$db_name", "$db_password") or die("Couldn't connect.");

$db = @mysql_select_db($db_database, $connection) or die("Couldn't select database.");

$sql = "SELECT bsize, bcolor, titlebgcolor, titletextcolor, msgbgcolor, msgtextcolor, hldatecolor, titletextsize, datelinetextsize, msgtextsize, newswidth
     FROM $table_name
";

$result = @mysql_query($sql, $connection) or die("Couldn't execute query.");

while ($row = mysql_fetch_array($result)) {

$bsize = $row['bsize'];
$bcolor = $row['bcolor'];
$titlebgcolor = $row['titlebgcolor'];
$titletextcolor = $row['titletextcolor'];
$msgbgcolor = $row['msgbgcolor'];
$msgtextcolor = $row['msgtextcolor'];
$hldatecolor = $row['hldatecolor'];
$titletextsize = $row['titletextsize'];
$datelinetextsize = $row['datelinetextsize'];
$msgtextsize = $row['msgtextsize'];
$newswidth = $row['newswidth'];
}

$table_name5 = "ns_news";

$connection5 = @mysql_connect("$db_server", "$db_name", "$db_password") or die("Couldn't connect.");

$db5 = @mysql_select_db($db_database, $connection5) or die("Couldn't select database.");

$sql5 = "SELECT title, postby, hldate, id, item, email, timestamp, today
     FROM $table_name5
     ORDER BY timestamp DESC
";

$result5 = @mysql_query($sql5, $connection5) or die("Couldn't execute query.");

while ($row5 = mysql_fetch_array($result5)) {

$title = $row5['title'];
$postby = $row5['postby'];
$hldate = $row5['hldate'];
$delown5 = $row5['delown'];
$id = $row5['id'];
$item = $row5['item'];
$email = $row5['email'];
$timestamp = $row5['timestamp'];
$today = $row5['today'];

$listnews .= "
<p>
<table border=\"$bsize\" bordercolor=\"$bcolor\" cellpadding=0 cellspacing=0 style=\"border-collapse: collapse\" width=$newswidth>
 <tr bgcolor=\"$titlebgcolor\">
 <td>
 <b><a name=\"$id\"><font color=\"$titletextcolor\" size=\"$titletextsize\">$title</font></a></b>
 <br><font size=\"$datelinetextsize\" color=\"$hldatecolor\">posted by <a href=\"MAILTO:$email\">$postby</a> on $today</font>
 </td>
 </tr>
     <tr bgcolor=\"$msgbgcolor\">
     <td>
     <font size=\"$msgtextsize\" color=\"$msgtextcolor\">
     $item
     </font>
     </td>
     </tr>
</table>
</P>
";

}

echo $listnews;

echo "<font size=$datelinetextsize><a href=\"http://www.hammer-time.net/files/download.php?dl=ns\">News by News Stream</a></font>";
?>