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

Changes to Submission Form?
Are you able to make changes to the Hotspot submission form? There are several f...
0 Replies
Posted on Friday, 26 April 2024
  • New
  • Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
    • #custom fields
    Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
  • Language parameter in the link to the comment
    Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
    1 Replies
    Posted on Saturday, 06 April 2024
    categories icon in header
    Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
    0 Replies
    Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories