Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated

[SOLUTION] Make Seen by ... more visible in Chat

6 years 7 months ago
  • Vladimir's Avatar
    Topic Author
  • Vladimir
  • Offline
  • Junior Boarder
  • Posts: 283
  • Thank you received: 40
Licenses:
JomSocial Active

When message has been seen by others there is message at the end of chat message history. No text is displayed, just small avatar, but on hover there is text. On mobile this is not working so to make Seen by message more visible You need to modify:
\components\com_community\templates\jomsocial\layouts\chat\default.php
Best way to do this is to copy that file to your own JomSocial template if it does not exist already. Another way it to replicate folder structure in "code" folder in Joomla template, like:
joomla\templates\YOUR_JOOMLA_TEMAPLATE\code\components\com_community\templates\jomsocial\layouts\chat\default.php
By doing this you avoid situation where next JomSocial update would overwrite your modified files. Also, by doing this you have original files present, so if any bad thing happens you revert to original state by deleting or renaming newly created files.
What to modify:
Find <!-- Seen by template --> on line 323. Then on line 328 there is {{ } }}. New line after that and add:

<span class ="joms-chat_seen_by"><?php echo JText::sprintf('COM_COMMUNITY_CHAT_SEEN_BY', '{{= data.names }}') . '..'; ?></span>
Additional '..' are there because after username script adds another dot like it is regular sentence, so to avoid that we add two more dots for 3 dots.
Whole block looks like:
<!-- Seen by template -->
<script type="text/template" id="joms-js-template-chat-seen-by">
    <div class="joms-chat__seen clearfix" title="<?php echo JText::sprintf('COM_COMMUNITY_CHAT_SEEN_BY', '{{= data.names }}'); ?>">
        {{ for ( var i in data.seen ) { }}
        <img src="{{= data.seen[ i ].avatar }}" />
        {{ } }}
		<span class ="joms-chat_seen_by"><?php echo JText::sprintf('COM_COMMUNITY_CHAT_SEEN_BY', '{{= data.names }}') . '..'; ?></span>
	</div>
</script>
After that you can make it more prominent with some css. Here is my solution for that:
.joms-chat__seen {
    padding: 6px 14px;
    height: 28px;
	background-color: #9bd2c2;
	margin-left: 55px;
    margin-right: 13px;
	margin-bottom: 8px
}
.joms-chat_seen_by {
	color: #12674f;
	font-size: 0.95em;
    font-weight: normal;
	line-height: 17px;
	padding-left: 8px;
}

6 years 7 months ago
Licenses:

Privet Vladimir.

Thank you for sharing this :)


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW