include_once ("inc/database.inc.php");
$date_format = "d. m y";
$olddate = date('d. m y', strtotime('-7 day'));
?>
0)
{ echo "GLUGGI Á SAMTÍMANN ";}
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date, n_title, n_type, n_text, n_author from andspyrna_articles where n_type=0 order by n_id asc, n_title
asc";
$result=@mysql_query($sql,$db);
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$n_type=$myrow["n_type"];
$author=$myrow["n_author"];
$n_title=$myrow["n_title"];
if ($author) {
$printauthorname = "(".$author.")";
}
else
{
$printauthorname = " ";
}
if ( $n_date > $olddate ) {
$isthisnew = "- Nýleg grein";
}
else
{
$isthisnew = " ";
}
echo " $myrow[n_title] $printauthorname $isthisnew ";
$count++;
}
?>
0)
{ echo "INNGANGSPUNKTAR ";}
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date, n_title, n_type, n_text, n_author from andspyrna_articles where n_type=1 order by n_type asc";
$result=@mysql_query($sql,$db);
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$n_type=$myrow["n_type"];
$author=$myrow["n_author"];
$n_title=$myrow["n_title"];
if ($author) {
$printauthorname = "(".$author.")";
}
else
{
$printauthorname = " ";
}
if ( $n_date > $olddate ) {
$isthisnew = "- Nýleg grein";
}
else
{
$isthisnew = " ";
}
echo " $myrow[n_title] $printauthorname $isthisnew ";
$count++;
}
?>
0)
{ echo "SAGAN ";}
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date, n_title, n_type, n_text, n_author from andspyrna_articles where n_type=2 order by n_id asc, n_title
asc";
$result=@mysql_query($sql,$db);
if ($n_id ==0)
{ echo "Engar greinar í þessum flokki";}
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$n_type=$myrow["n_type"];
$author=$myrow["n_author"];
$n_title=$myrow["n_title"];
if ($author) {
$printauthorname = "(".$author.")";
}
else
{
$printauthorname = " ";
}
if ( $olddate < $n_date ) {
$isthisnew = "- Nýleg grein";
}
else
{
$isthisnew = " ";
}
echo " $myrow[n_title] $printauthorname $isthisnew ";
$count++;
}
?>
0)
{ echo "ÚR PRENTVÉLINNI ";}
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date, n_title, n_type, n_text, n_author from andspyrna_articles where n_type=3 order by n_id asc, n_title
asc";
$result=@mysql_query($sql,$db);
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$n_type=$myrow["n_type"];
$author=$myrow["n_author"];
$n_title=$myrow["n_title"];
if ($author) {
$printauthorname = "(".$author.")";
}
else
{
$printauthorname = " ";
}
if ( $n_date > $olddate ) {
$isthisnew = "- Nýleg grein";
}
else
{
$isthisnew = " ";
}
echo " $myrow[n_title] $printauthorname $isthisnew ";
$count++;
}
?>
0)
{ echo "AÐRAR GREINAR ";}
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date, n_title, n_type, n_text, n_author from andspyrna_articles where n_type=4 order by n_id asc, n_title
asc";
$result=@mysql_query($sql,$db);
if ($n_id ==0)
{ echo "Engar greinar í þessum flokki";}
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$n_type=$myrow["n_type"];
$author=$myrow["n_author"];
$n_title=$myrow["n_title"];
if ($author) {
$printauthorname = "(".$author.")";
}
else
{
$printauthorname = " ";
}
if ( $n_date > $olddate ) {
$isthisnew = "- Nýleg grein";
}
else
{
$isthisnew = " ";
}
echo " $myrow[n_title] $printauthorname $isthisnew ";
$count++;
}
?>
|