You are here

function video_page in Video 6

Same name and namespace in other branches
  1. 5 video.module \video_page()
  2. 6.2 video.module \video_page()

Displays a Drupal page containing recently added videos

Return value

string HTML output

1 string reference to 'video_page'
video_menu in ./video.module
Implementation of hook_menu().

File

./video.module, line 170
video.module

Code

function video_page() {
  $output = '';
  if (arg(1) != 'help') {

    //We are not reading help so output a list of recent video nodes.
    $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'video' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10));
    while ($node = db_fetch_object($result)) {
      $output .= node_view(node_load($node->nid), 1);
    }
    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));

    // adds feed icon and link
    drupal_add_link(array(
      'rel' => 'alternate',
      'type' => 'application/rss+xml',
      'title' => variable_get('site_name', 'drupal') . ' ' . t('videos'),
      'href' => url('video/feed/'),
    ));
    $output .= '<br />' . theme('feed_icon', url('video/feed'));
  }
  return $output;
}