/** * Preprocessing the panel template. * * This is basically here to unify and clean up some class names. */ function ns_theme_preprocess_panels_pane(&$vars) { // Remove the old class. $vars['classes'] = strtr($vars['classes'], array('_' => '-')); // Adds the total number of comments to a node right next to the comment form title if ($vars['pane']->type == 'node_comment_form') { $comment_count = comment_num_all($vars['output']->delta); if ($comment_count > 0) { $title = '<span>' . $vars['output']->title . '</span><span class="total-comment-count">('; $title .= t('Total !comments', array('!comments' => format_plural($comment_count, '1 comment', '@count comments'))); $title .= ")</span>"; $vars['title'] = $title; } } }
function phptemplate_preprocess(&$vars, $hook) { global $theme; // Set Page Class $vars['page_class'] = theme_get_setting('page_class'); // Hide breadcrumb on all pages if (theme_get_setting('breadcrumb') == 0) { $vars['breadcrumb'] = ''; } $vars['closure'] .= ' <p id="theme-credit"><a href="http://drupal.org/project/strange_little_town">Strange Little Town</a> | ' . t('Original Designed : ') . '<a href="http://magical.nu/">Magical.nu</a> | ' . t('Drupal Ported : ') . '<a href="http://webzer.net/">Webzer.net</a></p> '; // Theme primary and secondary links. $vars['primary_menu'] = theme('links', $vars['primary_links'], array('class' => 'links primary-menu')); $vars['secondary_menu'] = theme('links', $vars['secondary_links'], array('class' => 'links secondary-menu')); // Set Accessibility nav bar if ($vars['primary_menu'] != '') { $vars['nav_access'] = ' <ul id="nav-access" class="hidden"> <li><a href="#primary-menu" accesskey="N" title="' . t('Skip to Primary Menu') . '">' . t('Skip to Primary Menu') . '</a></li> <li><a href="#main-content" accesskey="M" title="' . t('Skip to Main Content') . '">' . t('Skip to Main Content') . '</a></li> </ul> '; } else { $vars['nav_access'] = ' <ul id="nav-access" class="hidden"> <li><a href="#main-content" accesskey="M" title="' . t('Skip to Main Content') . '">' . t('Skip to Main Content') . '</a></li> </ul> '; } // Set Back to Top link toggle $vars['to_top'] = theme_get_setting('totop'); if (theme_get_setting('totop') == 0) { $vars['to_top'] = ''; } else { $vars['to_top'] = '<p id="to-top"><a href="#page">' . t('Back To Top') . '</a></p>'; } // Comments count if (isset($vars['node']->links['comment_comments'])) { if ($vars['teaser']) { $all = comment_num_all($vars['node']->nid); $vars['comments_count'] = format_plural($all, '1 comment', '@count comments'); } } // Make sure framework styles are placed above all others. $vars['css_alt'] = css_reorder($vars['css']); $vars['styles'] = drupal_get_css($vars['css_alt']); }
function phptemplate_preprocess_node(&$vars) { // Build array of handy node classes $node_classes = array(); $node_classes[] = $vars['zebra']; // Node is odd or even $node_classes[] = !$vars['node']->status ? 'node-unpublished' : ''; // Node is unpublished $node_classes[] = $vars['sticky'] ? 'sticky' : ''; // Node is sticky $node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node'; // Node is teaser or full-node $node_classes[] = 'node-type-' . $vars['node']->type; // Node is type-x, e.g., node-type-page $node_classes = array_filter($node_classes); // Remove empty elements $vars['node_classes'] = implode(' ', $node_classes); // Implode class list with spaces // Node Theme Settings // Node Links if (isset($vars['node']->links['node_read_more'])) { $node_content_type = theme_get_setting('readmore_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['node_read_more'] = array('title' => _themesettings_link(theme_get_setting('readmore_prefix_' . $node_content_type), theme_get_setting('readmore_suffix_' . $node_content_type), t(theme_get_setting('readmore_' . $node_content_type)), 'node/' . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('readmore_title_' . $node_content_type))), 'query' => NULL, 'fragment' => NULL, 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'readmore-item'), 'html' => TRUE); } if (isset($vars['node']->links['comment_add'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; if ($vars['teaser']) { $vars['node']->links['comment_add'] = array('title' => _themesettings_link(theme_get_setting('comment_add_prefix_' . $node_content_type), theme_get_setting('comment_add_suffix_' . $node_content_type), t(theme_get_setting('comment_add_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_add_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-add-item'), 'html' => TRUE); } else { $vars['node']->links['comment_add'] = array('title' => _themesettings_link(theme_get_setting('comment_node_prefix_' . $node_content_type), theme_get_setting('comment_node_suffix_' . $node_content_type), t(theme_get_setting('comment_node_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_node_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-node-item'), 'html' => TRUE); } } if (isset($vars['node']->links['comment_new_comments'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['comment_new_comments'] = array('title' => _themesettings_link(theme_get_setting('comment_new_prefix_' . $node_content_type), theme_get_setting('comment_new_suffix_' . $node_content_type), format_plural(comment_num_new($vars['node']->nid), t(theme_get_setting('comment_new_singular_' . $node_content_type)), t(theme_get_setting('comment_new_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_new_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'new', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-new-item'), 'html' => TRUE); } if (isset($vars['node']->links['comment_comments'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['comment_comments'] = array('title' => _themesettings_link(theme_get_setting('comment_prefix_' . $node_content_type), theme_get_setting('comment_suffix_' . $node_content_type), format_plural(comment_num_all($vars['node']->nid), t(theme_get_setting('comment_singular_' . $node_content_type)), t(theme_get_setting('comment_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comments', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-item'), 'html' => TRUE); } $vars['links'] = theme('links', $vars['node']->links, array('class' => 'links inline')); }
function acquia_marina_preprocess_node(&$vars) { // Build array of handy node classes $node_classes = array(); $node_classes[] = $vars['zebra']; // Node is odd or even $node_classes[] = !$vars['node']->status ? 'node-unpublished' : ''; // Node is unpublished $node_classes[] = $vars['sticky'] ? 'sticky' : ''; // Node is sticky $node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node'; // Node is teaser or full-node $node_classes[] = 'node-type-' . $vars['node']->type; // Node is type-x, e.g., node-type-page $node_classes = array_filter($node_classes); // Remove empty elements $vars['node_classes'] = implode(' ', $node_classes); // Implode class list with spaces // Add node_bottom region content $vars['node_bottom'] = theme('blocks', 'node_bottom'); // Node Theme Settings // Date & author if (!module_exists('submitted_by')) { $date = t('Posted ') . format_date($vars['node']->created, 'medium'); // Format date as small, medium, or large $author = theme('username', $vars['node']); $author_only_separator = t('Posted by '); $author_date_separator = t(' by '); $submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $vars['node']->type : 'default'; $date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1; $author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1; $author_separator = $date_setting ? $author_date_separator : $author_only_separator; $date_author = $date_setting ? $date : ''; $date_author .= $author_setting ? $author_separator . $author : ''; $vars['submitted'] = $date_author; } // Taxonomy $taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default'; $taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type); $taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type); if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page'])) { $vocabularies = taxonomy_get_vocabularies($vars['node']->type); $output = ''; $term_delimiter = ', '; foreach ($vocabularies as $vocabulary) { if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) { $terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid); if ($terms) { $term_items = ''; foreach ($terms as $term) { // Build vocabulary term items $term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))); $term_items .= '<li class="vocab-term">' . $term_link . $term_delimiter . '</li>'; } if ($taxonomy_format == 'vocab') { // Add vocabulary labels if separate $output .= '<li class="vocab vocab-' . $vocabulary->vid . '"><span class="vocab-name">' . $vocabulary->name . ':</span> <ul class="vocab-list">'; $output .= substr_replace($term_items, '</li>', -(strlen($term_delimiter) + 5)) . '</ul></li>'; } else { $output .= $term_items; } } } } if ($output != '') { $output = $taxonomy_format == 'list' ? substr_replace($output, '</li>', -(strlen($term_delimiter) + 5)) : $output; $output = '<ul class="taxonomy">' . $output . '</ul>'; } $vars['terms'] = $output; } else { $vars['terms'] = ''; } // Node Links if (isset($vars['node']->links['node_read_more'])) { $node_content_type = theme_get_setting('readmore_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['node_read_more'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('readmore_prefix_' . $node_content_type), theme_get_setting('readmore_suffix_' . $node_content_type), t(theme_get_setting('readmore_' . $node_content_type)), 'node/' . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('readmore_title_' . $node_content_type))), 'query' => NULL, 'fragment' => NULL, 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'readmore-item'), 'html' => TRUE); } if (isset($vars['node']->links['comment_add'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; if ($vars['teaser']) { $vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_add_prefix_' . $node_content_type), theme_get_setting('comment_add_suffix_' . $node_content_type), t(theme_get_setting('comment_add_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_add_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-add-item'), 'html' => TRUE); } else { $vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_node_prefix_' . $node_content_type), theme_get_setting('comment_node_suffix_' . $node_content_type), t(theme_get_setting('comment_node_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_node_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-node-item'), 'html' => TRUE); } } if (isset($vars['node']->links['comment_new_comments'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['comment_new_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_new_prefix_' . $node_content_type), theme_get_setting('comment_new_suffix_' . $node_content_type), format_plural(comment_num_new($vars['node']->nid), t(theme_get_setting('comment_new_singular_' . $node_content_type)), t(theme_get_setting('comment_new_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_new_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'new', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-new-item'), 'html' => TRUE); } if (isset($vars['node']->links['comment_comments'])) { $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default'; $vars['node']->links['comment_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_prefix_' . $node_content_type), theme_get_setting('comment_suffix_' . $node_content_type), format_plural(comment_num_all($vars['node']->nid), t(theme_get_setting('comment_singular_' . $node_content_type)), t(theme_get_setting('comment_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comments', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-item'), 'html' => TRUE); } $vars['links'] = theme('links', $vars['node']->links, array('class' => 'links inline')); }
$jobname = $account->profile_job; } print $jobname; ?> </div> <div class="image-and-social"> <?php print nodetype_apachesolr_get_node_image($result['node']->nid); ?> <div class="project-social"> <span class="voting-count"><?php print nodetype_apachesolr_get_votes_count($result['node']->nid); ?> </span> <span class="comments-count"><?php print comment_num_all($result['node']->nid); ?> </span> </div> </div> <h2 class="title"> <?php print l($title, 'node/' . $result['node']->nid, array('attributes' => array('title' => '', 'class' => 'node-' . $result['node']->nid))); ?> </h2> <?php } else { ?> <h2 class="title"> <a href="#" title=""><?php print $title;