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

PHP newImage函数代码示例

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

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



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

示例1: zipAddAlbum

function zipAddAlbum($album, $base, $zip)
{
    global $_zp_zip_list, $zip_gallery;
    $albumbase = '.' . substr($album->name, $base) . '/';
    foreach ($album->sidecars as $suffix) {
        $f = $albumbase . $album->name . '.' . $suffix;
        if (file_exists($f)) {
            $_zp_zip_list[] = $f;
        }
    }
    $images = $album->getImages();
    foreach ($images as $imagename) {
        $image = newImage($album, $imagename);
        $_zp_zip_list[] = $albumbase . $image->filename;
        $imagebase = stripSuffix($image->filename);
        foreach ($image->sidecars as $suffix) {
            $f = $albumbase . $imagebase . '.' . $suffix;
            if (file_exists($f)) {
                $_zp_zip_list[] = $f;
            }
        }
    }
    $albums = $album->getAlbums();
    foreach ($albums as $albumname) {
        $subalbum = new Album($zip_gallery, $albumname);
        if ($subalbum->exists && !$album->isDynamic()) {
            zipAddAlbum($subalbum, $base, $zip);
        }
    }
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:30,代码来源:album-zip.php


示例2: createImages

 static function createImages($rows)
 {
     $images = array();
     foreach ($rows as $r) {
         $image = newImage(new Album(new Gallery(), $r['folder']), $r['filename']);
         $images[] = $image;
     }
     return $images;
 }
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:9,代码来源:Utils.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: emailApproval

function emailApproval($comment)
{
    $owner = NULL;
    switch ($comment->getType()) {
        case 'albums':
            $sql = 'SELECT `folder` FROM ' . prefix('albums') . ' WHERE `id`=' . $comment->getOwnerID();
            $row = query_single_row($sql);
            if (is_array($row)) {
                $owner = new Album(new Gallery(), $row['folder']);
            }
            break;
        case 'images':
            $sql = 'SELECT `albumid`, `filename` FROM ' . prefix('images') . ' WHERE `id`=' . $comment->getOwnerID();
            $imagerow = query_single_row($sql);
            if (is_array($imagerow)) {
                $sql = 'SELECT `folder` FROM ' . prefix('albums') . ' WHERE `id`=' . $imagerow['albumid'];
                $row = query_single_row($sql);
                if (is_array($row)) {
                    $album = new Album(new Gallery(), $row['folder']);
                    $owner = newImage($album, $imagerow['filename']);
                }
            }
            break;
        case 'news':
            $sql = 'SELECT `titlelink` FROM ' . prefix('zenpage_news') . ' WHERE `id`=' . $comment->getOwnerID();
            $row = query_single_row($sql);
            if (is_array($row)) {
                $owner = new ZenpageNews($row['titlelink']);
            }
            break;
        case 'pages':
            $sql = 'SELECT `titlelink` FROM ' . prefix('zenpage_pages') . ' WHERE `id`=' . $comment->getOwnerID();
            $row = query_single_row($sql);
            if (is_array($row)) {
                $owner = new ZenpagePage($row['titlelink']);
            }
            break;
    }
    if (!is_null($owner)) {
        $owner->getComments();
        emailReply($comment, $owner);
    }
    return $comment;
}
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:44,代码来源:filter-comments.php


示例5: 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


示例6: getShow

    static function getShow($heading, $speedctl, $albumobj, $imageobj, $width, $height, $crop, $shuffle, $linkslides, $controls, $returnpath, $imagenumber)
    {
        global $_zp_gallery, $_zp_gallery_page;
        setOption('slideshow_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page), 1);
        if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) {
            return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>';
        }
        $slideshow = '';
        $numberofimages = $albumobj->getNumImages();
        // setting the image size
        if ($width) {
            $wrapperwidth = $width;
        } else {
            $width = $wrapperwidth = getOption("slideshow_width");
        }
        if ($height) {
            $wrapperheight = $height;
        } else {
            $height = $wrapperheight = getOption("slideshow_height");
        }
        if ($numberofimages == 0) {
            return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>';
        }
        $option = getOption("slideshow_mode");
        // jQuery Cycle slideshow config
        // get slideshow data
        $showdesc = getOption("slideshow_showdesc");
        // slideshow display section
        $validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
        $slideshow .= '
				<script type="text/javascript">
				// <!-- <![CDATA[
				$(document).ready(function(){
				$(function() {
				var ThisGallery = "' . html_encode($albumobj->getTitle()) . '";
				var ImageList = new Array();
				var TitleList = new Array();
				var DescList = new Array();
				var ImageNameList = new Array();
				var DynTime=(' . (int) getOption("slideshow_timeout") . ');
				';
        $images = $albumobj->getImages(0);
        if ($shuffle) {
            shuffle($images);
        }
        for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) {
            if (is_array($images[$idx])) {
                $filename = $images[$idx]['filename'];
                $album = newAlbum($images[$idx]['folder']);
                $image = newImage($album, $filename);
            } else {
                $filename = $images[$idx];
                $image = newImage($albumobj, $filename);
            }
            $ext = slideshow::is_valid($filename, $validtypes);
            if ($ext) {
                if ($crop) {
                    $img = $image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, NULL, NULL);
                } else {
                    $maxwidth = $width;
                    $maxheight = $height;
                    getMaxSpaceContainer($maxwidth, $maxheight, $image);
                    $img = $image->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, NULL, NULL);
                }
                $slideshow .= 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n";
                $slideshow .= 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n";
                if ($showdesc) {
                    $desc = $image->getDesc();
                    $desc = str_replace("\r\n", '<br />', $desc);
                    $desc = str_replace("\r", '<br />', $desc);
                    $slideshow .= 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n";
                } else {
                    $slideshow .= 'DescList[' . $cntr . '] = "";' . "\n";
                }
                if ($idx == $numberofimages - 1) {
                    $idx = -1;
                }
                $slideshow .= 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n";
                $cntr++;
            }
        }
        $slideshow .= "\n";
        $numberofimages = $cntr;
        $slideshow .= '
				var countOffset = ' . $imagenumber . ';
				var totalSlideCount = ' . $numberofimages . ';
				var currentslide = 2;
				function onBefore(curr, next, opts) {
				if (opts.timeout != DynTime) {
				opts.timeout = DynTime;
		}
		if (!opts.addSlide)
		return;
		var currentImageNum = currentslide;
		currentslide++;
		if (currentImageNum == totalSlideCount) {
		opts.addSlide = null;
		return;
		}
		var relativeSlot = (currentslide + countOffset) % totalSlideCount;
//.........这里部分代码省略.........
开发者ID:rb26,项目名称:zenphoto,代码行数:101,代码来源:slideshow.php


示例7: getitemComments

 /**
  * Gets the feed item data in a comments feed
  *
  * @param array $item Array of a comment
  * @return array
  */
 protected function getitemComments($item)
 {
     if ($item['anon']) {
         $author = "";
     } else {
         $author = " " . gettext("by") . " " . $item['name'];
     }
     $commentpath = $imagetag = $title = '';
     switch ($item['type']) {
         case 'images':
             $title = get_language_string($item['title']);
             $obj = newImage(array('folder' => $item['folder'], 'filename' => $item['filename']));
             $link = $obj->getlink();
             $feeditem['pubdate'] = date("r", strtotime($item['date']));
             $category = get_language_string($item['albumtitle']);
             $website = $item['website'];
             $title = $category . ": " . $title;
             $commentpath = PROTOCOL . '://' . $this->host . $link . "#" . $item['id'];
             break;
         case 'albums':
             $obj = newAlbum($item['folder']);
             $link = rtrim($obj->getLink(), '/');
             $feeditem['pubdate'] = date("r", strtotime($item['date']));
             $title = get_language_string($item['albumtitle']);
             $website = $item['website'];
             $commentpath = PROTOCOL . '://' . $this->host . $link . "#" . $item['id'];
             break;
         case 'news':
         case 'pages':
             if (extensionEnabled('zenpage')) {
                 $feeditem['pubdate'] = date("r", strtotime($item['date']));
                 $category = '';
                 $title = get_language_string($item['title']);
                 $titlelink = $item['titlelink'];
                 $website = $item['website'];
                 if ($item['type'] == 'news') {
                     $obj = newArticle($titlelink);
                 } else {
                     $obj = newPage($titlelink);
                 }
                 $commentpath = PROTOCOL . '://' . $this->host . html_encode($obj->getLink()) . "#" . $item['id'];
             } else {
                 $commentpath = '';
             }
             break;
     }
     $feeditem['title'] = getBare($title . $author);
     $feeditem['link'] = $commentpath;
     $feeditem['desc'] = $item['comment'];
     return $feeditem;
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:57,代码来源:class-feed.php


示例8: 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


示例9: printSlideShow


//.........这里部分代码省略.........
            $images = $album->getImages(0);
            // return path to get back to the page we called the slideshow from
            if (empty($_POST['imagenumber'])) {
                $returnpath = rewrite_path('/' . pathurlencode($album->name) . '/page/' . $pagenumber, '/index.php?album=' . urlencode($album->name) . '&page=' . $pagenumber);
            } else {
                $returnpath = rewrite_path('/' . pathurlencode($album->name) . '/' . rawurlencode($_POST['imagefile']) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile']));
            }
        }
        // slideshow display section
        switch ($option) {
            case "jQuery":
                $validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
                ?>
					<script type="text/javascript">
						$(document).ready(function(){
							$(function() {
								var ThisGallery = '<?php 
                echo html_encode($albumtitle);
                ?>
';
								var ImageList = new Array();
								var TitleList = new Array();
								var DescList = new Array();
								var ImageNameList = new Array();
								var DynTime=(<?php 
                echo getOption("slideshow_timeout");
                ?>
) * 1.0;	// force numeric
								<?php 
                for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) {
                    if ($dynamic) {
                        $filename = $images[$idx]['filename'];
                        $album = new Album($gallery, $images[$idx]['folder']);
                        $image = newImage($album, $filename);
                    } else {
                        $filename = $images[$idx];
                        $image = newImage($album, $filename);
                    }
                    $ext = is_valid($filename, $validtypes);
                    if ($ext) {
                        makeImageCurrent($image);
                        $img = getCustomSizedImageMaxSpace($width, $height);
                        //$img = WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . pathurlencode($image->album->name) . '&i=' . urlencode($filename) . '&s=' . $imagesize;
                        echo 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n";
                        echo 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n";
                        if (getOption("slideshow_showdesc")) {
                            $desc = $image->getDesc();
                            $desc = str_replace("\r\n", '<br />', $desc);
                            $desc = str_replace("\r", '<br />', $desc);
                            echo 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n";
                        } else {
                            echo 'DescList[' . $cntr . '] = "";' . "\n";
                        }
                        if ($idx == $numberofimages - 1) {
                            $idx = -1;
                        }
                        echo 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n";
                        $cntr++;
                    }
                }
                echo "\n";
                $numberofimages = $cntr;
                ?>
								var countOffset = <?php 
                echo $imagenumber;
                ?>
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:67,代码来源:Overrides.php


示例10: gettext

            ?>
" type="radio"	value="del_<?php 
            echo $item;
            ?>
" onclick="confirmdel(this, 'label_del_<?php 
            echo $item;
            ?>
', true)" />
																		<?php 
            echo gettext('Delete');
            ?>
																	</label>
																</td>
																<td>
																	<?php 
            $image = newImage($album, $display);
            ?>
																	<img src="<?php 
            echo html_encode(pathurlencode(getAdminThumb($image, 'large')));
            ?>
" alt="<?php 
            echo $image->filename;
            ?>
"/>
																</td>
																<td>
																	<?php 
            printf(gettext('%s'), $display);
            ?>
<a href="<?php 
            echo html_encode($image->getLink());
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:31,代码来源:publishContent.php


示例11: getSlideObj

 /**
  * We might need this to exclude file types or not…
  *
  * @param type $slide
  * @param type $albumobj
  * @return type
  */
 static function getSlideObj($slide, $albumobj)
 {
     return newImage($albumobj, $slide);
 }
开发者ID:rb26,项目名称:zenphoto,代码行数:11,代码来源:slideshow2.php


示例12: sanitize

<?php

/**
 * Hitcounter handler for slidshow
 *
 * @package plugins
 */
require_once "../../functions.php";
$album_name = sanitize($_GET["album"]);
$img_name = sanitize($_GET["img"]);
if ($album_name && $img_name) {
    $gallery = new Gallery();
    $album = new Album($gallery, $album_name);
    $image = newImage($album, $img_name);
    //update hit counter
    if (!$album->isMyItem(LIST_RIGHTS)) {
        $hc = $image->get('hitcounter') + 1;
        $image->set('hitcounter', $hc);
        $image->save();
    }
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:21,代码来源:slideshow-counter.php


示例13: printGslideshowStatistic

/**
 * Prints an image or album statistic slideshow using the {@link http://galleria.io/  jQuery plugin Galleria}
 *
 * See readme/documentation for usage:
 * Call directly in a template file or codeblock.
 *
 * NOTE: movie and audio files not supported.
 *
 * @param string $type return statistics of either 'images' or 'albums'
 * @param integer $number the number of items to get (images or albums, depending on $type set)
 * @param string $option
 *  	"popular" for the most popular
 *		"latest" for the latest uploaded by id (Discovery)
 * 		"latest-date" for the latest by date
 * 		"latest-mtime" for the latest by mtime
 *   	"latest-publishdate" for the latest by publishdate
 *      "mostrated" for the most voted
 *		"toprated" for the best voted
 *		"latestupdated" for the latest updated
 *		"random" for random order (yes, strictly no statistical order...)
 * @param string $albumfolder foldername of a specific album to pull items from
 * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
 * @param bool $linkslides true to link to image or album on slide, else click advances slideshow instead
 * @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped.  Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
 * @param integer $threshold the minimum number of ratings an image must have to be included in the list. (Default 0)
 *
 */
function printGslideshowStatistic($type, $number, $option, $albumfolder = '', $collection = false, $linkslides = true, $autoplay = true, $threshold = 0)
{
    save_context();
    $data = 'data';
    $embedded = true;
    $forceheight = true;
    $imagenumber = 0;
    $albumtitle = '';
    $returnpath = '';
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
    if ($type == 'album' || $type == 'albums') {
        $albums = getAlbumStatistic($number, $option, $albumfolder);
    } else {
        $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
    }
    ?>

			<script>
				var data = [

	<?php 
    if ($type == 'album' || $type == 'albums') {
        $c = 1;
        foreach ($albums as $album) {
            $tempalbum = newAlbum($album['folder']);
            $albumpath = html_encode(rewrite_path("/" . pathurlencode($tempalbum->name), "index.php?album=" . pathurlencode($tempalbum->name)));
            $albumthumb = $tempalbum->getAlbumThumbImage();
            $image = newImage($tempalbum, $albumthumb->filename);
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($tempalbum->getTitle()) . '\',' . "\n";
                $desc = $tempalbum->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . $albumpath . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    } else {
        $c = 1;
        foreach ($images as $image) {
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($image->getTitle()) . '\',' . "\n";
                $desc = $image->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
//.........这里部分代码省略.........
开发者ID:kokyandrei,项目名称:Unsupported,代码行数:101,代码来源:gslideshow.php


示例14: 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


示例15: gettext

        echo "<h2>" . gettext("Image order saved");
        echo '</h2></div>';
    }
    ?>

<div class="box" style="padding: 15px;">

<p><?php 
    echo gettext("Sort the images by dragging them...");
    ?>
</p>

<div id="images"><?php 
    $images = $album->getImages();
    foreach ($images as $image) {
        adminPrintImageThumb(newImage($album, $image));
    }
    ?>
</div>
<br>

<div><?php 
    zenSortablesSaveButton($_zp_sortable_list, "?page=edit&album=" . $album->getFolder() . "&saved");
    ?>
</div>

</div>

</div>

<?php 
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:31,代码来源:admin-albumsort.php


示例16: seoFriendly

         if (is_valid_image($name) || is_valid_other_type($name)) {
             $seoname = seoFriendly($name);
             if (strrpos($seoname, '.') === 0) {
                 $seoname = sha1($name) . $seoname;
             }
             // soe stripped out all the name.
             $targetFile = $targetPath . '/' . internalToFilesystem($seoname);
             if (file_exists($targetFile)) {
                 $append = '_' . time();
                 $seoname = stripSuffix($seoname) . $append . '.' . getSuffix($seoname);
                 $targetFile = $targetPath . '/' . internalToFilesystem($seoname);
             }
             if (move_uploaded_file($tempFile, $targetFile)) {
                 @chmod($targetFile, 0666 & CHMOD_VALUE);
                 $album = new Album($gallery, $folder);
                 $image = newImage($album, $seoname);
                 $image->setOwner($_zp_current_admin_obj->getUser());
                 if ($name != $seoname && $image->getTitle() == substr($seoname, 0, strrpos($seoname, '.'))) {
                     $image->setTitle(substr($name, 0, strrpos($name, '.')));
                 }
                 $image->save();
             } else {
                 $error = UPLOAD_ERR_NO_FILE;
             }
         } else {
             if (is_zip($name)) {
                 unzip($tempFile, $targetPath);
             }
         }
     }
 }
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:uploader.php


示例17: getAlbumGeodata

/**
 * Gathers the map data for an album
 * @param $album		album object
 * @param $map			google map object
 */
function getAlbumGeodata($album, $map)
{
    $result = false;
    $images = $album->getImages(0, 0, null, null, false);
    foreach ($images as $an_image) {
        $image = newImage($album, $an_image);
        $coord = getGeoCoord($image);
        if ($coord) {
            $result = true;
            // at least one image has geodata
            addGeoCoord($map, $coord);
        }
    }
    return $result;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:20,代码来源:googleMap.php


示例18: getImage

 /**
  * Returns a specific image
  *
  * @param int $index the index of the image desired
  * @return object
  */
 function getImage($index)
 {
     global $_zp_gallery;
     if (!is_null($this->images)) {
         $this->getImages();
     }
     if ($index >= 0 && $index < $this->getNumImages()) {
         $img = $this->images[$index];
         return newImage(new Album($_zp_gallery, $img['folder']), $img['filename']);
     }
     return false;
 }
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:18,代码来源:class-search.php


示例19: enableExtension

    {
        return $this->getCombiNews(NULL, NULL, 'published');
    }
}
global $plugin_is_filter;
enableExtension('galleryArticles', $plugin_is_filter);
$obj = new Combi();
$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');
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:combiNews.php


示例20: processImageBulkActions

/**
 * Handles Image bulk actions
 * @param $album
 */
function processImageBulkActions($album)
{
    $action = sanitize($_POST['checkallaction']);
    $result = zp_apply_filter('processBulkImageSave', NULL, $action, $album);
    $ids = sanitize($_POST['ids']);
    $total = count($ids);
    if ($action != 'noaction') {
        if ($total > 0) {
            if ($action == 'addtags') {
                $tags = bulkTags();
            }
            if ($action == 'moveimages' || $action == 'copyimages') {
                $dest = sanitize($_POST['massalbumselect']);
                $folder = sanitize($_POST['massfolder']);
                if (!$dest || $dest == $folder) {
                    return "&mcrerr=2";
                }
            }
            if ($action == 'changeowner') {
                $newowner = sanitize($_POST['massownerselect']);
            }
            $n = 0;
            foreach ($ids as $filename) {
                $n++;
                $imageobj = newImage($album, $filename);
                if (is_null($result)) {
                    switch ($action) {
                        case 'deleteall':
                            $imageobj->remove();
                            break;
                        case 'showall':
                            $imageobj->setShow(1);
                            break;
                        case 'hideall':
                            $imageobj->setShow(0);
                            break;
                        case 'commentson':
                            $imageobj->set('commentson', 1);
     

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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