This article will help you add an “Online /Offline” button that, when it’s clicked, will open the chat with ArrowChat. To add this, follow these steps:
1) Open the file: ./application/modules/User/widgets/profile-status/index.tpl
2) Find this code:
<div id='profile_status'> <h2> <?php echo $this->subject()->getTitle() ?> </h2>
3) And replace it with this code:
<?php $user_online_options = include('application/settings/database.php'); mysql_connect($user_online_options['params']['host'],$user_online_options['params']['username'],$user_online_options['params']['password']); mysql_select_db($user_online_options['params']['dbname']); $user_online_query = mysql_query("SELECT * FROM engine4_user_online WHERE user_id=" . $this->subject()->user_id); $user_is_online = mysql_num_rows($user_online_query); ?> <div id='profile_status'> <h2> <?php echo $this->subject()->getTitle() ?> <a href="javascript: void(0);" onclick="javascript:jqac.arrowchat.chatWith('<?php echo $this->subject()->user_id; ?>')"> <?php if($user_is_online) echo '<img src="application/modules/User/externals/images/online.gif" alt="Online" />'; else echo '<img src="application/modules/User/externals/images/offline.gif" alt="Offline" />'; ?> </a> <br> </h2>
4) Search on Google for an icon (PNG) “Online” and “Offline” status and upload this two icons into: ./application/modules/User/externals/images
5) You’re done!
Looking for quality Social Engine Web Hosting? Look no further than Arvixe Web Hosting!
This only works if user logs out. And if only turns off chat, it says user still online.
Please can you provide more information on your SE Version and AC Version as it all seems to work as it pulling data from your arrowchat database so could be a in your AC Version