Jump to content

Recommended Posts

Posted

I'm trying to update a number of pages with the following code

$levels = $pages->find("template=level");
echo "Changing ". count($levels). " levels";
foreach($levels as $lev){
    $lev->setOutputFormatting(false);
    $lev->user_id = 4233;
    $lev->save;
}

The message shows the correct number of levels, so the code is being run, but the pages are not changed.

It's probably something trivial, but I can't figure our what I'm missing. 

Can someone put me on the right track?

Posted

Thanks arjen - can't believe how long I looked at the code without noticing the missing () . Knew it had to be something obvious but still couldn't see it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...