本文整理汇总了PHP中DataAccess::GetLastMapsForUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP DataAccess::GetLastMapsForUsers方法的具体用法?PHP DataAccess::GetLastMapsForUsers怎么用?PHP DataAccess::GetLastMapsForUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess::GetLastMapsForUsers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Execute
public function Execute()
{
$viewData = array();
$errors = array();
if (Helper::IsLoggedInAdmin() && isset($_GET["loginAsUser"])) {
// login as a certain user and redirect to his page
if (Helper::LoginUserByUsername($_GET["loginAsUser"])) {
Helper::Redirect("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
}
}
$viewData["Users"] = DataAccess::GetAllUsers(!Helper::IsLoggedInAdmin());
$viewData["LastMapForEachUser"] = DataAccess::GetLastMapsForUsers("date");
// last x maps
$numberOfMaps = isset($_GET["lastMaps"]) && is_numeric($_GET["lastMaps"]) ? (int) $_GET["lastMaps"] : (isset($_GET["lastMaps"]) && $_GET["lastMaps"] == "all" ? 999999 : 10);
$viewData["LastMaps"] = DataAccess::GetMaps(0, 0, 0, 0, null, $numberOfMaps, "createdTime", Helper::GetLoggedInUserID());
// last x comments
$numberOfComments = isset($_GET["lastComments"]) && is_numeric($_GET["lastComments"]) ? (int) $_GET["lastComments"] : (isset($_GET["lastComments"]) && $_GET["lastComments"] == "all" ? 999999 : 10);
$viewData["LastComments"] = DataAccess::GetLastComments($numberOfComments, Helper::GetLoggedInUserID());
$viewData["OverviewMapData"] = null;
$categories = DataAccess::GetCategoriesByUserID();
foreach ($viewData["LastMaps"] as $map) {
$data = Helper::GetOverviewMapData($map, false, true, true, $categories);
if ($data != null) {
$viewData["OverviewMapData"][] = $data;
}
}
if (isset($_GET["error"]) && $_GET["error"] == "email") {
$errors[] = sprintf(__("ADMIN_EMAIL_ERROR"), ADMIN_EMAIL);
}
$viewData["Errors"] = $errors;
return $viewData;
}