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


PHP Video::format方法代码示例

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


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

示例1: format

 /**
  * format
  * this function takes the object and reformats some values
  */
 public function format($details = true)
 {
     parent::format($details);
     if ($details) {
         if ($this->artist) {
             $artist = new Artist($this->artist);
             $artist->format();
             $this->f_artist = $artist->link;
         }
         if ($this->song) {
             $song = new Song($this->song);
             $song->format();
             $this->f_song = $song->f_link;
         }
     }
     return true;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:21,代码来源:clip.class.php

示例2: format

 /**
  * format
  * this function takes the object and reformats some values
  */
 public function format($details = true)
 {
     parent::format($details);
     $season = new TVShow_Season($this->season);
     $season->format($details);
     $this->f_title = $this->original_name ?: $this->f_title;
     $this->f_link = '<a href="' . $this->link . '">' . $this->f_title . '</a>';
     $this->f_season = $season->f_name;
     $this->f_season_link = $season->f_link;
     $this->f_tvshow = $season->f_tvshow;
     $this->f_tvshow_link = $season->f_tvshow_link;
     $this->f_file = $this->f_tvshow;
     if ($this->episode_number) {
         $this->f_file .= ' - S' . sprintf('%02d', $season->season_number) . 'E' . sprintf('%02d', $this->episode_number);
     }
     $this->f_file .= ' - ' . $this->f_title;
     $this->f_full_title = $this->f_file;
     return true;
 }
开发者ID:nioc,项目名称:ampache,代码行数:23,代码来源:tvshow_episode.class.php

示例3: format

 /**
  * format
  * this function takes the object and reformats some values
  */
 public function format($details = true)
 {
     parent::format($details);
     $this->f_location = $this->location;
     return true;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:10,代码来源:personal_video.class.php

示例4: Song

// if random
if ($type == 'song') {
    /* Base Checks passed create the song object */
    $media = new Song($oid);
    $media->format();
} else {
    if ($type == 'song_preview') {
        $media = new Song_Preview($oid);
        $media->format();
    } else {
        $type = 'video';
        $media = new Video($oid);
        if (isset($_REQUEST['subtitle'])) {
            $subtitle = $media->get_subtitle_file($_REQUEST['subtitle']);
        }
        $media->format();
    }
}
if (!User::stream_control(array(array('object_type' => $type, 'object_id' => $media->id)))) {
    debug_event('UI::access_denied', 'Stream control failed for user ' . $GLOBALS['user']->username . ' on ' . $media->get_stream_name(), 3);
    UI::access_denied();
    exit;
}
if ($media->catalog) {
    // Build up the catalog for our current object
    $catalog = Catalog::create_from_id($media->catalog);
    /* If the media is disabled */
    if (!make_bool($media->enabled)) {
        debug_event('Play', "Error: {$media->file} is currently disabled, song skipped", '5');
        // Check to see if this is a democratic playlist, if so remove it completely
        if ($demo_id && isset($democratic)) {
开发者ID:ivan801,项目名称:ampache,代码行数:31,代码来源:index.php

示例5: T_

            <th class="cel_action essential"><?php 
echo T_('Action');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
/* Foreach through every artist that has been passed to us */
foreach ($object_ids as $video_id) {
    if (isset($video_type)) {
        $libitem = new $video_type($video_id);
    } else {
        $libitem = new Video($video_id);
    }
    $libitem->format();
    ?>
        <tr id="video_<?php 
    echo $libitem->id;
    ?>
" class="<?php 
    echo UI::flip_class();
    ?>
">
            <?php 
    require AmpConfig::get('prefix') . UI::find_template('show_video_row.inc.php');
    ?>
        </tr>
        <?php 
}
//end foreach
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_videos.inc.php

示例6: format

 /**
  * format
  * this function takes the object and reformats some values
  */
 public function format($details = true)
 {
     parent::format($details);
     $this->f_original_name = trim($this->prefix . " " . $this->f_title);
     $this->f_title = $this->f_original_name ?: $this->f_title;
     $this->f_full_title = $this->f_title;
     $this->f_link = '<a href="' . $this->link . '">' . $this->f_title . '</a>';
     return true;
 }
开发者ID:nioc,项目名称:ampache,代码行数:13,代码来源:movie.class.php

示例7: T_

            <th class="cel_tags optional"><?php 
echo T_('Tags');
?>
</th>
            <th class="cel_action essential"><?php 
echo T_('Action');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
/* Foreach through every artist that has been passed to us */
foreach ($object_ids as $video_id) {
    $video = new Video($video_id);
    $video->format();
    ?>
        <tr id="video_<?php 
    echo $video->id;
    ?>
" class="<?php 
    echo UI::flip_class();
    ?>
">
            <?php 
    require AmpConfig::get('prefix') . '/templates/show_video_row.inc.php';
    ?>
        </tr>
        <?php 
}
//end foreach
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:show_videos.inc.php

示例8: _videoChilds

 public static function _videoChilds($prmPath, $prmQuery, $start, $count)
 {
     $mediaItems = array();
     $maxCount = 0;
     $queryData = array();
     parse_str($prmQuery, $queryData);
     $parent = 'amp://video' . $prmPath;
     $pathreq = explode('/', $prmPath);
     if ($pathreq[0] == '' && count($pathreq) > 0) {
         array_shift($pathreq);
     }
     switch ($pathreq[0]) {
         case 'tvshows':
             switch (count($pathreq)) {
                 case 1:
                     // Get tvshow list
                     $tvshows = Catalog::get_tvshows();
                     list($maxCount, $tvshows) = self::_slice($tvshows, $start, $count);
                     foreach ($tvshows as $tvshow) {
                         $tvshow->format();
                         $mediaItems[] = self::_itemTVShow($tvshow, $parent);
                     }
                     break;
                 case 2:
                     // Get season list
                     $tvshow = new TVShow($pathreq[1]);
                     if ($tvshow->id) {
                         $season_ids = $tvshow->get_seasons();
                         list($maxCount, $season_ids) = self::_slice($season_ids, $start, $count);
                         foreach ($season_ids as $season_id) {
                             $season = new TVShow_Season($season_id);
                             $season->format();
                             $mediaItems[] = self::_itemTVShowSeason($season, $parent);
                         }
                     }
                     break;
                 case 3:
                     // Get episode list
                     $season = new TVShow_Season($pathreq[2]);
                     if ($season->id) {
                         $episode_ids = $season->get_episodes();
                         list($maxCount, $episode_ids) = self::_slice($episode_ids, $start, $count);
                         foreach ($episode_ids as $episode_id) {
                             $video = new Video($episode_id);
                             $video->format();
                             $mediaItems[] = self::_itemVideo($video, $parent);
                         }
                     }
                     break;
             }
             break;
         case 'clips':
             switch (count($pathreq)) {
                 case 1:
                     // Get clips list
                     $videos = Catalog::get_videos(null, 'clip');
                     list($maxCount, $videos) = self::_slice($videos, $start, $count);
                     foreach ($videos as $video) {
                         $video->format();
                         $mediaItems[] = self::_itemVideo($video, $parent);
                     }
                     break;
             }
             break;
         case 'movies':
             switch (count($pathreq)) {
                 case 1:
                     // Get clips list
                     $videos = Catalog::get_videos(null, 'movie');
                     list($maxCount, $videos) = self::_slice($videos, $start, $count);
                     foreach ($videos as $video) {
                         $video->format();
                         $mediaItems[] = self::_itemVideo($video, $parent);
                     }
                     break;
             }
             break;
         case 'personal_videos':
             switch (count($pathreq)) {
                 case 1:
                     // Get clips list
                     $videos = Catalog::get_videos(null, 'personal_video');
                     list($maxCount, $videos) = self::_slice($videos, $start, $count);
                     foreach ($videos as $video) {
                         $video->format();
                         $mediaItems[] = self::_itemVideo($video, $parent);
                     }
                     break;
             }
             break;
         default:
             $mediaItems[] = self::_videoMetadata('clips');
             $mediaItems[] = self::_videoMetadata('tvshows');
             $mediaItems[] = self::_videoMetadata('movies');
             $mediaItems[] = self::_videoMetadata('personal_videos');
             break;
     }
     if ($maxCount == 0) {
         $maxCount = count($mediaItems);
     }
//.........这里部分代码省略.........
开发者ID:nioc,项目名称:ampache,代码行数:101,代码来源:upnp_api.class.php

示例9: videos

 /**
  * videos
  *
  * This builds the xml document for displaying video objects
  *
  * @param    array    $videos    (description here...)
  * @return    string    return xml
  */
 public static function videos($videos)
 {
     if (count($videos) > self::$limit or self::$offset > 0) {
         $videos = array_slice($videos, self::$offset, self::$limit);
     }
     $string = '';
     foreach ($videos as $video_id) {
         $video = new Video($video_id);
         $video->format();
         $string .= "<video id=\"" . $video->id . "\">\n" . "\t<title><![CDATA[" . $video->title . "]]></title>\n" . "\t<mime><![CDATA[" . $video->mime . "]]></mime>\n" . "\t<resolution>" . $video->f_resolution . "</resolution>\n" . "\t<size>" . $video->size . "</size>\n" . self::tags_string($video->tags) . "\t<url><![CDATA[" . Video::play_url($video->id, '', 'api') . "]]></url>\n" . "</video>\n";
     }
     // end foreach
     $final = self::_header() . $string . self::_footer();
     return $final;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:23,代码来源:xml_data.class.php


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