%PDF- %PDF-
Direktori : /home/dordingu/www/vigspa/ |
Current File : /home/dordingu/www/vigspa/top.php |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Vígspá</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="refresh" content="120;URL="> </head> <body bgcolor="#E5E5E5"> <div align="center"> <br> <?php echo "<table width=100%>"; echo "<tr><td align=left>"; //include("news/setup.inc"); include_once("news/database.inc.php"); //--------------------------- $show_news="1"; $show_quote="templates/quote.html"; $time_offset="+5"; // user supplys a time zone off set for there server. function time_zone($time_offset) { $offset=substr($time_offset,0,1); switch ($offset){ case "+": $time_offset=str_replace("+","",$time_offset); $now=time()+($time_offset*3600); break; case "-": $time_offset=str_replace("-","",$time_offset); $now=time()-($time_offset*3600); break; default: $now=time(); break; } return $now; } //------------------ $sql="select count(*) from vigspa_quote"; $result=mysql_query($sql,$db); $myrow=mysql_fetch_array($result); $num_rows=$myrow[0]; $data = fread(fopen($show_quote, "r"), filesize($show_quote)); $sql="select * from vigspa_quote ORDER BY RAND() limit 0,01"; $result=@mysql_query($sql,$db); while ($myrow=mysql_fetch_array($result)) { $n_id=$myrow["n_id"]; $n_date=date($date_format,$myrow["my_date"]); $quotetext=$myrow["quotetext"]; $news_hold=explode("\n",$quotetext); $quoteauthor=$myrow["quoteauthor"]; for ($i=0;$i<count($news_hold);$i++) { $hold_word=explode(" ",$news_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].""; } else if (strpos($hold_word[$n],"@")) { $hold_word[$n]="<a href=\"mailto:$hold_word[$n]\" target=_new>$hold_word[$n]</a>"; } } $news_hold[$i]=implode(" ",$hold_word); } $quotetext=implode("\n",$news_hold); $quotetext=nl2br($quotetext); if (!$end_date) { $end_date=""; } $hold=$data; $hold=str_replace("{DATE}",$n_date,$hold); $hold=str_replace("{quote}",$quotetext,$hold); $hold=str_replace("{NUMER}",$n_id,$hold); $hold=str_replace("{author}",$quoteauthor,$hold); echo $hold; } echo ""; echo ""; ?> <p> </p></div> </body> </html>