• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Userflag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Userflag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:nioc,项目名称:ampache,代码行数:24,代码来源:tvshow_season.class.php


示例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&amp;id=<?php 
    echo $libitem->id;
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_playlist_row.inc.php


示例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');
    ?>
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_podcasts.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);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:58,代码来源:subsonic_api.class.php


示例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>';
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:46,代码来源:CatalogFavorites.plugin.php


示例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')) {
    ?>
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_tvshow_season.inc.php


示例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 
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_video_row.inc.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>
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_video.inc.php


示例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);
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:32,代码来源:api.class.php


示例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&amp;id=<?php 
    echo $album->id;
    ?>
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:show_album_row.inc.php


示例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);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:27,代码来源:catalog.class.php


示例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 
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:show_albums.inc.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&amp;<?php 
        echo $object_type;
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_playlist_media_row.inc.php


示例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;
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_podcast_row.inc.php


示例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;
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_tvshow_row.inc.php


示例16: T_

}
?>
            <th class="cel_action essential"><?php 
echo T_('Action');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
// Cache the ratings we are going to use
if (AmpConfig::get('ratings')) {
    Rating::build_cache('artist', $object_ids);
}
if (AmpConfig::get('userflags')) {
    Userflag::build_cache('artist', $object_ids);
}
/* Foreach through every artist that has been passed to us */
foreach ($object_ids as $artist_id) {
    $artist = new Artist($artist_id, $_SESSION['catalog']);
    $artist->format();
    ?>
        <tr id="artist_<?php 
    echo $artist->id;
    ?>
" class="<?php 
    echo UI::flip_class();
    ?>
">
            <?php 
    require AmpConfig::get('prefix') . '/templates/show_artist_row.inc.php';
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:show_artists.inc.php


示例17: array_map

if (User::is_registered()) {
    ?>
                    <?php 
    if (AmpConfig::get('ratings')) {
        Rating::build_cache('song', array_map(create_function('$i', '$i=(array) $i; return $i[\'object_id\'];'), $object_ids));
        ?>
                        <th class="cel_rating"><?php 
        echo T_('Rating');
        ?>
</th>
                    <?php 
    }
    ?>
                    <?php 
    if (AmpConfig::get('userflags')) {
        Userflag::build_cache('song', array_map(create_function('$i', '$i=(array) $i; return $i[\'object_id\'];'), $object_ids));
        ?>
                <?php 
    }
    ?>
                <th class="cel_userflag essential"><?php 
    echo T_('Fav.');
    ?>
</th>
            <?php 
}
?>
                <th class="cel_action essential"><?php 
echo T_('Action');
?>
</th>
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:show_playlist_songs.inc.php


示例18:

            <?php 
        Rating::show($playlist->id, 'playlist');
        ?>
    </div>
    <?php 
    }
    ?>
    <?php 
    if (AmpConfig::get('userflags')) {
        ?>
    <div style="display:table-cell;" id="userflag_<?php 
        echo $playlist->id;
        ?>
_playlist">
            <?php 
        Userflag::show($playlist->id, 'playlist');
        ?>
    </div>
    <?php 
    }
}
?>
<div id="information_actions">
    <ul>
    <?php 
if ($GLOBALS['user']->has_access('50')) {
    ?>
        <li>
            <a onclick="submitNewItemsOrder('<?php 
    echo $playlist->id;
    ?>
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_playlist.inc.php


示例19: remove_from_disk

 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;
 }
开发者ID:bl00m,项目名称:ampache,代码行数:25,代码来源:tvshow.class.php


示例20: 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();
     Art::gc();
     Stats::gc();
     Rating::gc();
     Userflag::gc();
     Playlist::gc();
     Tmp_Playlist::gc();
     Shoutbox::gc();
     Tag::gc();
     debug_event('catalog', 'Database cleanup ended', 5);
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:22,代码来源:catalog.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Users类代码示例发布时间:2022-05-23
下一篇:
PHP User_helper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap