Esempio n. 1
0
function printThemeMenu()
{
    echo '<ul class="menu main">';
    if (getMainSiteName() != '') {
        echo '<li><a href="' . getMainSiteURL() . '" title="' . getMainSiteName() . '">' . getMainSiteName() . '</a></li>';
    }
    echo '<li><a href="' . getGalleryIndexURL() . '" title="' . getGalleryTitle() . '">' . getGalleryTitle() . '</a></li>';
    if (function_exists('printNewsIndexURL')) {
        echo '<li><a href="' . getNewsIndexURL() . '" title="' . gettext('News') . '">' . gettext('News') . '</a></li>';
    }
    if (function_exists("printPageMenu")) {
        printPageMenu("list-top", "", "menu-active", "", "", '', 0, false, '');
    }
    echo '<li><a href="' . getCustomPageURL('archive') . '">' . gettext('Archives') . '</a></li>';
    echo '</ul>';
}
Esempio n. 2
0
function printThemeMenu()
{
    echo '<ul id="main">';
    if (getMainSiteName() != '') {
        echo '<li class="title">' . gettext('Main site') . '</li>';
        echo '<ul>';
        echo '<li><a href="' . getMainSiteURL() . '" title="' . getMainSiteName() . '">' . getMainSiteName() . '</a></li>';
        echo '</ul>';
    }
    if (function_exists('printAlbumMenu')) {
        echo '<li class="title">' . gettext('Gallery') . '</li>';
        $temp = getGalleryTitle();
        printAlbumMenu('list', false, '', 'menu-active', 'submenu', 'menu-active', $temp, true);
    } else {
        echo '<li class="title">' . gettext('Gallery') . '</li>';
        echo '<ul>';
        echo '<li><a href="' . getGalleryIndexURL() . '" title="' . getGalleryTitle() . '">' . getGalleryTitle() . '</a></li>';
        echo '</ul>';
    }
    if (function_exists('printNewsIndexURL')) {
        echo '<li class="title">' . gettext('News blog') . '</li>';
        printAllNewsCategories("All news", FALSE, "", "menu-active");
    }
    if (function_exists("printPageMenu")) {
        echo '<li class="title">' . gettext('Pages') . '</li>';
        printPageMenu("list", "", "menu-active", "submenu", "menu-active");
    }
    echo '<li class="title">' . gettext('Stay informed') . '</li>';
    echo '<ul>';
    echo '<li><a href="' . getCustomPageURL('archive') . '">' . gettext('Archives') . '</a></li>';
    echo '</ul>';
    echo '</ul>';
    echo '<div id="login">';
    echo '<div class="title">' . gettext('Connection') . '</div>';
    if (function_exists('printUserLogin_out') and !zp_loggedin()) {
        printUserLogin_out();
    }
    echo '</div>';
    if (function_exists("printLanguageSelector")) {
        echo '<div id="languages">';
        echo '<div class="title">' . gettext('Languages') . '</div>';
        printLanguageSelector();
        echo '<div class="clear_left"></div>';
        echo '</div>';
    }
}
Esempio n. 3
0
    static function printAlbumMenuJump($option = "", $indexname = "Gallery Index")
    {
        if ($indexname == "Gallery Index") {
            $indexname = gettext($indexname);
        }
        global $_zp_gallery, $_zp_current_album, $_zp_gallery_page;
        $albumpath = rewrite_path("/", "/index.php?album=");
        if (!empty($_zp_current_album) || $_zp_gallery_page != 'album.php') {
            $currentfolder = $_zp_current_album->name;
        }
        ?>
			<script type="text/javaScript">
				function gotoLink(form) {
				 	var OptionIndex=form.ListBoxURL.selectedIndex;
					parent.location = form.ListBoxURL.options[OptionIndex].value;
				}
			</script>
			<form name="AutoListBox" action="#">
				<p>
					<select name="ListBoxURL" size="1" onchange="gotoLink(this.form);">
					<?php 
        if (!empty($indexname)) {
            $selected = self::checkSelectedAlbum("", "index");
            ?>
					<option <?php 
            echo $selected;
            ?>
 value="<?php 
            echo htmlspecialchars(getGalleryIndexURL());
            ?>
"><?php 
            echo $indexname;
            ?>
</option>
					<?php 
        }
        $albums = $_zp_gallery->getAlbums();
        self::printAlbumMenuJumpAlbum($albums, $option, $albumpath);
        ?>
					</select>
				</p>
			</form>
			<?php 
    }
Esempio n. 4
0
/**
* Prints a dropdown menu of all albums(not context sensitive)
* Is used by the wrapper function printAlbumMenu() if the options "jump" is choosen. For standalone use, too.
*
* Usage: add the following to the php page where you wish to use these menus:
* enable this extension on the zenphoto admin plugins tab;
* Call the function printAlbumMenuJump() at the point where you want the menu to appear.
*
* @param string $option "count" for a image counter in brackets behind the album name, "" = for no image numbers
* @param string $indexname insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" if you don't use it, it is not printed then.
* @param bool $firstimagelink If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
* @param string $css_class see printAlbumMenuList
* @param bool $skipform If set to false this prints a full form option select list (default), if set to true it will only print the options
*/
function printAlbumMenuJump($option = "count", $indexname = "Gallery Index", $firstimagelink = false, $showsubs = NULL, $skipform = false)
{
    global $_zp_gallery, $_zp_current_album, $_zp_gallery_page;
    if (!is_null($_zp_current_album) || $_zp_gallery_page == 'album.php') {
        $currentfolder = $_zp_current_album->name;
    }
    if (is_null($showsubs)) {
        $showsubs = ALBUM_MENU_SHOWSUBS;
    }
    if ($showsubs && !is_numeric($showsubs)) {
        $showsubs = 9999999999.0;
    }
    if (!$skipform) {
        ?>
	<script type="text/javaScript">
		// <!-- <![CDATA[
		function gotoLink(form) {
		var OptionIndex=form.ListBoxURL.selectedIndex;
		parent.location = form.ListBoxURL.options[OptionIndex].value;
		}
		// ]]> -->
	</script>
	<form name="AutoListBox" action="#">
		<p>
			<select name="ListBoxURL" size="1" onchange="gotoLink(this.form);">
				<?php 
        if (!empty($indexname)) {
            $selected = checkSelectedAlbum("", "index");
            ?>
					<option <?php 
            echo $selected;
            ?>
 value="<?php 
            echo html_encode(getGalleryIndexURL());
            ?>
"><?php 
            echo $indexname;
            ?>
</option>
					<?php 
        }
    }
    $albums = getNestedAlbumList(null, $showsubs, false);
    foreach ($albums as $album) {
        $albumobj = newAlbum($album['name'], true);
        $count = '';
        if ($option == "count") {
            $numimages = $albumobj->getNumImages();
            if ($numimages != 0) {
                $count = " (" . $numimages . ")";
            }
        }
        $sortorder = count($album['sort_order']);
        $arrow = '';
        if ($sortorder > 1) {
            for ($c = 1; $c != $sortorder; $c++) {
                $arrow .= '» ';
            }
        }
        $selected = checkSelectedAlbum($albumobj->name, "album");
        if ($firstimagelink && $numimages != 0) {
            $link = "<option {$selected} value='" . html_encode($albumobj->getImage(0)->getLink()) . "'>" . $arrow . getBare($albumobj->getTitle()) . $count . "</option>";
        } else {
            $link = "<option {$selected} value='" . html_encode($albumobj->getLink(1)) . "'>" . $arrow . getBare($albumobj->getTitle()) . $count . "</option>";
        }
        echo $link;
    }
    if (!$skipform) {
        ?>
			</select>
		</p>
	</form>
	<?php 
    }
}
Esempio n. 5
0
		<h2><?php 
echo gettext('User Registration');
?>
</h2>
		<?php 
printRegistrationForm();
?>
	</div>
</div>

<p id="path">
	<?php 
printHomeLink('', ' > ');
?>
	<a href="<?php 
echo html_encode(getGalleryIndexURL(false));
?>
" title="<?php 
echo gettext('Main Index');
?>
"><?php 
echo gettext('Home');
?>
</a> &gt;
	<?php 
echo getGalleryTitle();
?>
	<em><?php 
echo gettext('Register');
?>
</em>
/**
 * If a custom gallery index page is set this first prints a link to the actual site index (home page = index.php)
 * followed by the gallery index page link. Otherwise just the gallery index link
 * 
 * @since 1.4.9
 * @param string $after Text to append after and outside the link for breadcrumbs
 * @param string $text Name of the link, if NULL "Gallery" is used
 */
function printGalleryIndexURL($after = NULL, $text = NULL)
{
    global $_zp_gallery_page;
    if (is_null($text)) {
        $text = gettext('Gallery');
    }
    $customgalleryindex = getOption('custom_index_page');
    if ($customgalleryindex) {
        printSiteHomeURL($after);
    }
    if ($_zp_gallery_page == getOption('custom_index_page') . '.php') {
        $after = NULL;
    }
    if (!$customgalleryindex || $customgalleryindex && in_array($_zp_gallery_page, array('image.php', 'album.php', 'gallery.php'))) {
        printLinkHTML(getGalleryIndexURL(), $text, $text, 'galleryindexurl');
        echo $after;
    }
}
Esempio n. 7
0
    $zpmas_cbtransition = 'fade';
}
if (!is_null(getOption('zpmas_cbssspeed'))) {
    $zpmas_cbssspeed = getOption('zpmas_cbssspeed');
} else {
    $zpmas_cbssspeed = 3000;
}
if (!is_null(getOption('zpmas_usenews'))) {
    $zpmas_usenews = getOption('zpmas_usenews');
} else {
    $zpmas_usenews = 3000;
}
if ($zpmas_infscroll) {
    $zpmas_homelink = html_encode(getGalleryIndexURL());
} else {
    $zpmas_homelink = html_encode(getGalleryIndexURL());
}
if ($zpmas_thumbsize == 'small') {
    $zpmas_col_ss = 'colsss';
    $zpmas_col_album = 'col11';
    $zpmas_col_image = 'col4';
    $zpmas_image_size = 108;
    $zpmas_album_size_w = 248;
    $zpmas_ss_size_w = 528;
    if ($zpmas_thumbcrop) {
        $zpmas_album_size_h = 125;
        $zpmas_ss_size_h = 270;
    } else {
        $zpmas_album_size_h = $zpmas_album_size_w;
        $zpmas_ss_size_h = $zpmas_ss_size_w;
    }
Esempio n. 8
0
<?php

Menu::main()->register(new MenuItem("Home", array('tile' => "index", 'href' => getGalleryIndexURL()), "home-menu-item", HOME));
Menu::main()->register(new MenuItem("Gallery", array('tile' => "album", 'href' => getGalleryIndexURL()), "gallery-menu-item", GALLERY));
if (function_exists('getNewsIndexURL')) {
    Menu::main()->register(new MenuItem("Notes", array('tile' => "news", 'href' => Utils::getNewsIndexURL()), "news-menu-item", NEWS));
}
//custom zenpage page
Menu::main()->register(new PageItem("Publications", "publi-menu-item", "publi"));
Menu::secondary()->register(new MenuItem("Theme info", array('tile' => "theme", 'href' => getCustomPageURL("theme-info")), "theme-menu-item", 'THEME'));
Menu::secondary()->register(new MenuItem("Contact", array('tile' => "contact", 'href' => getCustomPageURL("contact")), "contact-menu-item", "CONTACT"));
Menu::secondary()->register(new MenuItem("Search", array('tile' => "search", 'href' => getCustomPageURL('search')), "search-menu-item", ARCHIVES));
Esempio n. 9
0
				<ul class="path c">
					<?php 
if (getMainSiteURL()) {
    ?>
						<li><h1><a href="<?php 
    echo getMainSiteURL();
    ?>
"><?php 
    echo getMainSiteName();
    ?>
</a></h1></li>
					<?php 
}
?>
					<li><h2><a href="<?php 
echo getGalleryIndexURL();
?>
"><?php 
echo getGalleryTitle();
?>
</a></h2></li>
					<li><h3><a><?php 
echo gettext('Register');
?>
</a></h3></li>
				</ul>
			</div>
			<div id="content" class="c">
				<div class="box register">
					<h2><?php 
echo gettext('User Registration');
/**
 * Prints a context sensitive menu of all pages as a unordered html list
 *
 * @param string $option The mode for the menu:
 * 												"list" context sensitive toplevel plus sublevel pages,
 * 												"list-top" only top level pages,
 * 												"omit-top" only sub level pages
 * 												"list-sub" lists only the current pages direct offspring
 * @param string $mode 'pages' or 'categories'
 * @param bool $counter Only $mode = 'categories': Count the articles in each category
 * @param string $css_id CSS id of the top level list
 * @param string $css_class_topactive class of the active item in the top level list
 * @param string $css_class CSS class of the sub level list(s)
 * @param string $$css_class_active CSS class of the sub level list(s)
 * @param string $indexname insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" (default) if you don't use it, it is not printed then.
 * @param int $showsubs Set to depth of sublevels that should be shown always. 0 by default. To show all, set to a true! Only valid if option=="list".
 * @param bool $startlist set to true to output the UL tab (false automatically if you use 'omit-top' or 'list-sub')
 * @param int $limit truncation limit display strings
 * @return string
 */
function printNestedMenu($option = 'list', $mode = NULL, $counter = TRUE, $css_id = NULL, $css_class_topactive = NULL, $css_class = NULL, $css_class_active = NULL, $indexname = NULL, $showsubs = 0, $startlist = true, $limit = NULL)
{
    global $_zp_zenpage, $_zp_gallery_page, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_current_category;
    if (is_null($limit)) {
        $limit = MENU_TRUNCATE_STRING;
    }
    if ($css_id != "") {
        $css_id = " id='" . $css_id . "'";
    }
    if ($css_class_topactive != "") {
        $css_class_topactive = " class='" . $css_class_topactive . "'";
    }
    if ($css_class != "") {
        $css_class = " class='" . $css_class . "'";
    }
    if ($css_class_active != "") {
        $css_class_active = " class='" . $css_class_active . "'";
    }
    if ($showsubs === true) {
        $showsubs = 9999999999.0;
    }
    switch ($mode) {
        case 'pages':
            $items = $_zp_zenpage->getPages();
            $currentitem_id = getPageID();
            if (is_object($_zp_current_zenpage_page)) {
                $currentitem_parentid = $_zp_current_zenpage_page->getParentID();
            } else {
                $currentitem_parentid = NULL;
            }
            $currentitem_sortorder = getPageSortorder();
            break;
        case 'categories':
        case 'allcategories':
            $items = $_zp_zenpage->getAllCategories();
            if (is_object($_zp_current_category) && $mode == 'categories') {
                $currentitem_sortorder = $_zp_current_category->getSortOrder();
                $currentitem_id = $_zp_current_category->getID();
                $currentitem_parentid = $_zp_current_category->getParentID();
            } else {
                $currentitem_sortorder = NULL;
                $currentitem_id = NULL;
                $currentitem_parentid = NULL;
            }
            break;
    }
    // don't highlight current pages or foldout if in search mode as next_page() sets page context
    if (in_context(ZP_SEARCH) && $mode == 'pages') {
        // categories are not searched
        $css_class_topactive = "";
        $css_class_active = "";
        rem_context(ZP_ZENPAGE_PAGE);
    }
    if (0 == count($items) + (int) ($mode == 'allcategories')) {
        return;
    }
    // nothing to do
    $startlist = $startlist && !($option == 'omit-top' || $option == 'list-sub');
    if ($startlist) {
        echo "<ul{$css_id}>";
    }
    // if index link and if if with count
    if (!empty($indexname)) {
        if ($limit) {
            $display = shortenContent($indexname, $limit, MENU_TRUNCATE_INDICATOR);
        } else {
            $display = $indexname;
        }
        switch ($mode) {
            case 'pages':
                if ($_zp_gallery_page == "index.php") {
                    echo "<li {$css_class_topactive}>" . html_encode($display) . "</li>";
                } else {
                    echo "<li><a href='" . html_encode(getGalleryIndexURL()) . "' title='" . html_encode($indexname) . "'>" . html_encode($display) . "</a></li>";
                }
                break;
            case 'categories':
            case 'allcategories':
                if ($_zp_gallery_page == "news.php" && !is_NewsCategory() && !is_NewsArchive() && !is_NewsArticle()) {
                    echo "<li {$css_class_topactive}>" . html_encode($display);
                } else {
                    echo "<li><a href=\"" . html_encode(getNewsIndexURL()) . "\" title=\"" . html_encode($indexname) . "\">" . html_encode($display) . "</a>";
                }
                if ($counter) {
                    if (in_context(ZP_ZENPAGE_NEWS_CATEGORY) && $mode == 'categories') {
                        $totalcount = count($_zp_current_category->getArticles(0));
                    } else {
                        save_context();
                        rem_context(ZP_ZENPAGE_NEWS_DATE);
                        $totalcount = count($_zp_zenpage->getArticles(0));
                        restore_context();
                    }
                    echo ' <span style="white-space:nowrap;"><small>(' . sprintf(ngettext('%u article', '%u articles', $totalcount), $totalcount) . ')</small></span>';
                }
                echo "</li>\n";
                break;
        }
    }
    $baseindent = max(1, count(explode("-", $currentitem_sortorder)));
    $indent = 1;
    $open = array($indent => 0);
    $parents = array(NULL);
    $order = explode('-', $currentitem_sortorder);
    $mylevel = count($order);
    $myparentsort = array_shift($order);
    for ($c = 0; $c <= $mylevel; $c++) {
        $parents[$c] = NULL;
    }
    foreach ($items as $item) {
        switch ($mode) {
            case 'pages':
                $catcount = 1;
                //	so page items all show.
                $pageobj = new ZenpagePage($item['titlelink']);
                $itemtitle = $pageobj->getTitle();
                $itemsortorder = $pageobj->getSortOrder();
                $itemid = $pageobj->getID();
                $itemparentid = $pageobj->getParentID();
                $itemtitlelink = $pageobj->getTitlelink();
                $itemurl = $pageobj->getLink();
                $count = '';
                break;
            case 'categories':
            case 'allcategories':
                $catobj = new ZenpageCategory($item['titlelink']);
                $itemtitle = $catobj->getTitle();
                $itemsortorder = $catobj->getSortOrder();
                $itemid = $catobj->getID();
                $itemparentid = $catobj->getParentID();
                $itemtitlelink = $catobj->getTitlelink();
                $itemurl = $catobj->getLink();
                $catcount = count($catobj->getArticles());
                if ($counter) {
                    $count = ' <span style="white-space:nowrap;"><small>(' . sprintf(ngettext('%u article', '%u articles', $catcount), $catcount) . ')</small></span>';
                } else {
                    $count = '';
                }
                break;
        }
        if ($catcount) {
            $level = max(1, count(explode('-', $itemsortorder)));
            $process = $level <= $showsubs && $option == "list" || ($option == 'list' || $option == 'list-top') && $level == 1 || ($option == 'list' || $option == 'omit-top' && $level > 1) && ($itemid == $currentitem_id || $itemparentid == $currentitem_id || $level < $mylevel && $level > 1 && strpos($itemsortorder, $myparentsort) === 0 || $level == $mylevel && $currentitem_parentid == $itemparentid) || $option == 'list-sub' && $itemparentid == $currentitem_id;
            if ($process) {
                if ($level > $indent) {
                    echo "\n" . str_pad("\t", $indent, "\t") . "<ul{$css_class}>\n";
                    $indent++;
                    $parents[$indent] = NULL;
                    $open[$indent] = 0;
                } else {
                    if ($level < $indent) {
                        $parents[$indent] = NULL;
                        while ($indent > $level) {
                            if ($open[$indent]) {
                                $open[$indent]--;
                                echo "</li>\n";
                            }
                            $indent--;
                            echo str_pad("\t", $indent, "\t") . "</ul>\n";
                        }
                    } else {
                        // level == indent, have not changed
                        if ($open[$indent]) {
                            // level = indent
                            echo str_pad("\t", $indent, "\t") . "</li>\n";
                            $open[$indent]--;
                        } else {
                            echo "\n";
                        }
                    }
                }
                if ($open[$indent]) {
                    // close an open LI if it exists
                    echo "</li>\n";
                    $open[$indent]--;
                }
                echo str_pad("\t", $indent - 1, "\t");
                $open[$indent]++;
                $parents[$indent] = $itemid;
                if ($level == 1) {
                    // top level
                    $class = $css_class_topactive;
                } else {
                    $class = $css_class_active;
                }
                if (!is_null($_zp_current_zenpage_page)) {
                    $gettitle = $_zp_current_zenpage_page->getTitle();
                    $getname = $_zp_current_zenpage_page->getTitlelink();
                } else {
                    if (!is_null($_zp_current_category)) {
                        $gettitle = $_zp_current_category->getTitle();
                        $getname = $_zp_current_category->getTitlelink();
                    } else {
                        $gettitle = '';
                        $getname = '';
                    }
                }
                $current = "";
                if ($itemtitlelink == $getname && !in_context(ZP_SEARCH)) {
                    switch ($mode) {
                        case 'pages':
                            if ($_zp_gallery_page == 'pages.php') {
                                $current = $class;
                            }
                            break;
                        case 'categories':
                        case 'allcategories':
                            if ($_zp_gallery_page == 'news.php') {
                                $current = $class;
                            }
                            break;
                    }
                }
                if ($limit) {
                    $itemtitle = shortenContent($itemtitle, $limit, MENU_TRUNCATE_INDICATOR);
                }
                echo "<li><a {$current} href=\"" . html_encode($itemurl) . "\" title=\"" . html_encode(getBare($itemtitle)) . "\">" . html_encode($itemtitle) . "</a>" . $count;
            }
        }
    }
    // cleanup any hanging list elements
    while ($indent > 1) {
        if ($open[$indent]) {
            echo "</li>\n";
            $open[$indent]--;
        }
        $indent--;
        echo str_pad("\t", $indent, "\t") . "</ul>";
    }
    if ($open[$indent]) {
        echo "</li>\n";
        $open[$indent]--;
    } else {
        echo "\n";
    }
    if ($startlist) {
        echo "</ul>\n";
    }
}
Esempio n. 11
0
/**
 * Prints the above. Included for legacy compatibility
 * @global type $_zp_gallery_page
 * @param type $after
 * @param type $text
 */
function printGalleryIndexURL($after = NULL, $text = NULL)
{
    printLinkHTML(getGalleryIndexURL(), $text, $text, 'galleryindexurl');
    echo $after;
}
Esempio n. 12
0
/**
 * Prints a dropdown menu of all albums(not context sensitive)
 * Is used by the wrapper function printAlbumMenu() if the options "jump" is choosen. For standalone use, too.
 *
 * Usage: add the following to the php page where you wish to use these menus:
 * enable this extension on the zenphoto admin plugins tab;
 * Call the function printAlbumMenuJump() at the point where you want the menu to appear.
 *
 * @param string $option "count" for a image counter in brackets behind the album name, "" = for no image numbers
 * @param string $indexname insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" if you don't use it, it is not printed then.
 * @param bool $firstimagelink If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
 */
function printAlbumMenuJump($option = "count", $indexname = "Gallery Index", $firstimagelink = false)
{
    global $_zp_gallery, $_zp_current_album, $_zp_gallery_page;
    $albumpath = rewrite_path("/", "/index.php?album=");
    if (!is_null($_zp_current_album) || $_zp_gallery_page == 'album.php') {
        $currentfolder = $_zp_current_album->name;
    }
    ?>
	<script type="text/javaScript">
		// <!-- <![CDATA[
		function gotoLink(form) {
		 	var OptionIndex=form.ListBoxURL.selectedIndex;
			parent.location = form.ListBoxURL.options[OptionIndex].value;
		}
		// ]]> -->
	</script>
	<form name="AutoListBox" action="#">
		<p>
			<select name="ListBoxURL" size="1" onchange="gotoLink(this.form);">
			<?php 
    if (!empty($indexname)) {
        $selected = checkSelectedAlbum("", "index");
        ?>
			<option <?php 
        echo $selected;
        ?>
 value="<?php 
        echo html_encode(getGalleryIndexURL());
        ?>
"><?php 
        echo $indexname;
        ?>
</option>
			<?php 
    }
    $albums = $_zp_gallery->getAlbums();
    printAlbumMenuJumpAlbum($albums, $option, $albumpath, $firstimagelink);
    ?>
			</select>
		</p>
	</form>
	<?php 
}
    /**
     * Prints html meta data to be used in the <head> section of a page
     *
     */
    static function getHTMLMetaData()
    {
        global $_zp_gallery, $_zp_galley_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites, $htmlmetatags_need_cache;
        zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
        $host = sanitize("http://" . $_SERVER['HTTP_HOST']);
        $url = $host . getRequestURI();
        // Convert locale shorttag to allowed html meta format
        $locale = str_replace("_", "-", getUserLocale());
        $canonicalurl = '';
        // generate page title, get date
        $pagetitle = "";
        // for gallery index setup below switch
        $date = strftime(DATE_FORMAT);
        // if we don't have a item date use current date
        $desc = getBareGalleryDesc();
        $thumb = '';
        if (getOption('htmlmeta_sitelogo')) {
            $thumb = getOption('htmlmeta_sitelogo');
        }
        $type = 'article';
        switch ($_zp_gallery_page) {
            case 'index.php':
                $desc = getBareGalleryDesc();
                $canonicalurl = $host . getGalleryIndexURL();
                $type = 'website';
                break;
            case 'album.php':
                $pagetitle = getBareAlbumTitle() . " - ";
                $date = getAlbumDate();
                $desc = getBareAlbumDesc();
                $canonicalurl = $host . getAlbumURL();
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumb = $host . getAlbumThumb();
                }
                break;
            case 'image.php':
                $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
                $date = getImageDate();
                $desc = getBareImageDesc();
                $canonicalurl = $host . getImageURL();
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumb = $host . getImageThumb();
                }
                break;
            case 'news.php':
                if (function_exists("is_NewsArticle")) {
                    if (is_NewsArticle()) {
                        $pagetitle = getBareNewsTitle() . " - ";
                        $date = getNewsDate();
                        $desc = trim(getBare(getNewsContent()));
                        $canonicalurl = $host . $_zp_current_zenpage_news->getLink();
                    } else {
                        if (is_NewsCategory()) {
                            $pagetitle = $_zp_current_category->getTitlelink() . " - ";
                            $date = strftime(DATE_FORMAT);
                            $desc = trim(getBare($_zp_current_category->getDesc()));
                            $canonicalurl = $host . $_zp_current_category->getLink();
                            $type = 'category';
                        } else {
                            $pagetitle = gettext('News') . " - ";
                            $desc = '';
                            $canonicalurl = $host . getNewsIndexURL();
                            $type = 'website';
                        }
                    }
                }
                break;
            case 'pages.php':
                $pagetitle = getBarePageTitle() . " - ";
                $date = getPageDate();
                $desc = trim(getBare(getPageContent()));
                $canonicalurl = $host . $_zp_current_zenpage_page->getLink();
                break;
            default:
                // for all other possible static custom pages
                $custompage = stripSuffix($_zp_gallery_page);
                $standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
                if (is_object($_myFavorites)) {
                    $standard['favorites'] = gettext('My favorites');
                }
                if (array_key_exists($custompage, $standard)) {
                    $pagetitle = $standard[$custompage] . " - ";
                } else {
                    $pagetitle = $custompage . " - ";
                }
                $desc = '';
                $canonicalurl = $host . getCustomPageURL($custompage);
                break;
        }
        // shorten desc to the allowed 200 characters if necesssary.
        $desc = html_encode(trim(substr(getBare($desc), 0, 160)));
        $pagetitle = $pagetitle . getBareGalleryTitle();
        // get master admin
        $admin = $_zp_authority->getMasterUser();
        $author = $admin->getName();
        $meta = '';
        if (getOption('htmlmeta_http-equiv-cache-control')) {
            $meta .= '<meta http-equiv="Cache-control" content="' . getOption("htmlmeta_cache_control") . '">' . "\n";
        }
        if (getOption('htmlmeta_http-equiv-pragma')) {
            $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-keywords')) {
            $meta .= '<meta name="keywords" content="' . htmlmetatags::getMetaKeywords() . '">' . "\n";
        }
        if (getOption('htmlmeta_name-description')) {
            $meta .= '<meta name="description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-page-topic')) {
            $meta .= '<meta name="page-topic" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-robots')) {
            $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-publisher')) {
            $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-creator')) {
            $meta .= '<meta name="creator" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-author')) {
            $meta .= '<meta name="author" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-copyright')) {
            $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-rights')) {
            $meta .= '<meta name="rights" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-generator')) {
            $meta .= '<meta name="generator" content="Zenphoto ' . ZENPHOTO_VERSION . '">' . "\n";
        }
        if (getOption('htmlmeta_name-revisit-after')) {
            $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-expires')) {
            $expires = getOption("htmlmeta_expires");
            if ($expires == (int) $expires) {
                $expires = preg_replace('|\\s\\-\\d+|', '', date('r', time() + $expires)) . ' GMT';
            }
            $meta .= '<meta name="expires" content="' . $expires . '">' . "\n";
        }
        // OpenGraph meta
        if (getOption('htmlmeta_og-title')) {
            $meta .= '<meta property="og:title" content="' . $pagetitle . '">' . "\n";
        }
        if (getOption('htmlmeta_og-image') && !empty($thumb)) {
            $meta .= '<meta property="og:image" content="' . $thumb . '">' . "\n";
        }
        if (getOption('htmlmeta_og-description')) {
            $meta .= '<meta property="og:description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_og-url')) {
            $meta .= '<meta property="og:url" content="' . html_encode($url) . '">' . "\n";
        }
        if (getOption('htmlmeta_og-type')) {
            $meta .= '<meta property="og:type" content="' . $type . '">' . "\n";
        }
        // Social network extras
        if (getOption('htmlmeta_name-pinterest')) {
            $meta .= '<meta name="pinterest" content="nopin">' . "\n";
        }
        // dissalow users to pin images on Pinterest
        // Twitter card
        $twittername = getOption('htmlmeta_twittername');
        if (getOption('htmlmeta_twittercard') || !empty($twittername)) {
            $meta .= '<meta property="twitter:creator" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:site" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:card" content="summary">' . "\n";
            $meta .= '<meta property="twitter:title" content="' . $pagetitle . '">' . "\n";
            $meta .= '<meta property="twitter:description" content="' . $desc . '">' . "\n";
            if (!empty($thumb)) {
                $meta .= '<meta property="twitter:image" content="' . $thumb . '">' . "\n";
            }
        }
        // Canonical url
        if (getOption('htmlmeta_canonical-url')) {
            $meta .= '<link rel="canonical" href="' . $canonicalurl . '">' . "\n";
            if (METATAG_LOCALE_TYPE) {
                $langs = generateLanguageList();
                if (count($langs) != 1) {
                    foreach ($langs as $text => $lang) {
                        $langcheck = zpFunctions::getLanguageText($lang, '-');
                        //	for hreflang we need en-US
                        if ($langcheck != $locale) {
                            switch (METATAG_LOCALE_TYPE) {
                                case 1:
                                    $altlink = seo_locale::localePath(true, $lang);
                                    break;
                                case 2:
                                    $altlink = dynamic_locale::fullHostPath($lang);
                                    break;
                            }
                            switch ($_zp_gallery_page) {
                                case 'index.php':
                                    break;
                                case 'album.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name);
                                    break;
                                case 'image.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name) . '/' . html_encode($_zp_current_image->filename) . IM_SUFFIX;
                                    break;
                                case 'news.php':
                                    if (function_exists("is_NewsArticle")) {
                                        if (is_NewsArticle()) {
                                            $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_zenpage_news->getTitlelink());
                                        } else {
                                            if (is_NewsCategory()) {
                                                $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_category->getTitlelink());
                                            } else {
                                                $altlink .= '/' . _NEWS_;
                                            }
                                        }
                                    }
                                    break;
                                case 'pages.php':
                                    $altlink .= '/' . _PAGES_ . '/' . html_encode($_zp_current_zenpage_page->getTitlelink());
                                    break;
                                case 'archive.php':
                                    $altlink .= '/' . $_zp_conf_vars['special_pages']['archive']['rewrite'] . '/';
                                    break;
                                case 'search.php':
                                    $altlink .= '/' . $_zp_conf_vars['special_pages']['search']['rewrite'] . '/';
                                    break;
                                case 'contact.php':
                                    $altlink .= '/' . _PAGE_ . '/contact';
                                    break;
                                default:
                                    // for all other possible none standard custom pages
                                    $altlink .= '/' . _PAGE_ . '/' . html_encode($pagetitle);
                                    break;
                            }
                            // switch
                            $meta .= '<link rel="alternate" hreflang="' . $langcheck . '" href="' . $altlink . '">' . "\n";
                        }
                        // if lang
                    }
                    // foreach
                }
                // if count
            }
            // if option
        }
        // if canonical
        if (!empty($htmlmetatags_need_cache)) {
            $meta .= '<script type="text/javascript">' . "\n";
            $meta .= 'var caches = ["' . implode('","', $htmlmetatags_need_cache) . '"];' . "\n";
            $meta .= '
					window.onload = function() {
						var index,value;
						for (index in caches) {
								value = caches[index];
								$.ajax({
									cache: false,
									type: "GET",
									url: value
								});
						}
					}
					';
            $meta .= '</script>' . "\n";
        }
        zp_remove_filter('image_processor_uri', 'htmlmetatags::ipURI');
        echo $meta;
    }
Esempio n. 14
0
zenJavascript();
?>
	<title><?php 
echo getBareGalleryTitle();
?>
</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php 
echo $_zp_themeroot;
?>
/css/master.css" />
	<?php 
printRSSHeaderLink('Gallery', 'Gallery RSS');
setOption('thumb_crop_width', 85, false);
setOption('thumb_crop_height', 85, false);
$archivepageURL = htmlspecialchars(getGalleryIndexURL());
?>
</head>

<body class="index">
	<?php 
echo getGalleryTitle();
if (getOption('Allow_search')) {
    printSearchForm('');
}
?>

	<div id="content">

		<h1><?php 
echo getGalleryTitle();
Esempio n. 15
0
			<div id="logo">
<?php 
echo getGalleryLogo();
?>
			</div>
			<div id="gallery_title">
<?php 
echo getGalleryTitleHeader();
?>
			</div>
		</div>
		<div id="breadcrumb">
			<ul>
				<?php 
getFormattedMainSiteName('<li class="page">', '</li><li class="chevron"> > </li>');
echo '<li><a href="' . getGalleryIndexURL() . '">' . getBareGalleryTitle() . '</a></li>';
getParentBreadcrumbTLB('<li class="chevron"><a> &gt; </a></li>');
echo '<li class="chevron"><a> &gt; </a></li>';
echo '<li><a href="' . getAlbumURL() . '">' . getBareAlbumTitle() . '</a></li>';
echo '<li class="chevron"><a> &gt; </a></li>';
echo '<li><a>' . getBareImageTitle() . '</a></li>';
?>
			</ul>
		</div>
		<div id="menu">
<?php 
printThemeMenu();
?>
		</div>
		<div id="content" class="c">
			<div id="description">
Esempio n. 16
0
    ?>
"><?php 
    echo gettext("next");
    ?>
 &raquo;</a></div>
			<?php 
}
?>
		</div>
	</div>

<div id="content">

	<div id="breadcrumb">
	<h2><a href="<?php 
echo getGalleryIndexURL(false);
?>
" title="<?php 
gettext('Index');
?>
"><?php 
echo gettext("Index");
?>
</a> &raquo; <?php 
echo gettext("Gallery");
printParentBreadcrumb(" &raquo; ", " &raquo; ", " &raquo; ");
printAlbumBreadcrumb(" ", " &raquo; ");
?>
			 <strong><?php 
printImageTitle(true);
?>
Esempio n. 17
0
echo getBareGalleryTitle();
?>
</title>
	<meta http-equiv="content-type" content="text/html; charset=<?php 
echo LOCAL_CHARSET;
?>
" />
	<link rel="stylesheet" type="text/css" media="screen, projection" href="<?php 
echo $_zp_themeroot;
?>
/css/master.css" />
	<?php 
printRSSHeaderLink('Gallery', gettext('Gallery RSS'));
setOption('thumb_crop_width', 85, false);
setOption('thumb_crop_height', 85, false);
$archivepageURL = html_encode(getGalleryIndexURL());
?>
</head>

<body class="index">
	<?php 
zp_apply_filter('theme_body_open');
?>
	<?php 
echo getGalleryTitle();
if (getOption('Allow_search')) {
    printSearchForm('');
}
?>

	<div id="content">
Esempio n. 18
0
    ?>
				<a href="<?php 
    echo htmlspecialchars(getGalleryIndexURL(false));
    ?>
" title="<?php 
    echo gettext('Main Index');
    ?>
"><?php 
    echo gettext('Home');
    ?>
</a> | 
				<?php 
}
?>
				<a href="<?php 
echo htmlspecialchars(getGalleryIndexURL());
?>
" title="<?php 
echo gettext('Albums Index');
?>
"><?php 
echo getGalleryTitle();
?>
</a></span>  | 
				<?php 
echo gettext('Object not found');
?>
			</div>
		</div>

	</div>
/**
 * Prints a dropdown menu of all albums up to the 4 sublevel (not context sensitive)
 * Is used by the wrapper function printAlbumMenu() if the options "jump" is choosen. For standalone use, too.
 *
 * Usage: add the following to the php page where you wish to use these menus:
 * enable this extension on the zenphoto admin plugins tab;
 * Call the function printAlbumMenuJump() at the point where you want the menu to appear.
 *
 * @param string $option "count" for a image counter in brackets behind the album name, "" = for no image numbers
 * @param string $indexname insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" if you don't use it, it is not printed then.
 */
function printAlbumMenuJump($option = "count", $indexname = "Gallery Index")
{
    global $_zp_gallery, $_zp_current_album;
    $albumpath = rewrite_path("/", "/index.php?album=");
    if (!empty($_zp_current_album)) {
        $currentfolder = $_zp_current_album->name;
    }
    ?>
<form name="AutoListBox" action="#">
<p><select name="ListBoxURL" size="1"
		onchange="gotoLink(this.form);">
		<?php 
    if (!empty($indexname)) {
        $selected = checkSelectedAlbum("", "index");
        ?>
		<option <?php 
        echo $selected;
        ?>
 value="<?php 
        echo htmlspecialchars(getGalleryIndexURL());
        ?>
"><?php 
        echo $indexname;
        ?>
</option>
		<?php 
    }
    /**** TOPALBUM LEVEL ****/
    $gallery = $_zp_gallery;
    $albums = $_zp_gallery->getAlbums();
    foreach ($albums as $toplevelalbum) {
        $topalbum = new Album($gallery, $toplevelalbum, true);
        createAlbumMenuLink($topalbum, $option, "", $albumpath, "jump", 0);
        /**** SUBALBUM LEVEL 1 ****/
        $subalbums1 = $topalbum->getSubAlbums();
        foreach ($subalbums1 as $sublevelalbum1) {
            $subalbum1 = new Album($gallery, $sublevelalbum1, true);
            createAlbumMenuLink($subalbum1, $option, "", $albumpath, "jump", 1);
            /**** SUBALBUM LEVEL 2 ****/
            $subalbums2 = $subalbum1->getSubAlbums();
            foreach ($subalbums2 as $sublevelalbum2) {
                $subalbum2 = new Album($gallery, $sublevelalbum2, true);
                createAlbumMenuLink($subalbum2, $option, "", $albumpath, "jump", 2);
                /**** SUBALBUM LEVEL 3 ****/
                $subalbums3 = $subalbum2->getSubAlbums();
                foreach ($subalbums3 as $sublevelalbum3) {
                    $subalbum3 = new Album($gallery, $sublevelalbum3, true);
                    createAlbumMenuLink($subalbum3, $option, "", $albumpath, "jump", 3);
                    /**** SUBALBUM LEVEL 4 ****/
                    $subalbums4 = $subalbum3->getSubAlbums();
                    foreach ($subalbums4 as $sublevelalbum4) {
                        $subalbum4 = new Album($gallery, $sublevelalbum4, true);
                        createAlbumMenuLink($subalbum4, $option, "", $albumpath, "jump", 4);
                    }
                }
            }
        }
    }
    ?>
</select></p>
<script type="text/javaScript">
<!--
function gotoLink(form) {
 	var OptionIndex=form.ListBoxURL.selectedIndex;
	parent.location = form.ListBoxURL.options[OptionIndex].value;}
//-->
</script></form>
<?php 
}
Esempio n. 20
0
        ?>
								<a href="<?php 
        echo html_encode(getGalleryIndexURL());
        ?>
" title="<?php 
        echo gettext('Main Index');
        ?>
"><?php 
        printGalleryTitle();
        ?>
</a>
								<?php 
    } else {
        ?>
								<a href="<?php 
        echo html_encode(getGalleryIndexURL());
        ?>
" title="<?php 
        echo gettext('Albums Index');
        ?>
"><?php 
        printGalleryTitle();
        ?>
</a>
								<?php 
    }
    ?>
</a></span> |
						<?php 
    echo "<em>" . gettext('Contact') . "</em>";
    ?>
Esempio n. 21
0
function printBaseAlbumMenuJump($option = "count", $indexname = "Gallery Index", $firstimagelink = false)
{
    $type = getOption('zpbase_selectmenu');
    if ($type) {
        require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/print_album_menu.php';
        global $_zp_gallery, $_zp_current_album, $_zp_gallery_page;
        $albumpath = rewrite_path("/", "/index.php?album=");
        if (!is_null($_zp_current_album) || $_zp_gallery_page == 'album.php') {
            $currentfolder = $_zp_current_album->name;
        }
        if ($type == 'standard') {
            ?>
	<script type="text/javaScript">
		// <!-- <![CDATA[
		function gotoLink(form) {
		var OptionIndex=form.ListBoxURL.selectedIndex;
		parent.location = form.ListBoxURL.options[OptionIndex].value;
		}
		// ]]> -->
	</script>
	<form>
	<select name="ListBoxURL" size="1" onchange="gotoLink(this.form);">
	<?php 
        } else {
            ?>
	<form>
	<select>
	<?php 
        }
        if (getOption('zpbase_galleryishome')) {
            if ($_zp_gallery_page == "index.php" || $_zp_gallery_page == "album.php") {
                ?>
		<option <?php 
                if ($_zp_gallery_page == "index.php") {
                    echo 'selected';
                }
                ?>
 value="<?php 
                echo html_encode(getGalleryIndexURL());
                ?>
"><?php 
                echo $indexname;
                ?>
</option>
		<?php 
            } else {
                ?>
		<option selected value=""><?php 
                echo gettext('Select Album...');
                ?>
</option>
		<option value="<?php 
                echo html_encode(getGalleryIndexURL());
                ?>
"><?php 
                echo $indexname;
                ?>
</option>
		<?php 
            }
        } else {
            ?>
		<option <?php 
            if ($_zp_gallery_page == "index.php") {
                echo 'selected';
            }
            ?>
 value="<?php 
            echo html_encode(getGalleryIndexURL());
            ?>
"><?php 
            echo gettext('Home');
            ?>
</option>
		<?php 
            if ($_zp_gallery_page == "gallery.php" || $_zp_gallery_page == "album.php") {
                ?>
		<option <?php 
                if ($_zp_gallery_page == "gallery.php") {
                    echo 'selected';
                }
                ?>
 value="<?php 
                echo getCustomPageURL('gallery');
                ?>
"><?php 
                echo $indexname;
                ?>
</option>
		<?php 
            } else {
                ?>
		<?php 
                if ($_zp_gallery_page != "index.php") {
                    ?>
<option selected value=""><?php 
                    echo gettext('Select Album...');
                    ?>
</option><?php 
                }
                ?>
		<option value="<?php 
                echo getCustomPageURL('gallery');
                ?>
"><?php 
                echo $indexname;
                ?>
</option>
		<?php 
            }
        }
        printAlbumMenuJump($option, "", $firstimagelink, NULL, true);
        ?>
	</select>
	</form>

<?php 
    }
}