PHP Method User::GetByID, codiad Code Examples

This page contains top rated real world PHP examples of method User::GetByID from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: MarketStarterPack.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $pack = new MarketStarterPack();
     $pack->ID = $values["starterpack_ID"];
     $pack->Title = $values["starterpack_Title"];
     $pack->CreationUserID = User::GetByID($values["starterpack_CreationUserID"]);
     $pack->CreationTimestamp = $values["starterpack_CreationTimestamp"];
     return $pack;
 }
Example #2
Show file File: Notification.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $notif = new Notification();
     $notif->ID = $values["notification_id"];
     $notif->Sender = User::GetByID($values["sender_id"]);
     $notif->Receiver = User::GetByID($values["receiver_id"]);
     $notif->Title = $values["notification_title"];
     $notif->Content = $values["notification_content"];
     $notif->Timestamp = $values["notification_timestamp"];
     return $notif;
 }
Example #3
Show file File: Message.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $message = new Message();
     $message->ID = $values["message_id"];
     $message->Sender = User::GetByID($values["message_sender"]);
     $message->Title = $values["message_title"];
     $message->Content = strrepl($values["message_content"]);
     $message->Timestamp = $values["message_timestamp"];
     $message->Status = $values["message_status"];
     if (!$message->IsAuthenticated()) {
         return null;
     }
     return $message;
 }
Example #4
Show file File: Place.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $place = new Place();
     $place->ID = $values["place_ID"];
     $place->Name = $values["place_Name"];
     $place->Title = $values["place_Title"];
     $place->Description = $values["place_Description"];
     $place->Enabled = $values["place_Enabled"] == 1;
     $place->Capacity = $values["place_Capacity"];
     if (!is_numeric($place->Capacity)) {
         $place->Capacity = 0;
     }
     $place->CreationTimestamp = $values["place_CreationTimestamp"];
     $place->CreationUser = User::GetByID($values["place_CreationUserID"]);
     return $place;
 }
Example #5
Show file File: ShoutoutMessage.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $message = new ShoutoutMessage();
     $message->ID = $values["message_id"];
     $message->Sender = User::GetByID($values["message_sender_id"]);
     $message->Receiver = User::GetByID($values["message_receiver_id"]);
     $message->Content = strrepl($values["message_content"]);
     $message->Timestamp = $values["message_timestamp"];
     $message->Visibility = ShoutoutMessageVisibility::FromIndex($values["message_visibility"]);
     $CurrentUser = User::GetCurrent();
     if ($CurrentUser->ID != $message->Sender->ID) {
         switch ($message->Visibility) {
             case ShoutoutMessageVisibility::Hidden:
                 return null;
             case ShoutoutMessageVisibility::Friends:
                 // only friends of the person posting it can see the post
                 if ($CurrentUser == null) {
                     return null;
                 }
                 if (!$CurrentUser->HasFriend($message->Sender)) {
                     return null;
                 }
                 break;
             case ShoutoutMessageVisibility::Network:
                 // everyone on Psychatica can see the post (i.e., must be logged in)
                 if ($CurrentUser == null) {
                     return null;
                 }
                 break;
             case ShoutoutMessageVisibility::Everyone:
                 // entire Internet can see the post
                 break;
             case ShoutoutMessageVisibility::Blacklist:
                 // friends only
                 return null;
             case ShoutoutMessageVisibility::Whitelist:
                 // friends only
                 return null;
         }
     }
     return $message;
 }
Example #6
Show file File: Game.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $game = new Game();
     $game->ID = $values["game_id"];
     $game->Name = $values["game_name"];
     $game->Title = $values["game_title"];
     $game->Description = $values["game_description"];
     $game->Content = $values["game_content"];
     $game->Creator = User::GetByID($values["game_creator_id"]);
     $game->TimestampCreated = $values["game_timestamp_created"];
     $game->PlayerCountMaximum = $values["game_player_count_max"];
     $game->PlayerCountMinimum = $values["game_player_count_min"];
     $resources = array();
     $query = "SELECT * FROM phpmmo_arcade_game_resource_costs WHERE game_id = " . $game->ID;
     $result = mysql_query($query);
     $count = mysql_num_rows($result);
     for ($i = 0; $i < $count; $i++) {
         $values = mysql_fetch_assoc($result);
         $resource = mmo_get_resources_by_assoc($values);
         $resources[] = $resource;
     }
     $game->RequiredResources = $resources;
     return $game;
 }
Example #7
Show file File: Forum.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $forum = new Forum();
     $forum->ID = $values["forum_id"];
     $forum->Name = $values["forum_name"];
     $forum->Title = $values["forum_title"];
     $forum->Description = $values["forum_description"];
     $forum->CreationUser = User::GetByID($values["forum_creation_member_id"]);
     $forum->CreationTimestamp = $values["forum_creation_timestamp"];
     return $forum;
 }
Example #8
Show file File: File.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $tag = new FileTag();
     $tag->ID = $values["tag_id"];
     $tag->Name = $values["tag_name"];
     $tag->Title = $values["tag_title"];
     $tag->CreationUser = User::GetByID($values["tag_creation_member_id"]);
     $tag->CreationTimestamp = $values["tag_creation_timestamp"];
     return $tag;
 }
Example #9
Show file File: Create.inc.php Project: alcexhim/PhoenixSNS
0
use WebFX\System;
use WebFX\Controls\TextBox;
use PhoenixSNS\Objects\Message;
if ($path[1] == "create.mmo" && $_SERVER["REQUEST_METHOD"] == "POST" && $_POST["attempt"] == "1") {
    // create the message in the server
    $sender = $CurrentUser;
    $receivers = array();
    if ($_POST["message_receiver"] != null) {
        $receiver = User::GetByShortName($_POST["message_receiver"]);
        $receivers[] = $receiver;
    } else {
        if ($_POST["message_receivers"] != null) {
            $ids = explode(",", $_POST["message_receivers"]);
            foreach ($ids as $id) {
                $receiver = User::GetByID($id);
                if ($receiver == null) {
                    continue;
                }
                $receivers[] = $receiver;
            }
        }
    }
    if (count($receivers) == 0) {
        $page = new PsychaticaErrorPage();
        $page->Message = "You must provide at least one user to receive the message.";
        $page->Render();
        return;
    }
    Message::Create($sender, $receivers, $_POST["message_title"], $_POST["message_content"]);
    global $MySQL;
Example #10
Show file File: Journal.inc.php Project: alcexhim/PhoenixSNS
0
 public static function GetByAssoc($values)
 {
     $impression = new JournalImpression();
     $impression->User = User::GetByID($values["member_id"]);
     $impression->Count = $values["impression_count"];
     return $impression;
 }