コード例 #1
0
<?php

/**
 * @package    zoneideas
 * @subpackage dashboard
 * @author     Serg Podtynnyi <*****@*****.**>
 */
/**
 *
 *
 */
ob_start();
include_once "../core.php";
$action = false;
if (User::Logged()) {
    Viewer::AddData("ideas", Ideas::GetByUser(User::$current));
    Viewer::AddData("user", User::$current);
    Viewer::AddData("title", I18n::L("Title Dashboard"));
    Viewer::UseTemplate("dashboard.tpl");
    $action = "dashboard";
} else {
    Viewer::Restricted();
    $action = "restricted";
}
if (!$action) {
    Viewer::RequestError();
}
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();
コード例 #2
0
                $user->user_email = "";
                $user->user_name = $user->user_name . "_removed";
                if (!User::Update($user)) {
                    $error_message = I18n::L("Cannot update user.");
                    $user = User::GetById($id);
                } else {
                    header("Location:" . PREFIX . "/profile?" . $user->user_id);
                    exit;
                }
            } else {
                header("Location:" . PREFIX . "/profile?" . $user->user_id);
                exit;
            }
        }
        Viewer::AddData("user", $user);
        Viewer::AddData("title", I18n::L("Title %s's profile", array($user->user_name)));
        Viewer::AddData("ideas_count", Ideas::GetByUser($user) ? sizeof(Ideas::GetByUser($user)) : 0);
        Viewer::AddData("comments_count", Comments::GetByUser($user) ? sizeof(Comments::GetByUser($user)) : 0);
        Viewer::UseTemplate("user_profile.tpl");
        $action = "profile";
    }
} else {
    Viewer::Restricted();
    $action = "profile";
}
if (!$action) {
    Viewer::RequestError();
}
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();
コード例 #3
0
        $action = "summary";
    }
    if (isset($_GET["search"])) {
        $q = $_GET["q"];
        Viewer::UseTemplate("ideas.tpl");
        Viewer::AddData("title", "Search Ideas");
        Viewer::AddData("q", $q);
        if (!empty($q)) {
            Viewer::AddData("ideas", Ideas::SearchByTitle($q));
        }
        $action = "search";
    }
    if (isset($_GET["user"])) {
        $user_id = (int) $_GET["user"];
        $user = User::GetById($user_id);
        Viewer::AddData("ideas", Ideas::GetByUser($user));
        Viewer::AddData("user", $user);
        Viewer::UseTemplate("ideas.tpl");
        Viewer::AddData("title", I18n::L("Title %s's ideas", array($user->user_name)));
        $action = "user";
    }
} else {
    Viewer::Restricted();
    $action = "ideas";
}
if (!$action) {
    Viewer::RequestError();
}
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();