<?php

namespace PhoenixSNS\Objects;

\Enum::Create("PhoenixSNS\\Objects\\ConditionalStatementCombination", "Conjunction", "Disjunction");
\Enum::Create("PhoenixSNS\\Objects\\ConditionalStatementComparison", "Equals", "Contains", "StartsWith", "EndsWith");
class ConditionalStatementGroup
{
    public $Combination;
    public $Statements;
    public function __construct($combination = null, $statements = null)
    {
        if ($combination == null) {
            $combination = ConditionalStatementCombination::Conjunction;
        }
        if ($statements == null) {
            $statements = array();
        }
        $this->Combination = $combination;
        $this->Statements = $statements;
    }
    public function Evaluate($callbackParams)
    {
        $retval = false;
        foreach ($this->Statements as $stmt) {
            $value = $stmt->Evaluate($callbackParams);
            switch ($this->Combination) {
                case ConditionalStatementCombination::Conjunction:
                    $retval &= $value;
                    break;
                case ConditionalStatementCombination::Disjunction:
示例#2
0
<?php

namespace PhoenixSNS\Modules\World\Objects;

\Enum::Create("PhoenixSNS\\Modules\\World\\Objects\\PlaceHotspotTargetType", "URL", "Script", "Place", "Unknown");
class PlaceHotspot
{
    public $ID;
    public $Title;
    public $Left;
    public $Top;
    public $Width;
    public $Height;
    // Target can be a script, a URL, or a Place ID depending on TargetType.
    public $TargetPlace;
    public $TargetScript;
    public $TargetURL;
    public $TargetType;
    public static function GetByAssoc($values)
    {
        $item = new PlaceHotspot();
        $item->ID = $values["hotspot_ID"];
        $item->Title = $values["hotspot_Title"];
        $item->Left = $values["hotspot_Left"];
        $item->Top = $values["hotspot_Top"];
        $item->Width = $values["hotspot_Width"];
        $item->Height = $values["hotspot_Height"];
        $item->TargetPlace = Place::GetByID($values["hotspot_TargetPlaceID"]);
        $item->TargetScript = $values["hotspot_TargetScript"];
        $item->TargetURL = $values["hotspot_TargetURL"];
        switch ($values["hotspot_TargetTypeID"]) {
<?php

namespace PhoenixSNS\Objects;

use WebFX\System;
\Enum::Create("PhoenixSNS\\Objects\\LogMessageSeverity", "Notice", "Warning", "Error");
class PhoenixSNS
{
    public static function BuildSearchURL($properties = null, $validObjects = null, $caseInsensitive = false, $tenant = null)
    {
        if ($properties == null) {
            $properties = array();
        }
        if ($validObjects == null) {
            $validObjects = array();
        }
        $url = System::ExpandRelativePath("~/API/Search.php?");
        if ($tenant != null) {
            $url .= "tenant=" . $tenant->URL;
        } else {
            $url .= "tenant=" . System::$TenantName;
        }
        $url .= "&propertyCount=" . count($properties);
        $i = 0;
        foreach ($properties as $propertyID => $searchValue) {
            $url .= "&propertyID" . $i . "=" . $propertyID;
            $url .= "&propertyValue" . $i . "=" . $searchValue;
            $url .= "&propertyComparison" . $i . "=" . "contains";
            $i++;
        }
        $count = count($validObjects);
use WebFX\Controls\FormViewItemDateTime;
use WebFX\Controls\FormViewItemText;
use WebFX\Controls\FormViewItemMemo;
use WebFX\Controls\TabContainer;
use WebFX\Controls\TabPage;
use PhoenixSNS\TenantManager\MasterPages\WebPage;
use PhoenixSNS\Objects\Module;
use PhoenixSNS\Objects\DataCenter;
use PhoenixSNS\Objects\PaymentPlan;
use PhoenixSNS\Objects\Tenant;
use PhoenixSNS\Objects\TenantObject;
use PhoenixSNS\Objects\TenantProperty;
use PhoenixSNS\Objects\TenantPropertyValue;
use PhoenixSNS\Objects\TenantStatus;
use PhoenixSNS\Objects\TenantType;
\Enum::Create("PhoenixSNS\\TenantManager\\Pages\\TenantManagementPageMode", "Create", "Modify");
class TenantManagementPage extends WebPage
{
    public $Tenant;
    public $Mode;
    public function __construct()
    {
        parent::__construct();
        $this->Mode = TenantManagementPageMode::Create;
        $this->SidebarButtons[3]->Expanded = true;
    }
    protected function Initialize()
    {
        $this->Title = "Manage Tenant";
        $this->Subtitle = $this->Tenant->URL;
    }
<?php

\Enum::Create("ShoutoutMessageVisibility", "Hidden", "Friends", "Network", "Everyone", "Blacklist", "Whitelist");
class ShoutoutMessage
{
    public $ID;
    public $Sender;
    public $Receiver;
    public $Content;
    public $Timestamp;
    public $Visibility;
    public function GetPraises()
    {
        $query = "SELECT * FROM phpmmo_members, phpmmo_shoutout_message_likes WHERE phpmmo_shoutout_message_likes.message_id = " . $this->ID . " AND phpmmo_members.member_id = phpmmo_shoutout_message_likes.member_id";
        $result = mysql_query($query);
        $count = mysql_num_rows($result);
        $retval = array();
        for ($i = 0; $i < $count; $i++) {
            $values = mysql_fetch_assoc($result);
            $retval[] = User::GetByAssoc($values);
        }
        return $retval;
    }
    public function GetComments($max = null)
    {
        $query = "SELECT * FROM phpmmo_shoutout_message_comments WHERE phpmmo_shoutout_message_comments.message_id = " . $this->ID . " ORDER BY comment_timestamp DESC";
        if ($max != null) {
            $query .= " LIMIT " . $max;
        }
        $result = mysql_query($query);
        $count = mysql_num_rows($result);
示例#6
0
<?php

use WebFX\System;
use PhoenixSNS\Objects\MarketResourceTransaction;
use PhoenixSNS\Objects\Tenant;
use PhoenixSNS\Objects\TenantObject;
use PhoenixSNS\Objects\TenantQueryParameter;
use PhoenixSNS\Objects\TenantObjectInstancePropertyValue;
use PhoenixSNS\Objects\TenantObjectMethodParameterValue;
use PhoenixSNS\Objects\User;
use PhoenixSNS\MasterPages\MessagePage;
use PhoenixSNS\Pages\ErrorPage;
require_once "Pages/RegistrationWebPage.inc.php";
use PhoenixSNS\Modules\Account\Pages\RegistrationWebPage;
\Enum::Create("PhoenixSNS\\Modules\\Account\\UserRegistrationStatus", "Unregistered", "AwaitingVerification", "Registered", "GeneralError", "VerificationCodeInvalid", "UserNameTaken", "DisplayNameTaken", "PasswordMismatch");
use PhoenixSNS\Modules\Account\UserRegistrationStatus;
use DataFX\DataFX;
use DataFX\Table;
use DataFX\Column;
use DataFX\ColumnValue;
use DataFX\Record;
use DataFX\RecordColumn;
class RegistrationManager
{
    public static $ErrorCode;
    public static $ErrorMessage;
    public static function ActivateAccountByValidationCode($code)
    {
        global $MySQL;
        $CurrentTenant = Tenant::GetCurrent();
        // Does the User object have an instance with that e-mail confirmation code?