Skip Navigation

[Resolved] Problems with using the Messaging System

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 17 replies, has 2 voices.

Last updated by alperenK 3 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1891805
outbox-count-1-again.png
outbox-count-1.png

Hi Minesh, thanks a lot for your patience and perseverance with me. 🙂 With your help I understand everytime more how flexible toolset can be finding solutions. But to be honest, I'm a little confused now..

For me on the frontent I see every time the number "1" even when inside the view are more messages..... see attached pics.

And when I wanted to replicate your shortcode method to the receiver "inbox" part like you mentioned above, I can't find the section where you give in the shortcode that it should count the messages from "outbox"?? Which parameter is connectec here to "outbox" view, "wp_kar_posts"?

--> Where can I edit the shortcode so that it counts the number for "inbox" view?

add_shortcode('get_msg_count', 'func_show_msg_count');
function func_show_msg_count($atts) {

global $wpdb;
global $current_user;
$query = "SELECT count(a.ID) FROM wp_kar_posts a, wp_kar_postmeta b WHERE (a.ID=b.post_id) AND (b.meta_key= 'wpcf-first-message-id' and b.meta_value=a.ID) and a.post_author=".$current_user->ID;
$res = $wpdb->query($query);

return $res;
}

I wish you a happy new year and thank you thousend times!! 🙂

#1891931

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

For me on the frontent I see every time the number "1" even when inside the view are more messages..... see attached pics.
==>
As said, you will have to adjust your view to display only the message where post ID equal to the First message ID. There is no native solution available due to your custom requirement. You have to adjust the output of your view, you may use the wpv_filter_query hook to modify the view's query on fly:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

And when I wanted to replicate your shortcode method to the receiver "inbox" part like you mentioned above, I can't find the section where you give in the shortcode that it should count the messages from "outbox"?? Which parameter is connectec here to "outbox" view, "wp_kar_posts"?
--> Where can I edit the shortcode so that it counts the number for "inbox" view?
==>
You need to to build the shortcode for the inbox count on your own, if you do not know how to build, you may require to hire a pro Toolset expert as this is custom requirement and as per our support policy we do not entertain such custom code, however I try to help you by one example but we can not build customer sites, I can guide you but we can not write custom code to complete your task.

I hope this is totally understandable and you will be agree 🙂

You need to build your custom shortcode that should return the inbox count and replace on the following page with the section I marked in the following screenshot: hidden link
- hidden link

If you will require custom programming help, you can always contact our certified patterns:
- https://toolset.com/contractors/

#1892125

My issue is resolved now. Thank you!

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.