public static function GetByAssoc($values)
 {
     $item = new PlaceClippingRegion();
     $item->ID = $values["region_ID"];
     $item->Place = Place::GetByID($values["region_PlaceID"]);
     $item->Comments = $values["region_Comments"];
     return $item;
 }
Beispiel #2
0
 public static function GetByName($name)
 {
     if ($name == null) {
         return null;
     }
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "Places WHERE place_Name = '" . $MySQL->real_escape_string($name) . "'";
     $result = $MySQL->query($query);
     if ($result->num_rows > 0) {
         $values = $result->fetch_assoc();
         return Place::GetByAssoc($values);
     }
     return null;
 }
Beispiel #3
0
                     readfile("images/world/places/" . $CurrentPlace->ID . "/hotspot.png");
                     return true;
                 default:
                     return false;
             }
         } else {
             if ($CurrentPlace == null) {
                 System::Redirect("~/world");
                 return true;
             }
         }
     }
 } else {
     if ($path[0] == "") {
         // TODO: don't hardcode this!
         $CurrentPlace = Place::GetByID(11);
     } else {
         System::Redirect("~/world");
     }
 }
 $_SESSION["CurrentPlaceID"] = $CurrentPlace == null ? 0 : $CurrentPlace->ID;
 if ($CurrentUser == null) {
     $_SESSION["LoginRedirectURL"] = "~/world";
     System::Redirect("~/account/login.page");
     /*
     $page = new PsychaticaErrorPage();
     $page->Title = "Not Logged In";
     $page->Message = "You must be logged in to visit the World.  Please log in and then try visiting the World again.";
     */
     return true;
 } else {
    protected function RenderContent2()
    {
        ?>
			<div class="PhoenixVision" id="PhoenixVision_<?php 
        echo $this->ID;
        ?>
">
				<div class="World" id="PhoenixVision_<?php 
        echo $this->ID;
        ?>
_Content" style="display: none; <?php 
        if ($this->CurrentPlace != null) {
            echo "background-image: url('" . System::ExpandRelativePath("~/images/world/places/" . $this->CurrentPlace->ID . "/backgrnd.png") . "');";
        } else {
            echo "background-color: #000000;";
        }
        ?>
">
					<div class="WorldContent">
						<?php 
        if ($this->CurrentPlace != null) {
            echo "<!-- ** CLIPPING REGIONS ** \n";
            $pcrs = $this->CurrentPlace->GetClippingRegions();
            foreach ($pcrs as $pcr) {
                echo "{\n";
                $points = $pcr->GetPoints();
                foreach ($points as $point) {
                    echo "\t(" . $point->Left . ", " . $point->Top . "), \n";
                }
                echo "}, \n";
            }
            echo "-->";
            $hotspots = $this->CurrentPlace->GetHotspots();
            if (count($hotspots) > 0) {
                ?>
						<div class="WorldHotspots">
							<?php 
                foreach ($hotspots as $hotspot) {
                    echo "<a class=\"WorldHotspotEntry\" ";
                    if ($hotspot->TargetType == PlaceHotspotTargetType::URL || $hotspot->TargetType == PlaceHotspotTargetType::Script) {
                        if ($hotspot->TargetURL == null) {
                            echo "href=\"#\"";
                        } else {
                            echo "href=\"" . $hotspot->TargetURL . "\" target=\"_blank\"";
                        }
                        if ($hotspot->TargetScript != null) {
                            echo " onclick=\"" . $hotspot->TargetScript . "\"";
                        }
                    } else {
                        if ($hotspot->TargetType == PlaceHotspotTargetType::Place) {
                            echo "href=\"" . System::ExpandRelativePath("~/world/places/" . $hotspot->TargetPlace->Name) . "\" onclick=\"" . $this->ID . ".SetCurrentPlace(Place.GetByID(" . $hotspot->TargetPlace->ID . "); return false;\"";
                        }
                    }
                    echo " style=\"left: " . $hotspot->Left . "px; top: " . $hotspot->Top . "px; width: " . $hotspot->Width . "px; height: " . $hotspot->Height . "px;\"";
                    echo ">";
                    if ($hotspot->Title != null) {
                        echo "<span class=\"Title\">" . $hotspot->Title . "</span>";
                    }
                    echo "</a>";
                }
                ?>
						</div>
						<?php 
            }
            ?>
						<!-- chat log -->
						<?php 
            $wndChatLog = new Window("wndChatLog_" . $this->ID);
            $wndChatLog->Title = "Messages";
            $wndChatLog->Height = "177px";
            $wndChatLog->Style = "z-index: 4;";
            $wndChatLog->BeginContent();
            ?>
						<table class="ChatMessages" id="chatLog">
						</table>
						<?php 
            $wndChatLog->EndContent();
            ?>
						
						<div class="WorldPersonaContent" id="personas" style="position: relative;">
						</div>
						<?php 
        } else {
            ?>
						<div style="text-align: center; font-size: 18pt; font-weight: bold; color: #FF0000; padding-top: 240px;">place cannot be null</div>
						<?php 
        }
        ?>
					</div>
				</div>
				<div class="WorldProgress" id="PhoenixVision_<?php 
        echo $this->ID;
        ?>
_Progress" style="display: none; background-color: #000000; position: relative;">
					<div class="ProgressBarWrapper">
					<?php 
        $pb1 = new ProgressBar("PhoenixVision_" . $this->ID . "_ProgressBar");
        $pb1->Text = "Please wait while the World loads...";
        $pb1->Render();
        ?>
					</div>
					
					<script type="text/javascript">
					var <?php 
        echo $this->ID;
        ?>
 = new PhoenixVision("<?php 
        echo $this->ID;
        ?>
");
					<?php 
        echo $this->ID;
        ?>
.BootstrapObjects =
					[
						<?php 
        $i = 0;
        $places = Place::Get();
        foreach ($places as $place) {
            ?>
						{
							"Place": <?php 
            echo $place->ToJSON();
            ?>
,
							"ImageURL": "<?php 
            echo System::$Configuration["Application.BasePath"];
            ?>
/world/places/<?php 
            echo $place->Name;
            ?>
/images/preview.png",
							"Title": "Map objects"
						},<?php 
            /* if ($i < count($places) - 1) { echo (", "); } $i++; */
            ?>

						<?php 
        }
        ?>
					];
					<?php 
        echo $this->ID;
        ?>
.ProgressBar = PhoenixVision_<?php 
        echo $this->ID;
        ?>
_ProgressBar;
					<?php 
        echo $this->ID;
        ?>
.Refresh();
					</script>
				</div>
			</div>
<?php 
    }
use PhoenixSNS\Modules\World\Objects\PlaceClippingRegion;
use PhoenixSNS\Modules\World\Objects\PlaceClippingRegionPoint;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $q = $_POST;
} else {
    $q = $_GET;
}
switch ($q["Action"]) {
    case "Retrieve":
        if (isset($q["PlaceID"])) {
            $id = $q["PlaceID"];
            if (!is_numeric($id)) {
                echo "{ \"Success\": false, \"ErrorMessage\": \"ID must be an integer\" }";
                return;
            }
            $place = Place::GetByID($id);
            if ($place == null) {
                echo "{ \"Success\": false, \"ErrorMessage\": \"Place with ID " . $id . " does not exist\" }";
                return;
            }
            $items = PlaceClippingRegion::GetByPlace($place);
            $count = count($items);
            echo "{ \"Success\": true, \"Items\": [ ";
            for ($i = 0; $i < $count; $i++) {
                echo $items[$i]->ToJSON();
                if ($i < $count - 1) {
                    echo ", ";
                }
            }
            echo " ] }";
        } else {
Beispiel #6
0
            $item = Group::GetByAssoc($values);
            echo "{ \"Category\": \"Groups\", \"Item\": ";
            echo $item->ToJSON();
            echo " }";
            if ($i + $previousCount < $totalCount - 1) {
                echo ", ";
            }
        }
    });
}
if ($availableTables["Places"]) {
    $lookupTables[] = new LookupTable("Places", "place_Name", function ($table, $totalCount, $previousCount) {
        $result = $table->Result;
        for ($i = 0; $i < $result->num_rows; $i++) {
            $values = $result->fetch_assoc();
            $item = Place::GetByAssoc($values);
            echo "{ \"Category\": \"Places\", \"Item\": ";
            echo $item->ToJSON();
            echo " }";
            if ($i + $previousCount < $totalCount - 1) {
                echo ", ";
            }
        }
    });
}
if ($availableTables["Pages"]) {
    $lookupTables[] = new LookupTable("Pages", "page_Title", function ($table, $totalCount, $previousCount) {
        $result = $table->Result;
        for ($i = 0; $i < $result->num_rows; $i++) {
            $values = $result->fetch_assoc();
            $item = Page::GetByAssoc($values);