Commit | Line | Data |
---|---|---|
bc13d5d6 H |
1 | <? |
2 | include_once("../inc/kyberia.inc"); | |
3 | $database=new CLASS_KYBERIA(); | |
4 | function getParent($category) { | |
5 | global $pole; | |
6 | global $database; | |
7 | // echo "select category_parent from category where category_id='$category' and category_parent!=0"; | |
8 | $set=$database->query("select category_parent from category where category_id='$category' and category_parent!=0"); | |
9 | if ($set->next()) { | |
10 | // $set->next(); | |
11 | $pole[]=$set->getString('category_parent'); | |
12 | getParent($set->getString('category_parent')); | |
13 | } | |
14 | } | |
15 | ||
16 | ||
17 | include_once("../inc/kyberia.inc"); | |
18 | $database=new CLASS_KYBERIA(); | |
19 | $q="select forum_id,forum_category from forum"; | |
20 | $set=$database->query($q); | |
21 | //getParent(67); | |
22 | //print_r($pole); | |
23 | ||
24 | while($set->next()) { | |
25 | $pole[]=$set->getString('forum_category'); | |
26 | getParent($set->getString('forum_category')); | |
27 | $pole=array_reverse($pole); | |
28 | echo "<br>".$set->getString('forum_id'); | |
29 | foreach($pole as $key => $value) { | |
30 | $param.="&kat[$key]=$value"; | |
31 | } | |
32 | echo "::$param"; | |
33 | //$param=addslashes($param); | |
34 | $database->update("update forum set forum_category_param='$param' where forum_id='".$set->getString('forum_id')."'"); | |
35 | unset ($param); | |
36 | unset($pole); | |
37 | ||
38 | ||
39 | } | |
40 | ||
41 | ?> |