Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Add "You've got mail!" to your forum

Quote Reply
Add "You've got mail!" to your forum
Depending on your user's skill level - some people fail to realize that they have a message waiting for them. I added a quick line of code to add an audible greeting notifying them that they have mail:

<%if current_user_new_messages%> <embed src="http://www.yoursite.com/sounds/filename.wav" autostart=true hidden=true loop=false>
<%endif%>


I originally added this to the include_header template, but you received the sound file - even after clicking on "messages" - because it loads the header and the "messages" page loads include_header.html ...

So, I inserted this in two places just under <%body_tag%>: category_view and forum_view

After using it for a while, I backed off of forum_view - they will hear it enough off of the main category view.

I also found a great site with neat wav files for mail:

http://www.slonet.org/~rloomis/mailcall.html

Hope someone else finds benefit from this - I know my users have!

This feature could be jazzed up a little by a coder - just like avatars, people could select from a few messages in EDIT USER PROFILE - not upload their own, but select from multiple greatings.

Ideally, they hear the message once and are not bothered again, but hey - I want them to check their mail Blush!

Last edited by:

shiner: Jun 19, 2002, 12:58 PM
Quote Reply
Re: [shiner] Add "You've got mail!" to your forum In reply to
using the table editor in the admin portion, I added a field called email_greet. By changing the template for user_profile_basic I was able to add the HTML for users to select via radio buttons what e-mail greeting they want. A quick look at MySQLMAN shows that all users have a selection of 0,1,2,3,4 or 5

Here is your code for user_profile_basic.html (edit in the admin console under TEMPLATES > USER TEMPLATES). You can put it anywhere in here after a table row is closed out (</tr>) - so I put it near the bottom.








<tr>
<td align=right>
Select Your E-mail Greeting:<br>
</TD>
<td>
</td>
</tr>

<tr>
<td align=right>
<%GForum::Config::tpl_get($email_greet)%>
<input type="radio" name="email_greet" value="0" <%if email_greet == 0%> checked <%endif%>>

</td>
<td>None</td>
</tr>
<tr>
<td align=right>
<input type="radio" name="email_greet" value="1" <%if email_greet == 1%> checked <%endif%>>
</td>
<td><a href="http://www.yoursite.com/sounds/1.wav">Carl Carlson: You've got mail, baby</a></td>
</tr>

<tr>
<td align=right>
<input type="radio" name="email_greet" value="2" <%if email_greet == 2%> checked <%endif%>>

</td>
<td><a href="http://www.yoursite.com/sounds/2.wav">Rosie the Robot (Jetsons): Mail call!</a>
</td>
</tr>

<tr>
<td align=right>
<input type="radio" name="email_greet" value="3" <%if email_greet == 3%> checked <%endif%>>
</td>
<td><a href="http://www.yoursite.com/sounds/3.wav">The sound of a mail
box door being opened and a woman saying &quot;You've got mail.&quot;</a></td>
</tr>

<tr>
<td align=right>
<input type="radio" name="email_greet" value="4" <%if email_greet == 4%> checked <%endif%>>

</td>
<td><a href="http://www.yoursite.com/sounds/4.wav">David Letterman: Congratulations Skippy, you've got mail.</a></td>
</tr>

<tr>
<td align=right>
<input type="radio" name="email_greet" value="5" <%if email_greet == 5%> checked <%endif%>>
</td>
<td colspan=2><a href="http://www.yoursite.com/sounds/5.wav">Homer Simpson: The
mail! The mail is here!</a></td>
</tr>






Notice, a value of 0 equals no sound. Here is the code for category_list.html - just under the <%body_tag%>. This actually plays the sound that the user selected.








<%unless current_email_greet == 0%>
<%if current_user_new_messages%>
<embed src="http://www.yoursite.com/...email_greet%>.wav" autostart=true hidden=true loop=false>
<%endif%>
<%endunless%>





Last edited by:

shiner: Dec 10, 2002, 7:49 PM
Post deleted by shiner In reply to
Quote Reply
Re: [shiner] Add "You've got mail!" to your forum In reply to
Since play_email_greet is the second variable you need to use $play_email_greet


Realiiity.com Forums
Post deleted by shiner In reply to
Post deleted by shiner In reply to
Quote Reply
Re: [shiner] Add "You've got mail!" to your forum In reply to
I'd like to have this too!
There is a final working code I can add with no bugs?
Thanks
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [maxpico] Add "You've got mail!" to your forum In reply to
Thanks for bumping this up. Given what I have above, one can hardcode a specific sound file for all users. The problem comes when users want to select a sound. Their desired selection is stored to the database, but I can not get the desired sound and the actual sound to connect up to one another. You can have the forum display the user's desired sound (i.e. 1,2,3, or 4) but getting the "if/then" statement to work is where I am lost.
Quote Reply
Re: [shiner] Add "You've got mail!" to your forum In reply to
I see.... Someone reply here to solve the problem
Max
The one with Mac OS X Server 10.4 :)

Last edited by:

maxpico: Nov 22, 2002, 6:11 AM
Quote Reply
Re: [maxpico] Add "You've got mail!" to your forum In reply to
A HUGE thanks goes out to Paul for his assistance. Please see the above code for how to correctly make this a user selected option. I am so happy to see this completed! ~It has been months...