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


PHP UserList::getUserTopList方法代碼示例

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


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

示例1: User

   the GNU Affero General Public License along with this program.  

   If not, see <http://www.gnu.org/licenses/>.

*/
require_once 'database.php';
require 'data/User.php';
require 'data/List.php';
if (isset($_REQUEST['hs'])) {
    // foo
} else {
    //If we're not handshaking we display the start page
    require_once 'templating.php';
    if ($auth) {
        $user = new User($casuid);
        $userid = $user->id;
        // error_log($userid);
        $list = new UserList();
        $listitems = $list->getUserTopList(20, $userid);
        $selection = $list->getNewList(5);
        $smarty->assign('list', $listitems);
        if ($_GET['msg'] != "") {
            $msg = "Your image will be processed shortly, and the item will be hidden from your list.";
        }
        $smarty->assign('newlist', $selection);
        $smarty->assign('msg', $msg);
        $smarty->display('my-list.tpl');
    } else {
        $smarty->display('noauth.tpl');
    }
}
開發者ID:tom2320x,項目名稱:list,代碼行數:31,代碼來源:my-list.php

示例2: function

with('/api/userlist/delete', function () {
    respond('POST', '/[:userid]/[:id]', function ($request, $response) {
        $userid = $request->userid;
        $listitem = $request->id;
        $skey = $request->param('skey');
        $list = new UserList();
        $response = $list->deleteItem($userid, $listitem, $skey);
        $output = json_encode($response, JSON_PRETTY_PRINT);
        echo $output;
    });
});
with('/api/userlist', function () {
    respond('GET', '/[:id]', function ($request, $response) {
        $id = $request->id;
        $list = new UserList();
        $selection = $list->getUserTopList(100, $id);
        $output = json_encode($selection, JSON_PRETTY_PRINT);
        echo $output;
    });
    respond('POST', '/[:user]/[:id]', function ($request, $response) {
        $item = $request->id;
        $userid = $request->user;
        // We'll need to figure out a way to do these more securely
        $list = new UserList();
        $save = $list->addToMyList($item, $userid);
        echo "[]";
    });
});
with('/api/usercategories/add', function () {
    respond('POST', '/[:user]/[:id]', function ($request, $response) {
        $categoryid = $request->id;
開發者ID:tom2320x,項目名稱:list,代碼行數:31,代碼來源:index.php


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