SMF Development > Applied or Declined Requests

A Flashing Icon for the Chat Button in Default Theme...

(1/2) > >>

dooie:
There is a Mod called EmailFlash Created By: snork13 for Private Messages to let you know when you have any new messages that has become very useful for my forum as many of my members are older folks who do not see well. The Mod can be found here
http://custom.simplemachines.org/mods/index.php?mod=260

Could someone who knows how to do coding adapt a line of code to be added to the FlashChat integration by Daniel15 http://custom.simplemachines.org/mods/index.php?mod=611 so that an animated icon would be displayed when people were in Chat? I tried several times and just couldnt modify the Email Flash code to suit the Flash Chat button menu code. I have created my own chat bubble flashing icon as you can see below. I just need the code to add to have it show up as soon as there are any users in my chat room.

Here is an example of what I would be looking for...


I want to add an 8 - 10px animated icon to draw attention to the chat button when someone is in the Chat Room. My members have asked a few times if this could be done.

I really appreciate the efforts of Daniel15 with the Flash Chat Integration. I had manually set the Chat button before but deleting my edits and adding his made the Chat feature easier to manage.

I am running SMF 1.1.1 with the Default Theme and will not upgrade till version 2.0 is released to the public. It's just too much work to get all the Mods working right again with new versions.

Thanks for all your work.

Cheers,
Sean

Oldiesmann:
Should be relatively easy to do...

index.template.php

Find

--- Code: --- // FlashChat!
global $modSettings;
if ($context['user']['is_logged'])
echo ($current_action == 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat"', (!empty($modSettings['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($modSettings['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]' : ''), '</a>
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
--- End code ---

Replace

--- Code: --- // FlashChat!
global $modSettings;
$flashy_image = '<img src="{url_to_image}" alt="Flashy" border="0" />';
if ($context['user']['is_logged'])
echo ($current_action == 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat"', (!empty($modSettings['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($modSettings['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]&nbsp;' . $flashy_image : ''), '</a>
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
--- End code ---

Just replace {url_to_image} with the actual URL for that image.

Also, you should be running 1.1.4, not 1.1.1...

dooie:
It works like a charm, thank you so much!

Cheers,

razors edge:
Could you send me or post a link to that animated icon? I would like to add it to one of my sites if you did not mind?

Razors Edge

dooie:
I created my own, here it is,    feel free to use it. Just save as "chatflash.gif"


Cheers,

Navigation

[0] Message Index

[#] Next page

Go to full version