當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Playlist::get_users方法代碼示例

本文整理匯總了PHP中Playlist::get_users方法的典型用法代碼示例。如果您正苦於以下問題:PHP Playlist::get_users方法的具體用法?PHP Playlist::get_users怎麽用?PHP Playlist::get_users使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Playlist的用法示例。


在下文中一共展示了Playlist::get_users方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getplaylists

 /**
  * getPlaylists
  * Get all playlists a user is allowed to play.
  * Takes optional user in parameter.
  */
 public static function getplaylists($input)
 {
     self::check_version($input);
     $r = Subsonic_XML_Data::createSuccessResponse();
     $username = $input['username'];
     // Don't allow playlist listing for another user
     if (empty($username) || $username == $GLOBALS['user']->username) {
         Subsonic_XML_Data::addPlaylists($r, Playlist::get_playlists(), Search::get_searches());
     } else {
         $user = User::get_from_username($username);
         if ($user->id) {
             Subsonic_XML_Data::addPlaylists($r, Playlist::get_users($user->id));
         } else {
             Subsonic_XML_Data::addPlaylists($r, array());
         }
     }
     self::apiOutput($input, $r);
 }
開發者ID:bl00m,項目名稱:ampache,代碼行數:23,代碼來源:subsonic_api.class.php

示例2: T_

 */
?>

<ul>
    <li>
        <a href="javascript:void(0);" id="rb_append_dplaylist_new" onclick="handlePlaylistAction('<?php 
echo AmpConfig::get('ajax_url') . '?page=playlist&action=append_item&item_type=' . $_REQUEST['item_type'] . '&item_id=' . $_REQUEST['item_id'];
?>
', 'rb_append_dplaylist_new');">
            <?php 
echo T_('Add to New Playlist');
?>
        </a>
    </li>
<?php 
$playlists = Playlist::get_users($GLOBALS['user']->id);
Playlist::build_cache($playlists);
foreach ($playlists as $playlist_id) {
    $playlist = new Playlist($playlist_id);
    $playlist->format();
    ?>
    <li>
        <a href="javascript:void(0);" id="rb_append_dplaylist_<?php 
    echo $playlist->id;
    ?>
" onclick="handlePlaylistAction('<?php 
    echo AmpConfig::get('ajax_url') . '?page=playlist&action=append_item&playlist_id=' . $playlist->id . '&item_type=' . $_REQUEST['item_type'] . '&item_id=' . $_REQUEST['item_id'];
    ?>
', 'rb_append_dplaylist_<?php 
    echo $playlist->id;
    ?>
開發者ID:axelsimon,項目名稱:ampache,代碼行數:31,代碼來源:show_playlists_dialog.inc.php


注:本文中的Playlist::get_users方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。