Benoit Lathiere <[EMAIL PROTECTED]> wrote:
> Yop !
>
> To change sitegroups of my old site, I must use mgd_walk_tree but I don't understand
> how it works !
>
> my code :
> <?
> $root=14;
> mgd_walk_topic_tree($root->setsitegroup(id, level), $root, 1, 0)
> ?>
<?php
function change_sg($id)
{
$sg = //define as You wish
$topic = mgd_get_topic($id);
$topic->setsitegroup($sg);
}
mgd_walk_topic_tree (change_sg, $root, 1000, &$foo);
?>
For articles should be enough:
<?php
$articles = mgd_list_topic_articles_all($root);
while ($articles && $articles->fetch())
{
$articles->setsitegroup($sg);
}
?>
Sorry I made mistake by I write it from my mind , but I think You will get idea.
BTW http://www.midgard-project.org/manual/en/function.walk-topic-tree.php
Piotras
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]