本文整理汇总了PHP中Userflag类的典型用法代码示例。如果您正苦于以下问题:PHP Userflag类的具体用法?PHP Userflag怎么用?PHP Userflag使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Userflag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove_from_disk
public function remove_from_disk()
{
$deleted = true;
$video_ids = $this->get_episodes();
foreach ($video_ids as $id) {
$video = Video::create_from_id($id);
$deleted = $video->remove_from_disk();
if (!$deleted) {
debug_event('tvshow_season', 'Error when deleting the video `' . $id . '`.', 1);
break;
}
}
if ($deleted) {
$sql = "DELETE FROM `tvshow_season` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('tvshow_season', $this->id);
Userflag::gc('tvshow_season', $this->id);
Rating::gc('tvshow_season', $this->id);
Shoutbox::gc('tvshow_season', $this->id);
}
}
return $deleted;
}
示例2:
<td class="cel_rating" id="rating_<?php
echo $libitem->id;
?>
_playlist"><?php
Rating::show($libitem->id, 'playlist');
?>
</td>
<?php
}
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $libitem->id;
?>
_playlist"><?php
Userflag::show($libitem->id, 'playlist');
?>
</td>
<?php
}
}
?>
<td class="cel_action">
<?php
if (Access::check_function('batch_download') && check_can_zip('playlist')) {
?>
<a rel="nohtml" href="<?php
echo AmpConfig::get('web_path');
?>
/batch.php?action=playlist&id=<?php
echo $libitem->id;
示例3: T_
<?php
}
?>
<th class="cel_action essential"><?php
echo T_('Actions');
?>
</th>
</tr>
</thead>
<tbody>
<?php
if (AmpConfig::get('ratings')) {
Rating::build_cache('podcast', $object_ids);
}
if (AmpConfig::get('userflags')) {
Userflag::build_cache('podcast', $object_ids);
}
foreach ($object_ids as $podcast_id) {
$libitem = new Podcast($podcast_id);
$libitem->format();
?>
<tr id="podcast_<?php
echo $libitem->id;
?>
" class="<?php
echo UI::flip_class();
?>
">
<?php
require AmpConfig::get('prefix') . UI::find_template('show_podcast_row.inc.php');
?>
示例4: _setStar
private static function _setStar($input, $star)
{
$id = $input['id'];
$albumId = $input['albumId'];
$artistId = $input['artistId'];
// Normalize all in one array
$ids = array();
$r = Subsonic_XML_Data::createSuccessResponse();
if ($id) {
if (!is_array($id)) {
$id = array($id);
}
foreach ($id as $i) {
$aid = Subsonic_XML_Data::getAmpacheId($i);
if (Subsonic_XML_Data::isArtist($i)) {
$type = 'artist';
} else {
if (Subsonic_XML_Data::isAlbum($i)) {
$type = 'album';
} else {
if (Subsonic_XML_Data::isSong($i)) {
$type = 'song';
} else {
$type = "";
}
}
}
$ids[] = array('id' => $aid, 'type' => $type);
}
} else {
if ($albumId) {
if (!is_array($albumId)) {
$albumId = array($albumId);
}
foreach ($albumId as $i) {
$aid = Subsonic_XML_Data::getAmpacheId($i);
$ids[] = array('id' => $aid, 'album');
}
} else {
if ($artistId) {
if (!is_array($artistId)) {
$artistId = array($artistId);
}
foreach ($artistId as $i) {
$aid = Subsonic_XML_Data::getAmpacheId($i);
$ids[] = array('id' => $aid, 'artist');
}
} else {
$r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_MISSINGPARAM);
}
}
}
foreach ($ids as $i) {
$flag = new Userflag($i['id'], $i['type']);
$flag->set_flag($star);
}
self::apiOutput($input, $r);
}
示例5: 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>';
}
}
示例6: show_rating
<?php
show_rating($season->id, 'tvshow_season');
?>
</div>
<?php
}
?>
<?php
if (AmpConfig::get('userflags')) {
?>
<div style="display:table-cell;" id="userflag_<?php
echo $season->id;
?>
_tvshow_season">
<?php
Userflag::show($season->id, 'tvshow_season');
?>
</div>
<?php
}
}
?>
<div id="information_actions">
<h3><?php
echo T_('Actions');
?>
:</h3>
<ul>
<?php
if (AmpConfig::get('directplay')) {
?>
示例7:
?>
_video"><?php
Rating::show($libitem->id, 'video');
?>
</td>
<?php
}
?>
<?php
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $libitem->id;
?>
_video"><?php
Userflag::show($libitem->id, 'video');
?>
</td>
<?php
}
}
?>
<td class="cel_action">
<a href="<?php
echo $libitem->link;
?>
"><?php
echo UI::get_icon('preferences', T_('Video Information'));
?>
</a>
<?php
示例8: T_
<dt class="<?php
echo $rowparity;
?>
"><?php
echo T_('Fav.');
?>
</dt>
<dd class="<?php
echo $rowparity;
?>
">
<div id="userflag_<?php
echo $video->id;
?>
_video"><?php
Userflag::show($video->id, 'video');
?>
</div>
</dd>
<?php
}
}
$rowparity = UI::flip_class();
?>
<dt class="<?php
echo $rowparity;
?>
"><?php
echo T_('Action');
?>
</dt>
示例9: 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);
}
示例10:
<td class="cel_rating" id="rating_<?php
echo $album->id;
?>
_album"><?php
Rating::show($album->id, 'album');
?>
</td>
<?php
}
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $album->id;
?>
_album"><?php
Userflag::show($album->id, 'album');
?>
</td>
<?php
}
?>
<td class="cel_action">
<?php
if (AmpConfig::get('sociable') && (!$album->allow_group_disks || $album->allow_group_disks && !count($album->album_suite))) {
?>
<a href="<?php
echo AmpConfig::get('web_path');
?>
/shout.php?action=show_add_shout&type=album&id=<?php
echo $album->id;
?>
示例11: gc
/**
* gc
*
* This is a wrapper function for all of the different cleaning
* functions, it runs them in an order that resembles correctness.
*/
public static function gc()
{
debug_event('catalog', 'Database cleanup started', 5);
Song::gc();
Album::gc();
Artist::gc();
Video::gc();
Art::gc();
Stats::gc();
Rating::gc();
Userflag::gc();
Useractivity::gc();
Playlist::gc();
Tmp_Playlist::gc();
Shoutbox::gc();
Tag::gc();
// TODO: use InnoDB with foreign keys and on delete cascade to get rid of garbage collection
\Lib\Metadata\Repository\Metadata::gc();
\Lib\Metadata\Repository\MetadataField::gc();
debug_event('catalog', 'Database cleanup ended', 5);
}
示例12: T_
<?php
}
?>
<th class="cel_action essential"><?php
echo T_('Actions');
?>
</th>
</tr>
</thead>
<tbody>
<?php
if (AmpConfig::get('ratings')) {
Rating::build_cache('album', $object_ids);
}
if (AmpConfig::get('userflags')) {
Userflag::build_cache('album', $object_ids);
}
/* Foreach through the albums */
foreach ($object_ids as $album_id) {
$album = new Album($album_id);
$album->allow_group_disks = $allow_group_disks;
$album->format();
?>
<tr id="album_<?php
echo $album->id;
?>
" class="<?php
echo UI::flip_class();
?>
">
<?php
示例13:
"><?php
Rating::show($libitem->id, $object_type);
?>
</td>
<?php
}
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $libitem->id;
?>
_<?php
echo $object_type;
?>
"><?php
Userflag::show($libitem->id, $object_type);
?>
</td>
<?php
}
}
?>
<td class="cel_action">
<?php
if (AmpConfig::get('download')) {
?>
<a rel="nohtml" href="<?php
echo AmpConfig::get('web_path');
?>
/stream.php?action=download&<?php
echo $object_type;
示例14:
?>
_podcast">
<?php
Rating::show($libitem->id, 'podcast');
?>
</td>
<?php
}
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $libitem->id;
?>
_podcast">
<?php
Userflag::show($libitem->id, 'podcast');
?>
</td>
<?php
}
}
?>
<td class="cel_action">
<?php
if (Access::check('interface', '50')) {
?>
<a id="<?php
echo 'edit_podcast_' . $libitem->id;
?>
" onclick="showEditDialog('podcast_row', '<?php
echo $libitem->id;
示例15:
?>
_tvshow"><?php
Rating::show($libitem->id, 'tvshow');
?>
</td>
<?php
}
?>
<?php
if (AmpConfig::get('userflags')) {
?>
<td class="cel_userflag" id="userflag_<?php
echo $libitem->id;
?>
_tvshow"><?php
Userflag::show($libitem->id, 'tvshow');
?>
</td>
<?php
}
}
?>
<td class="cel_action">
<?php
if (Access::check('interface', '50')) {
?>
<a id="<?php
echo 'edit_tvshow_' . $libitem->id;
?>
" onclick="showEditDialog('tvshow_row', '<?php
echo $libitem->id;