Do you use CometChat and would like to allow your members to have an easier way to access chat if you have a lot of members it can be hard sometimes to locate the member you wish to message, with a small modification you can add a Chat with Me button to each profile so when the user is online you can just click the button to start chatting.
- Open the file: ./application/modules/User/widgets/profile-status/index.tpl
- Find this code:
<div id='profile_status'> <h2> <?php echo $this->subject()->getTitle() ?> </h2>
- and replace 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:parent.jqcc.cometchat.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>
- now save and upload to your server, always make a backup of the original file in-case you ever need to revert.
Looking for quality SocialEngine Hosting? Look no further than Arvixe Web Hosting