本文整理汇总了PHP中Art类的典型用法代码示例。如果您正苦于以下问题:PHP Art类的具体用法?PHP Art怎么用?PHP Art使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Art类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
function getList($email)
{
$this->db->query($this->table, ["*"], array("email" => $email));
$r = array();
while ($row = $this->db->getRow()) {
$art = new Art();
$art->set($row);
$r[] = $art;
}
return $r;
}
示例2: array
$results[] = array('type' => T_('Playlists'), 'link' => $playlist->link, 'label' => $playlist->name, 'value' => $playlist->name, 'rels' => '', 'image' => '');
}
}
if (($target == 'anywhere' || $target == 'label') && AmpConfig::get('label')) {
$searchreq = array('limit' => $limit, 'type' => 'label', 'rule_1_input' => $search, 'rule_1_operator' => '2', 'rule_1' => 'name');
$sres = Search::run($searchreq);
// Litmit not reach, new search with another operator
if (count($sres) < $limit) {
$searchreq['limit'] = $limit - count($sres);
$searchreq['rule_1_operator'] = '0';
$sres = array_unique(array_merge($sres, Search::run($searchreq)));
}
foreach ($sres as $id) {
$label = new Label($id);
$label->format(false);
$results[] = array('type' => T_('Labels'), 'link' => $label->link, 'label' => $label->name, 'value' => $label->name, 'rels' => '', 'image' => Art::url($label->id, 'label', null, 10));
}
}
if ($target == 'missing_artist' && AmpConfig::get('wanted')) {
$sres = Wanted::search_missing_artists($search);
$i = 0;
foreach ($sres as $r) {
$results[] = array('type' => T_('Missing Artists'), 'link' => AmpConfig::get('web_path') . '/artists.php?action=show_missing&mbid=' . $r['mbid'], 'label' => $r['name'], 'value' => $r['name'], 'rels' => '', 'image' => '');
$i++;
if ($i >= $limit) {
break;
}
}
}
if ($target == 'user' && AmpConfig::get('sociable')) {
$searchreq = array('limit' => $limit, 'type' => 'user', 'rule_1_input' => $search, 'rule_1_operator' => '2', 'rule_1' => 'username');
示例3: T_
echo $thcount;
?>
"><span class="nodata"><?php
echo T_('No podcast found');
?>
</span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr class="th-bottom">
<th class="cel_play"></th>
<?php
if (Art::is_enabled()) {
?>
<th class="cel_cover"><?php
echo T_('Art');
?>
</th>
<?php
}
?>
<th class="cel_title"><?php
echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=title', T_('Title'), 'podcast_sort_title_bottom');
?>
</th>
<th class="cel_episodes"><?php
echo T_('Episodes');
?>
示例4: insert_from_file
/**
* This insert art from file on disk.
* @param string $filepath
*/
public function insert_from_file($filepath)
{
debug_event('art', 'Insert art from file on disk ' . $filepath, '5');
$image = Art::get_from_source(array('file' => $filepath), $this->type);
$rfile = pathinfo($filepath);
$mime = "image/" . $rfile['extension'];
$this->insert($image, $mime);
}
示例5: ob_start
$key = 'live_stream_' . $radio->id;
break;
default:
exit;
}
// end switch on type
$results[$key] = '';
break;
case 'page':
$browse->set_start($_REQUEST['start']);
ob_start();
$browse->show_objects(null, $argument);
$results[$browse->get_content_div()] = ob_get_clean();
break;
case 'show_art':
Art::set_enabled();
ob_start();
$browse->show_objects(null, $argument);
$results[$browse->get_content_div()] = ob_get_clean();
break;
case 'get_filters':
ob_start();
require_once AmpConfig::get('prefix') . '/templates/browse_filters.inc.php';
$results['browse_filters'] = ob_get_clean();
break;
case 'options':
$option = $_REQUEST['option'];
$value = $_REQUEST['value'];
switch ($option) {
case 'use_pages':
$value = $value == 'true';
示例6: getcoverart
/**
* getCoverArt
* Get a cover art image.
* Takes the cover art id in parameter.
*/
public static function getcoverart($input)
{
self::check_version($input, "1.0.0", true);
$id = self::check_parameter($input, 'id', true);
$size = $input['size'];
$art = null;
if (Subsonic_XML_Data::isArtist($id)) {
$art = new Art(Subsonic_XML_Data::getAmpacheId($id), "artist");
} elseif (Subsonic_XML_Data::isAlbum($id)) {
$art = new Art(Subsonic_XML_Data::getAmpacheId($id), "album");
} elseif (Subsonic_XML_Data::isSong($id)) {
$art = new Art(Subsonic_XML_Data::getAmpacheId($id), "song");
if ($art != null && $art->id == null) {
// in most cases the song doesn't have a picture, but the album where it belongs to has
// if this is the case, we take the album art
$song = new Song(Subsonic_XML_Data::getAmpacheId(Subsonic_XML_Data::getAmpacheId($id)));
$art = new Art(Subsonic_XML_Data::getAmpacheId($song->album), "album");
}
} elseif (Subsonic_XML_Data::isPodcast($id)) {
$art = new Art(Subsonic_XML_Data::getAmpacheId($id), "podcast");
}
header("Access-Control-Allow-Origin: *");
if ($art != null) {
$art->get_db();
if ($size && AmpConfig::get('resize_images')) {
$dim = array();
$dim['width'] = $size;
$dim['height'] = $size;
$thumb = $art->get_thumb($dim);
if ($thumb) {
header('Content-type: ' . $thumb['thumb_mime']);
header('Content-Length: ' . strlen($thumb['thumb']));
echo $thumb['thumb'];
return;
}
}
header('Content-type: ' . $art->raw_mime);
header('Content-Length: ' . strlen($art->raw));
echo $art->raw;
}
}
示例7: T_
echo Ajax::button('?page=stream&action=directplay&object_type=artist&object_id=' . $libitem->id . '&append=true', 'play_add', T_('Play last'), 'addplay_artist_' . $libitem->id);
if (Stream_Playlist::check_autoplay_next()) {
echo Ajax::button('?page=stream&action=directplay&object_type=artist&object_id=' . $libitem->id . '&playnext=true', 'play_next', T_('Play next'), 'nextplay_artist_' . $libitem->id);
}
}
}
?>
</div>
</td>
<?php
if (Art::is_enabled()) {
$name = scrub_out($libitem->full_name);
?>
<td class="cel_cover">
<?php
Art::display('artist', $libitem->id, $name, 1, AmpConfig::get('web_path') . '/artists.php?action=show&artist=' . $libitem->id);
?>
</td>
<?php
}
?>
<td class="cel_artist"><?php
echo $libitem->f_link;
?>
</td>
<td class="cel_add">
<span class="cel_item_add">
<?php
if ($show_playlist_add) {
echo Ajax::button('?action=basket&type=artist&id=' . $libitem->id, 'add', T_('Add to temporary playlist'), 'add_artist_' . $libitem->id);
echo Ajax::button('?action=basket&type=artist_random&id=' . $libitem->id, 'random', T_('Random to temporary playlist'), 'random_artist_' . $libitem->id);
示例8:
}
}
?>
</div>
</td>
<?php
if (Art::is_enabled()) {
?>
<td class="cel_cover">
<?php
$art_showed = false;
if ($libitem->get_default_art_kind() == 'preview') {
$art_showed = Art::display('video', $libitem->id, $libitem->f_title, 9, $libitem->link, false, 'preview');
}
if (!$art_showed) {
Art::display('video', $libitem->id, $libitem->f_title, 6, $libitem->link);
}
?>
</td>
<?php
}
?>
<td class="cel_title"><?php
echo $libitem->f_link;
?>
</td>
<?php
if ($video_type != 'video') {
require AmpConfig::get('prefix') . '/templates/show_partial_' . $video_type . '_row.inc.php';
}
?>
示例9: insert_local_video
/**
* insert_local_video
* This inserts a video file into the video file table the tag
* information we can get is super sketchy so it's kind of a crap shoot
* here
*/
public function insert_local_video($file, $options = array())
{
/* Create the vainfo object and get info */
$gtypes = $this->get_gather_types('video');
$vainfo = new vainfo($file, $gtypes, '', '', '', $this->sort_pattern, $this->rename_pattern);
$vainfo->get_info();
$tag_name = vainfo::get_tag_type($vainfo->tags, 'metadata_order_video');
$results = vainfo::clean_tag_info($vainfo->tags, $tag_name, $file);
$results['catalog'] = $this->id;
$id = Video::insert($results, $gtypes, $options);
if ($results['art']) {
$art = new Art($id, 'video');
$art->insert_url($results['art']);
if (AmpConfig::get('generate_video_preview')) {
Video::generate_preview($id);
}
} else {
$this->added_videos_to_gather[] = $id;
}
$this->_filecache[strtolower($file)] = 'v_' . $id;
return $id;
}
示例10: delete_avatar
public function delete_avatar()
{
$art = new Art($this->id, 'user');
$art->reset();
}
示例11: library_metadata
public static function library_metadata($params)
{
$r = Plex_XML_Data::createLibContainer();
$n = count($params);
$litem = null;
$createMode = $_SERVER['REQUEST_METHOD'] == 'POST';
$editMode = $_SERVER['REQUEST_METHOD'] == 'PUT';
if ($n > 0) {
$key = $params[0];
$id = Plex_XML_Data::getAmpacheId($key);
if ($editMode) {
self::check_access(50);
}
if ($n == 1) {
// Should we check that files still exists here?
$checkFiles = $_REQUEST['checkFiles'];
$extra = $_REQUEST['includeExtra'];
if (Plex_XML_Data::isArtist($key)) {
$litem = new Artist($id);
$litem->format();
if ($editMode) {
$dmap = array('title' => 'name', 'summary' => null);
$litem->update(self::get_data_from_map($dmap));
}
Plex_XML_Data::addArtist($r, $litem);
} elseif (Plex_XML_Data::isAlbum($key)) {
$litem = new Album($id);
$litem->format();
if ($editMode) {
$dmap = array('title' => 'name', 'year' => null);
$litem->update(self::get_data_from_map($dmap));
}
Plex_XML_Data::addAlbum($r, $litem);
} elseif (Plex_XML_Data::isTrack($key)) {
$litem = new Song($id);
$litem->format();
if ($editMode) {
$dmap = array('title' => null);
$litem->update(self::get_data_from_map($dmap));
}
Plex_XML_Data::addSong($r, $litem);
} elseif (Plex_XML_Data::isTVShow($key)) {
$litem = new TVShow($id);
$litem->format();
if ($editMode) {
$dmap = array('title' => 'name', 'year' => null, 'summary' => null);
$litem->update(self::get_data_from_map($dmap));
}
Plex_XML_Data::addTVShow($r, $litem);
} elseif (Plex_XML_Data::isTVShowSeason($key)) {
$litem = new TVShow_Season($id);
$litem->format();
Plex_XML_Data::addTVShowSeason($r, $litem);
} elseif (Plex_XML_Data::isVideo($key)) {
$litem = Video::create_from_id($id);
if ($editMode) {
$dmap = array('title' => null, 'year' => null, 'originallyAvailableAt' => 'release_date', 'originalTitle' => 'original_name', 'summary' => null);
$litem->update(self::get_data_from_map($dmap));
}
$litem->format();
$subtype = strtolower(get_class($litem));
if ($subtype == 'tvshow_episode') {
Plex_XML_Data::addEpisode($r, $litem, true);
} elseif ($subtype == 'movie') {
Plex_XML_Data::addMovie($r, $litem, true);
}
} elseif (Plex_XML_Data::isPlaylist($key)) {
$litem = new Playlist($id);
$litem->format();
if ($editMode) {
$dmap = array('title' => 'name');
$litem->update(self::get_data_from_map($dmap));
}
Plex_XML_Data::addPlaylist($r, $litem);
}
} else {
$subact = $params[1];
if ($subact == "children") {
if (Plex_XML_Data::isArtist($key)) {
$litem = new Artist($id);
$litem->format();
Plex_XML_Data::setArtistRoot($r, $litem);
} else {
if (Plex_XML_Data::isAlbum($key)) {
$litem = new Album($id);
$litem->format();
Plex_XML_Data::setAlbumRoot($r, $litem);
} else {
if (Plex_XML_Data::isTVShow($key)) {
$litem = new TVShow($id);
$litem->format();
Plex_XML_Data::setTVShowRoot($r, $litem);
} else {
if (Plex_XML_Data::isTVShowSeason($key)) {
$litem = new TVShow_Season($id);
$litem->format();
Plex_XML_Data::setTVShowSeasonRoot($r, $litem);
}
}
}
//.........这里部分代码省略.........
示例12: load_latest_shout
/**
* load_latest_shout
* This loads in the latest added shouts
* @return array
*/
public static function load_latest_shout()
{
$ids = Shoutbox::get_top(10);
$results = array();
foreach ($ids as $id) {
$shout = new Shoutbox($id);
$shout->format();
$object = Shoutbox::get_object($shout->object_type, $shout->object_id);
$object->format();
$user = new User($shout->user);
$user->format();
$xml_array = array('title' => $user->username . ' ' . T_('on') . ' ' . $object->get_fullname(), 'link' => $object->link, 'description' => $shout->text, 'image' => Art::url($shout->object_id, $shout->object_type, null, 2), 'comments' => '', 'pubDate' => date("c", $shout->date));
$results[] = $xml_array;
}
// end foreach
return $results;
}
示例13: Browse
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
$web_path = AmpConfig::get('web_path');
$browse = new Browse();
$browse->set_type($object_type);
UI::show_box_top($tvshow->f_name, 'info-box');
?>
<div class="item_right_info">
<?php
Art::display('tvshow', $tvshow->id, $tvshow->f_name, 6);
?>
<?php
if ($tvshow->summary) {
?>
<div id="item_summary">
<?php
echo $tvshow->summary;
?>
</div>
<?php
}
?>
</div>
<?php
if (User::is_registered()) {
示例14: scrub_out
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
$web_path = AmpConfig::get('web_path');
// Title for this album
$title = scrub_out($walbum->name) . ' (' . $walbum->year . ')';
$title .= ' - ' . $walbum->f_artist_link;
UI::show_box_top($title, 'info-box missing');
?>
<div class="item_art">
<?php
// Attempt to find the art.
$art = new Art($walbum->mbid, 'album');
$options['artist'] = $artist->name;
$options['album_name'] = $walbum->name;
$options['keyword'] = $artist->name . " " . $walbum->name;
$images = $art->gather($options, '1');
if (count($images) > 0 && !empty($images[0]['url'])) {
$name = '[' . $artist->name . '] ' . scrub_out($walbum->name);
$image = $images[0]['url'];
echo "<a href=\"" . $image . "\" rel=\"prettyPhoto\">";
echo "<img src=\"" . $image . "\" alt=\"" . $name . "\" alt=\"" . $name . "\" height=\"128\" width=\"128\" />";
echo "</a>\n";
}
?>
</div>
<div id="information_actions">
<h3><?php
示例15: display
/**
* Display an item art.
* @param string $object_type
* @param int $object_id
* @param string $name
* @param int $thumb
* @param string $link
* @param boolean $show_default
* @param string $kind
* @return boolean
*/
public static function display($object_type, $object_id, $name, $thumb, $link = null, $show_default = true, $kind = 'default')
{
if (!self::is_valid_type($object_type)) {
return false;
}
if (!$show_default) {
// Don't show any image if not available
if (!self::has_db($object_id, $object_type, $kind)) {
return false;
}
}
$size = self::get_thumb_size($thumb);
$prettyPhoto = $link == null;
if ($link == null) {
$link = AmpConfig::get('web_path') . "/image.php?object_id=" . $object_id . "&object_type=" . $object_type;
if (AmpConfig::get('use_auth') && AmpConfig::get('require_session')) {
$link .= "&auth=" . session_id();
}
if ($kind != 'default') {
$link .= '&kind=' . $kind;
}
}
echo "<div class=\"item_art\">";
echo "<a href=\"" . $link . "\" title=\"" . $name . "\"";
if ($prettyPhoto) {
echo " rel=\"prettyPhoto\"";
}
echo ">";
$imgurl = AmpConfig::get('web_path') . "/image.php?object_id=" . $object_id . "&object_type=" . $object_type . "&thumb=" . $thumb;
if ($kind != 'default') {
$imgurl .= '&kind=' . $kind;
}
// This to keep browser cache feature but force a refresh in case image just changed
if (Art::has_db($object_id, $object_type)) {
$art = new Art($object_id, $object_type);
if ($art->get_db()) {
$imgurl .= '&fooid=' . $art->id;
}
}
echo "<img src=\"" . $imgurl . "\" alt=\"" . $name . "\" height=\"" . $size['height'] . "\" width=\"" . $size['width'] . "\" />";
if ($size['height'] > 150) {
echo "<div class=\"item_art_play\">";
echo Ajax::text('?page=stream&action=directplay&object_type=' . $object_type . '&object_id=' . $object_id . '\' + getPagePlaySettings() + \'', '<span class="item_art_play_icon" title="' . T_('Play') . '" />', 'directplay_art_' . $object_type . '_' . $object_id);
echo "</div>";
}
if ($prettyPhoto) {
$libitem = new $object_type($object_id);
echo "<div class=\"item_art_actions\">";
if ($GLOBALS['user']->has_access(50) || $GLOBALS['user']->has_access(25) && $GLOBALS['user']->id == $libitem->get_user_owner()) {
echo "<a href=\"javascript:NavigateTo('" . AmpConfig::get('web_path') . "/arts.php?action=find_art&object_type=" . $object_type . "&object_id=" . $object_id . "&burl=' + getCurrentPage());\">";
echo UI::get_icon('edit', T_('Edit/Find Art'));
echo "</a>";
echo "<a href=\"javascript:NavigateTo('" . AmpConfig::get('web_path') . "/arts.php?action=clear_art&object_type=" . $object_type . "&object_id=" . $object_id . "&burl=' + getCurrentPage());\" onclick=\"return confirm('" . T_('Do you really want to reset art?') . "');\">";
echo UI::get_icon('delete', T_('Reset Art'));
echo "</a>";
}
echo "</div>";
}
echo "</a>\n";
echo "</div>";
return true;
}