dont be unhappy my friend.
fortunately, today i had time for you and it just take one hour to show you how you can remove at least this one hardcode.
1- in news/language/YOUR_LANG/main.php change the following:
// START hacked by irmtfan
define('_NW_ONECOMMENT',"comment");
// END hacked by irmtfan
define('_NW_BYTESMORE',"%s bytes more");
// START hacked by irmtfan
define('_NW_NUMCOMMENTS',"comments");
// END hacked by irmtfan
2- in news/class/class.newsstory.php change the following:
$morelink = '';
if ( $fullcount > 1 ) {
$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
$morelink .= '">'._NW_READMORE.'</a>';
$morelink .= ' | '.sprintf(_NW_BYTESMORE,$totalcount);
if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
$morelink .= ' | ';
}
}
if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
$ccount = $this->comments();
$morelink .= '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
$morelink2 = '<a href="'.XOOPS_URL.'/modules/news/article.php?storyid='.$this->storyid().'';
if ( $ccount == 0 ) {
$morelink .= '">'._NW_COMMENTS.'</a>';
} else {
if ( $fullcount < 1 ) {
// START hacked by irmtfan
//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>';
//}
// END hacked by irmtfan
}
}
}
// START hacked by irmtfan
$story['numcomments'] = $ccount;
// END hacked by irmtfan
$story['morelink'] = $morelink;
3- then in news/templates/news_item.html change the following:
<!-- START hacked by irmtfan to remove num comments hard-code" -->
<span class="itemPermaLink"><{$story.morelink}> <{if $story.numcomments gt 0}> <{$story.numcomments}> <{if $story.numcomments gt 1}> <{$smarty.const._NW_NUMCOMMENTS}> <{else}> <{$smarty.const._NW_ONECOMMENT}> <{/if}> <{/if}></span>
<!-- END hacked by irmtfan to remove num comments hard-code" -->
you can see the right way of doing that. One smarty variable should only used for one php variable.
Edit:
by the way, english language is weak in this point because it needs to add a "s" to make a countable word plural (1 comment and 2 comment
s) . in persian we dont have this obstacle! (comment=nazar and comments=nazar)
IMO the best way for localize it for languages like english is adding a "s" suffix that can be used in such a situation. eg:
for english:
define("_COUNT_SUFFIX","s");
for persian:
define("_COUNT_SUFFIX","");