function DbGetTop($limit) { global $min_votes; //gemiddelde van ALLE movies bijelkaar $total_avg = db_QueryFetchRow("\n\t SELECT \n\t\tAVG(vote_value) as avg\n\t FROM votes\n\t"); // movies met hoogstge bayesian ratings $tops = db_QueryFetch("\n\t SELECT\n\t\tmovies.*,\n\t\t(( ({$min_votes} * {$total_avg['avg']}) + COUNT(vote_value) * AVG(vote_value) ) / ({$min_votes} + COUNT(vote_value))) as avg\n\t FROM votes,movies\n\t WHERE movies.movie_id=votes.movie_id\n\t GROUP by movie_id\n\t ORDER by avg DESC\n\t LIMIT {$limit}\n\t"); // rearrange to this form: // $ret[movie_name]=array($thumbs); foreach ($tops as $top) { $ret[$top[movie_name]] = GetThumbs($top[movie_name]); } return $ret; }
include_once 'ressources/class.artica.graphs.inc'; include_once 'ressources/class.rtmm.tools.inc'; $users = new usersMenus(); if (!$users->AsWebStatisticsAdministrator) { die; } if (isset($_GET["startpoint"])) { popup(); exit; } if (isset($_GET["tabs"])) { tabs(); exit; } if (isset($_GET["thumbnail"])) { GetThumbs(); die; } if (isset($_GET["rethumbnail"])) { rethumbnail(); die; } page(); function page() { $page = CurrentPageName(); $md = md5($_GET["www"]); $html = "<div id='startpoint-{$md}'></div>\n\t<script>LoadAjax('startpoint-{$md}','{$page}?startpoint=yes&www={$_GET["www"]}&xtime={$_GET["xtime"]}&week={$_GET["week"]}&year={$_GET["year"]}&month={$_GET["month"]}');</script>\n\t"; echo $html; } function popup()