示例#1
0
<?php 
fire_plugin_hook('public_content_top', array('view' => $this));
?>

<?php 
if (get_theme_option('Display Featured Collection') !== '0') {
    ?>
<!-- Featured Collection -->
<div id="featured-collection">
    <h2><?php 
    echo __('Featured Collection');
    ?>
</h2>
    <?php 
    echo random_featured_collection();
    ?>
</div><!-- end featured collection -->
<?php 
}
?>

<?php 
if (get_theme_option('Display Featured Exhibit') !== '0' && plugin_is_active('ExhibitBuilder') && function_exists('custom_exhibit_builder_display_random_featured_exhibit')) {
    ?>
<!-- Featured Exhibit in themes/season/custom.php -->
<?php 
    echo custom_exhibit_builder_display_random_featured_exhibit();
}
?>
示例#2
0
<?php 
fire_plugin_hook('public_content_top', array('view' => $this));
?>

<?php 
if (get_theme_option('Display Featured Collection') !== '0') {
    ?>
<!-- Featured Collection -->
<div id="featured-collection">
    <h2><?php 
    echo __('Featured Collection');
    ?>
</h2>
    <?php 
    $featuredCollectionHTML = random_featured_collection();
    //if there is no h3 tag then no collection was found and the placeholder HTML was returned
    if (!($headingStart = strpos($featuredCollectionHTML, '<h3>'))) {
        echo $featuredCollectionHTML;
    } else {
        //put the heading after the image so it can float right of the image
        $imageStart = strpos($featuredCollectionHTML, '<a href');
        $imageEnd = strpos($featuredCollectionHTML, '</div>');
        $featuredCollectionHTML = '<div class="collection record">' . substr($featuredCollectionHTML, $imageStart, $imageEnd - $imageStart) . substr($featuredCollectionHTML, $headingStart, $imageStart - $headingStart) . '</div>';
        echo $featuredCollectionHTML;
    }
    ?>
</div><!-- end featured collection -->
<?php 
}
?>
 /**
  * Checks that the correct message is displayed if there are no featured 
  * collections to display.
  */
 public function testNoRandomFeaturedCollection()
 {
     $this->dispatch('/');
     $html = random_featured_collection();
     $this->assertContains('No featured collections are available.', $html);
 }