Created
June 17, 2010 07:14
-
-
Save inazt/441788 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function content_timelock_link_alter(&$links, $node, $comment = NULL) { | |
global $user; | |
$have_access = in_array('moderator',array_values($user->roles) ) || $user->uid==1; | |
$diff_time = time() - $comment->timestamp; | |
$time_limit = variable_get('content_timelock_live_time',24); | |
if ( $diff_time > $time_limit*60 && !$have_access && variable_get('content_timelock_disable_alter_button',false) == true) { | |
unset($links['comment_edit']); | |
unset($links['comment_delete']); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment