$bodyclass .= ' queryresults';
    $maptype = 'queryresults';
} elseif (!empty($auth)) {
    $title = '' . mh_item_label('plural') . ' submitted by "' . $auth . '"';
    $bodyclass .= ' queryresults';
    $maptype = 'queryresults';
} elseif (!empty($subj)) {
    $title = 'Results for subject term "' . $subj . '"';
    $bodyclass .= ' queryresults';
    $maptype = 'queryresults';
} elseif ($query) {
    $title = 'Search Results for "' . $query . '"';
    $bodyclass .= ' queryresults';
    $maptype = 'queryresults';
} else {
    $title = 'All ' . mh_item_label('plural') . '';
    $bodyclass .= ' items stories';
}
echo head(array('maptype' => $maptype, 'title' => $title, 'bodyid' => 'items', 'bodyclass' => $bodyclass));
?>


<div id="content">

<section class="browse stories items">	
	<h2><?php 
$title .= $total_results ? ': <span class="item-number">' . $total_results . '</span>' : '';
echo $title;
?>
</h2>
		
function mh_display_random_item($num = 1)
{
    echo $num <= 1 ? '<h2>Random ' . mh_item_label() . '</h2>' : '<h2>Random ' . mh_item_label('plural') . '</h2>';
    set_loop_records('items', get_random_featured_items($num, true));
    if (has_loop_records('items')) {
        foreach (loop('items') as $item) {
            echo '<article class="item-result">';
            echo '<h3>' . link_to_item(metadata($item, array('Dublin Core', 'Title'))) . '</h3>';
            echo '<div class="item-thumb">' . link_to_item(item_image('square_thumbnail')) . '</div>';
            if ($desc = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 200))) {
                echo '<div class="item-description">' . $desc . '</div>';
            } else {
                echo '<div class="item-description">Text preview unavailable.</div>';
            }
            echo '</article>';
        }
    }
    echo '<p class="view-more-link">' . link_to_items_browse('View all ' . mh_item_label('plural') . '') . '</p>';
}
示例#3
0
    include_once 'stealth-index.php';
} else {
    //if not stealth mode, do everything else
    echo head(array('maptype' => 'focusarea', 'bodyid' => 'home', 'bodyclass' => 'home'));
    ?>

	
<div id="content">
<article id="homepage">

	<div id="desktop-block">
			<section id="custom-block">
				<?php 
    mh_custom_content();
    echo random_item_link("View A Random " . mh_item_label('singular'), 'big-button');
    $text = 'View all <span>' . total_records('Item') . ' ' . mh_item_label('plural') . '</span>';
    echo '<p class="view-more-link">' . link_to_items_browse($text) . '</p>';
    ?>
					
			</section>
				
			<section id="featured-story"> 
				<?php 
    echo mh_display_random_featured_item(true);
    ?>
			</section>	
					
	</div>	
			<section id="home-tours">
				<?php 
    mh_display_random_tours(11);