public function testDisplayNoRandomFeaturedItems()
 {
     $this->_createFeaturedItems(false);
     $this->dispatch('/');
     $html = random_featured_items();
     $this->assertContains('<p>No featured items are available.</p>', $html);
 }
Beispiel #2
0
    </div>

</div>
<!--Side Bar-->
<?php 
if (get_theme_option('Display Featured Item') !== '0') {
    ?>

<!-- Featured Item -->
<div id="featured-item">
    <h2><?php 
    echo __('Featured Item');
    ?>
</h2>
    <?php 
    $featuredItemHTML = random_featured_items(1);
    //if this substring isn't present then no featured item was found and the placeholder HTML was returned
    if (!($beginRemoval = strpos($featuredItemHTML, '<p class="item-description">'))) {
        echo $featuredItemHTML;
    } else {
        //put the heading after the image so it can float right of the image above the description
        $headingStart = strpos($featuredItemHTML, '<h3>');
        $imageStart = strpos($featuredItemHTML, '</h3>') + 5;
        $descriptionStart = strpos($featuredItemHTML, '<p class');
        $descriptionEnd = strpos($featuredItemHTML, '</p>');
        echo '<div class="item record">' . substr($featuredItemHTML, $imageStart, $descriptionStart - $imageStart) . substr($featuredItemHTML, $headingStart, $imageStart - $headingStart) . substr($featuredItemHTML, $descriptionStart, $descriptionEnd - $descriptionStart) . '</div>';
    }
    ?>
</div>
<!--end featured-item-->
<?php 
Beispiel #3
0
    ?>

            </div><!-- end class="item-meta" -->
        </div><!-- end class="item hentry" -->
    <?php 
}
?>
    <?php 
echo fire_plugin_hook('public_items_browse', array('items' => $items, 'view' => $this));
?>

    <?php 
echo pagination_links();
?>
</div>
<div id="secondary">
    <!-- Featured Item -->
    <div id="featured-item" class="featured">
        <h2><?php 
echo __('Featured Item');
?>
</h2>
        <?php 
echo random_featured_items(1);
?>
    </div><!--end featured-item-->

</div><!-- end primary -->

<?php 
echo foot();