HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


How to display comments in a block?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#79136 (In Topic #16139)
Avatar

Community saint

I want to display website comments in a block on the front page. I figured this would be easy but I'm stuck trying to determine what to use as a filter.

I am planning on using main_multi_content with a Param of "post". I thought I'd be able to determine the forum id for "Website comment topics" using the Site Tree Editor but I cannot find any enumeration of the forums in either the Welcome (Module: Forums) or Forum zones. Where can I find the forum id to use as a filter in the main_multi_content block? Also, am I correct that setting the Paaram as "post" will diplay the actual forum post?

Thanks for any help.

Bob
Back to the top
 
Posted
Rating:
#79137
Avatar

Community saint

Well, I figured out that the main_forum_news block mostly does what I want. However, it seems to list only the first comment rather than a stream of comments from a particular topic. This makes it almost the same as the main_forum_topics block since they both list just the initial post from a topic.

Is the main_forum_news block supposed to behave this way?

Bob
Back to the top
 
Posted
Rating:
#79138
Avatar

Community saint

I've done EXACTLY that on my site, Bob, but in my L/H panel (take a quick look).

This is the code I am currently using:

Code

[block="5" forum="15" member_based="0" date_key="lasttime" title="Last 5 Comments"]side_forum_news[/block]

You would, of course, adapt the block to suit your display.

I also edited BLOCK_SIDE_FORUM_NEWS_SUMMARY.tpl around line 5 to read 'LASTUSERNAME' instead of 'FIRSTUSERNAME'.

More info if you require it via PT …

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#79139
Avatar

Community saint

Hmmmmm….

Looks like you got there while I was still composing a response.

Can't throw any light on 'several' versus 'single' comment as I didn't want too many in the side panel in any case. But would be interesting to see if you come up with a solution.

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#79140
Avatar

Community saint

I like your display of comments - nice and clean.

What I am after is a block that truly represents the "most recent" comments which would mean that it would show and link to the last post made. Fo me, I wouldn't even mind that the same topic is listed several times if the most recent comments came from that topic. I actually think this is pretty standard fare as it allows your visitors to see the actual recent activity on your site.

Bob
Back to the top
 
Posted
Rating:
#79142
Avatar

Community saint

There appears to be an issue with the byline when using the main_forum_news block. The posts are credited to "System" instead of to the appropriate member. "Member Based" is checked for the block.

This block could be greatly improved if you could specify the maximum number of lines to display.

Also, the above change to make the block display each independent post even if that resulted in multiple items for the same topic would make this block much more useful. In its current form, it is almost the same as main_forum_topics.

Bob
Back to the top
 
Posted
Rating:
#79147
Avatar

Community saint

The posts are credited to "System" instead of to the appropriate member.
Yeah. It is the reason I edited the template to replace
FIRSTUSERNAME with LASTUSERNAME. At least that ties in with my block heading of 'Last 5 Comments'.

Let us know in here when you've cracked it, and what you needed to do.

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#79149
Avatar

Community saint

This seems to me to be a clear bug. I would hope that Chris would take a look at it.

Bob
Back to the top
 
Posted
Rating:
#79173
Avatar

Not a bug, the spacer post is by 'System', and that's the first post. No blocks were designed for showing site-wide latest comments I'm afraid.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79179
Avatar

Community saint

Personally, I don't have a problem with that.

I've always been grateful, as the Admin, to have one 'centralised' depository for ALL comments without having to go hunting for them through the site.

I've chosen to display the 'last comment' by the LASTUSERNAME in my side panel (by editing BLOCK_SIDE_FORUM_NEWS_SUMMARY.tpl), but I am happy to have 'System' as the first entry pointing to the original post for anybody (including me) that wants to refresh their memory as to what the comment is in reference to.

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#79184
Avatar

Community saint

I am afraid that I need to forcefully disagree. While disappointed that this block does not truly provide insight into the last post made, I can live with that. However, the issue with the "System" byline makes no sense to me.

The software intelligently skips posting the space posts (which would be wholly uninformative) in favor of the first actual post made by a member. But then it attributes that post to "System" rather than to the member who made that post. That's wrong. Whatever gets posted should at least be consistent and, since I think we can all agree it makes no sense to have a series of spacer posts displayed, the proper byline for that first post should be the member who made it.

Bob
Back to the top
 
Posted
Rating:
#79185
Avatar

Community saint

Fletch said

Personally, I don't have a problem with that.

I've always been grateful, as the Admin, to have one 'centralised' depository for ALL comments without having to go hunting for them through the site.

I've chosen to display the 'last comment' by the LASTUSERNAME in my side panel (by editing BLOCK_SIDE_FORUM_NEWS_SUMMARY.tpl), but I am happy to have 'System' as the first entry pointing to the original post for anybody (including me) that wants to refresh their memory as to what the comment is in reference to.

I've thought about implementing your change but then there is an inconsistency - the viewer is taken to the first post possibly made by another member rather than what is displayed in the block.

Bob
Back to the top
 
Posted
Rating:
#79186
Avatar

Community saint

BobS said

the viewer is taken to the first post possibly made by another member rather than what is displayed in the block.
Yes - and - no!

The viewer is taken to the first post, which is by 'System'. The block is displaying 'who' posted the last comment, and shows 'how many' comments there are (less 1, as per the tempcode).

I may rethink this display if I start to get negative observations from my users, but for the moment they appear to be satisfied that this is another way to get visitors involved. The regulars already know how to access the 'Forum:Comments' area.

 :o

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#79187
Avatar

Community saint

I may end up using your mod but I just hate inconsistencies and this strikes me as one.

I do hope Chris reconsiders on the present behavior since attributing a post made by a member to the System is just wrong and, it seems to me that if you have the data to show the first post after the spacer post, you also have the information for the proper byline.

Bob

Back to the top
 
Posted
Rating:
#79188
Avatar

Whoops, I had forgotten we did filter it. Try this…

Attachment
Put in sources/
» Download: ocf_forum_driver_helper.php (17 Kb, 77 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79190
Avatar

Community saint

Chris -

This results in the following error on the front page where the block is installed:

Code

An error has occurred

PHP NOTICE [8] Undefined index: p_poster_name_if_guest in sources/ocf_forum_driver_helper.php on line 296 (version: 7.1.5, PHP version: 5.2.17, URL: /start.htm)

Expand: Here is the stack trace: Here is the stack trace:


Thanks for trying to sort this.

Bob
Back to the top
 
Posted
Rating:
#79192
Avatar

Please try:
Attachment
» Download: ocf_forum_driver_helper.php (17 Kb, 72 downloads so far)


(I'm being very lazy - not setting up any test data to test this)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79193
Avatar

Community saint

Well, that doesn't error out but it still shows the byline as "System' even after clearing both template and browser caches.

I don't mind testing but feel free to log into my site if it is helpful. I think you have the credentials needed. The block is at the bottom of the left column in the center. Otherwise just post whatever fixes you come up with and I will test ASAP.

Thanks for your help.

Bob
Back to the top
 
Posted
Rating:
#79194
Avatar

Works for me (just tested). Maybe block caching.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79195
Avatar

Community saint

Yep. It works fine now and looks much better. Thanks for fixing this.

Hope you are feeling better.

Bob
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Expand