0

I would like to know how can I manually insert some php code inside a cck node (in Drupal). The thing is that I have this stuff:

$output .= '<br>';
$mor = _pitch_detalle($cid, $previamente, $luego);
if (sizeof($mor) > 0){
  $output .= theme('pitch', $mor);
}
return $output;

This stuff shows some information that changes from day to day, and each time the users view the page, the information changes. I want the user to see an unmodified version of that code, the same information that existed when the user created the page.

As the user cannot edit the page, I think that ist´s pretty safe to say that if I enter that code inside a field, it will remain unchanged. Is that assumption correct? How could I do that?

Thanks for your help!!! Rosamunda

2 Answers 2

1

How about using drupal core revision functionality?

With the functions node_revision_list and node_load you could load the "first" revision (version) of the node.

http://api.drupal.org/api/drupal/modules--node--node.module/function/node_load/7 http://api.drupal.org/api/drupal/modules--node--node.module/function/node_revision_list/7

Sign up to request clarification or add additional context in comments.

Comments

1

I would think you could do this in a custom template for the page too.

1 Comment

Thanks for your answer. I´ve tried, but as that is dynamic generated content, it shows the content as it is when the viewer acceses the site. I would like it to show the content as it was when the node was published.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.