本文整理汇总了PHP中Userflag::get_latest方法的典型用法代码示例。如果您正苦于以下问题:PHP Userflag::get_latest方法的具体用法?PHP Userflag::get_latest怎么用?PHP Userflag::get_latest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Userflag
的用法示例。
在下文中一共展示了Userflag::get_latest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_home
/**
* display_home
* This display the module in home page
*/
public function display_home()
{
if (AmpConfig::get('userflags')) {
$userflags = Userflag::get_latest(null, -1, $this->maxitems);
$i = 0;
echo '<div class="home_plugin"><table class="tabledata">';
foreach ($userflags as $userflag) {
$item = new $userflag['type']($userflag['id']);
$item->format();
$user = new User($userflag['user']);
$user->format();
if ($item->id) {
echo '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '"><td>';
echo '<div>';
echo '<div style="float: left;">';
echo '<span style="font-weight: bold;">' . $item->f_link . '</span> ';
echo '<span style="margin-right: 10px;">';
if (AmpConfig::get('directplay')) {
echo Ajax::button('?page=stream&action=directplay&object_type=' . $userflag['type'] . '&object_id=' . $userflag['id'], 'play', T_('Play'), 'play_' . $userflag['type'] . '_' . $userflag['id']);
if (Stream_Playlist::check_autoplay_append()) {
echo Ajax::button('?page=stream&action=directplay&object_type=' . $userflag['type'] . '&object_id=' . $userflag['id'] . '&append=true', 'play_add', T_('Play last'), 'addplay_' . $userflag['type'] . '_' . $userflag['id']);
}
}
echo Ajax::button('?action=basket&type=' . $userflag['type'] . '&id=' . $userflag['id'], 'add', T_('Add to temporary playlist'), 'play_full_' . $userflag['id']);
echo '</span>';
echo '</div>';
echo '<div style="float: right; opacity: 0.5;">' . T_('recommended by') . ' ' . $user->f_link . '</div>';
echo '</div><br />';
echo '<div style="margin-left: 30px;">';
echo '<div style="float: left; margin-right: 20px;">';
$thumb = UI::is_grid_view('album') ? 2 : 11;
$item->display_art($thumb);
echo '</div>';
echo '<div style="white-space: normal;">' . $item->get_description() . '</div>';
echo '</div>';
echo '</td></tr>';
$i++;
}
}
echo '</table></div>';
}
}
示例2: stats
public static function stats($input)
{
$type = $input['type'];
$offset = $input['offset'];
$limit = $input['limit'];
if ($type == "newest") {
$albums = Stats::get_newest("album", $limit, $offset);
} else {
if ($type == "highest") {
$albums = Rating::get_highest("album", $limit, $offset);
} else {
if ($type == "frequent") {
$albums = Stats::get_top("album", $limit, '', $offset);
} else {
if ($type == "recent") {
$albums = Stats::get_recent("album", $limit, $offset);
} else {
if ($type == "flagged") {
$albums = Userflag::get_latest('album');
} else {
if (!$limit) {
$limit = AmpConfig::get('popular_threshold');
}
$albums = Album::get_random($limit);
}
}
}
}
}
ob_end_clean();
echo XML_Data::albums($albums);
}
示例3: getstarred
/**
* getStarred
* Get starred songs, albums and artists.
* Takes no parameter.
* Not supported.
*/
public static function getstarred($input, $elementName = "starred")
{
self::check_version($input, "1.7.0");
$r = Subsonic_XML_Data::createSuccessResponse();
Subsonic_XML_Data::addStarred($r, Userflag::get_latest('artist', null, 99999), Userflag::get_latest('album', null, 99999), Userflag::get_latest('song', null, 99999), $elementName);
self::apiOutput($input, $r);
}
示例4: stats
/**
* This get library stats.
* @param array $input
*/
public static function stats($input)
{
$type = $input['type'];
$offset = $input['offset'];
$limit = $input['limit'];
$username = $input['username'];
$albums = null;
if ($type == "newest") {
$albums = Stats::get_newest("album", $limit, $offset);
} else {
if ($type == "highest") {
$albums = Rating::get_highest("album", $limit, $offset);
} else {
if ($type == "frequent") {
$albums = Stats::get_top("album", $limit, '', $offset);
} else {
if ($type == "recent") {
if (!empty($username)) {
$user = User::get_from_username($username);
if ($user !== null) {
$albums = $user->get_recently_played($limit, 'album');
} else {
debug_event('api', 'User `' . $username . '` cannot be found.', 1);
}
} else {
$albums = Stats::get_recent("album", $limit, $offset);
}
} else {
if ($type == "flagged") {
$albums = Userflag::get_latest('album');
} else {
if (!$limit) {
$limit = AmpConfig::get('popular_threshold');
}
$albums = Album::get_random($limit);
}
}
}
}
}
if ($albums !== null) {
ob_end_clean();
echo XML_Data::albums($albums);
}
}