示例#1
0
 function FindLastPage($perpage)
 {
     // Get the total number of posts
     $allgalleries = Galleries::FindAll();
     $rows = count($allgalleries);
     // Find the page number of the last page
     return ceil($rows / $perpage);
 }
if (in_array(getRequestVarAtIndex(1), $pages)) {
    echo "\t<div id=\"areachild\" class=\"dropslide\"";
    if (getRequestVarAtIndex(1) == "add_page") {
        echo ">\n";
    } else {
        echo " style=\"display: none;\">\n";
    }
    SUB_PAGES ? require_once snippetPath("admin-area_child") : (require_once snippetPath("admin-area"));
    echo "\t</div>\n";
}
$documents = Documents::FindAll();
require_once snippetPath("admin-insertDoc");
$images = Images::FindAll();
require_once snippetPath("admin-insertImage");
if (GALLERY_INSTALL && !in_array(getRequestVarAtIndex(1), $portfolio)) {
    $galleries = Galleries::FindAll("DESC");
    require_once snippetPath("admin-insertGallery");
}
if (PORTFOLIO_INSTALL && (ITEM_GALLERY_INSERT && !in_array(getRequestVarAtIndex(1), $portfolio))) {
    //$galleries = Galleries::FindAll();
    require_once snippetPath("admin-insertItemGallery");
}
if (VIDEO_INSTALL) {
    require_once snippetPath("admin-insertVideo");
}
if (TESTIMONIAL_INSTALL) {
    require_once snippetPath("admin-insertTestimonial");
}
if (PRODUCT_INSTALL) {
    $products = Product::FindAll();
    require_once snippetPath("admin-insertProduct");
示例#3
0
function display_page_content()
{
    $galleries = Galleries::FindAll("DESC");
    ?>

	<div id="edit-header" class="gallerynav">
		<div class="nav-left column">
    		<h1>Choose a Gallery to Edit</h1>
		</div>
		<div class="nav-right column">
            <a href="<?php 
    echo get_link("admin/add_gallery");
    ?>
" class="hcd_button">Add a New Gallery</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
<?php 
    if (isset($galleries) && count($galleries) > 0) {
        ?>
	
	<div id="table-header" class="documents">
		<strong class="item-link">Gallery Name &amp; Thumbnail</strong>
		<span class="item-public">Image Count</span>
	</div>
	
	<ul id="listgalleries" class="managelist">
<?php 
        foreach ($galleries as $gallery) {
            $count = $gallery->number_of_photos();
            $thumb = $gallery->get_thumb();
            echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_gallery/{$gallery->id}") . "\">";
            if ($thumb) {
                echo "<img src=\"{$thumb->getPublicUrl()}\" alt=\"{$gallery->name}\" />";
            }
            echo "{$gallery->name}</a></span>\n\t\t\t<span class=\"item-public\">{$count} images</span>";
            if (in_array($gallery->id, explode(",", PROTECTED_ADMIN_GALLERIES))) {
                echo "<span class=\"item-public red\">This gallery is used by a template. It can not be deleted.</span>";
            }
            echo "</li>\n";
        }
        ?>
	
	</ul>
<?php 
    } else {
        echo "<h3 class=\"empty-list\">There are no galleries yet! <a href=\"" . get_link("admin/add_gallery") . "\">Add one if you like</a>.</h3>\n";
    }
    ?>
	
	<p>&nbsp;</p>
	<h3>More about Galleries</h3>
	<p>Galleries can be inserted into content for pages and other things with a shortcode that looks like this:</p>
	<p><span style="color: #137;">}}gallery:name-of-galley}}</span></p>
	<p>The direction of the curly braces in the shortcode define how the gallery will lay out. For example: </p>
	<ul>
		<li><span style="color: #137; display: inline-block; width: 280px;">{{gallery:name-of-galley}}</span> Gallery will center in the content and be as large as the column will allow</li>
		<li><span style="color: #137; display: inline-block; width: 280px;">}}gallery:name-of-galley}}</span> Gallery will float left (the braces point left) and display as a thumbnail</li>
		<li><span style="color: #137; display: inline-block; width: 280px;">{{gallery:name-of-galley{{</span> Gallery will float right (the braces point right) and display as a thumbnail</li>
	</ul>
	<p>Other patterns display galleries as different types of collections of images. Here are the other patterns:</p>
	<ul>
		<li><span style="color: #137; display: inline-block; width: 280px;">{{carousel:name-of-gallery{{</span> Inserts an auto-scrolling carousel and displays it much like the gallery will display. Images can also be opened in a lightbox. </li>
		<li><span style="color: #137; display: inline-block; width: 280px;">{{random-from-gallery:name-of-gallery{{</span> Inserts one image randomly from the gallery, and floats it right or left or centers the image accordingly.</li>
	</ul>
<?php 
}
<!-- Insert an Item Gallery function -->
<div id="itemgal_insert" class="dropslide" style="display: none; ">
	<p><span class="hint">Click the name of the Item Gallery to insert the link to it in the edit window above. </span> The system will insert the default gallery link: }}gallery:name-of-gallery}}. The direction of the braces &ldquo;design&rdquo; the display &ndash; pointing left, the thumbnail floats left; pointing right, the thumbnail floats right; and centered, the thumbnail displays large in the content column. Other allowed values and patterns are: {{carousel:name-of-gallery{{ or {{random-from-gallery:name-of-gallery{{ </p>
<?php 
$itemgals = Galleries::FindAll("DESC", false);
if (count($itemgals) > 0) {
    ?>
	
	<table class="dropdown" cellpadding="0" cellspacing="0" border="0" width="98%">
		<tbody>
			<tr>
<?php 
    $counter_gal = 1;
    foreach ($itemgals as $gallery) {
        if ($counter_gal == 4) {
            echo "\t\t\t</tr><tr>\n";
            $counter_gal = 1;
        }
        $thumb = $gallery->get_thumb();
        if ($thumb) {
            ?>
			
				<td class="gallerythumb divider" valign="top"><a href="#" onclick="insertDocument('gallery:<?php 
            echo $gallery->slug;
            ?>
', '}}', '}}'); return false;"><img src="<?php 
            echo $thumb->getPublicUrl();
            ?>
"> <?php 
            echo $gallery->name;
            ?>