} elseif ($_GET['action'] == 'hide') { $DB->query("UPDATE f_forums SET hidden=1 WHERE forum_id=?d LIMIT 1", $_GET['forum_id']); redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'updforumsorder') { foreach ($_POST['forumorder'] as $fid => $order) { $DB->query("UPDATE f_forums SET disp_position=?d WHERE forum_id=?d LIMIT 1", $order, $fid); } redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'newcat') { $DB->query("INSERT INTO f_categories SET ?a", $_POST); redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'newforum') { $DB->query("INSERT INTO f_forums SET ?a", $_POST); redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'recount') { recount($_GET['forum_id']); redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'deleteforum') { delete_forum($_GET['forum_id']); redirect($_SERVER['HTTP_REFERER'], 1); } elseif ($_GET['action'] == 'deletecat') { delete_cat($_GET['cat_id']); redirect($_SERVER['HTTP_REFERER'], 1); } function recount($fid) { global $DB; $c_topics = $DB->selectCell("SELECT count(*) FROM f_topics WHERE forum_id=?d", $fid); $c_posts = $DB->selectCell("SELECT count(*) FROM f_topics RIGHT JOIN f_posts ON f_topics.topic_id=f_posts.topic_id WHERE forum_id=?d", $fid); $last_topic_id = $DB->selectCell("SELECT topic_id FROM f_topics WHERE forum_id=?d ORDER BY last_post DESC LIMIT 1", $fid); $DB->query("UPDATE f_forums SET num_topics=?d,num_posts=?d,last_topic_id=?d WHERE forum_id=?d LIMIT 1", $c_topics, $c_posts, $last_topic_id, $fid);
case "geocode": require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/geocode.mtree.php'; break; /*** * Recount */ /*** * Recount */ case "fullrecount": require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/recount.mtree.php'; recount('full', $cat_id[0]); break; case "fastrecount": require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/recount.mtree.php'; recount('fast', $cat_id[0]); break; /*** * Default List Category */ /*** * Default List Category */ default: listcats($cat_id[0], $cat_parent, $option); break; } /* End Left Navigation Menu */ if (!$hide_menu && !in_array($task, array('upgrade', 'spy', 'ajax', 'downloadft', 'manageftattachments'))) { HTML_mtree::print_endmenu(); }
function del_rating() { $del_rating = clear("del_rating"); if ($del_rating == 'yes' && $this->uid != $this->id) { //zjisteni jestli jsem j*z bodoval uzivatele $s = sql_query("select id from users_rating\n where (user = '******' and rated_user = '******')"); $d = sql_fetch_object($s); if ($d->id) { $s = sql_query("delete from users_rating\n where (id = '" . $d->id . "')"); if ($s) { $this->rating--; recount("user_rating", $this->id); } } } }