Hvað er Anarkismi? Útgáfa Bókasafn Dreifing Hafa Samband
Fréttir / Uppfærslur Greinar Bækur um Anarkisma TenglarMyndir

"; echo ""; echo "
"; 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".$hold_word[$n].""; } else if (substr($hold_word[$n],0,4)=="www.") { $hold_word[$n]="".$hold_word[$n].""; } else if (strpos($hold_word[$n],"@")) { $hold_word[$n]="$hold_word[$n]"; } } $news_hold[$i]=implode(" ",$hold_word); } $news=implode("\n",$news_hold); $news=nl2br($news); $hold=$data; $hold=str_replace("{start_date}",$dagsetning,$hold); $hold=str_replace("{end_date}",$end_date,$hold); $hold=str_replace("{news}",$news."",$hold); $hold=str_replace("{news_number}",$n_id,$hold); $hold=str_replace("{topic}",$topic,$hold); $hold=str_replace("{n_reporter}",$n_reporter,$hold); $hold=str_replace("{newssource}",$newssource,$hold); if ($picture) { if ($pic_link) { $hold=str_replace("{picture}","",$hold); } else { $hold=str_replace("{picture}","",$hold); } } else { $hold=str_replace("{picture}","",$hold); } echo $hold; } echo "
"; $stop=$start+$show_news; if ($stop>$num_rows) { $stop=$num_rows; } $start_point=$start+1; $showing="Fréttir $start_point - $stop af $num_rows
"; echo $showing; if ($start!=0) { echo " [Nýja og nýlegar fréttir] "; } if ($num_rows> $stop ) { echo " [Eldri fréttir] "; } echo "
"; ?>