Просмотр файла script/news_read.php

Размер файла: 2.07Kb
<?php
/*-----------------------------------------------------------------------------------------
mcGalleryPRO
All code is © 2003 Marc Cagninacci.
No files may be redistributed in whole or significant part.
----------------- mcgalleryPRO IS NOT FREE SOFTWARE -------------------
You should have receive a file called license.txt in this package
--------------------------------------------------------------------------------------------*/

$query = "SELECT * FROM mcgallery_news ORDER BY datenews DESC, idnews DESC LIMIT 0,10";
$res = mysql_query($query);
if (mysql_num_rows($res) > 0) { $boxtitle = $l_News; }

echo '<table border="0" align="center" class="td1" cellspacing="1" cellpadding="3" width="60%">';
echo '<tr><td class="td0" colspan="2">&nbsp;&nbsp;&nbsp;<font size="2">'.$boxtitle.'</font></td></tr>';

while ($rown = mysql_fetch_array($res))
{
	list($y, $m, $d) = split('-', $rown['datenews']);
	if ($datepref == 'fr') $datedis = $d.'/'.$m.'/'.$y;
	elseif ($datepref == 'en') $datedis = $m.'/'.$d.'/'.$y;
	else $datedis = $rown['datenews'];

 if ($rown['idnews'] == $news) { $fleche = 'bas.gif'; $bold = '<b>'; $Fbold = '</b>'; }
 else  { $fleche = 'droit.gif'; $bold = ''; $Fbold = ''; }
 echo '<tr><td class="td1"><a href="index.php?news='.$rown['idnews'].'"><img src="images/'.$fleche.'" border="0" alt=""></a></td>';
 echo '<td class="td2" width="100%"><font size="1">';
 echo '<a href="index.php?news='.$rown['idnews'].'" class="lien1">'.$bold.$datedis.'&nbsp;-&nbsp;'.stripslashes($rown['titlenews']).$Fbold.'</a></font></td></tr>';
 if ($rown['idnews'] == $news) 
 {
 echo '<tr><td class="td2" colspan="2"><font size="1">'.nl2br(stripslashes($rown['textnews']));
 echo '<br><a href="'.$rown['linkurl'].'" class="lien1"><b>'.stripslashes($rown['linktext']).'</b></a></font></td></tr>';
 }
}
echo '<tr><td class="td1" colspan="2" height="3"></td></tr>';
echo '<tr><td class="td2" colspan ="2" align="center"><font size="1">';
echo stripslashes($wellcome).'</font></td></tr>'; 
echo '<tr><td class="td0" colspan="2">&nbsp;</td></tr>';
echo '</table>';

?>