Community management insight at ManagingCommunities.com
phpBBHacks.com Turns 11 and It's Time for a Change
Search Advanced Search
Submit Your Work (Update) - Problems/Feedback - Support Forums

PM Sounds




First we add a few fields in the database. Add a field named 'notified' to the 'priv_msgs' table, Type INT and make it default to 0. Next add a field named 'user_pmsound' to the 'users' table, Type INT and make it default to 0. Then the prefs.php script is modified to allow the users to play a sample of each sound installed, and select no sound, sound 1, 2, or 3. The form section of the script is modified as well as the UPDATE statement to make this happen. Next, the lang_english.php script is modified to supply the language for the forms as well as to add the tag which causes page_header.php to play the sound as it loads the PM notification text. There are 4 diferent code snippets, one for each sound. Now we modify the PM notification section of page_header.php. First, we do a querry of priv_msgs to see if there are any PMs for this user in the table with a notified field that equals 0. If there is we then run a querry on the users table to find out which sound the user has selected and use that value to "eval" and "print" the correct $l_privnotify_sound_x string from the language file. The last thing we do is set the notified field for all the PMs in the priv_msgs table to 1 so the sound will not play every time the page_header.php is run. If there are no PMs for this user in the table with a notified field that equals 0, then the $l_privnotify_sound_0 string is run from the language file regardless of which sound is selected in the users table.


Please Rate Us
Featured phpBB
Dungeon Master

Fan community for the video game series.
Featured Author
Last Update
2012-05-13 01:34:28

Copyright © 2001-2012. phpBBHacks.com, iFroggy Network. All Rights Reserved.
Disclaimer. Privacy Policy. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.
We're still here, you rockin' with the best!