Пример #1
0
include "classes/login_user.class.php";
$pr = new MyLogin();
$glob_user = $pr->checkLogin();
$user_id = $pr->get_user_id();
$user_name = $pr->get_username();
/*******************************************************************/
//reaguje na odeslani formularu
if (isset($_POST["logging_out"])) {
    $glob_user = null;
    $pr->logoutUser();
}
if ($glob_user && $user_id != -1 && $user_name) {
    include_once "classes/posting.class.php";
    $posting = new Posting();
    if (isset($_POST["post_textarea"])) {
        $post_id = $posting->send_new_post($user_id, $_POST["post_textarea"]);
        $ret = upload_my_file($post_id, "images/post/");
    }
    if (isset($_POST["comment_textarea"])) {
        $posting->send_new_comment($user_id, $user_name, $_POST["comment_textarea"], $_POST["post_id"]);
    }
    call_edit_post($posting);
    call_delete_post($posting);
    call_like_post($posting, $user_id);
}
/********************************************************************/
// seznam dostupnych stran k zobrazeni
$dostupne = array("index", "login", "register", "home", "profile");
// defaultne se zobrazuje prvni strana
$zobrazim = $dostupne[0];
if (isset($_GET["web"]) && in_array($_GET["web"], $dostupne)) {