1. Guillermo
  2. Bug Report
  3. Monday, 08 December 2008
  4.  Subscribe via email
Hi, I don't know if I messed up things, or if it was actually a designed feature, but in my installation (joomla 1.5.8) the comments voting was available only to the author, just the opposite of what I wanted (to have people entitled to comment, be able to vote on others' comments).

So I made some minor hacks and everything works now. Here are them

On the template, I had to create a new BLOCK-voting block, and insert within it the {voting} tag:


{post}
<table class='postcontainer' id='post{id}' width='100%' cellpadding='0' cellspacing='0' style='margin-left:{wrapnum};'><!-- style='padding-left:{wrapnum};'> -->
<tr>
<td><a name='josc{id}'></a>
<table width='100%' cellpadding='4' cellspacing='1' style="border-bottom: 1px solid #cccccc;">
<tbody class='{postclass}'>
<tr>
<td width="80" align="center" valign="top">
{BLOCK-avatar_picture}<div>{avatar_picture}</div>{/BLOCK-avatar_picture}
<div class='small'>{username}</div>
</td>
<td>
{BLOCK-title}<div class='posttitle'>{title}</div>{/BLOCK-title}
<div style="text-align:right;" class='small'>{date}</div>
<!-- @willy: formateamos comentarios -->
<div class="comment_content">{content}</div><br/>
{BLOCK-voting}<div align="right">{voting}</div>{/BLOCK-voting}
{BLOCK-footer}
<table class='postfooter' width='100%' cellpadding='0' cellspacing='0'>
<tr><td align='center'>{editbuttons}</td></tr>
</table>
</td>
</tr>
{/BLOCK-footer}
</tbody>
</table>
</td>
</tr>
</table>
{/post}


Then on components/com_comment/joscomment/comment.class.php, I changed from


	
$display = ((!$my->username && $this->_only_registered) || !$this->_ajax || ($edit == '')) ? false : true;
$html = JOSC_utils::checkBlock('BLOCK-footer', $display, $html);
if ($display) {
/* {editbuttons} */
$html = str_replace('{editbuttons}', $edit, $html);
/* {voting} */
$html = str_replace('{voting}', $voting, $html);
}


to


/* {voting} */
$display = ((!$my->username && $this->_only_registered) || !$this->_ajax ) ? false : true;
$html = JOSC_utils::checkBlock('BLOCK-voting', $display, $html);
if ($display) {
$html = str_replace('{voting}', $voting, $html);
}


$display = ((!$my->username && $this->_only_registered) || !$this->_ajax || ($edit == '')) ? false : true;
$html = JOSC_utils::checkBlock('BLOCK-footer', $display, $html);
if ($display) {
/* {editbuttons} */
$html = str_replace('{editbuttons}', $edit, $html);
}


So this way I separate the decision to show/allow voting from the decision to Edit comments and changed the test to test only for being under the rules that allow me for posting a comment: If I can post a comment, then I can vote.

I can still vote my own comments but as I can only to it once per comment, I don't see it a big issue (and besides surely it won't be so hard to fix... but today's been a loooong day).

Am I on the right track? Or did I broke anything??? (I mean, towards future usage of the site)

Best regards Willie.
Responses (0)


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
2 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
error message when adding/cofiguring email address
When configuring the email plugin that send a email message to admin when a new ...
0 Replies
Posted on Friday, 09 May 2025
CMigrator: Path from Drupal 6 to J5?
(Category s/b CMigrator, but didn't see it on the list) I'm interested in usi...
0 Replies
Posted on Monday, 28 April 2025
Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • #kml
  • #download
Set number of hotspots / user groups
Hi, I'm working with Hotspots for my new website and I love it! After trying ...
0 Replies
Posted on Monday, 31 March 2025