Hello,

I'm trying to set a node to $node->is_protected = 1 based on another modules status being set to 1 as well. How would I go about setting $node->is_protected to 1 in node.tpl.php?

Thank you for you help thus far.

Lee

Comments

mtolmacs’s picture

Status: Active » Fixed

Basically you cannot do this now except if you want to litter your node.tpl.php with SQL.

I recommend to write a simple module and let that module set the required status for the module. To implement such a method you can find an example in the latest HEAD (and in the latest version of DRUPAL5 branch) with the function name protected_node_set_protected(...)

If you can wait a little bit you don't have to implement a new module for yourself because I will roll out a new release of the modules, but it takes time (usually 1-3 days) to the d.o to publish it on the module page.

Grimlock’s picture

Awesome! Thanks a ton tolmi, I can wait no problem.

So when the new version of Protected_node is released how will I go about using it?

Thanks for your time.

mtolmacs’s picture

Yayy. It's out :) Read the API.txt for details. I hope it helps

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.