<?php

require_once("/home/wwwroot/lib/sql.inc.php");
require_once("/home/wwwroot/lib/time.inc.php");
require_once('/home/wwwroot/lib/security.inc.php');


# _GenerateHtmlHeaderNews( $Date )
# _GenerateTopSearchFieldNews( $Date )
# _GenerateNewsOverviewNews( $date, $limit )


function title_plus( $string ){

	$string = deleteSpecialCharsNews($string); # sonderzeichen entfernen
	$string = preg_replace('/\s\s+/', '+', $string);
	$string = preg_replace('/\++/', '+', $string);
	$string = ereg_replace("[ \t\n\r]+", "+", $string);  
		
	$tmp  = $string;
	$flet = substr($tmp, 0,1); # get first char
	$last = $tmp[strlen($tmp)-1]; # get last char

	if ( preg_match("/\+/", $flet ) ) {
		#echo "PLus sign in front\n";
		$string = substr($string, 1);
	};

	if ( preg_match("/\+/", $last ) ) {
		#echo "PLus sign at last\n";
		$string = substr_replace($string ,"",-1); # remove last char from string
	};

	return $string;

}; # function title_plus( $string ){


function JahrBack( $Date ){

	list($day,$mon,$year)	= explode("-", $Date );
	$mon_digit				= TransferMonthNameToDigit( $mon, "en" );
	
	$CurrentDate			= $day.$mon_digit;
	$EndDate				= "3112";

	if ( $mon_digit == "01" && $day == "01" ){
		
		if ( $EndDate > $CurrentDate ) {
			return 1;
		} else {
			return 0;
		};

	} else {
		return 0;

	};# if ( $mon_digit == "01" && $day == "01" ){

}; # function JahrBack( $Date ){


function JahrNext( $Date ){

	list($day,$mon,$year)	= explode("-", $Date );
	$mon_digit				= TransferMonthNameToDigit( $mon, "en" );
	
	$CurrentDate			= $day.$mon_digit;
	$EndDate				= "0101";

	#echo "$CurrentDate > $EndDate";
	if ( $mon_digit == "12" && $day == "31" ){
		
		if ( $CurrentDate > $EndDate ) {
			return 1;
		} else {
			
			return 0;
		};

	} else {
		
		return 0;

	}; # if ( $mon_digit == "12" && $day == "31" ){

}; # function JahrNext( $Date ){


function pfeileBack( $Date ){

	# aktuelles datum zusammensetzen
	$d = date("d");	
	$m = date("m");	
	$y = date("Y");	


	$StartDate				= "01.01.2007";
	$EndDate				= "$d.$m.$y";

	list($day,$mon,$year)	= explode("-", $Date );
	$mon_digit				= TransferMonthNameToDigit( $mon, "en" );
	
	#if ( strlen($day) == 1 ){
	#	$day = "0$day";
	#};

	$CurrentDate			= "$day.$mon_digit.$year";

	list($d1,$m1,$y1)		= explode(".", $StartDate );
	$StartDate				= "$y1.$m1.$d1";
	list($d2,$m2,$y2)		= explode(".", $EndDate );
	$EndDate				= "$y2.$m2.$d2";
	list($d3,$m3,$y3)		= explode(".", $CurrentDate );
	$CurrentDate			= "$y3.$m3.$d3";

	$StartDate				= str_replace(".","",$StartDate);
	$EndDate				= str_replace(".","",$EndDate);
	$CurrentDate			= str_replace(".","",$CurrentDate);

	# echo "Cur: $CurrentDate | Start: $StartDate | End: $EndDate<br>";

	if ( $CurrentDate <= $StartDate ){	 # wenn aktuelles Datum kleiner gleich dem minimalen datum ist
				
		#echo "0:: $CurrentDate <= $StartDate";
		return 0;

	} elseif ( $CurrentDate > $StartDate ){	# wenn aktuelles datum gr��er/akuteller als das minimale datum ist

		#echo "1:: $CurrentDate > $StartDate";
		return 1;

	}; # if ( $CurrentDate <= $StartDate ){


}; # function pfeileBack( $Date ){


function pfeileNext( $Date ){

	# aktuelles datum zusammensetzen
	$d = date("d");	
	$m = date("m");	
	$y = date("Y");	


	$StartDate				= "01.01.2007";
	$EndDate				= "$d.$m.$y";

	list($day,$mon,$year)	= explode("-", $Date );
	$mon_digit				= TransferMonthNameToDigit( $mon, "en" );
	
#	if ( strlen($day) == 1 ){
#		$day = "0$day";
#	};

	$CurrentDate			= "$day.$mon_digit.$year";

	list($d1,$m1,$y1)		= explode(".", $StartDate );
	$StartDate				= "$y1.$m1.$d1";
	list($d2,$m2,$y2)		= explode(".", $EndDate );
	$EndDate				= "$y2.$m2.$d2";
	list($d3,$m3,$y3)		= explode(".", $CurrentDate );
	$CurrentDate			= "$y3.$m3.$d3";

	$StartDate				= str_replace(".","",$StartDate);
	$EndDate				= str_replace(".","",$EndDate);
	$CurrentDate			= str_replace(".","",$CurrentDate);

	# echo "Cur: $CurrentDate | Start: $StartDate | End: $EndDate<br>";

	if ( $CurrentDate <= $StartDate || $CurrentDate > $EndDate ){ # wenn aktuelles Datum kleiner gleich dem minimalen datum ist ODER aktuelle datum gr��er als das enddatum ist
				
		#echo "0:: $CurrentDate <= $StartDate || $CurrentDate > $EndDate";
		return 0;

	} elseif ( $CurrentDate < $EndDate ){	# wenn aktuelles datum kleiner/gleich als das enddatum ist

		#echo "1:: $CurrentDate <= $EndDate";
		return 1;

	}; # if ( $CurrentDate <= $StartDate ){


}; # function pfeileNext( $Date ){



function _GenerateNewsOverviewNews( $Date, $limit ){

	$tmp			= explode('-',$limit);
	$from			= $tmp[0];
	$to				= $tmp[1];

	$DayBefore		= GetLetterDateForNewsLinkFromDateMinusEN( $Date, '1');	
	$DayBefore		= TransferGetMonthYearLong( $DayBefore, 'en' );
	$NextDay		= GetLetterDateForNewsLinkFromDatePlusEN($Date, '1');
	$NextDay		= TransferGetMonthYearLong( $NextDay, 'en' );
		
	# echo "BACK: " . pfeileBack( $Date );
	# echo "NEXT: " . pfeileNext( $Date );
	# echo "$Date   " .JahrBack( $Date );
	# echo "$Date   " .JahrNext( $Date );

	if ( JahrBack( $Date ) == 1 ) {
		list($d,$m,$y) = explode("-", $DayBefore );
		$y -= 1;
		$DayBefore = "$d-$m-$y";
	};

	if ( JahrNext( $Date ) == 1 ) {
		list($d,$m,$y) = explode("-", $NextDay );
		$y += 1;
		$NextDay = "$d-$m-$y";
	};
	
	$list			= explode(",", $Date );
	$list			= explode('-', $list[0] );			# date= 12-m�rz-2006 --- Date vom gew�nschten, parameter �bergebenen $Date
	$Year			= $list[2];
	list(,$endung)	= explode("-$Year",$_SERVER["REQUEST_URI"]);

	$Back = "<a href=\"http://www.zoozle.org/torrent-rapidshare-download-english/$DayBefore$endung\" title=\"Yesterday - eMule Bit Torrent News\"> &lt;&lt;&lt; </a> &nbsp;&nbsp;&nbsp;";
	$Next = "<a href=\"http://www.zoozle.org/torrent-rapidshare-download-english/$NextDay$endung\" title=\"Tomorrow - eMule Bit Torrent News\"> &gt;&gt;&gt; </a>";

	if ( pfeileBack( $Date ) == 0 ) {
		$Back = "";
	};

	if ( pfeileNext( $Date ) == 0 ) {
		$Next = "";
	};


	echo <<<END
		<center>
		<p>&nbsp;</p>

		</p>
		<p>
		<span lang="en" align="center">
			<b>
				
				$Back &nbsp;&nbsp;&nbsp;
				$Next
				<a name="top"></a>
			</b>
		</span>
		</p>
		<p>&nbsp;</p>
		
		<span lang="en">
		<a href="#top" name="#top"></a>
		<table width="550" cellspacing="0" cellpadding="0" id="news-searchlinks">

END;

	if ( strcasecmp( $_SESSION['LANG'] , "de") == 0 ) {
		$language = "de";
	} elseif ( strcasecmp( $_SESSION['LANG'] , "en") == 0 ) {
		$language = "en";
	} elseif ( strcasecmp( $_SESSION['LANG'] , "") == 0 ) {
		$language = "en";
	} else {
		$language = "en";
	};

	$SqlDate	= ConvertNormalDateToSQLDate( $Date, 'en' );
	$count		= 0;
	$table		= TORRENT_NEWS;

	for ( $i=$from; $i<=$to; $i++ ){
		
		if ( strlen($i) == 1 ) {
		
			
			// Mod begin
			$DESC_last = "";
			$len_last = 0;
			// Mod end



			$NewsLimitResults	= "SELECT DISTINCT TRIM(`DESC`) AS `DESC` FROM `$table` WHERE `DATE` = \"$SqlDate\" AND `DESC` LIKE('$i%') AND CHAR_LENGTH( `DESC` ) > 8 ORDER BY `DESC` ASC";
			#$NewsLimitResults	= "SELECT DISTINCT TRIM(`DESC`) AS `DESC` FROM `$table` WHERE `DATE` = DATE_SUB($SqlDate,INTERVAL 0 DAY ) AND `DESC` LIKE('$i%') AND CHAR_LENGTH( `DESC` ) > 8 ORDER BY `DESC` ASC";
			$results			= doSQLQueryZoozle( $NewsLimitResults );
			
			while( $sql_results = mysql_fetch_array($results)) {

				#$DESC = iconv("UTF-8", "ISO-8859-1", $sql_results["DESC"] );
				$DESC = $sql_results["DESC"];
				
				$DESC1 = $DESC;
				$DESC = str_replace("  ", "+", ucfirst(trim($DESC)));
				$DESC = str_replace("   ", "+", ucfirst(trim($DESC)));
				$DESC = str_replace("%20", "+", $DESC);
				$DESC = preg_replace('/\s\s+/', '+', $DESC1);
				$DESC = ereg_replace("[ \t\n\r]+", "+", $DESC1); 
				$DESC = title_plus($DESC1);
				
				//Mod begin
				$len = strlen($DESC);
				$len = round($len*0.5, 0);
				if ($len_last != 0 AND (substr(strtolower($DESC), 0, $len) == substr(strtolower($DESC_last), 0, $len) OR substr(strtolower($DESC), 0, $len_last) == substr(strtolower($DESC_last), 0, $len_last))) {
				 continue;
				};
				$DESC_last = $DESC;
				$len_last = $len;
				//Mod end

				if ( $count < 15 ){
				
					echo <<<END
						<tr>
							<td align="left">
								<a href="http://www.zoozle.org/rapidshare-torrent-download-english/$DESC,torrent,en,0.html" title="$DESC1 torrent download english">$DESC1</a>
							</td>
						</tr>
END;


				} elseif ( $count >= 15 ){
					$count = 0;

					echo <<<END
						<tr>
							<td align="left">
								<a href="http://www.zoozle.org/rapidshare-torrent-download-english/$DESC,torrent,en,0.html" title="$DESC1 torrent download english">$DESC1</a>
								<br><br>
								&nbsp;&nbsp;&nbsp; <a href="#top" title="Return to the top"> Return to the top </a>
								<br><br>
							</td>
						</tr>
END;

				}; # if ( $count <= 15 ){

				$count++;

			}; # while( $sql_results = mysql_fetch_array($results)) {

		}; # if ( strlen($i) == 1 ) {

	}; # for ( $i=$from; $i<=$to; $i++ ){

	$rand					= rand(300,700);
	$NewsLimitTopKeyword	= "SELECT DISTINCT `DESC` FROM `$table` WHERE `DATE` = \"$SqlDate\" LIMIT $rand,1";
	#$NewsLimitTopKeyword	= "SELECT DISTINCT `DESC` FROM `$table` WHERE `DATE` = DATE_SUB($SqlDate,INTERVAL 1 DAY ) AND `CATG` = 'en' LIMIT $rand,1";

	$MySqlResults			= doSQLQueryZoozle( $NewsLimitTopKeyword );
	$sql_results			= mysql_fetch_array($MySqlResults);
	$XKeyWord				= $sql_results["DESC"];

	echo <<<END
			<tr>
			</tr>
		</table>				
	</span>	

	<p>&nbsp;</p>

	<p>
		<span lang="en" align="center">
			<b>
			$Back &nbsp;&nbsp;&nbsp;
			$Next
			</b>
		</span>
	</b>
	</p>
	<p>&nbsp;</p>

	<span lang="en" class="newslink">
		<strong>
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,0-9,torrent.html" title="0-9 $TitleDate  torrent news english">0-9</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,a-a,torrent.html" title="a $TitleDate  torrent news english">A</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,b-b,torrent.html" title="b $TitleDate  torrent news english">B</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,c-c,torrent.html" title="c $TitleDate  torrent news english">C</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,d-d,torrent.html" title="d $TitleDate  torrent news english">D</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,e-e,torrent.html" title="e $TitleDate  torrent news english">E</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,f-g,torrent.html" title="f-g $TitleDate  torrent news english">F-G</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,h-j,torrent.html" title="h-j $TitleDate  torrent news english">H-J</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,k-l,torrent.html" title="k-l $TitleDate  torrent news english">K-L</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,m-m,torrent.html" title="m $TitleDate  torrent news english">M</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,n-o,torrent.html" title="n-o $TitleDate  torrent news english">N-O</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,p-r,torrent.html" title="p-r $TitleDate  torrent news english">P-R</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,s-s,torrent.html" title="s $TitleDate  torrent news english">S</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,t-t,torrent.html" title="t $TitleDate  torrent news english">T</a>&nbsp;
			<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,u-z,torrent.html" title="u-z $TitleDate  torrent news english">U-Z</a>&nbsp;
		</strong>
	</span>


	<p>&nbsp;</p>
	
	 <a href="http://www.FriendlyDuck.com/AF_TA/rel/index.cfm?RST=UNXDE&TAD=403265" target="usenext.de" rel="nofollow">   
	 <img src="http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/854212A3-BCDD-D261-016FCAE255297F17.gif" name="picname_cjasdj" width=468 height=60 border=0 title="Usenet Binaries anonym mit DSL Speed downloaden inkl. gratis Software">   
	 </a>   
	 <script type="text/javascript">   
	 var layerLink_cjasdj = "http://www.FriendlyDuck.com/AF_TA/rel/index.cfm?RST=UNXDE&TAD=403265";   
	 var pics_cjasdj=new Array("http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/854212A3-BCDD-D261-016FCAE255297F17.gif","http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/85427286-BCDD-D261-0C45BFFB45B7D8B3.gif","http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/8542E342-BCDD-D261-05E26EF5528C11A8.gif", "http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/8542E342-BCDD-D261-05E26EF5528C11A8.gif", "http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/8542E342-BCDD-D261-05E26EF5528C11A8.gif");   
	 </script>   
	 <script type="text/javascript" src="http://m.FriendlyDuck.com/AF_TA/MediaServer/Media/8553488B-BCDD-D261-01785C083B4EF1E6.js"></script>   
	 <div id="AF_TA" style="position:absolute; width:2px; height:2px; z-index:-387; left: 0px; top: 0px; visibility: visible;"><img src="http://www.FriendlyDuck.com/AF_TA/ViewCounter/index.cfm?TAD=403265&bIsAffiliate=0" width=2 height=2 border=0></div>  
	 <img src="http://www.FriendlyDuck.com/AF_TA/rel/index.cfm?RST=UNXDE&TAD=403265" height="0" width="0" frameborder="0"></img>

	<p>&nbsp;</p>


END;

	return 1;

}; # function _GenerateNewsOverviewNews( $date, $limit ){






function _GenerateTopSearchFieldNews( $Date, $limit ){

	$TitleDate = ucfirst(str_replace("-", " ", $Date));

	# Algorithmus zum erstellen der Translate Links von english -> deutsch
	$RequestUrl				= "http://www.zoozle.org" . $_SERVER["REQUEST_URI"];
	$list					= explode('/', $RequestUrl);
	$MonthYear				= array_pop($list);							# hole letztes element:    januar-2006.html
	$list					= explode(',', $MonthYear);
	$TransferedMonthYear	= TransferGetMonthYearLong($list[0], 'de');	# aus january-2006.html -> januar-2006.html
	$TransferedMonthYearFR  = TransferGetMonthYearLong($list[0], 'fr');

	if ( eregi("([0-9]{1,2})-([a-z]{3,16})-([0-9]{2,4})", $TransferedMonthYear) ){
	
		if ( strlen($list[1]) == 3 && strlen($list[2]) > 4) {
			$TransferdURI	= "http://www.zoozle.net/torrent-rapidshare-download-deutsch/$TransferedMonthYear,$list[1],$list[2]";
			$TransferdURIFR	= "http://www.zoozle.biz/emule-bittorrent-nouvelles-francais/$TransferedMonthYearFR,$list[1],$list[2]";
		} else {
			$TransferdURI	= "http://www.zoozle.net/torrent-rapidshare-download-deutsch/$TransferedMonthYear";
			$TransferdURIFR	= "http://www.zoozle.biz/emule-bittorrent-nouvelles-francais/$TransferedMonthYearFR";
		};

	} else {
		$TransferdURI		= "http://www.zoozle.org/";
	};


	echo <<<END
		<center>
		<form method="get" action="http://www.zoozle.org/zoozle.php" name="searchfield" target="_self">	
			<table style="margin-top:+5px">
				<tr>
					<td>
						<input type="text" name="q" value="" maxlength="200" id="formfield" size="100">
					</td>
					<td>	
						<input type="submit" value="search" > 
					</td>
				</tr>
			</table>
			<table style="margin-top:+5px">
				<tr>	
					<td align="left">
						<span lang="en" id="cat-select">Category:</span>
						<strong>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="emule" >eMule</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="torrent" checked>Torrent</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="rapidshare">Rapidshare</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="usenet">Usenet</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="subtitle">Subtitle</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="lyrics">Lyrics</span>
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="serial">Serial</span> 
						<span align="right" id="radio-buttons"><input type="radio" name="s" value="cracks">Crack</span>
						</strong>
					</td>
				</tr>
				<tr>	
					<td align="left">
						<span lang="en" id="lang-select">Language:</span>
						<select name="l" style="width: 20mm">
							<option value="en">english</option>
							<option value="de">german</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
		</center>
		
	<!--	
		<p align="center">
			<span lang="en" id="translate">translate</span> / <span lang="de" id="translate">&uuml;bersetzen</span> / <span lang="fr" id="translate">traduire</span></p>
		</p>
		<p align="center">
			<a href="$RequestUrl" lang="en"><img src="/images/us.gif" alt="english" height="13" width="20" /></a>
			<a href="$TransferdURI" lang="de"><img src="/images/de.gif" alt="deutsch" height="13" width="20" /></a>
			<a href="$TransferdURIFR" rel="nofollow" lang="fr"><img src="/images/fr.gif" alt="francais" height="13" width="20" /></a>
		</p>
	-->

		<br>
		<center>
	
		<table border="0" width="550" id="table1" style="border-collapse: collapse">
			<tr>
				<td bgcolor="#E5ECFA"><img src="/images/us.gif" width="20" height="13" align="left" alt="de" /></td>
				<td bgcolor="#E5ECFA" align="center"><span lang="de" class="newscaption">Torrent News $limit <a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date.html" title="bit torrent bittorrent news english from $Date" target="_self">$Date</a> english</span></td>
				<td bgcolor="#E5ECFA"><img src="/images/us.gif" width="20" height="13" align="right" /></td>
			</tr>
			<tr>
				<td align="center" colspan="3">
					<span lang="de" class="newslink">
						<strong>
							<br />
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,0-9,torrent.html" title="0-9 $TitleDate  torrent news english">0-9</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,a-a,torrent.html" title="a $TitleDate  torrent news english">A</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,b-b,torrent.html" title="b $TitleDate  torrent news english">B</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,c-c,torrent.html" title="c $TitleDate  torrent news english">C</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,d-d,torrent.html" title="d $TitleDate  torrent news english">D</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,e-e,torrent.html" title="e $TitleDate  torrent news english">E</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,f-g,torrent.html" title="f-g $TitleDate  torrent news english">F-G</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,h-j,torrent.html" title="h-j $TitleDate  torrent news english">H-J</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,k-l,torrent.html" title="k-l $TitleDate  torrent news english">K-L</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,m-m,torrent.html" title="m $TitleDate  torrent news english">M</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,n-o,torrent.html" title="n-o $TitleDate  torrent news english">N-O</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,p-r,torrent.html" title="p-r $TitleDate  torrent news english">P-R</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,s-s,torrent.html" title="s $TitleDate  torrent news english">S</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,t-t,torrent.html" title="t $TitleDate  torrent news english">T</a>&nbsp;
							<a href="http://www.zoozle.org/torrent-rapidshare-download-english/$Date,u-z,torrent.html" title="u-z $TitleDate  torrent news english">U-Z</a>&nbsp;
						</strong>
					</span>
				</td>
			</tr>
		</table>
		</center>
END;

	return 1;

}; # function _GenerateTopSearchFieldNews( $Date ){



function _GenerateHtmlHeaderNews( $Date, $limit ){

	header("Content-type: text/html");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: public");  // HTTP/1.1
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: use-cache"); 
/*
	$rand						= rand(1,300);
	$table						= TORRENT_NEWS;
	$SqlDate					= ConvertNormalDateToSQLDate( $Date, 'en' );
	$NewsLimitDeXKeyword		= "SELECT DISTINCT `DESC` FROM `$table` WHERE `DATE` = \"$SqlDate\" AND `CATG` = 'en' LIMIT $rand,1";	
	$MySqlResults				= doSQLQueryZoozle( $NewsLimitDeXKeyword );
	$sql_results				= mysql_fetch_array($MySqlResults);
	$XKeyWord					= $sql_results["DESC"];
*/

	$tmp						= ucfirst(str_replace("-", ".", $Date));
	$Date						= ucfirst(str_replace("-", " ", $Date));
	$MetaKeysExtra				= "";

	if ( pfeileBack( $tmp ) == 0 ) {
		$MetaKeysExtra = "<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, NOFOLLOW\"><META NAME=\"GOOGLEBOT\" CONTENT=\"NOINDEX, NOFOLLOW\">";
	} else {
		$MetaKeysExtra = "<META NAME=\"ROBOTS\" CONTENT=\"INDEX,FOLLOW\">";
	}

	echo <<<END
		<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
		<html>
		<head>
			$MetaKeysExtra
			<meta http-equiv="Content-Language" content="en" />
			<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
			<meta name="keywords" content= "Torrent Download News $Date $limit, $XKeyWord, Bittorrent, Bit Torrent, Torrent, News, $Date, english, $limit" />
			<meta name="description" content= "Torrent News Archive with all listed torrent news for $Date with $XKeyWord and $limit" />	
			<meta name="revisit-after" content= "10 days" />
			<link href="/css/zoozle-new.css" rel="stylesheet" type="text/css" />
			<link href="/images/favicon.ico" rel="Bookmark Icon" />
			<link href="/images/favicon.ico" rel="SHORTCUT ICON" />
			<title>Torrent Download News $Date english $limit</title>
		</head>
		<body>
			<p align="center">
				<img border="0" src="/images/zoozle-news.gif" width="243" height="82" alt="zoozle news picture" />
			</p>

END;

	return 1;

}; # function _GenerateHtmlHeaderNews( $Date ){




?>