当前位置: 首页>>代码示例>>PHP>>正文


PHP DataAccess::GetAllUsers方法代码示例

本文整理汇总了PHP中DataAccess::GetAllUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP DataAccess::GetAllUsers方法的具体用法?PHP DataAccess::GetAllUsers怎么用?PHP DataAccess::GetAllUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataAccess的用法示例。


在下文中一共展示了DataAccess::GetAllUsers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:32,代码来源:users.controller.php

示例2: Execute

 public function Execute()
 {
     $viewData = array();
     // check if user is not specified or hidden
     if (!getCurrentUser()) {
         // all maps in archive
         $mode = "all";
         $count = $_GET["count"];
         if (!$count) {
             $count = 30;
         }
         $maps = DataAccess::GetMaps(0, 0, 0, 0, null, $count, "ID");
         $categories = DataAccess::GetCategoriesByUserID();
         $users = DataAccess::GetAllUsers(true);
         $viewData["Title"] = _SITE_TITLE;
         $viewData["LastCreatedTime"] = date("r", DataAccess::GetLastCreatedTime());
         $viewData["Description"] = _SITE_DESCRIPTION;
         $viewData["WebsiteUrl"] = Helper::GlobalPath("index.php");
     } else {
         // specified archive
         $mode = "user";
         if (!getCurrentUser()->Visible) {
             die;
         }
         $users[getCurrentUser()->ID] = getCurrentUser();
         $maps = DataAccess::GetMaps(getCurrentUser()->ID);
         $categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
         $viewData["Title"] = __("PAGE_TITLE");
         $viewData["LastCreatedTime"] = date("r", DataAccess::GetLastCreatedTime(getCurrentUser()->ID));
         $viewData["Description"] = __("RSS_DESCRIPTION");
         $viewData["WebsiteUrl"] = Helper::GlobalPath("index.php?" . Helper::CreateQuerystring(getCurrentUser()));
     }
     $viewData["Items"] = array();
     foreach ($maps as $map) {
         $item = array();
         $user = $users[$map->UserID];
         $item["Title"] = hsc(Helper::DateToLongString(Helper::StringToTime($map->Date, true)) . ": " . $map->Name);
         $item["URL"] = $map->MapImage ? Helper::GlobalPath('show_map.php?user=' . urlencode($user->Username) . '&map=' . $map->ID) : "";
         $atoms = array();
         if (__("SHOW_MAP_AREA_NAME") && $map->MapName != "") {
             $atoms[] = $map->MapName;
         }
         if (__("SHOW_ORGANISER") && $map->Organiser != "") {
             $atoms[] = $map->Organiser;
         }
         if (__("SHOW_COUNTRY") && $map->Country != "") {
             $atoms[] = $map->Country;
         }
         $atoms2 = array();
         if (__("SHOW_DISCIPLINE") && $map->Discipline != "") {
             $atoms2[] = hsc($map->Discipline);
         }
         if (__("SHOW_RELAY_LEG") && $map->RelayLeg != "") {
             $atoms2[] = __("RELAY_LEG_LOWERCASE") . ' ' . hsc($map->RelayLeg);
         }
         $item["Description"] = ($mode == "all" ? hsc($user->FirstName . " " . $user->LastName . '<br />') : '') . __("CATEGORY") . ": " . hsc($categories[$map->CategoryID]->Name) . hsc('<br />') . hsc(join(", ", $atoms)) . hsc('<br />') . join(", ", $atoms2);
         $item["PubDate"] = hsc(date("r", Helper::StringToTime($map->CreatedTime, true)));
         $viewData["Items"][] = $item;
     }
     return $viewData;
 }
开发者ID:andopor,项目名称:doma-project,代码行数:61,代码来源:rss.controller.php


注:本文中的DataAccess::GetAllUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。