nid) { case 199251: // List projects with CVS RSS feeds. $extra = project_stuff_cvs_rss(); break; } $node->content['body']['#value'] .= $extra; } } /** * List projects with CVS RSS links. */ function project_stuff_cvs_rss() { $count_query = "SELECT COUNT(*) FROM {node} WHERE type = 'project_project' AND status = 1"; $total = db_result(db_query($count_query)); $header = array(array('data' => t('Number'), 'field' => 'nid', 'sort' => 'desc'), t('Title'), t('CVS/RSS')); $result = pager_query("SELECT nid, title, status FROM {node} WHERE type = 'project_project' AND status = 1 ". tablesort_sql($header), 100, 0, $count_query); $rows = array(); $page = (int)$_GET['page']; $count = $total - $page * 100; while($row = db_fetch_array($result)) { $url = url('cvs', array('query' => 'rss=true&nid='. $row['nid'], 'absolute' => TRUE)); $rows[]= array($count--, l($row['title'], 'node/'. $row['nid']), theme('feed_icon', $url, $row['title'])); } drupal_set_message("There are $total projects."); return theme('table', $header, $rows). theme('pager'); }