Location: PHPKode > projects > news-tnk > news-tnk/php3/include/news_show.php3
<?
// news-tnk v1.2.3 php3
//by Thierry Nkaoua hide@address.com

if(!isset($news_init))$news_init=0;
?>

<center>
<!--news-tnk v1.2.3-->
<br>
<a name="newstag"><font size="+1">
<? if($news_init==1){
print("$max_news $talk[0]");
}else{
print("$talk[11]");
}?></font>
</a>
<br><br>

<a href="news_post.php3" target="_blank"><? print("$talk[3]");?></a>
<br><br>
<?
mysql_connect ($dbhost, $username, $password);
mysql_select_db ($database);
$result=mysql_query("SELECT * FROM news_list WHERE valid=1");
$news_full=mysql_num_rows($result)-1;
if($news_init<0 || $news_init > $news_full) $news_init=0;
$result=mysql_query("SELECT * FROM news_list WHERE valid=1 ORDER BY id DESC LIMIT $news_init,$max_news");


while($news=mysql_fetch_array($result)){
$namex= $news["name"];
$msgx= $news["msg"];
$titlex=$news["title"];
$datex=strftime("%d %B %Y, %H:%M", $news["date"]);
$emailx=$news["email"];
$webx=$news["web"];
$webx=strip_tags($webx);
$msg_modx=$news["msg_mod"];
$date_mod=strftime("%d %B %Y, %H:%M", $news["date_mod"]);
?>
<table border="1" cellspacing="5" cellpadding="5" width="80%">
<tr class="row">
<td>
<?
print("$talk[4]: $titlex<br>\n");
print("$talk[5]: <a href=\"mailto:$emailx\">$namex</a>&nbsp;&nbsp;\n");
if($webx!=""){
print("<a href=\"http://$webx\" target=_blank>$webx</a><br>\n");
}
print("$datex <hr>\n");
print("$msgx<hr>\n");
?>
</td>
</tr>
<tr class="row1">
<td>
<?
print("$talk[6] $date_mod\n");
if ($msg_modx!=""){
print("<hr><b>$talk[7]</b><br>$msg_modx\n");
}

?>
</td>
</tr>
</table>
<br>
<? } ?>

<br>
<table width="50%">
<tr align=center>
<?
$news_init_new=max($news_init-$max_news,0);
if($news_init!=0){
?>
<td>
<a href="
<? print("$PHP_SELF?news_init=$news_init_new#newstag"); ?>">
<img src="icons_board/left.jpg" alt="left" width=40 height=40 border=0></img>
</a>
</td>

<? }
$news_init_new=min($news_init+$max_news,$news_full);

if($news_init+$max_news<=$news_full){
?>
<td>
<a href="
<? print("$PHP_SELF?news_init=$news_init_new#newstag"); ?>">
<img src="icons_board/right.jpg" width=40 height=40 border=0 alt="right"></img>
</a>
</td>
<? } ?>
</tr>
</table>


</center>
Return current item: news-tnk