foreach($_REQUEST as $k => $v) ${$k} = $v;
$months = array('01'=>'كانون2','02'=>'شباط','03'=>'آذار','04'=>'نيسان','05'=>'أيار','06'=>'حزيران',
'07'=>'تموز','08'=>'آب','09'=>'أيلول','10'=>'تشرين1','11'=>'تشرين2','12'=>'كانون1');
include("head.php");
$result = mysql_query("SELECT Count(*) FROM News") or die(mysql_error());
$row = mysql_fetch_row($result);
$TotNews = $row[0];
$query = "SELECT Value FROM Configs WHERE Name='ItemPerPage'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_row($result);
$ItemPerPage = $row[0];
$pgs = ceil($TotNews/$ItemPerPage);
if ( !$pg ) $pg = 1;
$nextpg = $pg+1;
$prevpg = $pg-1;
$end = $pg * $ItemPerPage;
$start = $end - $ItemPerPage +1;
if ( $end > $TotNews ) $end = $TotNews;
?>
|
أخبار المركز |
|
(- من أصل }?> خبر) |
|
if ( $TotNews )
{
$SQLSTART = $start-1;
$result = mysql_query("SELECT News,URL,ImgType,Details,Featured,Date,NewsID FROM News Order By Date DESC LIMIT $SQLSTART,$ItemPerPage") or die(mysql_error());
while ($row = mysql_fetch_row($result))
{
$News = stripslashes($row[0]);
$URL = stripslashes($row[1]);
$ImgType = stripslashes($row[2]);
$Details = stripslashes($row[3]);
$Featured = stripslashes($row[4]);
$Date = stripslashes($row[5]);
$NewsID = intval($row[6]);
$DateArr = explode(" ", $Date);
list($Y,$M,$D)= explode("-",$DateArr[0]);
$FinalDate = $D.'-'.$months[$M].'-'.$Y;
$DetailsLines = explode("\n", $Details);
$Details = $DetailsLines[0]." ";
if (isset($DetailsLines[1])) $Details .= $DetailsLines[1]." ";
?>
|
";?>
|
|
|
}
}
?>
|
|
include("tail.php")
?>