本文整理汇总了PHP中DataAccess::GetCommentsByMapId方法的典型用法代码示例。如果您正苦于以下问题:PHP DataAccess::GetCommentsByMapId方法的具体用法?PHP DataAccess::GetCommentsByMapId怎么用?PHP DataAccess::GetCommentsByMapId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess::GetCommentsByMapId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Execute
public function Execute()
{
$viewData = array();
// no user specified - redirect to user list page
if (!getCurrentUser()) {
Helper::Redirect("users.php");
}
// user is hidden - redirect to user list page
if (!getCurrentUser()->Visible) {
Helper::Redirect("users.php");
}
// the requested map
$map = new Map();
$map->Load($_GET["map"]);
if (!$map->ID) {
die("The map has been removed.");
}
DataAccess::UnprotectMapIfNeeded($map);
if (Helper::MapIsProtected($map)) {
die("The map is protected until " . date("Y-m-d H:i:s", Helper::StringToTime($map->ProtectedUntil, true)) . ".");
}
if ($map->UserID != getCurrentUser()->ID) {
die;
}
$viewData["Comments"] = DataAccess::GetCommentsByMapId($map->ID);
$viewData["Name"] = $map->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true)) . ')';
// previous map in archive
$previous = DataAccess::GetPreviousMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
$viewData["PreviousName"] = $previous == null ? null : $previous->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($previous->Date, true)) . ')';
// next map in archive
$next = DataAccess::GetNextMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
$viewData["NextName"] = $next == null ? null : $next->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($next->Date, true)) . ')';
$size = $map->GetMapImageSize();
$viewData["ImageWidth"] = $size["Width"];
$viewData["ImageHeight"] = $size["Height"];
DataAccess::IncreaseMapViews($map);
$viewData["Map"] = $map;
$viewData["BackUrl"] = isset($_SERVER["HTTP_REFERER"]) && basename($_SERVER["HTTP_REFERER"]) == "users.php" ? "users.php" : "index.php?" . Helper::CreateQuerystring(getCurrentUser());
$viewData["Previous"] = $previous;
$viewData["Next"] = $next;
$viewData["ShowComments"] = isset($_GET["showComments"]) && ($_GET["showComments"] = true) || !__("COLLAPSE_VISITOR_COMMENTS");
$viewData["FirstMapImageName"] = Helper::GetMapImage($map);
if ($map->BlankMapImage) {
$viewData["SecondMapImageName"] = Helper::GetBlankMapImage($map);
}
$viewData["QuickRouteJpegExtensionData"] = $map->GetQuickRouteJpegExtensionData();
if (isset($viewData["QuickRouteJpegExtensionData"]) && $viewData["QuickRouteJpegExtensionData"]->IsValid) {
$categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
$viewData["OverviewMapData"][] = Helper::GetOverviewMapData($map, true, false, false, $categories);
$viewData["GoogleMapsUrl"] = "http://maps.google.com/maps" . "?q=" . urlencode(Helper::GlobalPath("export_kml.php?id=" . $map->ID . "&format=kml")) . "&language=" . Session::GetLanguageCode();
}
if (USE_3DRERUN == '1' && DataAccess::GetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", "0") + RERUN_FREQUENCY * 3600 < time()) {
$viewData["RerunMaps"] = Helper::GetMapsForRerunRequest();
$viewData["TotalRerunMaps"] = count(explode(",", $viewData["RerunMaps"]));
$viewData["ProcessRerun"] = true;
}
return $viewData;
}