Example #1
0
    protected function RenderContent()
    {
        $pages = Page::Get();
        $count = count($pages);
        ?>
<div class="Panel">
	<h3 class="PanelTitle">Pages (<?php 
        echo $count;
        ?>
)</h3>
	<div class="PanelContent">
		<div class="ProfilePage">
			<div class="ProfileTitle">
				<span class="ProfileUserName">
					<?php 
        echo "There ";
        if ($count == 1) {
            echo "is ";
        } else {
            echo "are ";
        }
        echo $count;
        if ($count == 1) {
            echo " page";
        } else {
            echo " pages";
        }
        echo ".";
        ?>
				</span>
				<span class="ProfileControlBox">
					<a href="<?php 
        echo System::ExpandRelativePath("~/community/pages/create.mmo");
        ?>
" onclick="DisplayCreatePageDialog();">Create Page</a>
				</span>
			</div>
			<div class="ProfileContent">
			<?php 
        $grpPages = new ButtonGroup("grpPages");
        foreach ($pages as $item) {
            $grpPages->Items[] = new ButtonGroupButton(null, $item->Title, null, "~/community/pages/" . $item->Name . "/images/thumbnail.png", "~/community/pages/" . $item->Name, "PageInformationDialog.ShowDialog(" . $item->ID . ");");
        }
        $grpPages->Render();
        ?>
			</div>
		</div>
	</div>
</div>
<?php 
    }
Example #2
0
 public static function GetByName($name)
 {
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "Pages WHERE page_Name = '" . $MySQL->real_escape_string($name) . "'";
     $result = $MySQL->query($query);
     $values = $result->fetch_assoc();
     return Page::GetByAssoc($values);
 }
Example #3
0
 protected function BeforeContent()
 {
     parent::BeforeContent();
     $tbsCommunity = new TabStrip("tbsCommunity");
     $tbsCommunity->TabPosition = TabContainerTabPosition::Top;
     $tbsCommunity->Tabs[] = new TabStripTab("tabMembers", "<i class=\"fa fa-users\"></i> <span class=\"Text\">Members (" . User::Count() . ")</span>", "~/community/members", null, $this->Name == "members");
     if (System::GetConfigurationValue("Groups.Enabled", false)) {
         $tbsCommunity->Tabs[] = new TabStripTab("tabGroups", "<i class=\"fa fa-comments\"></i> <span class=\"Text\">Groups (" . Group::Count() . ")</span>", "~/community/groups", null, $this->Name == "groups");
     }
     if (System::GetConfigurationValue("Pages.Enabled", false)) {
         $tbsCommunity->Tabs[] = new TabStripTab("tabPages", "<i class=\"fa fa-flag\"></i> <span class=\"Text\">Pages (" . Page::Count() . ")</span>", "~/community/pages", null, $this->Name == "pages");
     }
     $tbsCommunity->Render();
     /*
     	?>
     	<table style="width: 100%">
     		<tr>
     <td style="width: 128px; vertical-align: top;">
     	<?php
     		// $actionList = new PsychaticaActionList();
     		// $actionList->Items = array
     		// (
     		//		new PsychaticaActionListItem("~/community/members", "Members (" . User::Count() . ")"),
     		//		new PsychaticaActionListItem("~/community/groups", "Groups (" . User::Count() . ")"),
     		//		new PsychaticaActionListItem("~/community/pages", "Pages (" . User::Count() . ")")
     		// );
     		// $actionList->Items[1]->Selected = true;
     	?>
     	
     	<div class="ActionList">
     		<?php
     		// if (System::$Configuration["Members.Enabled"]) {
     		if ($pagename == "members") {
     			if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/members")); ?>"> <?php }
     			else { ?> <span class="Selected"> <?php }
     		} else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/members")); ?>"> <?php } ?>
     		Members (<?php echo(User::Count()); ?>)
     			<?php if ($pagename == "members" && !$outline) { ?> </span> <?php } else { ?> </a> <?php }
     		//	}
     		
     		if (System::$Configuration["Groups.Enabled"]) {
     		if ($pagename == "groups") {
     			if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/groups")); ?>"> <?php }
     			else { ?> <span class="Selected"> <?php }
     		} else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/groups")); ?>"> <?php } ?>
     		Groups (<?php echo(Group::Count()); ?>)
     			<?php if ($pagename == "groups" && !$outline) { ?> </span> <?php } else { ?> </a> <?php }
     		}
     		
     		if (System::$Configuration["Pages.Enabled"]) {
     		if ($pagename == "pages") {
     			if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/pages")); ?>"> <?php }
     			else { ?> <span class="Selected"> <?php }
     		} else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/pages")); ?>"> <?php } ?>
     		Pages (<?php echo(Page::Count()); ?>)
     			<?php if ($pagename == "pages" && !$outline) { ?> </span> <?php } else { ?> </a> <?php }
     		}
     		
     		if (System::$Configuration["Forums.Enabled"]) {
     		if ($pagename == "forums") {
     			if ($outline) { ?> <a class="Selected" href="<?php echo(System::ExpandRelativePath("~/community/forums")); ?>"> <?php }
     			else { ?> <span class="Selected"> <?php }
     		} else { ?><a href="<?php echo(System::ExpandRelativePath("~/community/forums")); ?>"> <?php } ?>
     		Forums (<?php echo(Forum::Count()); ?>)
     			<?php if ($pagename == "forums" && !$outline) { ?> </span> <?php } else { ?> </a> <?php }
     		}
     		?>
     	</div>
     </td>
     <td>
     	<?php
     */
 }
Example #4
0
<?php

namespace PhoenixSNS\Modules\Community\Pages;

use PhoenixSNS\Objects\Page;
use PhoenixSNS\Modules\Community\CommunityPage;
use WebFX\Controls\BreadcrumbItem;
use PsychaticaWebPage;
$id = $path[1];
$thispage = null;
if (is_numeric($id)) {
    $thispage = Page::GetByID($id);
} else {
    $thispage = Page::GetByName($id);
}
if ($thispage == null) {
    $page = new PsychaticaErrorPage("Page not found");
    $page->Message = "That page does not exist in the system. It may have been deleted, or you may have typed the name incorrectly.";
    $page->ReturnButtonURL = "~/community/pages";
    $page->ReturnButtonText = "Return to Page List";
    $page->Render();
    return;
}
switch ($path[2]) {
    case "images":
        switch ($path[3]) {
            case "avatar":
                switch ($path[4]) {
                    case "thumbnail.png":
                        // paths are relative to the path of the including file
                        header("Content-Type: image");
Example #5
0
            $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);
            echo "{ \"Category\": \"Pages\", \"Item\": ";
            echo $item->ToJSON();
            echo " }";
            if ($i + $previousCount < $totalCount - 1) {
                echo ", ";
            }
        }
    });
}
if ($availableTables["Tasks"]) {
    $lookupTables[] = new LookupTable("Tasks", "task_Title", function ($table, $totalCount, $previousCount) {
        $result = $table->Result;
        for ($i = 0; $i < $result->num_rows; $i++) {
            $values = $result->fetch_assoc();
            $item = Task::GetByAssoc($values);