0){
$nick = $_GET["user"];
$nickquery=" AND nick='".$nick."' ";
}
if (isset($_GET['findword'])){
$findwordbase = $_GET["findword"];
print "";
} else {
$findwordbase = "";
}
$findword = strtoupper($findwordbase);
if (strlen($findword)>0){
$findwordlimit=" LIMIT 25 ";
}else{
$findwordlimit="";
}
?>
Trending - FilmO";
?>
TRENDING

";
function drawtrends($numberofweeksin){
global $conn;
global $lng;
global $txt;
if(!$numberofweeksin){
$numberofweeksin=1;
}
$numberofweeks=$numberofweeksin;
$date = new DateTime('-'.$numberofweeks.' week');
$date = $date->format('Y-m-d H:i:s');
//echo $date;
//$parancs = "SELECT COUNT(legutobb.movie_id) AS darab,COUNT(DISTINCT userid) AS tagok,COUNT(DISTINCT episode) AS epizodok,filmek.movie_id, hun_title, filmek.movie_id, title, season, year, nick, language, datetime, episode FROM movies filmek, lastmovies legutobb WHERE (filmek.movie_id = legutobb.movie_id ) AND userid IN (".$_SESSION['active_list_userids'].") AND ( title LIKE '%" . $findword . "%' OR hun_title LIKE '%" . $findword . "%' ) AND datetime>'".$date."' GROUP BY filmek.movie_id ORDER BY COUNT(DISTINCT userid) DESC, COUNT(legutobb.movie_id) DESC" ;
$parancs = "SELECT COUNT(legutobb.movie_id) AS darab,COUNT(DISTINCT userid) AS tagok, COUNT(DISTINCT episode) AS epizodok,filmek.movie_id, hun_title, filmek.movie_id, title, season, year, nick, language, legutobb.datetime, episode FROM movies filmek, lastmovies legutobb WHERE (filmek.movie_id = legutobb.movie_id ) AND ( title LIKE '%" . $findword . "%' OR hun_title LIKE '%" . $findword . "%' ) AND legutobb.datetime>'".$date."' GROUP BY filmek.movie_id ORDER BY COUNT(DISTINCT userid) DESC, COUNT(legutobb.movie_id) DESC" ;
if($lng=="hun"){
$weektext="Hét";
if($numberofweeks==52){
$numberofweeks=1;
$weektext="Év";
}
}else{
if($numberofweeks>1){
$weektext="Weeks";
}else{
$weektext="Week";
}
if($numberofweeks==52){
$numberofweeks=1;
$weektext="Year";
}
}
$eredmeny = mysql_query($parancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error());
print "
";
//print"";
echo "";
echo "| ".ucfirst( strtolower($txt['last']))." $numberofweeks $weektext |
";
echo "".$txt['movies']." / ".$txt['series']." | ".$txt['all']." |
";
echo "";
$trendingmoviesarray=array();
$szamlalo=0;
$minimumusers=1;
if($numberofweeksin>51){
$minimumusers=4;
}
while ( $sor = mysql_fetch_array($eredmeny))
{
$trendingmoviesarray[]= $sor['movie_id'];
if($sor['tagok']>$minimumusers){
$szamlalo++;
if($szamlalo>9){
$tdvisible="tdhidden";
}else{
$tdvisible="";
}
//echo "
";
$titlebe="".$sor['title'];
if ($sor['season']>0){
$titlebe.= " [s".$sor['season']."]";
}
$titlebe.="
";
if(strlen($sor['eng_title'])>1){
$titlebe.="".$sor['eng_title'];
if ($sor['season']>0){
$titlebe.= " [s".$sor['season']."]";
}
$titlebe.="
";
}
if ($lng=="hun"){
$titlebe.="".$sor['hun_title'];
if ($sor['season']>0){
$titlebe.= " [s".$sor['season']."]";
}
$titlebe.="
";
}
$titlebe.=$sor['year'];
$titlebe.="
";
if($lng=="hun"){
$memberstext="tag";
$episodestext="epizód";
}else{
$memberstext="members";
if($sor['epizodok']>1){
$episodestext="episode";
}else{
$episodestext="episodes";
}
}
$titlebe.="".$sor['tagok']." ".$memberstext."
";
if ($sor['season']>0){
$titlebe.="".$sor['epizodok']." ".$episodestext."
";
}
$poster="pix/poster/" . $sor['movie_id'] . ".jpg";
if (!file_exists($poster)){
$poster="pix/poster/0.jpg";
}
print " | ";
if ($szamlalo%9==0){
print "
";
}
}
}
echo "
";
//$parancs = "SELECT COUNT(legutobb.movie_id) AS darab,COUNT(DISTINCT userid) AS tagok,COUNT(DISTINCT episode) AS epizodok,filmek.movie_id, hun_title, filmek.movie_id, title, season, year, nick, language, datetime, episode FROM movies filmek, lastmovies legutobb WHERE (filmek.movie_id = legutobb.movie_id ) AND userid IN (".$_SESSION['active_list_userids'].") AND ( title LIKE '%" . $findword . "%' OR hun_title LIKE '%" . $findword . "%' ) AND datetime>'".$date."' GROUP BY filmek.movie_id ORDER BY COUNT(DISTINCT userid) DESC, COUNT(legutobb.movie_id) DESC" ;
//$parancs = "SELECT COUNT(szemelyek.person_id) FROM persons szemelyek, actor szineszek " ;
//echo implode(",",$trendingmoviesarray);
$szemelyszamlalo=0;
echo "".$txt['persons']." | ".$txt['all']." |
";
$parancs = "SELECT
COALESCE(COALESCE(t2.darab,0) + COALESCE(c2.darab,0) + COALESCE(v2.darab,0)) AS Totals, name, p.person_id
FROM persons p
LEFT JOIN (SELECT t.person_id, COUNT(t.movie_id) AS darab FROM actor t WHERE movie_id IN (".implode(",",$trendingmoviesarray).") and voice_lang!='hun' GROUP BY t.person_id) t2
ON p.person_id = t2.person_id
LEFT JOIN (SELECT c.person_id, COUNT(c.movie_id) AS darab FROM director c WHERE movie_id IN (".implode(",",$trendingmoviesarray).") GROUP BY c.person_id) c2
ON p.person_id = c2.person_id
LEFT JOIN (SELECT v.person_id, COUNT(v.movie_id) AS darab FROM writer v WHERE movie_id IN (".implode(",",$trendingmoviesarray).") GROUP BY v.person_id) v2
ON p.person_id = v2.person_id
HAVING Totals>1
ORDER BY Totals DESC, p.person_id ASC
";
// WHERE p.person_id = 1;" ;
$minimumusers=1;
if($numberofweeksin>51){
$minimumusers=14;
}
$eredmeny = mysql_query($parancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error());
echo "";
while ( $sor = mysql_fetch_array($eredmeny)){
if($sor['Totals']>$minimumusers){
$szemelyszamlalo++;
if($szemelyszamlalo>9){
$tdvisible="tdhidden";
}else{
$tdvisible="";
}
//echo $sor['name']." >> ".$sor['Totals']."
";
$titlebe="".$sor['name']."";
$titlebe.="".$sor['Totals']." ".$txt['movie']." / ".$txt['serie']."
";
$poster="pix/person/" . $sor['person_id'] . ".jpg";
print " | ";
if ($szemelyszamlalo%9==0){
print "
";
}
}
}
echo "
";
////////////KULTFIGURAK
$kultfiguraszamlalo=0;
echo "".ucfirst($txt['cult_characters_SMALL'])." | ".$txt['all']." |
";
$parancs = "SELECT
COALESCE(COALESCE(t2.darab,0)) AS Totals, ".$lng."_name, p.id
FROM cult_characters p
LEFT JOIN (SELECT t.cult_id, COUNT(t.movie_id) AS darab FROM actor t WHERE movie_id IN (".implode(",",$trendingmoviesarray).") GROUP BY t.cult_id) t2
ON p.id = t2.cult_id
HAVING Totals>1
ORDER BY Totals DESC, p.id ASC
";
// WHERE p.cult_id = 1;" ;
$minimumusers=1;
if($numberofweeksin>51){
$minimumusers=3;
}
$eredmeny = mysql_query($parancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error());
echo "";
while ( $sor = mysql_fetch_array($eredmeny)){
if($sor['Totals']>$minimumusers){
$kultfiguraszamlalo++;
if($kultfiguraszamlalo>9){
$tdvisible="tdhidden";
}else{
$tdvisible="";
}
//echo $sor['name']." >> ".$sor['Totals']."
";
$titlebe="".$sor[$lng.'_name']."";
$titlebe.="".$sor['Totals']." ".$txt['movie']." / ".$txt['serie']."
";
$poster="pix/cult_character/" . $sor['id'] . ".jpg";
print " | ";
if ($kultfiguraszamlalo%9==0){
print "
";
}
}
}
echo "
";
////////////ENDKULTFIGURAK
$cimkeszamlalo=0;
echo "".$txt['tags']." | ".$txt['all']." |
";
$parancs = "SELECT
COALESCE(COALESCE(t2.darab,0)) AS Totals, ".$lng."_tag_name, p.tag_id
FROM tags p
LEFT JOIN (SELECT t.tag_id, COUNT(t.movie_id) AS darab FROM movie_tags t WHERE movie_id IN (".implode(",",$trendingmoviesarray).") GROUP BY t.tag_id) t2
ON p.tag_id = t2.tag_id
HAVING Totals>1
ORDER BY Totals DESC, p.tag_id ASC
";
// WHERE p.person_id = 1;" ;
$minimumusers=2;
if($numberofweeksin>51){
$minimumusers=32;
}
$eredmeny = mysql_query($parancs, $conn) or die("Nem tudtam az adatokat lekérni. A hiba oka: ".mysql_error());
echo "";
while ( $sor = mysql_fetch_array($eredmeny)){
if($sor['Totals']>$minimumusers){
$cimkeszamlalo++;
if($cimkeszamlalo>9){
$tdvisible="tdhidden";
}else{
$tdvisible="";
}
//echo $sor['name']." >> ".$sor['Totals']." ";
//$titlebe="".$sor[$lng.'_tag_name']."";
$titlebe="".$sor['Totals']." ".$txt['movie']." / ".$txt['serie']." ";
print "".$sor[$lng.'_tag_name']." ";
}
}
echo " |
";
echo "
";
}
drawtrends();
drawtrends(2);
drawtrends(4);
drawtrends(52);
?>