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


PHP Artist::update_artist_info方法代码示例

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


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

示例1: get_artist_info

 /**
  * get_artist_info
  * Returns artist information
  */
 public static function get_artist_info($artist_id, $fullname = '')
 {
     $artist = null;
     if ($artist_id) {
         $artist = new Artist($artist_id);
         $artist->format();
         $fullname = $artist->f_full_name;
         // Data newer than 6 months, use it
         if ($artist->last_update + 15768000 > time()) {
             $results = array();
             $results['summary'] = $artist->summary;
             $results['placeformed'] = $artist->placeformed;
             $results['yearformed'] = $artist->yearformed;
             $results['largephoto'] = Art::url($artist->id, 'artist');
             $results['megaphoto'] = $results['largephoto'];
             return $results;
         }
     }
     $query = 'artist=' . rawurlencode($fullname);
     $xml = self::get_lastfm_results('artist.getinfo', $query);
     $results = array();
     $results['summary'] = strip_tags(preg_replace("#<a href=([^<]*)Last\\.fm</a>.#", "", (string) $xml->artist->bio->summary));
     $results['placeformed'] = (string) $xml->artist->bio->placeformed;
     $results['yearformed'] = (string) $xml->artist->bio->yearformed;
     $results['largephoto'] = $xml->artist->image[2];
     $results['megaphoto'] = $xml->artist->image[4];
     if ($artist) {
         if (!empty($results['summary']) || !empty($results['megaphoto'])) {
             $artist->update_artist_info($results['summary'], $results['placeformed'], $results['yearformed']);
             $image = Art::get_from_source(array('url' => $results['megaphoto']), 'artist');
             $rurl = pathinfo($results['megaphoto']);
             $mime = 'image/' . $rurl['extension'];
             $art = new Art($artist->id, 'artist');
             $art->reset();
             $art->insert($image, $mime);
             $results['largephoto'] = Art::url($artist->id, 'artist');
             $results['megaphoto'] = $results['largephoto'];
         }
     }
     return $results;
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:45,代码来源:recommendation.class.php


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