<?php
 

session_start();
include("include/config.php");
include("include/functions/import.php");
$thebaseurl = $config['baseurl'];

$getfilter = htmlentities(strip_tags($_REQUEST[filter]));
$filter = escape($getfilter);
$showmax = 12;
$count = 1;

$query = "SELECT * from videos where public='1' AND active='1' order by time_added desc limit $showmax";

$db=mysql_connect ($DBHOST,$DBUSER,$DBPASSWORD) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($DBNAME); 
  
$result = mysql_query($query) or die ('Query Error: ' . mysql_error()); 
while ($results = mysql_fetch_array($result)) 
{ 
  $link       = $config['baseurl']."/videos/".$results['VIDEOID']."/".seo_clean_titles_sendmail($results['title']); 
  $title = str_replace ("&amp","",htmlspecialchars(stripslashes($results['title'])));
  $description = str_replace ("&amp","",htmlspecialchars(stripslashes($results['description']))); 
		
	print "&t".$count."=".$results['VIDEOID']."-1";
	print "&l".$count."=".$title;
	print "&link".$count."=".$link; 
	print "&d".$count."=".$description; 
  	print "&cm".$count."=Views : ".$results['viewcount']." | Comments : ".$results['commentcount'].""; 
	$count++;
} 

?>