Example #1
0
        System::Redirect("~/community/members/" . $thisuser->ShortName . "/information");
        return;
    }
}
if ($thisuser == null && $action != "images") {
    $errorPage = new ErrorPage();
    $errorPage->Title = "User Not Found";
    $errorPage->Message = "That user does not exist in the system. They may have deleted their account, or you may have typed their name incorrectly.";
    $errorPage->ReturnButtonURL = "~/community/members";
    $errorPage->ReturnButtonText = "Return to User List";
    $errorPage->Render();
    return;
}
if ($thisuser->ProfileVisibility != UserProfileVisibility::Everyone && $action != "images") {
    if (!$thisuser->IsVisible()) {
        $errorPage = new ErrorPage();
        $errorPage->Title = "Private Profile";
        $errorPage->DisplayContactMessage = false;
        if ($thisuser->ProfileVisibility == UserProfileVisibility::Hidden) {
            $errorPage->Message = "This user's profile is private.";
        } else {
            if ($thisuser->ProfileVisibility == UserProfileVisibility::Friends) {
                $errorPage->Message = "This user's profile is only visible to their friends. Please <a href=\"" . System::ExpandRelativePath("~/community/members/" . $thisuser->ShortName . "/connect") . "\">add this person as a friend</a> to see this person's profile.";
            } else {
                if ($thisuser->ProfileVisibility == UserProfileVisibility::ExtendedFriends) {
                    $errorPage->Message = "This user's profile is only visible to their friends, or friends of their friends. Please <a href=\"" . System::ExpandRelativePath("~/community/members/" . $thisuser->ShortName . "/connect") . "\">add this person as a friend</a> to see this person's profile.";
                } else {
                    if ($thisuser->ProfileVisibility == UserProfileVisibility::Sitewide) {
                        $errorPage->Message = "This person's profile is not visible to people outside of " . System::GetConfigurationValue("Application.Name") . ". Please <a href=\"" . System::ExpandRelativePath("~/account/login.page") . "\">log in to " . System::GetConfigurationValue("Application.Name") . "</a> to see this person's profile.";
                    } else {
                        $errorPage->Message = "Unknown profile visibility " . $thisuser->ProfileVisibility;
Example #2
0
<?php

namespace PhoenixSNS\Modules\Community;

use WebFX\System;
use WebFX\Controls\ButtonGroup;
use WebFX\Controls\ButtonGroupButton;
use WebFX\Controls\BreadcrumbItem;
use WebFX\Controls\Panel;
use PhoenixSNS\Objects\Group;
use PhoenixSNS\Objects\User;
use PhoenixSNS\Pages\ErrorPage;
$thisgroup = Group::GetByIDOrName($path[1]);
if ($thisgroup == null) {
    $page = new ErrorPage("Group not found");
    $page->Message = "That group does not exist in the system. It may have been deleted, or you may have typed the name incorrectly.";
    $page->ReturnButtonURL = "~/community/groups";
    $page->ReturnButtonText = "Return to Group List";
    $page->Render();
    return;
}
class GroupDetailPage extends CommunityPage
{
    public $Group;
    public $Path;
    public function __construct($group)
    {
        parent::__construct();
        $this->Title = $group->Title;
        $this->Group = $group;
    }