%PDF- %PDF-
Direktori : /home/dordingu/public_html/iadapt/ |
Current File : /home/dordingu/public_html/iadapt/bloggaddi.inc.php |
<?php include_once("news/database.inc.php"); $date_format="d-m-Y"; $sql="select n_id,UNIX_TIMESTAMP(n_date) as my_date,n_title_eng, news_english, pic_link,n_pic,n_newstype from iadapt_blogg_addi where (CURRENT_DATE-7) < n_date OR CURRENT_DATE = n_date order by n_id desc limit 0,01"; $ofset = 50; $count = 0; $result=mysql_query($sql,$db); // n�tt while (($myrow=mysql_fetch_array($result)) && ($count < 5)) { if (strlen($myrow[news_english]) > $ofset) { $spacepos = strpos($myrow[news_english], " " , $ofset); $abstract = substr($myrow[news_english], 0 , $spacepos); $abstract = "$abstract ...<a href=http://www.dordingull.com/iadapt//bloggaddi.php?n_id=$myrow[n_id] class=sidebartext>[meira]</a>"; } else { $abstract = $myrow[news_english]; } // n�tt - endar $n_id=$myrow["n_id"]; $n_date=date($date_format,$myrow["my_date"]); $news_english=$myrow["news_english"]; $band_hold=explode("\n",$news_english); // FIX fyrir hlj�msveitir for ($i=0;$i<count($band_hold);$i++) { $hold_word=explode(" ",$band_hold[$i]); for ($n=0;$n<count($hold_word);$n++) { if (substr($hold_word[$n],0,4)=="http") { $hold_word[$n]="<a href=".$hold_word[$n]." target=_new>".$hold_word[$n]."</a>"; } else if (strpos($hold_word[$n],"@")) { $hold_word[$n]="<a href=\"mailto:$hold_word[$n]\" target=_new>$hold_word[$n]</a>"; } } $band_hold[$i]=implode(" ",$hold_word); } $news_english=implode("\n",$band_hold); $news_english=nl2br($news_english); $dagsetning=date($date_format,$myrow["my_date"]); echo "<BR><font color=red><B>ADDI:</B></font> <B>$myrow[n_title_eng]</b> - <i>$dagsetning</i></B>"; echo "<BR>$abstract<p></font>"; $count++; } ?>