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


PHP Board::getAudioArtURL方法代码示例

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


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

示例1: getThumbnailURL

 /**
  * Supplies a clean thumbnail URL for embedding an attachment on a board.
  *
  * @param  \App\Board  $board
  * @return string
  */
 public function getThumbnailURL(Board $board)
 {
     $ext = $this->guessExtension();
     if ($this->isSpoiler()) {
         return $board->getSpoilerUrl();
     }
     if ($this->isImage() || $this->isDocument()) {
         $ext = Settings::get('attachmentThumbnailJpeg') ? "jpg" : "png";
     } else {
         if ($this->isVideo()) {
             $ext = "jpg";
         } else {
             if ($this->isAudio()) {
                 if (!$this->hasThumb()) {
                     return $board->getAudioArtURL();
                 }
                 $ext = "png";
             } else {
                 if ($this->isImageVector()) {
                     // With the SVG filetype, we do not generate a thumbnail, so just serve the actual SVG.
                     return $this->getDownloadURL($board);
                 }
             }
         }
     }
     $params = ['attachment' => $this->getIdentifier(), 'filename' => $this->getDownloadName() . ".{$ext}"];
     if (!env('APP_MEDIA_URL', false)) {
         $params['board'] = $board;
     }
     // "False" generates a relativel URL.
     // Attachments get cached, so we want that.
     return route('static.thumb.attachment', $params, false);
 }
开发者ID:tmrwbo,项目名称:infinity-next,代码行数:39,代码来源:FileStorage.php

示例2: getThumbnailURL

 /**
  * Supplies a clean thumbnail URL for embedding an attachment on a board.
  *
  * @param  App\Board  $board
  * @return string
  */
 public function getThumbnailURL(Board $board)
 {
     $baseURL = "/{$board->board_uri}/file/thumb/{$this->hash}/";
     $ext = $this->guessExtension();
     if ($this->isSpoiler()) {
         return $board->getSpoilerUrl();
     }
     if ($this->isImage()) {
         $ext = Settings::get('attachmentThumbnailJpeg') ? "jpg" : "png";
     } else {
         if ($this->isVideo()) {
             $ext = "jpg";
         } else {
             if ($this->isAudio()) {
                 if (!$this->hasThumb()) {
                     return $board->getAudioArtURL();
                 }
                 $ext = "png";
             } else {
                 if ($this->isImageVector()) {
                     // With the SVG filetype, we do not generate a thumbnail, so just serve the actual SVG.
                     $baseURL = "/{$board->board_uri}/file/{$this->hash}/";
                 }
             }
         }
     }
     return url("{$baseURL}{$this->getFileName()}.{$ext}");
 }
开发者ID:JEWSbreaking8chan,项目名称:infinity-next,代码行数:34,代码来源:FileStorage.php

示例3: getThumbnailURL

 /**
  * Supplies a clean thumbnail URL for embedding an attachment on a board.
  *
  * @param  App\Board  $board
  * @return string
  */
 public function getThumbnailURL(Board $board)
 {
     $baseURL = "/{$board->board_uri}/file/thumb/{$this->hash}/";
     $ext = $this->guessExtension();
     if ($this->isSpoiler()) {
         return $board->getSpoilerUrl();
     }
     if ($this->isAudio()) {
         if (!$this->hasThumb()) {
             return $board->getAudioArtURL();
         }
     } else {
         if ($this->isImageVector()) {
             // With the SVG filetype, we do not generate a thumbnail, so just serve the actual SVG.
             $baseURL = "/{$board->board_uri}/file/{$this->hash}/";
         }
     }
     // Sometimes we supply a filename when fetching the filestorage as an attachment.
     if (isset($this->pivot) && isset($this->pivot->filename)) {
         return url($baseURL . urlencode($this->pivot->filename));
     }
     return url($baseURL . strtotime($this->first_uploaded_at) . "." . $this->guessExtension());
 }
开发者ID:spanishtech,项目名称:infinity-next,代码行数:29,代码来源:FileStorage.php


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