当前位置: 首页>>代码示例>>PHP>>正文


PHP Album::getAlbumID方法代码示例

本文整理汇总了PHP中Album::getAlbumID方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::getAlbumID方法的具体用法?PHP Album::getAlbumID怎么用?PHP Album::getAlbumID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Album的用法示例。


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

示例1: printAlbumMenuListAlbum

/**
 * Handles an album for printAlbumMenuList
 *
 * @param array $albums albums array
 * @param string $path for createAlbumMenuLink
 * @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, $path, $folder, $option, $showcount, $showsubs, $css_class, $css_class_topactive, $css_class_active, $firstimagelink, $keeptopactive, $limit = NULL)
{
    global $_zp_gallery, $_zp_current_album;
    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;
    }
    if (empty($keeptopactive)) {
        $keeptopactive = false;
    }
    $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;
        $topalbum = new Album($_zp_gallery, $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();
                $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) && (getAlbumID() == $topalbum->getAlbumID() || $topalbum->name == $currenturalbumname)) {
                $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) {
                $imgurl = getFirstImageOfAlbum($topalbum);
                $link = "<li><a " . $current . "href='" . $imgurl . "' title='" . html_encode($title) . "'>" . html_encode($display) . "</a>" . $count;
            } else {
                $link = "<li><a " . $current . "href='" . html_encode($path . pathurlencode($topalbum->name)) . "' 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";
                printAlbumMenuListAlbum($subalbums, $path, $folder, $option, $showcount, $showsubs, $css_class, $css_class_topactive, $css_class_active, $firstimagelink, false, $limit);
                echo "\n</ul>\n";
            }
        }
        if ($option == 'list' || $option == 'list-top' || $level > 1) {
            // close the LI
//.........这里部分代码省略.........
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:101,代码来源:print_album_menu.php

示例2: zpFormattedDate

     $imagefile = "albums/" . $albumobj->name . "/" . $item->filename;
     $thumburl = '<img border="0" src="' . $protocol . '://' . $host . $item->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" />';
     $itemcontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->get("title"), $locale)) . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
     $videocontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->getTitle(), $locale)) . '" href="' . $protocol . '://' . $itemlink . '"><img src="' . $protocol . '://' . $host . $item->getThumb() . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" /></a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
     $datecontent = '<![CDATA[Date: ' . zpFormattedDate(DATE_FORMAT, $item->get('mtime')) . ']]>';
 } else {
     $galleryobj = new Gallery();
     $albumitem = new Album($galleryobj, $item['folder']);
     $totalimages = $albumitem->getNumImages();
     $itemlink = $host . WEBPATH . $albumpath . pathurlencode($albumitem->name);
     $thumb = $albumitem->getAlbumThumbImage();
     $thumburl = '<img border="0" src="' . $thumb->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . html_encode(get_language_string($albumitem->get("title"), $locale)) . '" />';
     $title = get_language_string($albumitem->get("title"), $locale);
     if (true || getOption("feed_sortorder_albums") == "latestupdated") {
         $filechangedate = filectime(ALBUM_FOLDER_SERVERPATH . internalToFilesystem($albumitem->name));
         $latestimage = query_single_row("SELECT mtime FROM " . prefix('images') . " WHERE albumid = " . $albumitem->getAlbumID() . " AND `show` = 1 ORDER BY id DESC");
         $lastuploaded = query("SELECT COUNT(*) FROM " . prefix('images') . " WHERE albumid = " . $albumitem->getAlbumID() . " AND mtime = " . $latestimage['mtime']);
         $row = db_fetch_row($lastuploaded);
         $count = $row[0];
         if ($count == 1) {
             $imagenumber = sprintf(gettext('%s (1 new image)'), $title);
         } else {
             $imagenumber = sprintf(gettext('%1$s (%2$s new images)'), $title, $count);
         }
         $itemcontent = '<![CDATA[<a title="' . $title . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . '<p>' . html_encode($imagenumber) . '</p>' . html_encode(get_language_string($albumitem->get("desc"), $locale)) . ']]>';
         $videocontent = '';
         $datecontent = '<![CDATA[' . sprintf(gettext("Last update: %s"), zpFormattedDate(DATE_FORMAT, $filechangedate)) . ']]>';
     } else {
         if ($totalimages == 1) {
             $imagenumber = sprintf(gettext('%s (1 image)'), $title);
         } else {
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:rss.php

示例3: save

 /**
  * Uptates the database with all changes
  */
 function save()
 {
     if (DEBUG_LOGIN) {
         debugLogVar("Zenphoto_Administrator->save()", $this);
     }
     $objects = $this->getObjects();
     $gallery = new Gallery();
     if (is_null($this->get('date'))) {
         $this->set('date', date('Y-m-d H:i:s'));
     }
     parent::save();
     $id = $this->getID();
     if (is_array($objects)) {
         $sql = "DELETE FROM " . prefix('admin_to_object') . ' WHERE `adminid`=' . $id;
         $result = query($sql, false);
         if ($result) {
             foreach ($objects as $object) {
                 if (array_key_exists('edit', $object)) {
                     $edit = $object['edit'] | 32767 & ~(MANAGED_OBJECT_RIGHTS_VIEW_IMAGE | MANAGED_OBJECT_RIGHTS_EDIT | MANAGED_OBJECT_RIGHTS_UPLOAD);
                 } else {
                     $edit = 32767;
                 }
                 switch ($object['type']) {
                     case 'album':
                         $album = new Album($gallery, $object['data']);
                         $albumid = $album->getAlbumID();
                         $sql = "INSERT INTO " . prefix('admin_to_object') . " (adminid, objectid, type, edit) VALUES ({$id}, {$albumid}, 'album', {$edit})";
                         $result = query($sql);
                         break;
                     case 'pages':
                         $sql = 'SELECT * FROM ' . prefix('pages') . ' WHERE `titlelink`=' . db_quote($object['data']);
                         $result = query_single_row($sql);
                         if (is_array($result)) {
                             $objectid = $result['id'];
                             $sql = "INSERT INTO " . prefix('admin_to_object') . " (adminid, objectid, type, edit) VALUES ({$id}, {$objectid}, 'pages', {$edit})";
                             $result = query($sql);
                         }
                         break;
                     case 'news':
                         $sql = 'SELECT * FROM ' . prefix('news_categories') . ' WHERE `titlelink`=' . db_quote($object['data']);
                         $result = query_single_row($sql);
                         if (is_array($result)) {
                             $objectid = $result['id'];
                             $sql = "INSERT INTO " . prefix('admin_to_object') . " (adminid, objectid, type, edit) VALUES ({$id}, {$objectid}, 'news', {$edit})";
                             $result = query($sql);
                         }
                         break;
                 }
             }
         }
     }
 }
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:55,代码来源:lib-auth.php

示例4: saveAdmin

/**
 * Saves an admin user's settings
 *
 * @param string $user The username of the admin
 * @param string $pass The password associated with the user name (md5)
 * @param string $name The display name of the admin
 * @param string $email The email address of the admin
 * @param bit $rights The administrating rites for the admin
 * @param array $albums an array of albums that the admin can access. (If empty, access is to all albums)
 */
function saveAdmin($user, $pass, $name, $email, $rights, $albums)
{
    if (DEBUG_LOGIN) {
        debugLog("saveAdmin({$user}, {$pass}, {$name}, {$email}, {$rights}, {$albums})");
    }
    $sql = "SELECT `name`, `id` FROM " . prefix('administrators') . " WHERE `user` = '{$user}'";
    $result = query_single_row($sql);
    if ($result) {
        $id = $result['id'];
        if (is_null($pass)) {
            $password = '';
        } else {
            $password = "' ,`password`='" . escape($pass);
        }
        if (is_null($rights)) {
            $rightsset = '';
        } else {
            $rightsset = "', `rights`='" . escape($rights);
        }
        $sql = "UPDATE " . prefix('administrators') . "SET `name`='" . escape($name) . $password . "', `email`='" . escape($email) . $rightsset . "' WHERE `id`='" . $id . "'";
        $result = query($sql);
        if (DEBUG_LOGIN) {
            debugLog("updating[{$id}]:{$result}");
        }
    } else {
        if (is_null($pass)) {
            $pass = passwordHash($user, $pass);
        }
        $sql = "INSERT INTO " . prefix('administrators') . " (user, password, name, email, rights) VALUES ('" . escape($user) . "','" . escape($pass) . "','" . escape($name) . "','" . escape($email) . "','" . $rights . "')";
        $result = query($sql);
        $sql = "SELECT `name`, `id` FROM " . prefix('administrators') . " WHERE `user` = '{$user}'";
        $result = query_single_row($sql);
        $id = $result['id'];
        if (DEBUG_LOGIN) {
            debugLog("inserting[{$id}]:{$result}");
        }
    }
    $gallery = new Gallery();
    if (is_array($albums)) {
        $sql = "DELETE FROM " . prefix('admintoalbum') . " WHERE `adminid`={$id}";
        $result = query($sql);
        foreach ($albums as $albumname) {
            $album = new Album($gallery, $albumname);
            $albumid = $album->getAlbumID();
            $sql = "INSERT INTO " . prefix('admintoalbum') . " (adminid, albumid) VALUES ({$id}, {$albumid})";
            $result = query($sql);
        }
    }
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:59,代码来源:functions-auth.php


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