?>

<div id="node-<?php 
print $node->nid;
?>
" class="node <?php 
print $node_classes;
?>
">
  <div class="inner">
    <div id="contest-banner">
      <!-- IMAGE -->
      <?php 
if (isset($field_detail_image_contest[0]['filepath']) && !$is_edit) {
    $preset = variable_get('nivaria_contests_base_preset_contest_closed', 'Featured');
    print theme_imagecache($preset, $field_detail_image_contest[0]['filepath'], $title);
}
?>
      <!-- END IMAGE -->

      <div class="contest-titles">
        <!-- TITLE -->
        <?php 
if ($page == 0) {
    ?>
        <h2 class="title"><a href="<?php 
    print $node_url;
    ?>
" title="<?php 
    print $title;
    ?>
 */
?>
<li>
  <!-- Project Inscription custom result template -->
  <?php 
if (isset($result['node']->nid)) {
    ?>
    <?php 
    $account = user_load($result['node']->uid);
    ?>
    <?php 
    if ($account && !empty($account->picture)) {
        ?>
    <div class="user-image">
      <?php 
        print theme_imagecache('user_picture_meta', $account->picture, $account->name);
        ?>
    </div>
    <?php 
    }
    ?>
    <?php 
    print l($account->realname, 'user/' . $result['node']->uid, array('attributes' => array('title' => $account->realname, 'class' => 'user-' . $result['node']->uid)));
    ?>
     <div class="job">
        <?php 
    $jobname = '';
    if (!empty($account->profile_job)) {
        $jobname = $account->profile_job;
    }
    print $jobname;
示例#3
0
/**
 * Implementation of theme_shoutbox_post()
 */
function commons_roots_shoutbox_post($shout, $links = array(), $alter_row_color = TRUE)
{
    global $user;
    // Gather moderation links
    if ($links) {
        foreach ($links as $link) {
            $linkattributes = $link['linkattributes'];
            $link_html = '<img src="' . $link['img'] . '"  width="' . $link['img_width'] . '" height="' . $link['img_height'] . '" alt="' . $link['title'] . '" class="shoutbox-imglink"/>';
            $link_url = 'shout/' . $shout->shout_id . '/' . $link['action'];
            $img_links = l($link_html, $link_url, array('html' => TRUE, 'query' => array('destination' => drupal_get_path_alias($_GET['q'])))) . $img_links;
        }
    }
    // Generate user name with link
    $user_name = shoutbox_get_user_link($shout);
    // Generate title attribute
    $title = t('Posted !date at !time by !name', array('!date' => format_date($shout->created, 'custom', 'm/d/y'), '!time' => format_date($shout->created, 'custom', 'h:ia'), '!name' => $shout->nick));
    // Add to the shout classes
    $shout_classes = array();
    $shout_classes[] = 'shoutbox-msg';
    // Check for moderation
    if ($shout->moderate == 1) {
        $shout_classes[] = 'shoutbox-unpublished';
        $approval_message = '&nbsp;(' . t('This shout is waiting for approval by a moderator.') . ')';
    }
    // Check for specific user class
    $user_classes = array();
    $user_classes[] = 'shoutbox-user-name';
    if ($shout->uid == $user->uid) {
        $user_classes[] = 'shoutbox-current-user-name';
    } else {
        if ($shout->uid == 0) {
            $user_classes[] = 'shoutbox-anonymous-user';
        }
    }
    // Load user image and format
    $author_picture = '';
    $shout_author = user_load($shout->uid);
    if (!$shout_author->picture && variable_get('user_picture_default', '')) {
        $shout_author->picture = variable_get('user_picture_default', '');
    }
    if ($shout_author->picture) {
        $author_picture = theme_imagecache('user_picture_meta', $shout_author->picture, $shout_author->name, $shout_author->name);
    }
    // Time format
    $format = variable_get('shoutbox_time_format', 'ago');
    switch ($format) {
        case 'ago':
            $submitted = t('!interval ago', array('!interval' => format_interval(time() - $shout->created)));
            break;
        case 'small':
        case 'medium':
        case 'large':
            $submitted = format_date($shout->created, $format);
            break;
    }
    // Build the post
    $post = '';
    $post .= '<div class="' . implode(' ', $shout_classes) . '" title="' . $title . '">';
    $post .= '<div class="shoutbox-admin-links">' . $img_links . '</div>';
    $post .= '<div class="shoutbox-post-info">' . $author_picture;
    $post .= '<span class="shoutbox-user-name ' . implode(' ', $user_classes) . '">' . $user_name . '</span>';
    $post .= '<span class="shoutbox-msg-time">' . $submitted . '</span>';
    $post .= '</div>';
    $post .= '<div class="shout-message">' . $shout->shout . $approval_message . '</div>';
    $post .= '</div>' . "\n";
    return $post;
}
示例#4
0
文件: template.php 项目: ramsalt/kr
function kr2011_preprocess_node(&$vars)
{
    if ($vars['type'] == 'Article') {
        if (strlen($vars['field_article_fakta'][0]['value']) > 4) {
            $vars['fakta'] = $vars['field_article_fakta'][0]['safe'];
        }
        if (strlen($vars['field_teaser'][0]['value']) > 2) {
            $vars['ingress'] = 1;
            $vars['ingress_value'] = $vars['field_teaser'][0]['safe'];
        }
        foreach ($vars['field_sitat'] as $sitatlinje) {
            $sitater .= '<div class="sitat-line"><span>' . $sitatlinje['value'] . '</span></div>';
            if (strlen($sitatlinje['value']) > 2) {
                $vars['sitat'] = 1;
            }
        }
        $vars['sitat_content'] = '<div class="sitat-wrapper">' . $sitater . '</div>';
        $updated = format_date($vars['node']->changed, 'medium');
        if ($vars['node']->changed != $vars['node']->created) {
            $vars['node_updated_rdfa'] = _openpublish_get_rdfa_date($vars['node']->changed, $updated);
        }
        //  $vars['node_created_rdfa'] = _openpublish_get_rdfa_date($vars['node']->created, $vars['node_created']);
        //  $vars['node_created_rdfa'] .= _openpublish_get_rdfa_date($vars['node']->updated, $updated);
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/js/kr2011.js', 'theme', 'footer');
        //	print_R($vars['node']);
    } elseif ($vars['type'] == 'bildegalleri') {
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/flex/jquery.min.js');
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/flex/jquery-noconflict.js');
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/flex/jquery.flexslider.js', 'theme', 'header');
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/flex/jquery.colorbox.js', 'theme', 'header');
        drupal_add_css(drupal_get_path('theme', 'kr2011') . '/flex/flexslider.css');
        drupal_add_css(drupal_get_path('theme', 'kr2011') . '/flex/kr-flex.css');
        drupal_add_css(drupal_get_path('theme', 'kr2011') . '/flex/colorbox.css');
        drupal_add_js(drupal_get_path('theme', 'kr2011') . '/flex/bilde.js', 'theme', 'header');
        $hidden = '<div class="colorbox-images-container">';
        $html = '<div class="flexslider">
        <ul class="slides">';
        foreach ($vars['field_galleri_bilde'] as $delta => $item) {
            $html .= '<li>';
            $html .= '<a class="colorboks1" href="#bilde_' . $vars['nid'] . '_' . $delta . '">';
            $html .= $item['view'];
            if ($vars['field_galleri_desc'][$delta]['safe'] && $vars['field_galleri_kredit'][$delta]['safe']) {
                $html .= '<p>' . $vars['field_galleri_desc'][$delta]['safe'];
                $html .= '<span class="kredit">' . $vars['field_galleri_kredit'][$delta]['safe'] . '</span></p>';
            } elseif ($vars['field_galleri_desc'][$delta]['safe']) {
                $html .= '<p>' . $vars['field_galleri_desc'][$delta]['safe'] . '</p>';
            } elseif ($vars['field_galleri_kredit'][$delta]['safe']) {
                $html .= '<p><span class="kredit">' . $vars['field_galleri_kredit'][$delta]['safe'] . '</span></p>';
            }
            $html .= '</a>';
            $html .= '</li>';
            $image = image_get_info(imagecache_create_path('slider_stort', $vars['field_galleri_bilde'][$delta]['filepath']));
            //<img src="'.imagecache_create_path('slider_stort', $vars['field_galleri_bilde'][$delta]['filepath']).'">
            $hidden .= '<div id="bilde_' . $vars['nid'] . '_' . $delta . '" class="cimage">
      ' . theme_imagecache('slider_stort', $vars['field_galleri_bilde'][$delta]['filepath']) . '
      
      <div class="caption">' . $vars['field_galleri_desc'][$delta]['safe'] . '</div>
      </div>';
        }
        $html .= '</ul></div>';
        $hidden .= '</div>';
        $vars['content'] = $html;
        $vars['content'] .= $hidden;
    } elseif ($vars['type'] == 'eksternt_blogginnlegg') {
        $blogcontent = node_load($vars['nid']);
        $blog = node_load($blogcontent->feeds_node_item->feed_nid);
        $html = '<div class="bloginfo">';
        $html .= '<div class="section-date-author">';
        $date_label = date('d. ', $blogcontent->created) . t(date('M', $blogcontent->created)) . date(' Y - H:i', $blogcontent->created);
        $html .= _openpublish_get_rdfa_date($blogcontent->created, $date_label);
        $html .= ' | Fra bloggen: ' . l($blog->title, 'node/' . $blog->nid);
        $html .= '</div></div>';
        $html2 = '<div class="bloggfooter">Dette blogginnlegget er hentet fra: ' . l($blogcontent->feeds_node_item->url, $blogcontent->feeds_node_item->url) . '</div>';
        $vars['content'] = $html . $vars['content'] . $html2;
    }
}
        ?>
    <div class="inscription-code">
        <?php 
        print t('Your identifier is !code', array('!code' => $field_inscription_code[0]['value']));
        ?>
    </div>
    <?php 
    }
    ?>
    <!-- Identifier Code -->

    <!-- IMAGE -->
    <?php 
    if (isset($field_contest_image[0]['filepath']) && !$is_edit) {
        $preset = 'inscriptions_336_162';
        print theme_imagecache($preset, $field_contest_image[0]['filepath'], $contest_title);
    }
    ?>
    <!-- END IMAGE -->

    <!-- INSCRIPTION LIMIT DATE -->
    <?php 
    if (!$is_edit && isset($contest) && $contest->field_contest_state[0]['value'] == ContestState::OPEN) {
        print show_contest_dates_in_inscription_detail($contest);
    }
    ?>
    <!-- END INSCRIPTION LIMIT DATE -->

    <!-- INSCRIPTION, PAYMENT OR PRESENTATION LINK -->
    <?php 
    if (!$is_edit && isset($contest) && $contest->field_contest_state[0]['value'] == ContestState::OPEN && $node->field_inscription_state[0]['value'] != InscriptionState::PREINSCRIPTED) {
示例#6
0
文件: template.php 项目: ramsalt/kr
function kr2012_preprocess_search_result(&$variables)
{
    global $language;
    $result = $variables['result'];
    $variables['url'] = check_url($result['link']);
    $variables['url'] = str_replace('178.79.186.243', 'kommunal-rapport.no', $variables['url']);
    $variables['title'] = check_plain($result['title']);
    if (isset($result['language']) && $result['language'] != $language->language && $result['language'] != LANGUAGE_NONE) {
        $variables['title_attributes_array']['xml:lang'] = $result['language'];
        $variables['content_attributes_array']['xml:lang'] = $result['language'];
    }
    $info = array();
    if (!empty($result['module'])) {
        $info['module'] = check_plain($result['module']);
    }
    if (!empty($result['user'])) {
        $info['user'] = $result['user'];
    }
    if (!empty($result['date'])) {
        $info['date'] = format_date($result['date'], 'short');
    }
    if (isset($result['extra']) && is_array($result['extra'])) {
        $info = array_merge($info, $result['extra']);
    }
    // Check for existence. User search does not include snippets.
    //$variables['snippet'] = isset($result['snippet']) ? $result['snippet'] : '';
    //dsm($variables);
    $node = node_load($variables['result']['node']->entity_id);
    $variables['snippet'] = strip_tags($node->teaser);
    if (isset($node->field_main_image[0])) {
        $variables['bilde'] = theme_imagecache('thumbnail', $node->field_main_image[0]['filepath']);
    }
    // Provide separated and grouped meta information..
    $variables['info_split'] = $info;
    $variables['info'] = implode(' - ', $info);
    $variables['theme_hook_suggestions'][] = 'search_result__' . $variables['module'];
}
    <?php 
if ($terms) {
    ?>
    <div class="terms">
      <?php 
    print $terms;
    ?>
    </div>
    <?php 
}
?>

    <div class="content clearfix">
        <div class="colaborator-top">
           <?php 
print theme_imagecache('image_220_220', $field_square_image_col[0]['filepath'], $node->title);
?>
            <h1 class="title"><?php 
print $node->title;
?>
</h1>
            <div class="short-description">
            <?php 
print $field_short_description[0]['value'];
?>
            </div>
            <?php 
print $field_link_col_rendered;
?>
            <?php 
print $field_colaborator_type_col_rendered;
<div class="heartbeat-message-block <?php 
print $message->message_id . ' ' . $zebra;
?>
">

  <div class="beat-item" id="beat-item-<?php 
print $message->uaid;
?>
">

<div class="beat-item-info">
   <?php 
if (!empty($message->actor->picture)) {
    ?>
   <span class="heartbeat_times"><?php 
    print theme_imagecache('user_picture_meta', $message->actor->picture, $message->actor->name, $message->actor->name);
    ?>
</span>
   <?php 
}
?>
   <?php 
if (!empty($message->content['time_info'])) {
    ?>
    <span class="heartbeat_times"><?php 
    print $message->content['time_info'];
    ?>
</span>
    <?php 
}
?>