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

PHP newAlbum函数代码示例

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

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



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

示例1: toolbox

    static function toolbox($albumname, $imagename)
    {
        $album = newAlbum($albumname);
        if ($album->isMyItem(ALBUM_RIGHTS)) {
            $image = newimage($album, $imagename);
            if (isImagePhoto($image)) {
                ?>
				<li>
					<a href="<?php 
                echo WEBPATH . "/" . ZENFOLDER . '/' . PLUGIN_FOLDER;
                ?>
/crop_image.php?a=<?php 
                echo pathurlencode($albumname);
                ?>
						 &amp;i=<?php 
                echo urlencode($imagename);
                ?>
&amp;performcrop=frontend "><?php 
                echo gettext("Crop image");
                ?>
</a>
				</li>
				<?php 
            }
        }
    }
开发者ID:rb26,项目名称:zenphoto,代码行数:26,代码来源:crop_image.php


示例2: checkFolder

 function checkFolder($album)
 {
     global $count, $albumcount;
     $subalbums = $album->getAlbums(0);
     foreach ($subalbums as $subalbum) {
         $obj = newAlbum($subalbum);
         cleanAlbum($obj);
     }
     $folder = $album->name . '/';
     $files = $album->getImages(0);
     foreach ($files as $filename) {
         $seoname = seoFriendly($filename);
         if (stripSuffix($seoname) != stripSuffix($filename)) {
             $image = newImage($album, $filename);
             if ($e = $image->rename($seoname)) {
                 $error = getE($e, $filename, $seoname);
                 printf(gettext('<em>%1$s</em> rename to <em>%2$s</em> failed: %3$s'), $folder . $filename, $seoname, $error);
                 echo "<br />\n";
             } else {
                 $image->save();
                 clearstatcache();
                 echo '&nbsp;&nbsp;';
                 printf(gettext('<em>%1$s</em> renamed to <em>%2$s</em>'), $folder . $filename, $seoname);
                 echo "<br />\n";
                 $count++;
             }
         }
     }
 }
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:29,代码来源:seo_cleanup.php


示例3: createImages

 static function createImages($rows)
 {
     global $_zp_gallery;
     $images = array();
     $g = empty($_zp_gallery) ? new Gallery() : $_zp_gallery;
     foreach ($rows as $r) {
         $image = newImage(newAlbum($r['folder']), $r['filename']);
         $images[] = $image;
     }
     return $images;
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:11,代码来源:functions.php


示例4: unpublishSubalbums

function unpublishSubalbums($album)
{
    global $_zp_gallery;
    $albums = $album->getAlbums();
    foreach ($albums as $albumname) {
        $subalbum = newAlbum($albumname);
        $subalbum->setShow(false);
        $subalbum->save();
        unpublishSubalbums($subalbum);
    }
}
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:11,代码来源:publishContent.php


示例5: getOptionsSupported

 function getOptionsSupported()
 {
     $showdates_checkboxes = array(gettext('Albums') => 'libratus_date_albums', gettext('Images') => 'libratus_date_images', gettext('News') => 'libratus_date_news', gettext('Pages') => 'libratus_date_pages');
     $stats_checkboxes = array(gettext('Images - Popular') => 'libratus_stats_images_popular', gettext('Images - Latest by ID') => 'libratus_stats_images_latestbyid', gettext('Images - Latest by Date') => 'libratus_stats_images_latestbydate', gettext('Images - Latest by mtime') => 'libratus_stats_images_latestbymtime', gettext('Images - Latest by Publish Date') => 'libratus_stats_images_latestbypdate', gettext('Images - Most Rated') => 'libratus_stats_images_mostrated', gettext('Images - Top Rated') => 'libratus_stats_images_toprated', gettext('Albums - Popular') => 'libratus_stats_albums_popular', gettext('Albums - Latest by ID') => 'libratus_stats_albums_latestbyid', gettext('Albums - Latest by Date') => 'libratus_stats_albums_latestbydate', gettext('Albums - Latest by mtime') => 'libratus_stats_albums_latestbymtime', gettext('Albums - Latest by Publish Date') => 'libratus_stats_albums_latestbypdate', gettext('Albums - Most Rated') => 'libratus_stats_albums_mostrated', gettext('Albums - Top Rated') => 'libratus_stats_albums_toprated', gettext('Albums - Latest Updated') => 'libratus_stats_albums_latestupdated');
     $bottom_stats_checkboxes = array(gettext('Gallery - Description') => 'libratus_stats_gal_desc_bottom', gettext('News - Latest') => 'libratus_stats_news_latest_bottom', gettext('Comments - Latest') => 'libratus_stats_comments_latest_bottom', gettext('Images - Popular') => 'libratus_stats_images_popular_bottom', gettext('Images - Latest by ID') => 'libratus_stats_images_latestbyid_bottom', gettext('Images - Latest by Date') => 'libratus_stats_images_latestbydate_bottom', gettext('Images - Latest by mtime') => 'libratus_stats_images_latestbymtime_bottom', gettext('Images - Latest by Publish Date') => 'libratus_stats_images_latestbypdate_bottom', gettext('Images - Most Rated') => 'libratus_stats_images_mostrated_bottom', gettext('Images - Top Rated') => 'libratus_stats_images_toprated_bottom', gettext('Albums - Popular') => 'libratus_stats_albums_popular_bottom', gettext('Albums - Latest by ID') => 'libratus_stats_albums_latestbyid_bottom', gettext('Albums - Latest by Date') => 'libratus_stats_albums_latestbydate_bottom', gettext('Albums - Latest by mtime') => 'libratus_stats_albums_latestbymtime_bottom', gettext('Albums - Latest by Publish Date') => 'libratus_stats_albums_latestbypdate_bottom', gettext('Albums - Most Rated') => 'libratus_stats_albums_mostrated_bottom', gettext('Albums - Top Rated') => 'libratus_stats_albums_toprated_bottom', gettext('Albums - Latest Updated') => 'libratus_stats_albums_latestupdated_bottom');
     global $_zp_gallery;
     $albumlist = array();
     $albumlist['Entire Gallery'] = '';
     $albums = getNestedAlbumList(null, 9999999, false);
     foreach ($albums as $album) {
         $albumobj = newAlbum($album['name'], true);
         $albumlist[$album['name']] = $album['name'];
     }
     return array(gettext('Max Width of Site') => array('key' => 'libratus_maxwidth', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 1, 'multilingual' => 0, 'desc' => gettext('Set the max-width of site in pixels.  Site is fluid but will not expand beyond this width.')), gettext('Home Slideshow Type') => array('key' => 'libratus_ss_type', 'type' => OPTION_TYPE_SELECTOR, 'order' => 2, 'selections' => array(gettext('Random') => 'random', gettext('Popular') => 'popular', gettext('Latest by ID') => 'latestbyid', gettext('Latest by Date') => 'latestbydate', gettext('Latest by mtime') => 'latestbymtime', gettext('Latest by Publish Date') => 'latestbypdate', gettext('Most Rated') => 'mostrated', gettext('Top Rated') => 'toprated'), 'desc' => gettext('Select what image statistic to show on the frontpage slideshow.')), gettext('Home Slideshow from Album') => array('key' => 'libratus_ss_album', 'type' => OPTION_TYPE_SELECTOR, 'order' => 3, 'selections' => $albumlist, 'desc' => gettext('Optionally select a specific album the Home Slideshow pulls from. Default is "Entire Gallery", which pulls from the entire gallery. Be careful with this option to ensure there are images that meet the statistic and they are viewable (rights), otherwise no images will show.')), gettext('Slideshow Interval') => array('key' => 'libratus_ss_interval', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 4, 'multilingual' => 0, 'desc' => gettext('In milliseconds (default 5000).')), gettext('Home Page Full-width') => array('key' => 'libratus_index_fullwidth', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 5, 'desc' => gettext("Check for album thumbs to full-width on home page (no sidebar statistics menu with search).")), gettext('Show Date') => array('key' => 'libratus_date', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 6, 'checkboxes' => $showdates_checkboxes, 'desc' => gettext("Toggle whether to display dates in albums, images, news, and pages. On \"pages\", libratus shows last updated date if checked. Note that you need to show dates on images, or on news, for those to show on the archive page.")), gettext('Download Button') => array('key' => 'libratus_download', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 7, 'desc' => gettext("Check to enable users the ability to download original image from image details page. If you want a save dialog, you will need to set the appropriate option in options->image as well (protected, download).")), gettext('Simple Social Sharing?') => array('key' => 'libratus_social', 'type' => OPTION_TYPE_CHECKBOX, 'order' => 8, 'desc' => gettext("Check to display simple links (lightweight) for users to share to their Facebook, Google, and Twitter accounts. Make sure to enable the meta tags plugin and enable the og entries for these sites to pull the correct thumbs, titles, and descriptions upon share.")), gettext('Custom CSS') => array('key' => 'libratus_customcss', 'type' => OPTION_TYPE_TEXTAREA, 'order' => 9, 'multilingual' => 0, 'desc' => gettext('Enter any custom CSS, safely carries over upon theme upgrade. Will be placed between style tags in the head.')), gettext('Google Tracking Code') => array('key' => 'libratus_analytics', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 10, 'multilingual' => 0, 'desc' => gettext('Enter your Google Analytics Universal Tracking Id here to auto insert the tracking code on every page (UA-...). Leave blank to omit. Note that the analytics code will not be outputted for admin users, so that administrator page visits will not be counted.')), gettext('Tracking Type') => array('key' => 'libratus_analytics_type', 'type' => OPTION_TYPE_RADIO, 'order' => 11, 'buttons' => array(gettext('Universal') => 'universal', gettext('Classic') => 'classic'), 'desc' => gettext("Select what type of analytics you are using. See your Google analytics account for explanations.")), gettext('Facebook Link') => array('key' => 'libratus_facebook', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 12, 'multilingual' => 0, 'desc' => gettext('Enter your full Facebook page link (http://....). Leave blank to omit.')), gettext('Twitter Link') => array('key' => 'libratus_twitter', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 13, 'multilingual' => 0, 'desc' => gettext('Enter your full Twitter page link (http://....). Leave blank to omit.')), gettext('Google+ Link') => array('key' => 'libratus_google', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 14, 'multilingual' => 0, 'desc' => gettext('Enter your full Google+ page link (http://....). Leave blank to omit.')), gettext('Copyright Text') => array('key' => 'libratus_copy', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 15, 'multilingual' => 0, 'desc' => gettext('Edit text for footer copyright. Leave blank to omit.')), gettext('Statistical Pages on Archive') => array('key' => 'libratus_stats', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 16, 'checkboxes' => $stats_checkboxes, 'desc' => gettext('Select which statistical pages to show in the archive side menu and homepage side menu (optional), if any.')), gettext('Statistical Pages Number') => array('key' => 'libratus_stats_number', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 17, 'multilingual' => 0, 'desc' => gettext('Enter the number of images or albums to show for each statistic on the archive pages (default 30).')), gettext('Bottom Stats Items per Row') => array('key' => 'libratus_bottom_stats_perrow', 'type' => OPTION_TYPE_RADIO, 'order' => 18, 'buttons' => array(gettext('Disable') => 0, gettext('1') => 1, gettext('2') => 2, gettext('3') => 3, gettext('4') => 4), 'desc' => gettext("Select how many items per row for the bottom stats, if any.")), gettext('Bottom Stats') => array('key' => 'libratus_bottom_stats', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => 19, 'checkboxes' => $bottom_stats_checkboxes, 'desc' => gettext('Select what to show in the bottom row, if not disabled above. Recommended to choose multiples of the option items per row.')), gettext('Number of Images in Bottom Stats') => array('key' => 'libratus_bottom_stats_number', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 20, 'multilingual' => 0, 'desc' => gettext('Enter the number of images or albums to show for each selected statistic in the bottom footer.')), gettext('Related Max Number') => array('key' => 'libratus_related_maxnumber', 'type' => OPTION_TYPE_TEXTBOX, 'order' => 21, 'multilingual' => 0, 'desc' => gettext('Enter the MAX number of related albums and images to show on their respective pages (if plugin is enabled).')));
 }
开发者ID:ckfreeman,项目名称:libratus,代码行数:15,代码来源:themeoptions.php


示例6: getSubalbumImages

function getSubalbumImages($folder)
{
    global $imagelist, $_zp_gallery;
    $album = newAlbum($folder);
    if ($album->isDynamic()) {
        return;
    }
    $images = $album->getImages();
    foreach ($images as $image) {
        $imagelist[] = '/' . $folder . '/' . $image;
    }
    $albums = $album->getAlbums();
    foreach ($albums as $folder) {
        getSubalbumImages($folder);
    }
}
开发者ID:rb26,项目名称:zenphoto,代码行数:16,代码来源:admin-dynamic-album.php


示例7: uploadPhoto

function uploadPhoto($ip, $image, $nick, $email, $path, $albumName)
{
    $existsAlbum = isAlbum($nick, $albumName);
    if (!$existsAlbum) {
        if (!newAlbum($ip, $nick, $email, $albumName, "private", "DEFAULT")) {
            return '1';
        }
    }
    if (uploadImage($image, $path)) {
        $newPhoto = addPhoto($nick, $path, $albumName);
        if (!newPhoto and !$existsAlbum) {
            deleteAlbum($nick, $albumName);
            // Remove Photo
            return '2';
        }
        addAction($nick, $email, $ip, 'new_photo');
        return '0';
    }
    return '3';
}
开发者ID:jagumiel,项目名称:bigou-Album,代码行数:20,代码来源:photo_logic.php


示例8: getSitemapImages

/**
 * currently this splitts only sitemaps for albums and its images. Spliting the images itself requires a major rework...
 *
 * Gets links to all images for all albums (album by album)
 *
 * @return string
 */
function getSitemapImages()
{
    global $_zp_gallery, $sitemap_number;
    $data = '';
    $sitemap_locales = generateLanguageList();
    $imagechangefreq = getOption('sitemap_changefreq_images');
    $imagelastmod = getOption('sitemap_lastmod_images');
    $limit = sitemap_getDBLimit(1);
    $albums = array();
    getSitemapAlbumList($_zp_gallery, $albums, 'passImages');
    $offset = $sitemap_number - 1;
    $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
    if ($albums) {
        $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
        if (GOOGLE_SITEMAP) {
            $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">');
        } else {
            $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
        }
        foreach ($albums as $album) {
            @set_time_limit(120);
            //	Extend script timeout to allow for gathering the images.
            $albumobj = newAlbum($album['folder']);
            $images = $albumobj->getImages();
            // print plain images links if available
            if ($images) {
                foreach ($images as $image) {
                    $imageobj = newImage($albumobj, $image);
                    $ext = getSuffix($imageobj->filename);
                    $date = sitemap_getDateformat($imageobj, $imagelastmod);
                    switch (SITEMAP_LOCALE_TYPE) {
                        case 1:
                            foreach ($sitemap_locales as $locale) {
                                $path = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX;
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
                                if (GOOGLE_SITEMAP) {
                                    $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, $locale);
                                }
                                $data .= sitemap_echonl("</url>");
                            }
                            break;
                        case 2:
                            foreach ($sitemap_locales as $locale) {
                                $path = rewrite_path(pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX, '?album=' . pathurlencode($albumobj->name) . '&amp;image=' . urlencode($imageobj->filename), dynamic_locale::fullHostPath($locale));
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
                                if (GOOGLE_SITEMAP) {
                                    $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, $locale);
                                }
                                $data .= sitemap_echonl("</url>");
                            }
                            break;
                        default:
                            $path = rewrite_path(pathurlencode($albumobj->name) . '/' . urlencode($imageobj->filename) . IM_SUFFIX, '?album=' . pathurlencode($albumobj->name) . '&amp;image=' . urlencode($imageobj->filename), FULLWEBPATH);
                            $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $path . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $imagechangefreq . "</changefreq>\n\t\t<priority>0.6</priority>\n");
                            if (GOOGLE_SITEMAP) {
                                $data .= getSitemapGoogleImageVideoExtras($albumobj, $imageobj, NULL);
                            }
                            $data .= sitemap_echonl("</url>");
                            break;
                    }
                }
            }
        }
        $data .= sitemap_echonl('</urlset>');
        // End off the <urlset> tag
    }
    return $data;
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:75,代码来源:sitemap-extended.php


示例9: getNestedAlbumList

/**
 * generates a nested list of albums for the album tab sorting
 * Returns an array of "albums" each element contains:
 * 								'name' which is the folder name
 * 								'sort_order' which is an array of the sort order set
 *
 * @param $subalbum root level album (NULL is the gallery)
 * @param $levels how far to nest
 * @param $level internal for keeping the sort order elements
 * @return array
 */
function getNestedAlbumList($subalbum, $levels, $level = array())
{
    global $_zp_gallery;
    $cur = count($level);
    $levels--;
    // make it 0 relative to sync with $cur
    if (is_null($subalbum)) {
        $albums = $_zp_gallery->getAlbums();
    } else {
        $albums = $subalbum->getAlbums();
    }
    $list = array();
    foreach ($albums as $analbum) {
        $albumobj = newAlbum($analbum);
        if (!is_null($subalbum) || $albumobj->isMyItem(ALBUM_RIGHTS)) {
            $level[$cur] = sprintf('%03u', $albumobj->getSortOrder());
            $list[] = array('name' => $analbum, 'sort_order' => $level);
            if ($cur < $levels && $albumobj->getNumAlbums() && !$albumobj->isDynamic()) {
                $list = array_merge($list, getNestedAlbumList($albumobj, $levels + 1, $level));
            }
        }
    }
    return $list;
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:35,代码来源:functions.php


示例10: zenpageAlbumImage

/**
 * support to show an image from an album
 * The imagename is optional. If absent the album thumb image will be
 * used and the link will be to the album. If present the link will be
 * to the image.
 *
 * @param string $albumname
 * @param string $imagename
 * @param int $size the size to make the image. If omitted image will be 50% of 'image_size' option.
 * @param bool $linkalbum set true to link specific image to album instead of image
 */
function zenpageAlbumImage($albumname, $imagename = NULL, $size = NULL, $linkalbum = false)
{
    global $_zp_gallery;
    echo '<br />';
    $album = newAlbum($albumname);
    if ($album->loaded) {
        if (is_null($size)) {
            $size = floor(getOption('image_size') * 0.5);
        }
        $image = NULL;
        if (is_null($imagename)) {
            $linkalbum = true;
            $image = $album->getAlbumThumbImage();
        } else {
            $image = newImage($album, $imagename);
        }
        if ($image && $image->loaded) {
            makeImageCurrent($image);
            if ($linkalbum) {
                rem_context(ZP_IMAGE);
                echo '<a href="' . html_encode($album->getLink()) . '"   title="' . sprintf(gettext('View the %s album'), $albumname) . '">';
                add_context(ZP_IMAGE);
                printCustomSizedImage(sprintf(gettext('View the album %s'), $albumname), $size);
                rem_context(ZP_IMAGE | ZP_ALBUM);
                echo '</a>';
            } else {
                echo '<a href="' . html_encode(getImageURL()) . '" title="' . sprintf(gettext('View %s'), $imagename) . '">';
                printCustomSizedImage(sprintf(gettext('View %s'), $imagename), $size);
                rem_context(ZP_IMAGE | ZP_ALBUM);
                echo '</a>';
            }
        } else {
            ?>
			<span style="background:red;color:black;">
				<?php 
            printf(gettext('<code>zenpageAlbumImage()</code> did not find the image %1$s:%2$s'), $albumname, $imagename);
            ?>
			</span>
			<?php 
        }
    } else {
        ?>
		<span style="background:red;color:black;">
			<?php 
        printf(gettext('<code>zenpageAlbumImage()</code> did not find the album %1$s'), $albumname);
        ?>
		</span>
		<?php 
    }
}
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:61,代码来源:zenpage-template-functions.php


示例11: printAlbumMenuJump

/**
* 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 
    }
}
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:89,代码来源:print_album_menu.php


示例12: internalToFilesystem

$album = internalToFilesystem($album8);
$image = internalToFilesystem($image8);
/* Prevent hotlinking to the full image from other domains. */
if (getOption('hotlink_protection') && isset($_SERVER['HTTP_REFERER'])) {
    preg_match('|(.*)//([^/]*)|', $_SERVER['HTTP_REFERER'], $matches);
    $checkstring = preg_replace('/^www./', '', strtolower($matches[2]));
    if (strpos($checkstring, ":")) {
        $checkstring = substr($checkstring, 0, strpos($checkstring, ":"));
    }
    if (preg_replace('/^www./', '', strtolower($_SERVER['SERVER_NAME'])) != $checkstring) {
        /* It seems they are directly requesting the full image. */
        header('Location: ' . FULLWEBPATH . '/index.php?album=' . $album8 . '&image=' . $image8);
        exitZP();
    }
}
$albumobj = newAlbum($album8, true, true);
$imageobj = newImage($albumobj, $image8, true);
$args = getImageArgs($_GET);
$args[0] = 'FULL';
$adminrequest = $args[12];
if ($forbidden = getOption('image_processor_flooding_protection') && (!isset($_GET['check']) || $_GET['check'] != sha1(HASH_SEED . serialize($args)))) {
    // maybe it was from the tinyZenpage javascript which does not know better!
    zp_session_start();
    $forbidden = !isset($_SESSION['adminRequest']) || $_SESSION['adminRequest'] != @$_COOKIE['zp_user_auth'];
}
$args[0] = 'FULL';
$hash = getOption('protected_image_password');
if (($hash || !$albumobj->checkAccess()) && !zp_loggedin(VIEW_FULLIMAGE_RIGHTS)) {
    //	handle password form if posted
    zp_handle_password('zp_image_auth', getOption('protected_image_password'), getOption('protected_image_user'));
    //check for passwords
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:full-image.php


示例13: pathurlencode

    }
    $albumparm = '&amp;album=' . pathurlencode($folder);
}
if (isset($_GET['refresh'])) {
    if (empty($imageid)) {
        $metaURL = $backurl;
    } else {
        if (!empty($ret)) {
            $ret = '&amp;return=' . $ret;
        }
        $metaURL = $redirecturl = '?' . $type . 'refresh=continue&amp;id=' . $imageid . $albumparm . $ret . '&XSRFToken=' . getXSRFToken('refresh');
    }
} else {
    if ($type !== 'prune&amp;') {
        if (!empty($folder)) {
            $album = newAlbum($folder);
            if (!$album->isMyItem(ALBUM_RIGHTS)) {
                if (!zp_apply_filter('admin_managed_albums_access', false, $return)) {
                    header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php');
                    exitZP();
                }
            }
            $sql = "SELECT `id` FROM " . prefix('albums') . " WHERE `folder`=" . db_quote($folder);
            $row = query_single_row($sql);
            $id = $row['id'];
        }
        if (!empty($id)) {
            $imagewhere = "WHERE `albumid`={$id}";
            $r = " {$folder}";
            $albumwhere = "WHERE `parentid`={$id}";
        }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-refresh-metadata.php


示例14: getitems

 public function getitems()
 {
     $items = array();
     if ($album = @$this->options['album']) {
         if ($image = @$this->options['image']) {
             if (!is_array($image)) {
                 $image = array($image);
             }
             foreach ($image as $filename) {
                 $obj = newImage(NULL, array('folder' => $album, 'filename' => $filename), true);
                 if ($obj->exists) {
                     $items[] = $obj;
                 }
             }
         } else {
             if (!is_array($album)) {
                 $album = array($album);
             }
             foreach ($album as $folder) {
                 $obj = newAlbum($folder, true);
                 if ($obj->exists) {
                     $items[] = $obj;
                 }
             }
         }
         return $items;
     }
     if ($this->feedtype == 'news' && ($news = @$this->options['titlelink'])) {
         if (!is_array($news)) {
             $news = array($news);
         }
         foreach ($news as $article) {
             $obj = new ZenpageNews($article, false);
             if ($obj->loaded) {
                 $items[] = array('titlelink' => $article);
             }
         }
         return $items;
     }
     if ($this->feedtype == 'pages' && ($pages = @$this->options['titlelink'])) {
         if (!is_array($pages)) {
             $pages = array($pages);
         }
         foreach ($pages as $page) {
             $obj = new ZenpagePage($page, false);
             if ($obj->loaded) {
                 $items[] = array('titlelink' => $page);
             }
         }
         return $items;
     }
     return parent::getitems();
 }
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:53,代码来源:externalFeed.php


示例15: ZenpageCategory

$combi = $obj->getOldCombiNews();
$cat = new ZenpageCategory('combiNews', true);
$cat->setTitle(gettext('combiNews'));
$cat->setDesc(gettext('Auto category for ported combi-news articles.'));
$cat->save();
foreach ($combi as $article) {
    switch ($article['type']) {
        case 'images':
            $obj = newImage(NULL, array('folder' => $article['albumname'], 'filename' => $article['titlelink']), false);
            if ($obj->exists) {
                $obj->setPublishDate($article['date']);
                self::publishArticle($obj, 'combiNews');
            }
            break;
        case 'albums':
            $obj = newAlbum($article['albumname'], false);
            if ($obj->exists) {
                $obj->setPublishDate($article['date']);
                self::publishArticle($obj, 'combiNews');
            }
            break;
    }
}
purgeOption('zenpage_combinews');
purgeOption('combinews-customtitle');
purgeOption('combinews-customtitle-imagetitles');
purgeOption("zenpage_combinews_sortorder");
purgeOption('zenpage_combinews_imagesize');
purgeOption('combinews-thumbnail-width');
purgeOption('combinews-thumbnail-height');
purgeOption('combinews-thumbnail-cropwidth');
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:combiNews.php


示例16: unset

         unset($_POST['instance']);
     }
     $id = sanitize($_POST['id']);
     switch ($_POST['type']) {
         case 'images':
             $img = newImage(NULL, array('folder' => dirname($id), 'filename' => basename($id)));
             if ($_POST['addToFavorites']) {
                 if ($img->loaded) {
                     $___Favorites->addImage($img);
                 }
             } else {
                 $___Favorites->removeImage($img);
             }
             break;
         case 'albums':
             $alb = newAlbum($id);
             if ($_POST['addToFavorites']) {
                 if ($alb->loaded) {
                     $___Favorites->addAlbum($alb);
                 }
             } else {
                 $___Favorites->removeAlbum($alb);
             }
             break;
     }
     unset($___Favorites);
     if (isset($_instance)) {
         unset($_instance);
     }
 }
 $_myFavorites = new favorites($_zp_current_admin_obj->getUser());
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:favoritesHandler.php


示例17: create

 /**
  * Creates a zip file of the album
  *
  * @param string $albumname album folder
  * @param bool fromcache if true, images will be the "sized" image in the cache file
  */
 static function create($albumname, $fromcache)
 {
     global $_zp_zip_list, $_zp_gallery, $defaultSize;
     $album = newAlbum($albumname);
     if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumname)) {
         self::pageError(403, gettext("Forbidden"));
     }
     if (!$album->exists) {
         self::pageError(404, gettext('Album not found'));
     }
     $_zp_zip_list = array();
     if ($fromcache) {
         $opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from cached images of %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
         loadLocalOptions(false, $_zp_gallery->getCurrentTheme());
         $defaultSize = getOption('image_size');
         self::AddAlbumCache($album, strlen($albumname), SERVERPATH . '/' . CACHEFOLDER . '/' . $albumname);
     } else {
         $opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from images in %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
         self::AddAlbum($album, strlen($albumname), SERVERPATH . '/' . ALBUMFOLDER . '/' . $albumname);
     }
     $zip = new ZipStream($albumname . '.zip', $opt);
     foreach ($_zp_zip_list as $path => $file) {
         @set_time_limit(6000);
         $zip->add_file_from_path(internalToFilesystem($file), internalToFilesystem($path));
     }
     $zip->finish();
 }
开发者ID:rb26,项目名称:zenphoto,代码行数:33,代码来源:downloadList.php


示例18: getUploadImagesInAlbum

function getUploadImagesInAlbum($albumlist)
{
    $numbers = array();
    foreach ($albumlist as $key => $value) {
        $obj = newAlbum($key);
        $numbers[] = $obj->getNumImages();
    }
    $numimages = count($numbers);
    $content = $count = '';
    foreach ($numbers as $number) {
        $content .= "'";
        $count++;
        $content .= $number;
        if ($count < $numimages) {
            $content .= "',";
            // js array entry end
        } else {
            $content .= "'";
            // js array end
        }
    }
    return $content;
}
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:23,代码来源:image_upload_limiter.php


示例19: thumb

    static function thumb($image, $i, $field, $type)
    {
        global $albumHeritage;
        if ($type == 'save') {
            if (isset($_POST[$i . '-' . $field['name']])) {
                if ($thumbnail = $_POST[$i . '-' . $field['name']]) {
                    $talbum = newAlbum($thumbnail);
                    if ($image->imagefolder == $thumbnail) {
                        $talbum->setThumb($image->filename);
                    } else {
                        $talbum->setThumb('/' . $image->imagefolder . '/' . $image->filename);
                    }
                    $talbum->save();
                }
            }
            return NULL;
        } else {
            $item = NULL;
            if ($image->album->subRights() & MANAGED_OBJECT_RIGHTS_EDIT) {
                ob_start();
                ?>
				<select name="<?php 
                echo $i . '-' . $field['name'];
                ?>
" >
					<option value=""></option>
					<?php 
                generateListFromArray(array(), $albumHeritage, false, true);
                ?>
				</select>
				<?php 
                $item = ob_get_contents();
                ob_end_clean();
            }
            return $item;
        }
    }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:37,代码来源:optionalObjectFields.php


示例20: printGslideshowStatistic

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP newArticle函数代码示例发布时间:2022-05-15
下一篇:
PHP network_to_name函数代码示例发布时间: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