- Moderated by:
- Support
-
- rank:
-
Softmore
- registered:
- December 2007
- Status:
- offline
- last visit:
- 24.02.08
- Posts:
- 67
New articles are currently being posted on the home page of my web site, I also allow users to post comments, Is there a way where I can display the number of comments posted for each article (below the article), this way it will be easy for users to see which article has how many comments.
Thanks -
- rank:
-
Softmore
- registered:
- December 2007
- Status:
- offline
- last visit:
- 24.02.08
- Posts:
- 67
Thanks, the total comments and the option to post comments show up, however, they appear only if I log in, how can I ensure that even without logging, a person should be able to see the number of comments and click on them to read it. -
- rank:
-
Freshman
- registered:
- April 2006
- Status:
- offline
- last visit:
- 11.10.08
- Posts:
- 48
Download this Theme:http://www.markwest.…-getit-lid-50.phtml
--
regards from germany
postnuke-themes.de My Testsite for Zikula
-
- rank:
-
Team Member
- registered:
- December 2003
- Status:
- offline
- last visit:
- 04.12.08
- Posts:
- 2992
Hmmm... that is modified, eh?!
I have not modified a legacy theme since .726...
So here is the comments function:
Code
// Work out how to say 'comment(s)(?)' correctly
$comment = '';
$postcomment = '';
if (pnModAvailable('Comments')) {
if ($info['withcomm'] == 0) {
if ($info['comments'] == 0) {
$comment = _COMMENTSQ;
} else if ($info['comments'] == 1) {
$comment = '1 ' . _COMMENT;
} else {
$comment = "$info[comments] "._COMMENTS;
}
}
// Allowed to comment?
if (pnSecAuthAction(0, $component, $instance, ACCESS_COMMENT)) {
$comment = "<a href=\"$links[comment]\">$comment</a>";
$postcomment = "<a href=\"$links[postcomment]\">"._COMMENTSQ.'</a>';
} else {
$comment = '';
$postcomment = '';
}
} else if (pnModAvailable('EZComments') && pnModIsHooked('EZComments', 'News')) {
$commentcount = pnModAPIFunc('EZComments', 'user', 'countitems', array('mod' => 'News', 'objectid' => $info['sid'], 'status' => 0));
if ($commentcount == 0) {
$comment = _COMMENTSQ;
} else if ($commentcount == 1) {
$comment = '1 ' . _COMMENT;
} else {
$comment = "$commentcount "._COMMENTS;
}
if (pnSecAuthAction(0, 'EZComments::', "News::$info[sid]", ACCESS_COMMENT)) {
$comment = "<a href=\"$links[comment]\">$comment</a>";
$postcomment = "<a href=\"$links[postcomment]\">"._COMMENTSQ.'</a>';
} else {
$comment = '';
$postcomment = '';
}
}
Extract what you need.
HTH
--
David Pahl
Zikula Support Team -
- rank:
-
Softmore
- registered:
- December 2007
- Status:
- offline
- last visit:
- 24.02.08
- Posts:
- 67
David,
Thanks so much, I have it working in Seabreeze, I noticed that after I added , the homepage just showed the number of comments without any prefix or suffix and it was not very intutive. Added this piece of code: : and now the users see something like Comments: 2.
The only draw back being I don't know how to make this a hyperlink so that users can directly click on it and read the comments. Any suggestioins?
Further, is there a way I can have user assign ratings to the AddArticle when they submit the article and also for users reading it, rate it? I saw some forum postings on a module EZComments, I hope their is a simpler way of achieving it.
Thanks
