• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getUrAlbum函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getUrAlbum函数的典型用法代码示例。如果您正苦于以下问题:PHP getUrAlbum函数的具体用法?PHP getUrAlbum怎么用?PHP getUrAlbum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getUrAlbum函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: printAlbumMenuListAlbum

/**
 * Handles an album for printAlbumMenuList
 *
 * @param array $albums albums array
 * @param string $folder
 * @param string $option see printAlbumMenuList
 * @param string $showcount see printAlbumMenuList
 * @param int $showsubs see printAlbumMenuList
 * @param string $css_class see printAlbumMenuList
 * @param string $css_class_topactive see printAlbumMenuList
 * @param string $css_class_active see printAlbumMenuList
 * @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 bool $keeptopactive If set to TRUE the toplevel album entry will stay marked as active if within its subalbums ("list" only)
 * @param int $limit truncation of display text
 */
function printAlbumMenuListAlbum($albums, $folder, $option, $showcount, $showsubs, $css_class, $css_class_topactive, $css_class_active, $firstimagelink, $keeptopactive, $limit = NULL)
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_search, $_recursion_limiter;
    if (is_null($limit)) {
        $limit = MENU_TRUNCATE_STRING;
    }
    if (is_null($showcount)) {
        $showcount = ALBUM_MENU_COUNT;
    }
    if (is_null($showsubs)) {
        $showsubs = ALBUM_MENU_SHOWSUBS;
    }
    if ($showsubs && !is_numeric($showsubs)) {
        $showsubs = 9999999999.0;
    }
    $pagelevel = count(explode('/', $folder));
    $currenturalbumname = "";
    foreach ($albums as $album) {
        $level = count(explode('/', $album));
        $process = $level < $showsubs && $option == "list" || $option != 'list-top' && strpos($folder, $album) === 0 && $level <= $pagelevel;
        if ($process && hasDynamicAlbumSuffix($album) && !is_dir(ALBUM_FOLDER_SERVERPATH . $album)) {
            if (in_array($album, $_recursion_limiter)) {
                $process = false;
            }
            // skip already seen dynamic albums
        }
        $topalbum = newAlbum($album, true);
        if ($level > 1 || $option != 'omit-top') {
            // listing current level album
            if ($level == 1) {
                $css_class_t = $css_class_topactive;
            } else {
                $css_class_t = $css_class_active;
            }
            if ($keeptopactive) {
                if (isset($_zp_current_album) && is_object($_zp_current_album)) {
                    $currenturalbum = getUrAlbum($_zp_current_album);
                    $currenturalbumname = $currenturalbum->name;
                }
            }
            $count = "";
            if ($showcount) {
                $toplevelsubalbums = $topalbum->getAlbums();
                $toplevelsubalbums = count($toplevelsubalbums);
                $topalbumnumimages = $topalbum->getNumImages();
                if ($topalbumnumimages + $toplevelsubalbums > 0) {
                    $count = ' <span style="white-space:nowrap;"><small>(';
                    if ($toplevelsubalbums > 0) {
                        $count .= sprintf(ngettext('%u album', '%u albums', $toplevelsubalbums), $toplevelsubalbums);
                    }
                    if ($topalbumnumimages > 0) {
                        if ($toplevelsubalbums) {
                            $count .= ' ';
                        }
                        $count .= sprintf(ngettext('%u image', '%u images', $topalbumnumimages), $topalbumnumimages);
                    }
                    $count .= ')</small></span>';
                }
            }
            if (in_context(ZP_ALBUM) && !in_context(ZP_SEARCH_LINKED) && (@$_zp_current_album->getID() == $topalbum->getID() || $topalbum->name == $currenturalbumname) || in_context(ZP_SEARCH_LINKED) && ($a = $_zp_current_search->getDynamicAlbum()) && $a->name == $topalbum->name) {
                $current = $css_class_t . ' ';
            } else {
                $current = "";
            }
            $title = $topalbum->getTitle();
            if ($limit) {
                $display = shortenContent($title, $limit, MENU_TRUNCATE_INDICATOR);
            } else {
                $display = $title;
            }
            if ($firstimagelink && $topalbum->getNumImages() != 0) {
                $link = "<li><a " . $current . "href='" . html_encode($topalbum->getImage(0)->getLink()) . "' title='" . html_encode($title) . "'>" . html_encode($display) . "</a>" . $count;
            } else {
                $link = "<li><a " . $current . "href='" . html_encode($topalbum->getLink(1)) . "' title='" . html_encode($title) . "'>" . html_encode($display) . "</a>" . $count;
            }
            echo $link;
        }
        if ($process) {
            // listing subalbums
            $subalbums = $topalbum->getAlbums();
            if (!empty($subalbums)) {
                echo "\n<ul" . $css_class . ">\n";
                array_push($_recursion_limiter, $album);
                printAlbumMenuListAlbum($subalbums, $folder, $option, $showcount, $showsubs, $css_class, $css_class_topactive, $css_class_active, $firstimagelink, false, $limit);
                array_pop($_recursion_limiter);
//.........这里部分代码省略.........
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:101,代码来源:print_album_menu.php


示例2: getGalleryIndexURL

/**
 * Returns the URL of the main gallery index page. If a custom index page is set this returns that page.
 * So this is not necessarily the home page of the site!
 * @return string
 */
function getGalleryIndexURL()
{
    global $_zp_current_album, $_zp_gallery_page;
    if (func_num_args() !== 0) {
        internal_deprecations::getGalleryIndexURL();
    }
    $custom_index = getOption('custom_index_page');
    if ($custom_index) {
        $link = rewrite_path('/' . _PAGE_ . '/' . $custom_index, "/index.php?p=" . $custom_index);
    } else {
        $link = WEBPATH . "/";
    }
    if (in_context(ZP_ALBUM) && $_zp_gallery_page != 'index.php') {
        $album = getUrAlbum($_zp_current_album);
        if (($page = $album->getGalleryPage()) > 1) {
            if ($custom_index) {
                $link = rewrite_path('/' . _PAGE_ . '/' . $custom_index . '/' . $page, "/index.php?p=" . $custom_index . "&amp;page=" . $page);
            } else {
                $link = rewrite_path('/' . _PAGE_ . '/' . $page, "/index.php?" . "page=" . $page);
            }
        }
    }
    return zp_apply_filter('getLink', $link, 'index.php', NULL);
}
开发者ID:IliyanGochev,项目名称:zenphoto,代码行数:29,代码来源:template-functions.php


示例3: setupTheme

/**
 * Returns the theme folder
 * If there is an album theme, loads the theme options.
 *
 * @param object $album album object if override desired
 *
 * @return string
 */
function setupTheme($album = NULL)
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_search, $_zp_themeroot;
    $albumtheme = '';
    if (is_null($album)) {
        if (in_context(ZP_SEARCH_LINKED)) {
            if (!($album = $_zp_current_search->getDynamicAlbum())) {
                $album = $_zp_current_album;
            }
        } else {
            $album = $_zp_current_album;
        }
    }
    $theme = $_zp_gallery->getCurrentTheme();
    $id = 0;
    if (!is_null($album)) {
        $parent = getUrAlbum($album);
        $albumtheme = $parent->getAlbumTheme();
        if (!empty($albumtheme)) {
            $theme = $albumtheme;
            $id = $parent->getID();
        }
    }
    $theme = zp_apply_filter('setupTheme', $theme);
    $_zp_gallery->setCurrentTheme($theme);
    $themeindex = getPlugin('index.php', $theme);
    if (empty($theme) || empty($themeindex)) {
        header('Last-Modified: ' . ZP_LAST_MODIFIED);
        header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
        ?>
		<!DOCTYPE html>
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
			</head>
			<body>
				<strong><?php 
        printf(gettext('Zenphoto found no theme scripts. Please check the <em>%s</em> folder of your installation.'), THEMEFOLDER);
        ?>
</strong>
			</body>
		</html>
		<?php 
        exitZP();
    } else {
        loadLocalOptions($id, $theme);
        $_zp_themeroot = WEBPATH . "/" . THEMEFOLDER . "/{$theme}";
    }
    return $theme;
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:57,代码来源:functions.php


示例4: setupTheme

/**
 * Returns the theme folder
 * If there is an album theme, loads the theme options.
 *
 * @return string
 */
function setupTheme()
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_search, $_zp_options, $_zp_themeroot;
    $albumtheme = '';
    if (in_context(ZP_SEARCH_LINKED)) {
        $name = $_zp_current_search->dynalbumname;
        if (!empty($name)) {
            $album = new Album($_zp_gallery, $name);
        } else {
            $album = NULL;
        }
    } else {
        $album = $_zp_current_album;
    }
    $theme = $_zp_gallery->getCurrentTheme();
    if (!is_null($album)) {
        $parent = getUrAlbum($album);
        $albumtheme = $parent->getAlbumTheme();
    }
    if (!(false === ($requirePath = getPlugin('themeoptions.php', $theme)))) {
        require_once $requirePath;
        $optionHandler = new ThemeOptions();
        /* prime the theme options */
    }
    if (!empty($albumtheme)) {
        $theme = $albumtheme;
        $tbl = prefix('options') . ' WHERE `ownerid`=' . $parent->id;
        //load the album theme options
        $sql = "SELECT `name`, `value` FROM " . $tbl;
        $optionlist = query_full_array($sql, true);
        if ($optionlist !== false) {
            foreach ($optionlist as $option) {
                $_zp_options[$option['name']] = $option['value'];
            }
        }
    }
    $_zp_themeroot = WEBPATH . "/" . THEMEFOLDER . "/{$theme}";
    return $theme;
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:45,代码来源:functions.php


示例5: loadAlbum

function loadAlbum($album)
{
    global $gallery, $_zp_current_album, $_zp_current_image;
    $subalbums = $album->getAlbums();
    $started = false;
    $tcount = $count = 0;
    foreach ($subalbums as $folder) {
        $subalbum = new Album($gallery, $folder);
        if (!$subalbum->isDynamic()) {
            $tcount = $tcount + loadAlbum($subalbum);
        }
    }
    $theme = $gallery->getCurrentTheme();
    $id = 0;
    $parent = getUrAlbum($album);
    $albumtheme = $parent->getAlbumTheme();
    if (!empty($albumtheme)) {
        $theme = $albumtheme;
        $id = $parent->id;
    }
    loadLocalOptions($id, $theme);
    $_zp_current_album = $album;
    if ($album->getNumImages() > 0) {
        echo "<br />" . $album->name . ' ';
        while (next_image(true)) {
            $thumb = getImageThumb();
            if (strpos($thumb, 'i.php?') === false) {
                $thumb = NULL;
            }
            if (isImagePhoto($_zp_current_image)) {
                $image = getDefaultSizedImage();
                if (strpos($image, 'i.php?') === false) {
                    $image = NULL;
                }
            } else {
                $image = NULL;
                if ($_zp_current_image->objectsThumb == NULL) {
                    $thumb = NULL;
                }
            }
            if (!empty($thumb) || !empty($image)) {
                if (!$count) {
                    $started = true;
                    echo "{ ";
                } else {
                    echo ' | ';
                }
            }
            if (!empty($thumb)) {
                echo '<img src="' . $thumb . '" height="8" width="8" /> ';
            }
            if (!empty($image)) {
                echo ' <img src="' . $image . '" height="20" width="20" />';
            }
            if (!empty($thumb) || !empty($image)) {
                echo "\n";
            }
            $count++;
        }
        if ($started) {
            echo ' } ';
        }
        printf(ngettext('[%u image]', '[%u images]', $count), $count);
        echo "<br />\n";
    }
    return $count + $tcount;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:67,代码来源:cache_images.php


示例6: loadAlbum

function loadAlbum($album)
{
    global $_zp_current_album, $_zp_current_image, $_zp_gallery, $custom, $enabled;
    $subalbums = $album->getAlbums();
    $started = false;
    $tcount = $count = 0;
    foreach ($subalbums as $folder) {
        $subalbum = newAlbum($folder);
        if (!$subalbum->isDynamic()) {
            $tcount = $tcount + loadAlbum($subalbum);
        }
    }
    $theme = $_zp_gallery->getCurrentTheme();
    $id = 0;
    $parent = getUrAlbum($album);
    $albumtheme = $parent->getAlbumTheme();
    if (!empty($albumtheme)) {
        $theme = $albumtheme;
        $id = $parent->getID();
    }
    loadLocalOptions($id, $theme);
    $_zp_current_album = $album;
    if ($album->getNumImages() > 0) {
        echo "<br />" . $album->name . ' ';
        while (next_image(true)) {
            if (isImagePhoto($_zp_current_image)) {
                $countit = 0;
                if (in_array('*', $enabled)) {
                    $uri = getFullImageURL(NULL, 'Protected view');
                    if (strpos($uri, 'full-image.php?') !== false) {
                        if (!($count + $countit)) {
                            echo "{ ";
                        } else {
                            echo ' | ';
                        }
                        $countit = 1;
                        ?>
						<a href="<?php 
                        echo html_encode($uri);
                        ?>
&amp;debug">
							<?php 
                        echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="30" width="30" alt="X" />' . "\n";
                        ?>
						</a>
						<?php 
                    }
                }
                foreach ($custom as $key => $cacheimage) {
                    if (in_array($key, $enabled)) {
                        $size = isset($cacheimage['image_size']) ? $cacheimage['image_size'] : NULL;
                        $width = isset($cacheimage['image_width']) ? $cacheimage['image_width'] : NULL;
                        $height = isset($cacheimage['image_height']) ? $cacheimage['image_height'] : NULL;
                        $thumbstandin = isset($cacheimage['thumb']) ? $cacheimage['thumb'] : NULL;
                        if ($special = $thumbstandin === true) {
                            list($special, $cw, $ch, $cx, $cy) = $_zp_current_image->getThumbCropping($size, $width, $height);
                        }
                        if (!$special) {
                            $cw = isset($cacheimage['crop_width']) ? $cacheimage['crop_width'] : NULL;
                            $ch = isset($cacheimage['crop_height']) ? $cacheimage['crop_height'] : NULL;
                            $cx = isset($cacheimage['crop_x']) ? $cacheimage['crop_x'] : NULL;
                            $cy = isset($cacheimage['crop_y']) ? $cacheimage['crop_y'] : NULL;
                        }
                        $effects = isset($cacheimage['gray']) ? $cacheimage['gray'] : NULL;
                        if (isset($cacheimage['wmk'])) {
                            $passedWM = $cacheimage['wmk'];
                        } else {
                            if ($thumbstandin) {
                                $passedWM = getWatermarkParam($_zp_current_image, WATERMARK_THUMB);
                            } else {
                                $passedWM = getWatermarkParam($_zp_current_image, WATERMARK_IMAGE);
                            }
                        }
                        if (isset($cacheimage['maxspace'])) {
                            getMaxSpaceContainer($width, $height, $_zp_current_image, $thumbstandin);
                        }
                        $args = array($size, $width, $height, $cw, $ch, $cx, $cy, NULL, $thumbstandin, NULL, $thumbstandin, $passedWM, NULL, $effects);
                        $args = getImageParameters($args, $album->name);
                        $uri = getImageURI($args, $album->name, $_zp_current_image->filename, $_zp_current_image->filemtime);
                        if (strpos($uri, 'i.php?') !== false) {
                            if (!($count + $countit)) {
                                echo "{ ";
                            } else {
                                echo ' | ';
                            }
                            $countit = 1;
                            ?>
							<a href="<?php 
                            echo html_encode($uri);
                            ?>
&amp;debug">
								<?php 
                            if ($thumbstandin) {
                                echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="15" width="15" alt="x" />' . "\n";
                            } else {
                                echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="20" width="20" alt="X" />' . "\n";
                            }
                            ?>
							</a>
							<?php 
//.........这里部分代码省略.........
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:101,代码来源:cacheImages.php


示例7: prepareCustomPage

/**
 *
 * sets up for loading p=page pages
 * @return string
 */
function prepareCustomPage()
{
    global $_zp_current_album, $_zp_current_image, $_zp_gallery_page, $_zp_script, $_zp_current_search;
    $searchalbums = handleSearchParms('page', $_zp_current_album, $_zp_current_image);
    $album = NULL;
    $page = str_replace(array('/', '\\', '.'), '', sanitize($_GET['p']));
    if (isset($_GET['z'])) {
        // system page
        if ($subfolder = sanitize($_GET['z'])) {
            $subfolder .= '/';
        }
        $_zp_gallery_page = $page . '.php';
        $_zp_script = ZENFOLDER . '/' . $subfolder . $page . '.php';
    } else {
        $_zp_gallery_page = $page . '.php';
        switch ($_zp_gallery_page) {
            case 'search.php':
                if (!empty($searchalbums)) {
                    //	we are within a search of a specific album(s)
                    $albums = array();
                    foreach ($searchalbums as $analbum) {
                        $parent = getUrAlbum(newAlbum($analbum));
                        $albums[$parent->getID()] = $parent;
                    }
                    if (count($albums) == 1) {
                        // there is only one parent album for the search
                        $album = array_shift($albums);
                    }
                }
                break;
        }
    }
    $theme = setupTheme($album);
    if (empty($_zp_script)) {
        $_zp_script = THEMEFOLDER . "/{$theme}/{$page}.php";
    }
    return $theme;
}
开发者ID:elpadi,项目名称:dahlen-studio,代码行数:43,代码来源:functions-controller.php


示例8: getSearchImages

 /**
  * Returns an array of image names found in the search
  *
  * @param string $sorttype what to sort on
  * @param string $sortdirection what direction
  * @param bool $mine set true/false to overried ownership
  * @return array
  */
 private function getSearchImages($sorttype, $sortdirection, $mine = NULL)
 {
     if (getOption('search_no_images') || $this->search_no_images) {
         return array();
     }
     list($sorttype, $sortdirection) = $this->sortKey($sorttype, $sortdirection, 'title', 'images');
     if (is_null($mine) && zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
         $mine = true;
     }
     $searchstring = $this->getSearchString();
     $searchdate = $this->dates;
     if (empty($searchstring) && empty($searchdate)) {
         return array();
     }
     // nothing to find
     $criteria = $this->getCacheTag('images', serialize($searchstring) . ' ' . $searchdate, $sorttype . ' ' . $sortdirection . ' ' . $mine);
     if ($criteria == $this->searches['images']) {
         return $this->images;
     }
     $images = $this->getCachedSearch($criteria);
     if (is_null($images)) {
         if (empty($searchdate)) {
             list($search_query, $weights) = $this->searchFieldsAndTags($searchstring, 'images', $sorttype, $sortdirection);
         } else {
             $search_query = $this->searchDate($searchstring, $searchdate, 'images', $sorttype, $sortdirection);
         }
         if (empty($search_query)) {
             $search_result = false;
         } else {
             $search_result = query($search_query);
         }
         $albums_seen = $images = array();
         if ($search_result) {
             while ($row = db_fetch_assoc($search_result)) {
                 $albumid = $row['albumid'];
                 if (array_key_exists($albumid, $albums_seen)) {
                     $albumrow = $albums_seen[$albumid];
                 } else {
                     $query = "SELECT folder, `show` FROM " . prefix('albums') . " WHERE id = {$albumid}";
                     $row2 = query_single_row($query);
                     // id is unique
                     if ($row2) {
                         $albumname = $row2['folder'];
                         $allow = false;
                         $album = newAlbum($albumname);
                         $uralbum = getUrAlbum($album);
                         $viewUnpublished = $this->search_unpublished || zp_loggedin() && $uralbum->albumSubRights() & (MANAGED_OBJECT_RIGHTS_EDIT | MANAGED_OBJECT_RIGHTS_VIEW);
                         switch (checkPublishDates($row)) {
                             case 1:
                                 $imageobj = newImage($this, $row['filename']);
                                 $imageobj->setShow(0);
                                 $imageobj->save();
                             case 2:
                                 $row['show'] = 0;
                                 break;
                         }
                         if ($mine || is_null($mine) && ($album->isMyItem(LIST_RIGHTS) || checkAlbumPassword($albumname) && ($album->getShow() || $viewUnpublished))) {
                             $allow = empty($this->album_list) || in_array($albumname, $this->album_list);
                         }
                         $albums_seen[$albumid] = $albumrow = array('allow' => $allow, 'viewUnpublished' => $viewUnpublished, 'folder' => $albumname, 'localpath' => ALBUM_FOLDER_SERVERPATH . internalToFilesystem($albumname) . '/');
                     } else {
                         $albums_seen[$albumid] = $albumrow = array('allow' => false, 'viewUnpublished' => false, 'folder' => '', 'localpath' => '');
                     }
                 }
                 if ($albumrow['allow'] && ($row['show'] || $albumrow['viewUnpublished'])) {
                     if (file_exists($albumrow['localpath'] . internalToFilesystem($row['filename']))) {
                         //	still exists
                         $data = array('title' => $row['title'], 'filename' => $row['filename'], 'folder' => $albumrow['folder']);
                         if (isset($weights)) {
                             $data['weight'] = $weights[$row['id']];
                         }
                         $images[] = $data;
                     }
                 }
             }
             db_free_result($search_result);
             if (is_null($sorttype) && isset($weights)) {
                 $images = sortMultiArray($images, 'weight', true, true, false, false, array('weight'));
             }
             if ($sorttype == '`title`') {
                 $images = sortByMultilingual($images, 'title', $sortdirection);
             }
         }
         if (empty($searchdate)) {
             zp_apply_filter('search_statistics', $searchstring, 'images', !empty($images), $this->dynalbumname, $this->iteration++);
         }
         $this->cacheSearch($criteria, $images);
     }
     $this->searches['images'] = $criteria;
     return $images;
 }
开发者ID:elpadi,项目名称:dahlen-studio,代码行数:99,代码来源:class-search.php


示例9: getCustomPageURL

/**
 * Produces the url to a custom page (e.g. one that is not album.php, image.php, or index.php)
 *
 * @param string $linktext Text for the URL
 * @param string $page page name to include in URL
 * @param string $q query string to add to url
 * @return string
 */
function getCustomPageURL($page, $q = '')
{
    global $_zp_current_album, $_zp_conf_vars, $_zp_gallery_page;
    if (array_key_exists($page, $_zp_conf_vars['special_pages'])) {
        $result_r = preg_replace('~^_PAGE_/~', _PAGE_ . '/', $_zp_conf_vars['special_pages'][$page]['rewrite']);
    } else {
        $result_r = '/' . _PAGE_ . '/' . $page;
    }
    $result = "index.php?p={$page}";
    if (in_context(ZP_ALBUM) && $_zp_gallery_page != $page . '.php') {
        $album = getUrAlbum($_zp_current_album);
        if (($pageno = $album->getGalleryPage()) > 1) {
            $result_r .= '/' . $pageno . '/';
            $result .= '&page=' . $pageno;
        }
    }
    if (!empty($q)) {
        $result_r .= "?{$q}";
        $result .= "&{$q}";
    }
    return zp_apply_filter('getLink', rewrite_path($result_r, $result), $page . '.php', NULL);
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:30,代码来源:template-functions.php


示例10: subRights

 /**
  * returns the mitigated album rights.
  * returns NULL if not a managed album
  */
 function subRights()
 {
     global $_zp_admin_album_list;
     if (!is_null($this->subrights)) {
         return $this->subrights;
     }
     $this->subrights = 0;
     if (zp_loggedin()) {
         if (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
             $this->subrights = MANAGED_OBJECT_RIGHTS_EDIT | MANAGED_OBJECT_RIGHTS_UPLOAD | MANAGED_OBJECT_RIGHTS_VIEW;
             return $this->subrights;
         }
         getManagedAlbumList();
         if (count($_zp_admin_album_list) > 0) {
             $uralbum = getUrAlbum($this);
             if ($uralbum->name == $this->name) {
                 if (isset($_zp_admin_album_list[$uralbum->name])) {
                     $this->subrights = $_zp_admin_album_list[$uralbum->name] | MANAGED_OBJECT_MEMBER;
                     if (zp_loggedin(VIEW_UNPUBLISHED_RIGHTS)) {
                         $this->subrights = $this->subrights | MANAGED_OBJECT_RIGHTS_VIEW;
                     }
                 }
             } else {
                 $this->subrights = $uralbum->subRights();
             }
         }
     }
     return $this->subrights;
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:33,代码来源:class-album.php


示例11: getCurrentTheme

/**
 * Returns the name of the currently active theme
 *
 * @return string
 */
function getCurrentTheme()
{
    global $_zp_gallery, $_zp_current_album;
    $theme = $_zp_gallery->getCurrentTheme();
    if (in_context(ZP_ALBUM)) {
        $parent = getUrAlbum($_zp_current_album);
        $albumtheme = $parent->getAlbumTheme();
        if (!empty($albumtheme)) {
            return $albumtheme;
        }
    }
    return $theme;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:18,代码来源:template-functions.php


示例12: getGalleryIndexURL

/**
 * Returns the URL of the main gallery page containing the current album
 *
 * @param bool $relative set to false to get the true index page
 * @return string
 */
function getGalleryIndexURL($relative = true)
{
    global $_zp_current_album, $_zp_gallery_page;
    if ($relative && $_zp_gallery_page != 'index.php' && in_context(ZP_ALBUM)) {
        $album = getUrAlbum($_zp_current_album);
        $page = $album->getGalleryPage();
    } else {
        $page = 0;
    }
    $gallink1 = '';
    $gallink2 = '';
    $specialpage = false;
    if ($relative && ($specialpage = getOption('custom_index_page'))) {
        if (file_exists(SERVERPATH . '/' . THEMEFOLDER . '/' . getOption('current_theme') . '/' . UTF8ToFilesystem($specialpage) . '.php')) {
            $gallink1 = $specialpage . '/';
            $gallink2 = 'p=' . $specialpage . '&';
        } else {
            $specialpage = false;
        }
    }
    if ($page > 1) {
        return rewrite_path("/page/" . $gallink1 . $page, "/index.php?" . $gallink2 . "page=" . $page);
    } else {
        if ($specialpage) {
            return rewrite_path('/page/' . $gallink1, '?' . substr($gallink2, 0, -1));
        }
        return WEBPATH . "/";
    }
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:35,代码来源:template-functions.php


示例13: comment_form_addComment


//.........这里部分代码省略.........
        switch ($goodMessage) {
            case 0:
                $commentobj->setInModeration(2);
                $commentobj->comment_error_text .= sprintf(gettext('Your comment was rejected by the <em>%s</em> SPAM filter.'), $_zp_spamFilter->name);
                $goodMessage = false;
                break;
            case 1:
                $_zp_comment_on_hold = sprintf(gettext('Your comment has been marked for moderation by the <em>%s</em> SPAM filter.'), $_zp_spamFilter->name);
                $commentobj->comment_error_text .= $_zp_comment_on_hold;
                $commentobj->setInModeration(1);
                $moderate = 1;
                break;
            case 2:
                $commentobj->setInModeration(0);
                break;
        }
    }
    $localerrors = $commentobj->getInModeration();
    zp_apply_filter('comment_post', $commentobj, $receiver);
    if ($check === false) {
        // ignore filter provided errors if caller is supplying the fields to check
        $localerrors = $commentobj->getInModeration();
    }
    if ($goodMessage && $localerrors >= 0) {
        // Update the database entry with the new comment
        $commentobj->save();
        //  add to comments array and notify the admin user
        if (!$moderate) {
            $receiver->comments[] = array('name' => $commentobj->getname(), 'email' => $commentobj->getEmail(), 'website' => $commentobj->getWebsite(), 'comment' => $commentobj->getComment(), 'date' => $commentobj->getDateTime(), 'custom_data' => $commentobj->getCustomData());
        }
        switch ($type) {
            case "albums":
                $url = "album=" . pathurlencode($receiver->name);
                $ur_album = getUrAlbum($receiver);
                if ($moderate) {
                    $action = sprintf(gettext('A comment has been placed in moderation on your album “%1$s”.'), $receiver->name);
                } else {
                    $action = sprintf(gettext('A comment has been posted on your album “%1$s”.'), $receiver->name);
                }
                break;
            case "news":
                $url = "p=news&title=" . urlencode($receiver->getTitlelink());
                if ($moderate) {
                    $action = sprintf(gettext('A comment has been placed in moderation on your article “%1$s”.'), $receiver->getTitlelink());
                } else {
                    $action = sprintf(gettext('A comment has been posted on your article “%1$s”.'), $receiver->getTitlelink());
                }
                break;
            case "pages":
                $url = "p=pages&title=" . urlencode($receiver->getTitlelink());
                if ($moderate) {
                    $action = sprintf(gettext('A comment has been placed in moderation on your page “%1$s”.'), $receiver->getTitlelink());
                } else {
                    $action = sprintf(gettext('A comment has been posted on your page “%1$s”.'), $receiver->getTitlelink());
                }
                break;
            default:
                // all image types
                $album = $receiver->getAlbum();
                $url = "album=" . pathurlencode($album->name) . "&image=" . urlencode($receiver->filename);
                $ur_album = getUrAlbum($album);
                if ($moderate) {
                    $action = sprintf(gettext('A comment has been placed in moderation on your image “%1$s” in the album “%2$s”.'), $receiver->getTitle(), $album->name);
                } else {
                    $action = sprintf(gettext('A comment has been posted on your image “%1$s” in the album “%2$s”.'), $receiver->getTitle(), $album->name);
                }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:67,代码来源:functions.php


示例14: setupTheme

/**
 * Returns the theme folder
 * If there is an album theme, loads the theme options.
 *
 * @return string
 */
function setupTheme()
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_search, $_zp_themeroot, $_zp_last_modified;
    if (!is_object($_zp_gallery)) {
        $_zp_gallery = new Gallery();
    }
    $albumtheme = '';
    if (in_context(ZP_SEARCH_LINKED)) {
        $name = $_zp_current_search->dynalbumname;
        if (!empty($name)) {
            $album = new Album($_zp_gallery, $name);
        } else {
            $album = NULL;
        }
    } else {
        $album = $_zp_current_album;
    }
    $theme = $_zp_gallery->getCurrentTheme();
    $id = 0;
    if (!is_null($album)) {
        $parent = getUrAlbum($album);
        $albumtheme = $parent->getAlbumTheme();
        if (!empty($albumtheme)) {
            $theme = $albumtheme;
            $id = $parent->id;
        }
    }
    $theme = zp_apply_filter('setupTheme', $theme);
    $themeindex = getPlugin('index.php', $theme);
    if (empty($theme) || empty($themeindex)) {
        header('Last-Modified: ' . $_zp_last_modified);
        header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
        ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		</head>
		<body>
			<strong><?php 
        printf(gettext('Zenphoto found no theme scripts. Please check the <em>%s</em> folder of your installation.'), THEMEFOLDER);
        ?>
</strong>
		</body>
		</html>
		<?php 
        exit;
    } else {
        loadLocalOptions($id, $theme);
        $_zp_themeroot = WEBPATH . "/" . THEMEFOLDER . "/{$theme}";
    }
    return $theme;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:58,代码来源:functions.php



注:本文中的getUrAlbum函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getUrl函数代码示例发布时间:2022-05-15
下一篇:
PHP getUnprotectedImageURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap