function vote_storylink_page_interval_top in Vote Up/Down 5
1 call to vote_storylink_page_interval_top()
- vote_storylink_page in ./
vote_storylink.module - Menu callback; displays a Drupal page containing recent story links entries.
File
- ./
vote_storylink.module, line 424
Code
function vote_storylink_page_interval_top($interval) {
drupal_set_title($title = t('Popular story links this @epoch', array(
'@epoch' => t($interval),
)));
$epoch = strtotime("-1 {$interval}");
$sql = db_rewrite_sql("SELECT n.nid, n.created, v.content_id, v.value, v.tag, v.function FROM {node} n INNER JOIN {votingapi_cache} v ON n.nid = v.content_id WHERE n.type = 'storylink' AND n.status = 1 AND n.created >= %d AND v.tag = 'vote' AND v.function = 'sum' AND v.content_type = 'node' ORDER BY v.value DESC, n.created DESC");
$result = pager_query($sql, variable_get('default_nodes_main', 10), 0, NULL, $epoch);
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load($node->nid), 1);
}
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
$output .= theme('feed_icon', url("storylink/top/{$interval}/feed"));
$feed_url = url("storylink/top/{$interval}/feed", NULL, NULL, TRUE);
drupal_add_feed($feed_url, t('RSS - @title', array(
'@title' => $title,
)));
return $output;
}