本文整理匯總了PHP中DAO::getUserById方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAO::getUserById方法的具體用法?PHP DAO::getUserById怎麽用?PHP DAO::getUserById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAO
的用法示例。
在下文中一共展示了DAO::getUserById方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DAO
register_shutdown_function("fatal_handler");
include "include.php";
$page_name = $_SERVER['SCRIPT_NAME'];
$category = $_GET['category'];
if (!$category) {
$category = 1;
}
$active_page = $_GET['page'];
if (!$active_page) {
$active_page = 1;
}
$dao = new DAO();
$user = null;
if (isset($_COOKIE['userid'])) {
print $_COOKIE['userid'];
$user = $dao->getUserById($_COOKIE['userid']);
}
$count = $dao->getTextCount($category);
$page_count = 0;
if ($count > 0) {
$page_count = (int) ($count / 10);
if ($count % 10 != 0) {
$page_count++;
}
}
if ($active_page > $page_count) {
$active_page = 1;
}
$texts = $dao->getTextPage($category, $active_page);
$template = new Template($user, $active_page, $category, $page_count, $page_name, $texts);
$dao->close();