$SQL_SORT = " ORDER BY RAND(1) "; } $sql = 'SELECT movieid,title,year FROM movies ' . $SQL_FILTER . $SQL_SORT . "LIMIT {$start_movie_number} , {$movies_per_page}"; $stat = prepareStatement($sql); $stat->execute(); $rows = $stat->fetchAll(); foreach ($rows as $row) { $movieid = $row['movieid']; $title = $row['title']; $year = $row['year']; $sql = "SELECT rating FROM ratings WHERE movieid=? and userid=?"; $stat = prepareStatement($sql); $stat->bindParam(1, $movieid); $stat->bindParam(2, $userid); $stat->execute(); $res = $stat->fetchAll(); $data = array('tab' => 'movies'); $data['type'] = 'movie'; if (empty($res)) { $rating = -1; $data['rated'] = FALSE; } else { $data['rated'] = TRUE; $data['rating'] = $res[0]['rating']; } print_movie($movieid, $title, $year, $data); } //pager end if (!$no_pager) { print_paging('movies', $page, $movies_per_page, $tot_movies, 'movies'); }
echo $app_menu['marked']['url']; ?> " /> <input type="hidden" name="results" value="<?php echo implode(';', $result_urls); ?> " /> <input type="hidden" name="redirect_url" value="<?php echo $QUERY->url(); ?> " /> <? if (!$CONF['submit_forms_with_script']): ?> <input type="submit" name="mark_results" value="Mark Selected Records" /> <? endif /* JS buttons */ ?> <? if ($QUERY->info['results_count'] + $MARKED_RECORDS->count() <= $CONF['marked_records_size']): ?> <input type="submit" name="mark_all_results" value="Mark All Records" /> <? endif /* mark all button */ ?> <? if (!$CONF['submit_forms_with_script'] || $QUERY->info['results_count'] + $MARKED_RECORDS->count() <= $CONF['marked_records_size']): ?> <a href="<?php echo $MODULE->url('help', '/marked'); ?> " onClick="return popup_help(this)">About marked records »</a> <? endif /* help text */ ?> </form> <? endif /* Marked records */ ?> </div> <? if ($QUERY->info['page_count'] > 1) print_paging(); ?> <? endif ?> <?php require_once $CONF['path_templates'] . 'inc-footer.php';
$recvalue = $row['value']; $explanation = $row['explanation']; $algo = 'hybrid'; $recid = $row['recommendationid']; $sql = "SELECT rating FROM ratings WHERE movieid=? and userid=?"; $stat = prepareStatement($sql); $stat->bindParam(1, $movieid); $stat->bindParam(2, $user); $stat->execute(); $res = $stat->fetchAll(); $data = array('tab' => 'hybrid'); $data['recvalue'] = $recvalue; $data['explanation'] = $explanation; $data['recid'] = $recid; $data['algo'] = $algo; $data['type'] = 'hybrid'; if (empty($res)) { $data['rated'] = FALSE; } else { $data['rated'] = TRUE; $data['rating'] = $res[0]['rating']; } //relic from old code, here for backwards compatibility $data['relevancefeedback'] = FALSE; print_movie($movieid, $title, $year, $data); } //--- print "</div>"; //pager bottom print_paging('hybrid', $page, $recs_per_page, $tot_recs, 'hybrid');
foreach ($rows as $row) { $movieid = $row['movieid']; $title = trim($row['title']); $year = trim($row['year']); $recvalue = $row['value']; $recid = $row['recid']; $sql = "SELECT rating FROM ratings WHERE movieid=? and userid=?"; $stat = prepareStatement($sql); $stat->bindParam(1, $movieid); $stat->bindParam(2, $user); $stat->execute(); $res = $stat->fetchAll(); $data = array('tab' => $algo); $data['type'] = 'rec'; $data['recvalue'] = $recvalue; $data['recid'] = $recid; $data['algo'] = $algo; if (empty($res)) { $data['rated'] = FALSE; } else { $data['rated'] = TRUE; $data['rating'] = $res[0]['rating']; } //relic from old code, here for backwards compatibility $data['relevancefeedback'] = FALSE; print_movie($movieid, $title, $year, $data); } print "</div>"; //pager bottom print_paging('recs-' . $algo, $page, $recs_per_page, $tot_recs, $algo);