When you look at the end of an article in News (1.56 - 1.62) with XOOPS 2.2.6 then you see at the bottom something like:
Quote:
Read More... | 6774 bytes more | 16 comments
To my surprise both links point to the same URL of the full article view.
I found that very ennoying and illogical, because when I click on comments, I expect to land on the comments at the bottom of the article and not pages away at the top.
So, I patched it.
First we need an anchor to land. I choose this at the top of the comment functions block (in this way other modules can benefit as well).
In /include/comment_view.php at 153 change
$navbar = '
to
$navbar = ' <a name="comments"></a>
Next we adapt the links in modules\news\class\class.newsstory.php around 640 or 690 from
if ( $ccount == 0 ) {
$morelink .= '">'._NW_COMMENTS.'</a>';
} else {
if ( $fullcount < 1 ) {
if ( $ccount == 1 ) {
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">'._NW_ONECOMMENT.'</a>';
} else {
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'">';
$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
$morelink .= '</a>';
}
} else {
if ( $ccount == 1 ) {
$morelink .= '">'._NW_ONECOMMENT.'</a>';
} else {
$morelink .= '">';
$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
$morelink .= '</a>';
}
}
}
in five changes to
if ( $ccount == 0 ) {
$morelink .= '#comments">'._NW_COMMENTS.'</a>';
} else {
if ( $fullcount < 1 ) {
if ( $ccount == 1 ) {
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'#comments">'._NW_ONECOMMENT.'</a>';
} else {
$morelink .= '">'._NW_READMORE.'</a> | '.$morelink2.'#comments">';
$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
$morelink .= '</a>';
}
} else {
if ( $ccount == 1 ) {
$morelink .= '#comments">'._NW_ONECOMMENT.'</a>';
} else {
$morelink .= '#comments">';
$morelink .= sprintf(_NW_NUMCOMMENTS, $ccount);
$morelink .= '</a>';
}
}
}
And when we were changing anyway, I found the layout of the comment functions block for posting a comment very confusing and the link to post is easy overlooked. It deserves a more prominent place for easier access.
The four controls are placed in a table with 1 row and 1 column. So I decided to add a new row, because a new column wasn't it what I was looking for.
For this you have to change
$navbar .= ' <input type="button" onclick="self.location.href=''.$postcomment_link.''.$link_extra.''" class="formButton" value="'._CM_POSTCOMMENT.'" />';
in /include/comment_view.php at 204 to
$navbar .= '</td></tr><tr><td class="odd" align="center"><input type="button" onclick="self.location.href=''.$postcomment_link.''.$link_extra.''" class="formButton" value="'._CM_POSTCOMMENT.'" />';
So that looks already much nicer!
Only the text
Quote:
The comments are owned by the poster. We aren't responsible for their content.
looks a little orphaned, maybe I must add it in the table in a row between the controls, but that's for a next time!