";
echo "";
$show_news_template="templates/news.html";
$date_format="d/m/Y";
$show_news="5";
include_once("inc/database.inc.php");
if (($show_news!="all"))
{
if (isset($start) && !$prev)
{
$start_row=$start;
$start=$start+$show_news;
}
else if (!$start && !$prev)
{
$start=0;
$start_row=0;
}
if ($prev)
{
$start_row=$prev;
$start=$prev-$show_news;
}
if (!$end)
{
$end=$show_news;
}
$limit="Limit $start,$end";
}
$sql="select count(*) from andspyrna_news";
$result=mysql_query($sql,$db);
$myrow=mysql_fetch_array($result);
$num_rows=$myrow[0];
$theid = $_GET['frett'];
$data = fread(fopen($show_news_template, "r"), filesize($show_news_template));
$sql="select n_id, UNIX_TIMESTAMP(n_date) as my_date ,n_title, news, showorhide, pic_link, n_pic, n_newstype, n_reporter, newssource from andspyrna_news order by n_date desc,n_id desc $limit";
$result=@mysql_query($sql,$db);
while ($myrow=mysql_fetch_array($result))
{
$n_id=$myrow["n_id"];
$n_date=date($date_format,$myrow["my_date"]);
$news=$myrow["news"];
$pic_link=$myrow["pic_link"];
$news_hold=explode("\n",$news);
$picture=$myrow["n_pic"];
$n_newstype=$myrow["n_newstype"];
$n_reporter=$myrow["n_reporter"];
$dagsetning=strftime("%e. %B %Y %a.", $myrow["my_date"]);;
$newssource=$myrow["newssource"];
$topic=$myrow["n_title"];
for ($i=0;$i | ";
$stop=$start+$show_news;
if ($stop>$num_rows)
{
$stop=$num_rows;
}
$start_point=$start+1;
$showing=" | "; echo $showing; if ($start!=0) { echo " [Nýja og nýlegar fréttir] "; } if ($num_rows> $stop ) { echo " [Eldri fréttir] "; } echo " |