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
0
         $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
0
    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
0
 /**
  * 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
0
             $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
0
 /**
  * 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
0
        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
0
    }
}
?>
    </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
0
 /**
  * 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
0
 public function delete_avatar()
 {
     $art = new Art($this->id, 'user');
     $art->reset();
 }
示例#11
0
 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);
                             }
                         }
                     }
                 }
             } elseif ($subact == "thumbs" || $subact == "posters" || $subact == "arts" || $subact == 'backgrounds') {
                 $kind = Plex_XML_Data::getPhotoKind($subact);
                 if ($createMode) {
                     // Upload art
                     $litem = Plex_XML_Data::createLibraryItem($key);
                     if ($litem != null) {
                         $uri = Plex_XML_Data::getMetadataUri($key) . '/' . Plex_XML_Data::getPhotoPlexKind($kind) . '/' . $key;
                         if (is_a($litem, 'video')) {
                             $type = 'video';
                         } else {
                             $type = get_class($litem);
                         }
                         $art = new Art($litem->id, $type, $kind);
                         $raw = file_get_contents("php://input");
                         $art->insert($raw);
                         header('Content-Type: text/html');
                         echo $uri;
                         exit;
                     }
                 }
                 Plex_XML_Data::addPhotos($r, $key, $kind);
             } elseif ($subact == "thumb" || $subact == "poster" || $subact == "art" || $subact == "background") {
                 if ($n == 3) {
                     $kind = Plex_XML_Data::getPhotoKind($subact);
                     // Ignore art id as we can only have 1 thumb
                     $art = null;
                     if (Plex_XML_Data::isArtist($key)) {
                         $art = new Art($id, "artist", $kind);
                     } else {
                         if (Plex_XML_Data::isAlbum($key)) {
                             $art = new Art($id, "album", $kind);
                         } else {
                             if (Plex_XML_Data::isTrack($key)) {
                                 $art = new Art($id, "song", $kind);
                             } else {
                                 if (Plex_XML_Data::isTVShow($key)) {
                                     $art = new Art($id, "tvshow", $kind);
                                 } else {
                                     if (Plex_XML_Data::isTVShowSeason($key)) {
                                         $art = new Art($id, "tvshow_season", $kind);
                                     } else {
                                         if (Plex_XML_Data::isVideo($key)) {
                                             $art = new Art($id, "video", $kind);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     if ($art != null) {
                         $art->get_db();
                         ob_clean();
                         if (!isset($size)) {
                             self::setHeader($art->raw_mime);
                             echo $art->raw;
                         } else {
                             $dim = array();
                             $dim['width'] = $size;
                             $dim['height'] = $size;
                             $thumb = $art->get_thumb($dim);
                             self::setHeader($art->thumb_mime);
                             echo $thumb['thumb'];
                         }
                         exit;
                     }
                 }
             }
         }
     }
     if ($litem != null) {
         $catalog_ids = $litem->get_catalogs();
         if (count($catalog_ids) > 0) {
             $catalog = Catalog::create_from_id($catalog_ids[0]);
             Plex_XML_Data::addCatalogIdentity($r, $catalog);
         }
     }
     Plex_XML_Data::setContainerSize($r);
     self::apiOutputXml($r->asXML());
 }
示例#12
0
 /**
  * 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
0
 * 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
0
 *
 * 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) . '&nbsp;(' . $walbum->year . ')';
$title .= '&nbsp;-&nbsp;' . $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
0
 /**
  * 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;
 }
示例#16
0
 */
// Gotta do some math here!
$total_images = count($images);
$rows = floor($total_images / 4);
$i = 0;
UI::show_box_top(T_('Select New Album Art'), 'box box_album_art');
?>
<table class="table-data">
<tr>
<?php 
while ($i <= $rows) {
    $j = 0;
    while ($j < 4) {
        $key = $i * 4 + $j;
        $image_url = AmpConfig::get('web_path') . '/image.php?type=session&amp;image_index=' . $key;
        $dimensions = Core::image_dimensions(Art::get_from_source($_SESSION['form']['images'][$key], 'album'));
        if (!isset($images[$key])) {
            echo "<td>&nbsp;</td>\n";
        } else {
            ?>
            <td align="center">
                <a href="<?php 
            echo $image_url;
            ?>
" rel="prettyPhoto" target="_blank"><img src="<?php 
            echo $image_url;
            ?>
" alt="<?php 
            echo T_('Album Art');
            ?>
" border="0" height="175" width="175" /></a>
示例#17
0
文件: image.php 项目: bl00m/ampache
            require_once AmpConfig::get('prefix') . UI::find_template('show_big_art.inc.php');
            break;
        case 'session':
            // If we need to pull the data out of the session
            Session::check();
            $filename = scrub_in($_REQUEST['image_index']);
            $image = Art::get_from_source($_SESSION['form']['images'][$filename], 'album');
            $mime = $_SESSION['form']['images'][$filename]['mime'];
            $typeManaged = true;
            break;
    }
}
if (!$typeManaged) {
    $item = new $type($_GET['object_id']);
    $filename = $item->name ?: $item->title;
    $art = new Art($item->id, $type, $kind);
    $art->get_db();
    $etag = $art->id;
    // That means the client has a cached version of the image
    $reqheaders = getallheaders();
    if (isset($reqheaders['If-Modified-Since']) && isset($reqheaders['If-None-Match'])) {
        $ccontrol = $reqheaders['Cache-Control'];
        if ($ccontrol != 'no-cache') {
            $cetagf = explode('-', $reqheaders['If-None-Match']);
            $cetag = $cetagf[0];
            // Same image than the cached one? Use the cache.
            if ($cetag == $etag) {
                header('HTTP/1.1 304 Not Modified');
                exit;
            }
        }
示例#18
0
            <?php 
    echo $media->f_tags;
    ?>
        </div>
    <?php 
}
?>
</div>

<?php 
if (Art::is_enabled()) {
    ?>
<div class="np_group" id="np_group_3">
  <div class="np_cell cel_albumart">
      <?php 
    Art::display('album', $media->album, $media->get_fullname(), 1, AmpConfig::get('web_path') . '/albums.php?action=show&album=' . $media->album);
    ?>
  </div>
</div>
<?php 
}
?>

<?php 
if (AmpConfig::get('show_similar')) {
    ?>
<div class="np_group similars" id="similar_items_<?php 
    echo $media->id;
    ?>
">
    <div class="np_group similars">
示例#19
0
 public function display_art($thumb = 2)
 {
     $id = null;
     $type = null;
     if (Art::has_db($this->id, 'video')) {
         $id = $this->id;
         $type = 'video';
     } else {
         if (Art::has_db($this->season, 'tvshow_season')) {
             $id = $this->season;
             $type = 'tvshow_season';
         } else {
             $season = new TVShow_Season($this->season);
             if (Art::has_db($season->tvshow, 'tvshow')) {
                 $id = $season->tvshow;
                 $type = 'tvshow';
             }
         }
     }
     if ($id !== null && $type !== null) {
         Art::display($type, $id, $this->get_fullname(), $thumb, $this->link);
     }
 }
示例#20
0
文件: arts.php 项目: nioc/ampache
            // Store the results for further use
            $_SESSION['form']['images'] = $images;
            require_once AmpConfig::get('prefix') . '/templates/show_arts.inc.php';
        } else {
            show_confirmation(T_('Art Not Located'), T_('Art could not be located at this time. This may be due to write access error, or the file is not received correctly.'), $burl);
        }
        require_once AmpConfig::get('prefix') . '/templates/show_get_art.inc.php';
        break;
    case 'select_art':
        /* Check to see if we have the image url still */
        $image_id = $_REQUEST['image'];
        // Prevent the script from timing out
        set_time_limit(0);
        $image = Art::get_from_source($_SESSION['form']['images'][$image_id], 'album');
        $mime = $_SESSION['form']['images'][$image_id]['mime'];
        // Special case for albums, I'm not sure if we should keep it, remove it or find a generic way
        if ($object_type == 'album') {
            $album = new $object_type($object_id);
            $album_groups = $album->get_group_disks_ids();
            foreach ($album_groups as $a_id) {
                $art = new Art($a_id, $object_type);
                $art->insert($image, $mime);
            }
        } else {
            $art = new Art($object_id, $object_type);
            $art->insert($image, $mime);
        }
        header("Location:" . $burl);
        break;
}
UI::show_footer();
示例#21
0
    echo 'edit_artist_' . $artist->id;
    ?>
', '<?php 
    echo T_('Artist edit');
    ?>
', '', '')">
                <?php 
    echo T_('Edit Artist');
    ?>
            </a>
        <?php 
}
?>
        <li>
            <input type="checkbox" id="show_artist_artCB" <?php 
echo $string = Art::is_enabled() ? 'checked="checked"' : '';
?>
/> <?php 
echo T_('Show Art');
?>
            <?php 
echo Ajax::observe('show_artist_artCB', 'click', Ajax::action('?page=browse&action=show_art&browse_id=' . $browse->id, ''));
?>
        </li>
    </ul>
</div>
<?php 
UI::show_box_bottom();
?>
<div class="tabs_wrapper">
    <div id="tabs_container">
示例#22
0
 /**
  * get_image
  * This returns an image tag if the type of object we're currently rolling with
  * has an image associated with it
  */
 public function get_image()
 {
     $image_string = '';
     if (Art::has_db($this->object_id, $this->object_type)) {
         $image_string = "<img class=\"shoutboximage\" height=\"75\" width=\"75\" src=\"" . AmpConfig::get('web_path') . "/image.php?object_id=" . $this->object_id . "&object_type=" . $this->object_type . "&thumb=1\" />";
     }
     return $image_string;
 }
</a>
        <a href="http://www.last.fm/search?q=%22<?php 
echo rawurlencode($album->f_artist);
?>
%22+%22<?php 
echo rawurlencode($album->f_name);
?>
%22&type=album" target="_blank"><?php 
echo UI::get_icon('lastfm', T_('Search on Last.fm ...'));
?>
</a>
    </div>
    <?php 
if ($album->name != T_('Unknown (Orphaned)')) {
    $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name);
    Art::display('album', $album->id, $name, 2);
}
?>
</div>
<div id="information_actions">
    <h3><?php 
echo T_('Actions');
?>
:</h3>
    <ul>
        <?php 
if ($show_direct_play) {
    ?>
        <li>
            <?php 
    echo Ajax::button('?page=stream&action=directplay&object_type=album&' . $album->get_http_album_query_ids('object_id'), 'play', T_('Play'), 'directplay_full_');
示例#24
0
%22&go=Go" target="_blank"><?php 
echo UI::get_icon('wikipedia', T_('Search on Wikipedia ...'));
?>
</a>
        <a href="http://www.last.fm/search?q=%22<?php 
echo rawurlencode($label->f_name);
?>
%22&type=label" target="_blank"><?php 
echo UI::get_icon('lastfm', T_('Search on Last.fm ...'));
?>
</a>
    </div>
    <div id="artist_biography">
        <div class="item_info">
            <?php 
Art::display('label', $label->id, $label->f_name, 2);
?>
            <div class="item_properties">
                <?php 
echo scrub_out($label->address);
?>
            </div>
        </div>
        <div id="item_summary">
            <?php 
echo nl2br(scrub_out($label->summary));
?>
        </div>
    </div>
</div>
    <?php 
if (AmpConfig::get('directplay')) {
    echo Ajax::button('?page=stream&action=directplay&object_type=tvshow_season&object_id=' . $libitem->id, 'play', T_('Play'), 'play_season_' . $libitem->id);
    if (Stream_Playlist::check_autoplay_append()) {
        echo Ajax::button('?page=stream&action=directplay&object_type=tvshow_season&object_id=' . $libitem->id . '&append=true', 'play_add', T_('Play last'), 'addplay_season_' . $libitem->id);
    }
}
?>
    </div>
</td>
<?php 
if (Art::is_enabled()) {
    ?>
<td class="cel_cover">
    <?php 
    Art::display('tvshow_season', $libitem->id, $libitem->f_name, 6, $libitem->link);
    ?>
</td>
<?php 
}
?>
<td class="cel_season"><?php 
echo $libitem->f_link;
?>
</td>
<td class="cel_tvshow"><?php 
echo $libitem->f_tvshow_link;
?>
</td>
<td class="cel_episodes"><?php 
echo $libitem->episodes;
示例#26
0
 * 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($season->f_name . ' - ' . $season->f_tvshow_link, 'info-box');
?>
<div class="item_right_info">
    <?php 
Art::display('tvshow_season', $season->id, $season->f_name, 6);
?>
</div>
<?php 
if (User::is_registered()) {
    ?>
    <?php 
    if (AmpConfig::get('ratings')) {
        ?>
    <div id="rating_<?php 
        echo intval($season->id);
        ?>
_tvshow_season" style="display:inline;">
        <?php 
        show_rating($season->id, 'tvshow_season');
        ?>
示例#27
0
 public function gather_arts($type, $options = array(), $limit = 5)
 {
     debug_event('tadb', 'gather_arts for type `' . $type . '`', 5);
     return Art::gather_metadata_plugin($this, $type, $options);
 }
示例#28
0
 public function gather_arts($type, $options = array(), $limit = 5)
 {
     return Art::gather_metadata_plugin($this, $type, $options);
 }
示例#29
0
 public function display_art($thumb = 2)
 {
     if (Art::has_db($this->id, 'tag')) {
         Art::display('tag', $this->id, $this->get_fullname(), $thumb, $this->link);
     }
 }
示例#30
0
 public function remove_from_disk()
 {
     $deleted = true;
     $season_ids = $this->get_seasons();
     foreach ($season_ids as $id) {
         $season = new TVShow_Season($id);
         $deleted = $season->remove_from_disk();
         if (!$deleted) {
             debug_event('tvshow', 'Error when deleting the season `' . $id . '`.', 1);
             break;
         }
     }
     if ($deleted) {
         $sql = "DELETE FROM `tvshow` WHERE `id` = ?";
         $deleted = Dba::write($sql, array($this->id));
         if ($deleted) {
             Art::gc('tvshow', $this->id);
             Userflag::gc('tvshow', $this->id);
             Rating::gc('tvshow', $this->id);
             Shoutbox::gc('tvshow', $this->id);
             Useractivity::gc('tvshow', $this->id);
         }
     }
     return $deleted;
 }