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

Complete Uninstall to Work in J4??
We have recently updated a site from Joomlav3 to v4 (4.4.2). Now when we go to m...
7 Replies
Posted on Tuesday, 30 April 2024
Info about CMigrator for Joomla
Hi i need to import a few thousand articles from a site made in wordprres to a ...
0 Replies
Posted on Tuesday, 07 May 2024
  • New
    • #CMigator
    Error on android phone
    Why its working good on Computer and if i try it with smartphones the map dosent...
    0 Replies
    Posted on Tuesday, 07 May 2024
  • New
  • Bug with front-end submission and table not having
    Hi, i think i found a problem. When trying to edit a hotspot from front-end ...
    3 Replies
    Posted on Wednesday, 15 March 2023
    Question regarding custom fields
    How do I access custom fields after I have created them?...
    1 Replies
    Posted on Wednesday, 24 April 2024
    • #custom fields