Ejemplo n.º 1
0
/**
 * Process variables for search-result.tpl.php.
 *
 * The $variables array contains the following arguments:
 * - $result
 * - $module
 *
 * @see search-result.tpl.php
 */
function ibtimes_my_preprocess_search_result(&$variables)
{
    global $language;
    $result = $variables['result'];
    $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'];
    }
    $node = node_load($result['node']->entity_id);
    $info = array();
    if (!empty($result['module'])) {
        $info['module'] = check_plain($result['module']);
    }
    if (!empty($result['user']) && !empty($node)) {
        $info['user'] = ibtimes_user_get_reporter_name($node);
    }
    if (!empty($result['date'])) {
        $info['date'] = format_date($result['node']->created, 'short');
    }
    if (isset($result['extra']) && is_array($result['extra'])) {
        $info = array_merge($info, $result['extra']);
    }
    if (!empty($result['node']->sm_field_images)) {
        $imgid = str_replace('node:', '', $result['node']->sm_field_images[0]);
        $file = ibtimes_image_get_image($imgid);
        if ($file) {
            $file_style = array('style_name' => 'v2_thumbnail', 'path' => $file, 'alt' => $result['title'], 'title' => $result['title']);
            $variables['image'] = theme('image_style', $file_style);
        }
    }
    // Check for existence. User search does not include snippets.
    $variables['snippet'] = isset($result['snippet']) ? $result['snippet'] : '';
    // Provide separated and grouped meta information..
    $variables['info_split'] = $info;
    $variables['info'] = implode(' - ', $info);
    $variables['theme_hook_suggestions'][] = 'search_result__' . $variables['module'];
}
Ejemplo n.º 2
0
?>
    <div class="print-logo"><?php 
print $print['logo'];
?>
</div>
    <div class="print-site_name"><?php 
print $print['site_name'];
?>
</div>
    <div class="print-header"><?php 
print $print['title'];
?>
</div>
    <div class="author-date-header">
     <span class="author">Di <?php 
print ibtimes_user_get_reporter_name($node);
?>
</span> | <span class="date"><?php 
print format_date($node->created, 'custom', 'F d Y g:i A');
?>
</span>
    </div>
    <!--hr class="print-hr" /-->
    <div class="print-content"><?php 
print $print['content'];
?>
</div>
    <div class="print-footer"><?php 
print $print['footer_message'];
?>
</div>