コード例 #1
0
            Viewer::AddData("comments", Comments::GetByIdea($idea));
            Viewer::AddData("idea", $idea);
            Viewer::AddData("title", $idea->idea_title);
            if (isset($_GET["rate_plus"])) {
                $rated = 3;
            } elseif (isset($_GET["rate_minus"])) {
                $rated = 2;
            } else {
                $rated = 1;
            }
            if (User::Logged()) {
                $rate = Rate::Find($idea, User::$current);
                if (!empty($rate)) {
                    $rated = 4;
                }
                Viewer::AddData("rated", $rated);
            }
            Viewer::UseTemplate("idea.tpl");
            $action = "idea";
        }
    }
} else {
    Viewer::Restricted();
    $action = "idea";
}
if (!$action) {
    Viewer::RequestError();
}
Viewer::AddData("action", $action);
Viewer::Show();
ob_end_flush();