Some suggestions for Replix:
In the file replix.inc.php
Change:
if(!$modx->isMemberOfWebGroup($modgrp)) {
$comment = str_replace('[+moderate+]','',$comment);
} else {
$comment = str_replace('[+moderate+]','<a href="[~[*id*]~]#" onclick="document.forms.ReplixDelete'.$tagid.'.cid.value=\''.$id.'\';document.forms.ReplixDelete'.$tagid.'.submit();" title="Delete Comment"><img src="manager/media/images/icons/delete.gif" width="16" height="16" alt="Delete Comment" border="0" /></a>',$comment);
}
to this:
if($modx->isMemberOfWebGroup($modgrp) || $modx->checkSession()) {
$comment = str_replace('[+moderate+]','<a href="[~[*id*]~]#" onclick="document.forms.ReplixDelete'.$tagid.'.cid.value=\''.$id.'\';document.forms.ReplixDelete'.$tagid.'.submit();" title="Delete Comment"><img src="manager/media/images/icons/delete.gif" width="16" height="16" alt="Delete Comment" border="0" /></a>',$comment);
} else {
$comment = str_replace('[+moderate+]','',$comment);
}
Now it will allow both users in the right webusergroups, as well as managers, to delete comments. (By the way, are you going to add the ability to edit comments?)
Add:
//class for every other comment.
$altrowcss = isset($altrowcss) ? $altrowcss : 'altRow';
To the top variable checks, and:
$altRow = ($i%2)==0 ? ' '.$altrowcss : null;
$comment = str_replace('[+altrowclass+]',$altRow,$comment);
In the template tag replacement loop. Now you can alternate the look of every other comment in a list, like the old UserComments snippet.
I like what you’ve done with this snippet, bS. I’m probably going to drop support of my UserCommentDocs snippet in favor of using yours.
Also, the delete buttons are not working for me. It submits the page, and when it comes back up, none of the comments are on the page anymore, almost like one button deleted all of the comments. But when I refresh the page again using the refresh button, the comments are back, including the one I tried to delete. I’m using Firefox 1.5.0.4 on Windows XP.