Daniel S
Daniel S

Reputation: 609

drupal node update permission once a week

is there such a module already made, where let's say a user has access on a page only one time or only once a week, really been looking for this a long time now.

Upvotes: 0

Views: 61

Answers (1)

kakoma
kakoma

Reputation: 1203

I don't think you'd need a module for this. Create a custom template for the node in question.

First, add the ability to create a page template by page title Add this to your theme's template.php

function themename_preprocess_page(&$vars, $hook) {//bofun
  if (isset($vars['node'])) {
  // If the page title is "restricted" the template suggestion will be "page--restricted.tpl.php".
     $vars['theme_hook_suggestions'][] = 'page__'. str_replace(' ', '__', strtolower($vars['node']->title));

  }

}//eofun

In the templates folder, copy page.tpl.php and rename the new file page--restricted.tpl.php. Edit the new file. Add this to the beginning of the divs that show content

   <?php if (in_array('Staff', $user->roles) && date('l') == "Wednesday" ): /*only display users who have the user role type of Staff and display only on Wednesday*/ ?>
<div>
The restricted content
</div>
<?php else: echo "<h1 class='title' id='page-title'>Access Denied</h1><br />You are not authorized to access this page."; endif; ?>

Upvotes: 1

Related Questions