-
Author
-
November 8, 2013 at 08:35 #6260aztlanlaParticipant
Hi, I was able to add online/offline status to the members page, but have not been able to add it too the profile page. Can you help with this?
Also, I added a chat button to the profile page, how can make the chat button appear only when the member is online?
Thanks again
November 9, 2013 at 01:39 #6313SQadminKeymasterThe online/offline will be included this month in 2.3 update.
To check if online, see this topic: https://archived.seventhqueen.com/forums/topic/check-if-user-is-online#reply-5149
if you are on a profile page you need to replace bp_get_member_user_id() with bp_displayed_user_id()
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 10, 2013 at 09:58 #6374aztlanlaParticipantThanks I was able to get the Online status to work under profile.
I edited this file
/wp-content/themes/sweetdate-child/members/single/members-header.php
and added
COPY CODE<?php if (kleo_is_user_online(bp_displayed_user_id())) { echo '<FONT COLOR="black"><b>Online</b></FONT>'; } else { echo "Offline"; } ?>
right above
COPY CODE<div class="row">
But still can’t get the chat button to appear if online and disappear if offline.
November 12, 2013 at 01:13 #6441SQadminKeymasterIt should be the exact sentence but instead of echo-ing the online status, you echo the button
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 12, 2013 at 08:52 #6473aztlanlaParticipantI had tried that before, maybe I’m not escaping it correctly.
Here’s the code I used.
COPY CODEecho '<button type="button" onclick="javascript:jqcc.cometchat.chatWith('<?php echo bp_displayed_user_id() ?>');">Instant Message</button>';
I had it placed in place of echo-ing the online status, but it does not work. I get the page to error out.
November 13, 2013 at 00:03 #6528SQadminKeymasterYou have some strange single quotes.. replace them with the regular ‘ from the keyboard
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionNovember 13, 2013 at 07:12 #6560aztlanlaParticipantThose are the same quotes I have throughout the members-header.php.
I deleted the single quotes and typed them in again, they look exactly the same.Here is the whole line
COPY CODE<?php if (kleo_is_user_online(bp_displayed_user_id())) { echo '<button type="button" onclick="javascript:jqcc.cometchat.chatWith('<?php echo bp_displayed_user_id() ?>');">Instant Message</button>'; } else { echo "Offline"; } ?>
Here is the error that comes up on the page.
COPY CODEParse error: syntax error, unexpected '?' in /wp-content/themes/sweetdate-child/members/single/member-header.php on line 51
November 14, 2013 at 12:53 #6612SQadminKeymasterYou haven’t added it right.. you need basic php knowledge:
<?php if (kleo_is_user_online(bp_displayed_user_id())) { echo '<button type="button" onclick="javascript:jqcc.cometchat.chatWith('. bp_displayed_user_id().');">Instant Message</button>'; } else { echo "Offline"; } ?>
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.