$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)) { $zobrazim = $_GET["web"]; } if ($glob_user) { // pokud je uzivatel přihlašen -> nedostane se do login.php a register.php