Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Hi,

I know a few years back I've read a topic here regarding unread blog posts and if it's possible to show them with a different color or with bold text, as a new/unread topic in this or any other forum, for example. At that time KK said it's not possible and he is thinking to add forum capabilities to Couch in order to make this kind of things possible.
Could this be done now with Couch or not? I'm asking this because I have something in my mind, which could be used as a work-around for showing unread posts and also their number, but have no time to test it in the coming few days, so I thought I'll ask the experts ;)
Thanks!
Hi @atisz,

This is squarely a forum type feature and, I'm afraid, there has not been any progress on that front yet.

That said, Couch now has almost all the functions necessary to create a full-fledged forum and I aim at creating one in the near future and port our existing forum (the one you are on right now) to that.

It is just a little while away though at the moment.
KK wrote: Hi @atisz,

This is squarely a forum type feature and, I'm afraid, there has not been any progress on that front yet.

That said, Couch now has almost all the functions necessary to create a full-fledged forum and I aim at creating one in the near future and port our existing forum (the one you are on right now) to that.

It is just a little while away though at the moment.


Thanks @KK! I'm looking forward to the day this feature will be available in Couch :)
As I have mentioned in my previous post, I had something in my mind which in some cases can help us to achieve this. It's usable only in member area for user specific data display, I've just tested it, and it's working (for highlight and count unread private messages).
In messages.php I used your page hits counter solution, then in the menu I used:
Code: Select all
<li><a class="messages" href="messages.php"><i class="fa fa-envelope fa-fw"></i>Messages <em><cms:pages masterpage='members/messages.php' custom_field="receiver_id=id(<cms:show k_member_id />) | page_hits=0" count_only='1' /></em></a></li>

In list view for highlighting new/unread private messages I used:
Code: Select all
<cms:if page_hits='0'>
                               <a href="<cms:show k_page_link/>" style="font-weight:bold;"><cms:excerptHTML count='7' ignore='img'><cms:show message /></cms:excerptHTML></a>
                             <cms:else />
                                <a href="<cms:show k_page_link/>"><cms:excerptHTML count='7' ignore='img'><cms:show message /></cms:excerptHTML></a>
                             </cms:if>

It's only usable in this kind of situations, when the pages are available for only one person, so if the page is viewed the hit counter gets updated, so page count and message highlight is updated also.

Regards, Attila
Nice solution, Attila :)
Good for tracking, like, if the recipient has read the private message or not.
KK wrote: Nice solution, Attila :)
Good for tracking, like, if the recipient has read the private message or not.


Thanks, KK. Yes, that could be another use-case which I'm planning to implement :)
However, I realized I need an extra check for my solution, because if the sender has the option to see and read his sent messages, there is a chance that he reads the message before the receiver, so the counter gets incremented and on receiver side wouldn't count the message as a new one :( How can I check in page view sender_id editable against k_member_id ? I'm thinking to something like
Code: Select all
<cms:if sender_id NOT k_member_id> ... increment page_hits ... </cms:if>

Thanks.
I think you should use another type 'relation' region in messages template (many-to-one) for the sender, just like the one you have for the receiver.

This way on any message page you can retrieve info about the sender and put it to use - as in doing the check in your case.

Hope it helps.
KK wrote: I think you should use another type 'relation' region in messages template (many-to-one) for the sender, just like the one you have for the receiver.

This way on any message page you can retrieve info about the sender and put it to use - as in doing the check in your case.

Hope it helps.

KK, in fact I already have this 'relation' region called sender_id! So it's available in every message page, I just don't know how to check if sender_id is different from k_member_id.
OK :)

Assuming the relation region's name is 'sender', placing the following in the page_view of message should work -
Code: Select all
<!-- will fetch the member page representing the sender  -->
<cms:related_pages 'sender' >
    <cms:set my_sender_id=k_page_id 'global' />
</cms:related_pages>

<!-- use the sender_id -->
<cms:if k_member_id != my_sender_id>
    .. update read count ..
</cms:if>

Does this help?
KK wrote: OK :)

Assuming the relation region's name is 'sender', placing the following in the page_view of message should work -
Code: Select all
<!-- will fetch the member page representing the sender  -->
<cms:related_pages 'sender' >
    <cms:set my_sender_id=k_page_id 'global' />
</cms:related_pages>

<!-- use the sender_id -->
<cms:if k_member_id != my_sender_id>
    .. update read count ..
</cms:if>

Does this help?


It's beautiful, KK! Working perfect and I added the tracking also, to see if the recipient has read the private message or not ;) Thank You!

Regards, Attila
9 posts Page 1 of 1
cron