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


PHP PHOTO_BOL_PhotoAlbumService::findUserAlbumList方法代码示例

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


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

示例1: __construct

 public function __construct($userId, $limit, $exclude)
 {
     parent::__construct();
     $this->photoAlbumService = PHOTO_BOL_PhotoAlbumService::getInstance();
     $user = BOL_UserService::getInstance()->findUserById($userId);
     $this->assign('username', $user->getUsername());
     $albums = $this->photoAlbumService->findUserAlbumList($user->id, 1, $limit, $exclude, true);
     $this->assign('albums', $albums);
     foreach ($albums as $album) {
         array_push($exclude, $album['dto']->id);
     }
     $loadMore = $this->photoAlbumService->countUserAlbums($userId, $exclude);
     if (!$loadMore) {
         $script = "OWM.trigger('photo.hide_load_more', {});";
         OW::getDocument()->addOnloadScript($script);
     }
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:17,代码来源:album_list.php

示例2: userAlbums

 /**
  * Controller action for user albums list
  *
  * @param array $params
  * @throws Redirect404Exception
  */
 public function userAlbums(array $params)
 {
     if (empty($params['user']) || !mb_strlen($username = trim($params['user']))) {
         throw new Redirect404Exception();
     }
     $user = BOL_UserService::getInstance()->findByUsername($username);
     if (!$user) {
         throw new Redirect404Exception();
     }
     $userId = $user->id;
     $ownerMode = $userId == OW::getUser()->getId();
     // is moderator
     $modPermissions = OW::getUser()->isAuthorized('photo');
     if (!OW::getUser()->isAuthorized('photo', 'view') && !$modPermissions && !$ownerMode) {
         $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html');
         return;
     }
     // permissions check
     if (!$ownerMode && !$modPermissions) {
         $privacyParams = array('action' => 'photo_view_album', 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
         $event = new OW_Event('privacy_check_permission', $privacyParams);
         OW::getEventManager()->trigger($event);
     }
     $this->assign('username', $username);
     $displayName = BOL_UserService::getInstance()->getDisplayName($userId);
     $this->assign('displayName', $displayName);
     $total = $this->photoAlbumService->countUserAlbums($userId);
     $page = !empty($_GET['page']) && (int) $_GET['page'] ? abs((int) $_GET['page']) : 1;
     $config = OW::getConfig();
     $albumPerPage = $config->getValue('photo', 'photos_per_page');
     $albums = $this->photoAlbumService->findUserAlbumList($userId, $page, $albumPerPage);
     $this->assign('albums', $albums);
     $this->assign('total', $total);
     $this->assign('userId', $userId);
     // Paging
     $pages = (int) ceil($total / $albumPerPage);
     $paging = new BASE_CMP_Paging($page, $pages, $albumPerPage);
     $this->assign('paging', $paging->render());
     $this->assign('widthConfig', $config->getValue('photo', 'preview_image_width'));
     $this->assign('heightConfig', $config->getValue('photo', 'preview_image_height'));
     OW::getDocument()->setHeading(OW::getLanguage()->text('photo', 'page_title_user_albums', array('user' => $displayName)));
     OW::getDocument()->setHeadingIconClass('ow_ic_picture');
     OW::getDocument()->setTitle(OW::getLanguage()->text('photo', 'meta_title_photo_useralbums', array('displayName' => $displayName)));
     if ($albums) {
         $albumTitles = array();
         $i = 0;
         foreach ($albums as $album) {
             $albumTitles[] = $album['dto']->name;
             if ($i == 10) {
                 break;
             }
             $i++;
         }
         $albumTitles = implode(', ', $albumTitles);
         OW::getDocument()->setDescription(OW::getLanguage()->text('photo', 'meta_description_photo_useralbums', array('displayName' => $displayName, 'albums' => $albumTitles)));
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:63,代码来源:photo.php


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