Esempio n. 1
0
"><?php 
    print $title;
    ?>
</a></h2>
<?php 
}
?>

  <?php 
// Add Status image
foreach ($node->taxonomy as $tid => $tax) {
    if ($node->taxonomy[$tid]->vid == 6) {
        $tids = $tid;
    }
}
print '<div class="pr-status">Status: ' . taxonomy_image_display($tids) . '</div>';
?>

  <?php 
if ($submitted) {
    ?>
    <span class="submitted"><?php 
    print t('!date — !username', array('!username' => theme('username', $node), '!date' => format_date($node->created)));
    ?>
</span>
  <?php 
}
?>

  <div class="content">
    <?php 
Esempio n. 2
0
/**
 * Intercept node template variables
 *
 * @param $vars
 *   A sequential array of variables passed to the theme function.
 */
function vozmob_white_label_preprocess_node(&$vars)
{
    jquery_plugin_add('cycle', 'theme', 'header');
    jquery_plugin_add('expose');
    jquery_plugin_add('overlay');
    drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/cycle.js', 'theme');
    $node = $vars['node'];
    // for easy reference
    // for easy variable adding for different node types
    // jquery_plugin_add('jquery.sound');
    // drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/jquery.sound.js', 'theme');
    // Hackish way of adding video thumbnail into the node view.
    // This should get cleaned up (e.g. using CCK to render media mover video).
    $vars['overlay_launcher'] = FALSE;
    if (empty($node->field_image[0]['view']) && !empty($node->media_mover)) {
        foreach ($node->media_mover as $cid) {
            foreach ($cid as $mmfid) {
                if (substr($mmfid['complete_file'], -4, 4) == '.jpg') {
                    $vars['overlay_launcher'] = TRUE;
                    $vars['overlay_launcher_image'] = $mmfid['complete_file'];
                    break 2;
                }
            }
        }
    }
    // Hackish way of adding audio overlay launcher into the node view.
    // This should get cleaned up (e.g. using CCK to render media mover audio).
    if (!$vars['overlay_launcher'] && empty($node->field_image[0]['view']) && !empty($node->media_mover)) {
        foreach ($node->media_mover as $cid) {
            foreach ($cid as $mmfid) {
                if (substr($mmfid['complete_file'], -4, 4) == '.mp3') {
                    $vars['overlay_launcher'] = TRUE;
                    $vars['overlay_launcher_image'] = drupal_get_path('theme', 'vozmob_white_label') . '/images/' . ($vars['teaser'] ? 'audio_icon_whitebg.gif' : 'audio_icon_large.gif');
                    break 2;
                }
            }
        }
    }
    // split term by vocabulary and format appropriatly
    $vocabulary = array();
    foreach ($node->taxonomy as $tid => $term) {
        $vocabulary[$term->vid]['taxonomy_term_' . $term->tid] = array('tid' => $term->tid, 'name' => $term->name, 'title' => $term->name, 'href' => taxonomy_term_path($term), 'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)), 'path' => taxonomy_term_path($term));
    }
    // tags
    $vars['terms'] = theme('links', $vocabulary[1], array('class' => 'links inline'));
    if (module_exists('uploadterm') && module_exists('taxonomy_image')) {
        // media terms
        $term_image_links = array();
        foreach ($vocabulary[variable_get('uploadterm_vocabulary', 0)] as $term) {
            $term_image_links[] = l(taxonomy_image_display($term['tid']), $term['path'], array('html' => TRUE));
            // can add size here
        }
        $vars['mediaterms'] = theme('item_list', $term_image_links, NULL, 'ul', array('class' => 'links inline media'));
    }
    switch ($node->type) {
        case 'page':
            break;
            //  case 'slideshow': //add the sound plugin
            //    jquery_plugin_add('jquery.sound');
            //    drupal_add_js(drupal_get_path('theme', 'vozmob_white_label') . '/scripts/jquery.sound.js', 'theme');
    }
}
Esempio n. 3
0
/**
* Theme the forums to look like phpBB
*/
function _phptemplate_variables($hook, $vars)
{
    static $is_forum;
    $variables = array();
    if (!isset($is_forum)) {
        if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == '') {
            $nid = arg(1);
        }
        if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
            $nid = arg(2);
        }
        if ($nid) {
            $node = node_load(array('nid' => $nid));
        }
        $is_forum = $node && $node->type == 'forum';
        _is_forum($is_forum);
    }
    if ($is_forum) {
        switch ($hook) {
            case 'comment':
                $variables['template_file'] = 'node-forum';
                $variables['row_class'] = _row_class();
                $variables['name'] = $vars['author'];
                $variables['userid'] = $vars['comment']->uid;
                $joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
                $variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
                $posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
                $variables['posts'] = $posts ? $posts : 0;
                $variables['submitted'] = format_date($vars['comment']->timestamp);
                $subject = $vars['comment']->subject;
                $variables['title'] = empty($subject) ? '&nbsp' : $subject;
                $variables['content'] = $vars['comment']->comment;
                $variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
                break;
            case 'node':
                $variables['row_class'] = _row_class();
                $variables['userid'] = $vars['node']->uid;
                $joined = module_invoke('flatforum', 'get_created', $vars['node']->uid);
                $variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
                $posts = module_invoke('flatforum', 'get', $vars['node']->uid);
                $variables['posts'] = $posts ? $posts : 0;
                $variables['title'] = empty($vars['title']) ? '&nbsp' : $vars['title'];
                $variables['content'] = $vars['node']->body;
                $variables['links'] = empty($vars['links']) ? '&nbsp' : $vars['links'];
                break;
        }
    }
    if ($hook == 'node') {
        if (module_exists("taxonomy_image")) {
            foreach (taxonomy_node_get_terms($vars['node']->nid) as $term) {
                $variables['taxonomy_images'][] = taxonomy_image_display($term->tid);
            }
        }
        if (module_exists("taxonomy_text")) {
            foreach (taxonomy_node_get_terms($vars['node']->nid) as $term) {
                $variables['taxonomy_text'][] = taxonomy_text_display($term->tid);
            }
        }
    }
    return $variables;
}
    print $messages;
}
?>
          <?php 
print $help;
?>
            <div class="clear-block">
              <!-- content section -->
                <?php 
print $breadcrumb;
?>

              <div id="taxonomy-term-wrapper">
                  <div id="taxonomy-term-img-wrapper">
                      <?php 
print taxonomy_image_display($term_id);
?>
                  </div>
                  <div id="taxonomy-term-description-wrapper">
                      <div id="taxonomy-term-title"><?php 
print $term_name;
?>
</div>
                      <div id="taxonomy-term-desc"><?php 
print $term_desc;
?>
</div>
                  </div>
              </div>

                <?php 
/**
 * Override or insert variables into the node templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("node" in this case.)
 */
function vojo_generic_preprocess_node(&$vars, $hook)
{
    if (module_exists('uploadterm') && module_exists('taxonomy_image')) {
        // media terms
        $term_image_links = array();
        foreach ($vocabulary[variable_get('uploadterm_vocabulary', 0)] as $term) {
            $term_image_links[] = l(taxonomy_image_display($term['tid']), $term['path'], array('html' => TRUE));
            // can add size here
        }
        $vars['mediaterms'] = theme('item_list', $term_image_links, NULL, 'ul', array('class' => 'links inline media'));
    }
    // Keep term links sepearate from other node links. No need to display other links twice.
    $vars['taxonomy'] = taxonomy_link('taxonomy terms', $vars['node']);
    unset($vars['taxonomy']['comment_add']);
    unset($vars['taxonomy']['sms_sendtophone']);
    $vars['terms'] = theme('links', $vars['taxonomy'], array('class' => 'inline links'));
}