Example #1
0
function display_page_content()
{
    $gallery_slug = requestIdParam();
    $gallery = Galleries::FindBySlug($gallery_slug);
    foreach ($gallery->get_photos() as $photo) {
        echo "<a href='{$photo->getPublicUrl()}' title='{$photo->caption}'>Photo</a>";
    }
}
Example #2
0
 function getGallery()
 {
     return Galleries::FindBySlug("portfolioGal_" . $this->id . "_" . $this->name);
 }
Example #3
0
function carousel_display($content_to_display)
{
    $pattern_recog = array("left" => array("{", "{"), "right" => array("}", "}"), "center" => array("{", "}"));
    foreach ($pattern_recog as $float => $direction) {
        $carouselPattern = "*" . $direction[0] . "{2}(carousel:[A-Za-z0-9_ \\-]+)" . $direction[1] . "{2}*";
        $carouselSlugs = getFilterIds($content_to_display, $carouselPattern);
        foreach ($carouselSlugs as $slug) {
            $galname = end(explode(":", $slug));
            $carousel = Galleries::FindBySlug($galname);
            if (is_object($carousel)) {
                // Start the Carousel. Width should be set by _required.css
                $replacement = '<figure id="carousel_' . $carousel->slug . '" class="hcd-photo hcd-photo__' . $float . '"><div class="slideshow slideshow__inserted"><div class="slideshow--wrapper flexslider js-slideshow js-gallery"><ul class="slides slideshow--list">';
                // create the LIs in the UL
                foreach ($carousel->get_photos() as $photo) {
                    $url = $photo->getPublicUrl();
                    $caption = cleanupSpecialChars($photo->caption);
                    $replacement .= '<li class="slideshow--item"><div class="slideshow--slide"><a class="slideshow--link js-popup" href="' . $url . '" title="' . $caption . '"><img src="' . $url . '" alt="' . $caption . '" /></a></div></li>';
                }
                $replacement .= "</ul></div></div></figure>";
                $content_to_display = updateContent($content_to_display, "*" . $direction[0] . "{2}carousel:{$carousel->slug}" . $direction[1] . "{2}*", $replacement);
            } else {
                $content_to_display = "<span class=\"database_error\">HCd&gt;CMS Warning: Gallery &ldquo;{$galname}&rdquo; not found!</span> " . $content_to_display;
            }
        }
    }
    return $content_to_display;
}