As a blog admin, I want to minimize the duration for which my blog authors/users have the capability to edit their blog posts. Essentially, at some point, I want to consider a blog post stable (at least in some blog contexts--which means I probably want to make this programmable on a per-category and/or per-blog basis) so that it doesn't confuse all the readers that are attempting to talk about said blog content.

Additionally, I'd like to know, if I'm a reader, I want to know uf a blog entry has been edited since its initial post, and what the last edit date was. If I can, a history list of changes and a diffs display b/w the versions of the blog entry (as in a MediaWiki/Wikipedia page) would be helpful, but the stuff in the first sentence of this paragraph is more important.

Thanks for any help,
-Matt

Comments

mattengland’s picture

Ok, no immediate response like I usually find when there is an existing solution available, and this fact may or may not reflect that there is no existing solution for this requirement.

Can Drupal at least provide a "last edit" date on any blog entry (or any node content, for that matter)? This seems to me to be a fairly critical requirement. Without it, one has a pointer (a URL) to some content (in this case a blog entry) that presents the same date (the blog-created date) but varying content (if a blog author decided to edit, significantly or not, one of her/his exising blog entries) over time. Is this a correct analysis?

Because of this, different readers may be reading and referencing the (in this case blog-entry) content, assuming they are reading the same thing, when in fact they are not.

Do I have a fair read on this? If so: ouch. This breaks business processes.

-Matt

mattengland’s picture

Ok, it appears that 4.5.2's /admin/user/configure/permission page can specificy whether or not any user-role (?) has the ability to edit an existing blog post via the "edit own blog" setting.

This is good; it's what I sought. (I had mistakenly set this to be "true" when I first setup my blog system, not knowing what exactly it did.)

I would still be interested in a "last-edit date display" capability for content (namely blogs) that can be edited after an initial post (if a user has appropriate permission). Can any thing in Drupal (module or otherwise) provide this capability?

-Matt

mattengland’s picture

In 4.5.2 (which I'm using), it turns out that removing the edit capability for a user-role prevents the user from creating any initial blog content all together, instead of allowing them to post once without editing existing posts (which is what I seek).

I prematurely posted my note above.

I'm still seeking a solution for this, and it's growing in importance. Any suggestions?

-Matt

mattengland’s picture

If I can somehow manually disable the edit link (as in /blogs/node/2/edit) then maybe I can create this capability myself with my own "patch."

Any thoughts?

I'm hoping to get some experienced feedback before I go mucking around in the php engine (or whatever drives Drupal) myself. I'd of course like to see if existing capabilities/modules can address this, too.

-Matt

mattengland’s picture

The description of http://drupal.org/project/node_privacy_byrole shows some promise. I have yet to try it.

mattengland’s picture

It looks like it will tough to eliminate edit capability all together. I can see that even if I try and enforce "you can never edit blog posts after you send them" on my users, they still may require edits to the category assignments at least.

To this end, at this point (and I may change my mind as I get more experience), I think I really want the "last modification/last edit" timestamp label capability.

-Matt

mattengland’s picture

If I _did_ want to eliminate edit, it looks like I might change the following code in function in blog.module:

/**
 * Implementation of hook_access().
 */
function blog_access($op, $node) {
  global $user;

  if ($op == 'create') {
    return user_access('edit own blog') && $user->uid;
  }

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own blog') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }
}

to be...

/**
 * Implementation of hook_access().
 */
function blog_access($op, $node) {
  global $user;

  if ($op == 'create') {
    return $user->uid;
  }

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own blog') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }
}

...and then any user can create blog entries but will only be allowed to update existing entries if "edit own blog" is checked.

Even though I don't think this is what I want to do, I ask: if I did want to do this, would this be the way to go (assuming I'm ok with all users being able to unconditionally create blog entries)?

-Matt

mattengland’s picture

I'm trying add the following code to get a last-edit display in statistics.module in the statistics_summary function:

    if ($content->changed != $content->created)
    {
$output .= '<tr><td style="text-align: right;"><small>'. t('Last edited on %a', array('%a' => format_date($content->changed, 'large'))) .'</small></td></tr>';
    }

I have not yet gotten this to work. Is this the way to go?

Any other options?

-Matt

urbanfalcon’s picture

Best bet is to try to use the themes for formatting of information, not the modules themselves. I don't know if it'll work in your case, but if you were trying to add a last changed date to the footer of a regular node (and you're using the phptemplate engine), you'd open node.tpl.php and add down at the bottom:

<div class="info">Last changed on: <b><?php print str_replace('-', ' – ', format_date($node->changed)) ?></b></div>

mattengland’s picture

What does "Create new revision" do for the reader? Anything? It appears to only help the editor and the "revisions" are not reflected to the reader.

-Matt

smallfluffykat’s picture

Yeah you're right I think - it only helps the editor. Sorry I have no clue how to help with the OP.

mattengland’s picture

After the overwhelming response I got on this thread (just kidding), I made an attempted solution found here:

http://drupal.org/node/21885

Please let me know what you think about this attempted "patch"?

-Matt

smallfluffykat’s picture

I know, sometimes it seems like no-one is reading and I know I didn't help but I figured that at least if you knew that someone was reading your posts but not able to help it would make you feel better ;-)

mattengland’s picture

I appreciate the response :)

I think I would serve myself better if I actually followed the recommended patch procedures here at Drupal.org, but I'm not sure if I'll find time to do that.

-Matt