index() public method

If current user's profile, get notifications. Otherwise show their activity (if available) or discussions.
Since: 2.0.0
public index ( mixed $User = '', string $Username = '', integer $UserID = '', $Page = false )
$User mixed Unique identifier, possible ID or username.
$Username string .
$UserID integer Unique ID.
示例#1
0
    $user = NULL;
    if (isset($_SESSION['user_hash'])) {
        $user = $_SESSION['user_hash'];
    }
    switch ($user_profile_id) {
        case $user:
            if (isset($_GET['m'])) {
                $method = $_GET['m'];
                switch ($method) {
                    case 'edit':
                        $profile_controller->edit($_SESSION['user_id']);
                        break;
                    default:
                        $profile_controller->error_page();
                        break;
                }
            } else {
                $profile_controller->index($user_profile_id);
            }
            break;
        default:
            if (isset($_GET['m'])) {
                $profile_controller->error_page();
                exit;
            }
            $profile_controller->index($user_profile_id);
            break;
    }
} else {
    $profile_controller->error_page();
}