{ global $pole; global $database; // echo "select category_parent from category where category_id='$category' and category_parent!=0"; $set = $database->query("select category_parent from category where category_id='{$category}' and category_parent!=0"); if ($set->next()) { // $set->next(); $pole[] = $set->getString('category_parent'); getParent($set->getString('category_parent')); } } $database = new CLASS_KYBERIA(); $q = "select * from category"; $set = $database->query($q); //getParent(67); //print_r($pole); while ($set->next()) { $pole[] = $set->getString('category_id'); getParent($set->getString('category_id')); print_r($pole); $pole = array_reverse($pole); echo "<br>" . $set->getString('category_id'); foreach ($pole as $key => $value) { $param .= "{$value};"; } echo "::{$param}"; $param = addslashes($param); $database->update("update category set category_tree='{$param}' where category_id='" . $set->getString('category_id') . "'"); unset($param); unset($pole); }
{ global $pole; global $database; // echo "select category_parent from category where category_id='$category' and category_parent!=0"; $set = $database->query("select category_parent from category where category_id='{$category}' and category_parent!=0"); if ($set->next()) { // $set->next(); $pole[] = $set->getString('category_parent'); getParent($set->getString('category_parent')); } } include_once "../inc/kyberia.inc"; $database = new CLASS_KYBERIA(); $q = "select forum_id,forum_category from forum"; $set = $database->query($q); //getParent(67); //print_r($pole); while ($set->next()) { $pole[] = $set->getString('forum_category'); getParent($set->getString('forum_category')); $pole = array_reverse($pole); echo "<br>" . $set->getString('forum_id'); foreach ($pole as $key => $value) { $param .= "&kat[{$key}]={$value}"; } echo "::{$param}"; //$param=addslashes($param); $database->update("update forum set forum_category_param='{$param}' where forum_id='" . $set->getString('forum_id') . "'"); unset($param); unset($pole); }
//brutalne query na zistenie vsetkeho o fore a userovy $forumset = $kyberia->query("select user_forum.submission_count,forum_info.forum_info,category.category_name as category,user.login as owner_name,forum.*,user_forum.user_bookmark as bookmark from forum left join user_forum on (user_forum.forum_id=forum.forum_id and user_forum.user_id={$user_id}) left join category on (category.category_id=forum.forum_category) left join user on (user.id=forum.forum_owner) left join forum_info on (forum_info.forum_id=forum.forum_id) where forum.forum_id='{$node_id}'"); $forumset->next(); $forum = $forumset->getRecord(); //hehe you don't have access if ($forum['forum_public'] == 'private' and !($forum['forum_owner'] == $user_id or $access_type == 'access' or $access_type == 'master' or $access_type == 'op')) { echo "toto forum je privatne. sorry"; echo "<br>Ak chces pristup napis vlasnikovi fora"; echo "<br>mal by to byt " . $forum['forum_owner']; return; } //ak uz mal pristup vo fore tak sa zapisalo bookmark if ($forum['bookmark'] == 'no' or $forum['bookmark'] == 'yes') { //zapise sa "0 novych prispevkov" $q = "UPDATE user_forum set submission_count=0,last_visit=NOW() where forum_id='{$node_id}' and user_id='{$user_id}'"; $rows = $kyberia->update($q); } else { $kyberia->query("INSERT INTO user_forum set submission_count=0,forum_id='{$node_id}',user_id='{$user_id}'"); } } elseif ($action == 'userinfo') { $userinfoset = $kyberia->query("select * from user where id='{$node_id}'"); $userinfoset->next(); $userinfo = $userinfoset->getRecord(); } elseif ($action == 'journaux' && !empty($_GET['node_id'])) { $dennikset = $kyberia->query("select * from dennik where id='{$node_id}'"); $dennikset->next(); $dennik = $dennikset->getRecord(); } elseif ($action == 'article' && !empty($node_id)) { $articleset = $kyberia->query("select * from articles where id_article='" . $node_id . "'"); $articleset->next(); $article = $articleset->getRecord();