本文整理汇总了PHP中UserList::getNewList方法的典型用法代码示例。如果您正苦于以下问题:PHP UserList::getNewList方法的具体用法?PHP UserList::getNewList怎么用?PHP UserList::getNewList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserList
的用法示例。
在下文中一共展示了UserList::getNewList方法的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');
}
}
示例2: respond
$output = json_encode($selection, JSON_PRETTY_PRINT);
echo $output;
});
respond('GET', '/[:id]', function ($request, $response) {
// Show items from a single category
$id = $request->id;
$list = new UserList();
$selection = $list->getCategoriesList(20, $id);
$output = json_encode($selection, JSON_PRETTY_PRINT);
echo $output;
});
});
with('/api/items', function () {
respond('GET', '/?', function ($request, $response) {
$list = new UserList();
$selection = $list->getNewList(20);
$output = json_encode($selection, JSON_PRETTY_PRINT);
echo $output;
});
respond('GET', '/[:id]', function ($request, $response) {
// Show items from a single category
$id = $request->id;
$list = new UserList();
$selection = $list->getSingleListItem($id);
$output = json_encode($selection, JSON_PRETTY_PRINT);
echo $output;
});
respond('POST', '/[:id]', function ($request, $response) {
echo "This is where you can add things to your list";
});
});