function phptemplate_views_view_table_forumTracker($view, $nodes, $type)
{
    $fields = _views_get_fields();
    $comments_per_page = _comment_get_display_setting('comments_per_page');
    foreach ($nodes as $node) {
        $row = array();
        foreach ($view->field as $field) {
            if ($fields[$field['id']]['visible'] !== FALSE) {
                if ($field['field'] == 'comment_count') {
                    $count = db_result(db_query('SELECT COUNT(c.cid) FROM {comments} c WHERE c.nid=%d', $node->nid));
                    // Find the ending point. The pager URL is always 1 less than
                    // the number being displayed because the first page is 0.
                    $last_display_page = ceil($count / $comments_per_page);
                    $last_pager_page = $last_display_page - 1;
                    if ($last_pager_page < 0) {
                        $last_pager_page = 0;
                    }
                    $cell['data'] = $node->node_comment_statistics_comment_count . '<br />';
                    //$cell['data'] .= l('new', 'node/'.$node->nid, array(), 'page='.$last_pager_page.'#new');
                    $cell['data'] .= advanced_forum_first_new_post_link($node, $count);
                    $cell['class'] = "view-field " . views_css_safe('view-field-' . $field['queryname']);
                    $row[] = $cell;
                } else {
                    $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
                    $cell['class'] = "view-field " . views_css_safe('view-field-' . $field['queryname']);
                    $row[] = $cell;
                }
            }
        }
        $rows[] = $row;
    }
    return theme('table', $view->table_header, $rows);
}
Beispiel #2
0
/**
 * views template to output a view.
 * This code was generated by the views theming wizard
 * Date: Tue, 05/27/2008 - 17:53
 * View: front_features
 *
 * This function goes in your template.php file
 */
function phptemplate_views_view_list_front_features($view, $nodes, $type)
{
    $fields = _views_get_fields();
    $taken = array();
    // Set up the fields in nicely named chunks.
    foreach ($view->field as $id => $field) {
        $field_name = $field['field'];
        if (isset($taken[$field_name])) {
            $field_name = $field['queryname'];
        }
        $taken[$field_name] = true;
        $field_names[$id] = $field_name;
    }
    // Set up some variables that won't change.
    $base_vars = array('view' => $view, 'view_type' => $type);
    foreach ($nodes as $i => $node) {
        $vars = $base_vars;
        $vars['node'] = $node;
        $vars['count'] = $i;
        $vars['stripe'] = $i % 2 ? 'even' : 'odd';
        $vars['position'] = '';
        foreach ($view->field as $id => $field) {
            $name = $field_names[$id];
            $vars[$name] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            if (isset($field['label'])) {
                $vars[$name . '_label'] = $field['label'];
            }
        }
        if ($i > 0) {
            $output .= '<div class="panel-separator"></div>';
        }
        $output .= _phptemplate_callback('views-list-front_features', $vars);
    }
    return $output;
}
/**
 * views template to output a view.
 * This code was generated by the views theming wizard
 * Date: Thu, 08/16/2007 - 3:44am
 * View: BibleStudyList
 *
 * This function goes in your template.php file
 */
function phptemplate_views_view_list_BibleStudyList($view, $nodes, $type)
{
    $fields = _views_get_fields();
    $taken = array();
    // Set up the fields in nicely named chunks.
    foreach ($view->field as $id => $field) {
        $field_name = $field['field'];
        if (isset($taken[$field_name])) {
            $field_name = $field['queryname'];
        }
        $taken[$field_name] = true;
        $field_names[$id] = $field_name;
    }
    // Set up some variables that won't change.
    $base_vars = array('view' => $view, 'view_type' => $type);
    foreach ($nodes as $i => $node) {
        $vars = $base_vars;
        $vars['node'] = $node;
        $vars['count'] = $i;
        $vars['stripe'] = $i % 2 ? 'even' : 'odd';
        foreach ($view->field as $id => $field) {
            $name = $field_names[$id];
            $vars[$name] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            if (isset($field['label'])) {
                $vars[$name . '_label'] = $field['label'];
            }
        }
        $items[] = _phptemplate_callback('views-list-BibleStudyList', $vars);
    }
    if ($items) {
        return theme('item_list', $items);
    }
}