Mod Name / Version - Private Message Pop Up Notification 2.2 Version 2.2 fixes an issue with the popup script not displaying on some servers.
Description - This pops up a little window when there are new Private Messages Waiting. The window tells how many messages, and gives a link to check them. The window will refresh periodically and update the total number of messages, and close when there are no more new messages to read. There is also an option to have an audio alert (with or without the popup window) when you have new private messages. Users can specify which option, or none or both in their profiles.
Pre-requisites - none
Author - JoshPet
Credits - Definately couldn't have done this without help from JustDave and Gardener - Thanks Guys! Thanks to Chaos for helping to track down bugs and errors in my instructions for 6.2. <img src="/threads/php/images/graemlins/smile.gif" alt="" />
Database Altered - Yes - 2 fields (U_PrivatePopup & U_PrivateAlert) are added to allow users the option to choose or disable either option
New Files - messagepopup.php
Any other info - I was pretty proud of myself for pulling this one off. <img src="/threads/php/images/graemlins/wink.gif" alt="" /> LOL
Screenshot - Here is what the popup window looks like. I made it bright yellow, with red text (not stylesheet dependent) so that it will stand out. It inserts the name of the site (from config file), user's name, number of messages and link back to check private messages. Clicking the link or the flashing envelope icon will open the list of received messages back in the original threads window. []https://www.ubbdev.com/threads/php/uploads/59752-popupwindow.gif[/]
per your suggestion // ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate else { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert"; }
lines 1755-1790 // ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate else { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert"; }
That solve the first problem now I am getting this
Parse error: parse error, unexpected T_STRING, expecting ',' or ')' in c:\wwwroot\ubbthreads\editbasic.php on line 74
Lines 61-80 // ---------------------------------------- // Get the current profile for this username $Username_q = addslashes($Username); $query = " SELECT U_LoginName,U_Password,U_Email,U_Fakeemail,U_Name,U_Signature, U_Homepage,U_Occupation,U_Hobbies,U_Location,U_Bio,U_TextCols, U_TextRows,U_Extra1,U_Extra2,U_Extra3,U_Extra4,U_Extra5,U_Picture, U_Visible,U_AcceptPriv,U_OnlineFormat,U_PrivatePopup,U_PrivateAlert FROM {$config['tbprefix']}Users WHERE U_Username = '$Username_q' "; $sth = $dbh -> do_query($query);
// -------------------------------- // Make sure we found this Username list($LoginName,$ChosenPassword,$Email,$Fakeemail,$Name,$Signature, $Homepage,$Occupation,$Hobbies,$Location,$Bio,$TextCols, $TextRows,$ICQ,$Extra2,$Extra3,$Extra4,$Extra5,$Picture, $Visible,$AcceptPriv, $OnlineFormat,t,$PrivatePopup, $PrivateAlert) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth);
if (!$ChosenPassword){ $html -> not_right("{$ubbt_lang['NO_PROF']} '$Username'",$Cat); }
Sorry you've had so much trouble. Guess it was too late when I pulled together my instructions. Or they were messed up from before. I had posted this under 6.1 but just got around to updating it (at my user's request) last night.
This might be a good basis to use as a start onto an instant message hack where this window would pop up with the message you send them from a list of choosable users online at that moment.
Ok we are one step closer to the promised land. The pop up window now comes up but I am getting a server 500 error within it And I was up pretty late too as you can see by my 4:50 am post and my uhh..other posts on the forum
*edit-my badd...the privatemessage.php and the sound file got extracted with its dir folder instead of directly to my UBBThreads directory.-told ya I was up late *
Josh does this function check for Private Message automatically or does it rely on me refreshing the page I am viewing? I dont seem to be getting notification until I refresh and it sees the flashing envelope icon
Also when hovering above the flashing envelope in the pop up box the numerical value is missing for amount of posts "You have _ new message(s)
Updated the zip with what *should* be the last of the tweaks and fixes.
Added Chaos to the Credits list for tracking down all the bugs and errors in the directions. Hadn't fooled with this mod since 6.1 so I guess it was dusty.
Each time it plays... it's basically bandwidth used. So smaller is better if bandwidth is a concern for you... or if you have lots of members on dialup.
// ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate if ($Query != "*") { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert"; }
# # Change to this: #
// ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate if ($Query != "*") { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert"; }
hier is the right one: ########################################## # Find this: #
// ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate if ($Query != "*") { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number"; }
# # Change to this: #
// ----------------------------------------------------------------- // We are automatically adding StyleSheet, Status, Privates and // FrontPage and Number to each SQL call because this information is needed by // every script that makes a call to authenticate if ($Query != "*") { if ($Query) { $Query .=","; } $Query .= "U_Username,U_Password,U_SessionId, U_StyleSheet, U_Status, U_Privates, U_FrontPage, U_Number, U_PrivatePopup, U_PrivateAlert"; }
bugs? 1. Set the default for Private Message Popup & Private Message Alert Sound
they are allways on NO if i change them to YES it's ok if i open the "Personal information" again they go automatic on NO
2. Set the Private Message Alert Sound
if the Private Message Popup is on YES allways the sound, YES/NO in the Private Message Alert Sound without function
3. below the footer its showing a Query: +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Query: UPDATE w3t_Users SET U_Rating = '40' , U_Rates = '8' , U_RealRating = '5' WHERE U_Number = '2' Query took a total of 0.001 seconds. +++++++++++++++++++++++++++++++++++++++++++++++++++++++ a bug? ore possible don't show that?
1. when i open "Main Configuration" >> "Personal information, email, password, etc." >> "Do you want a Notification box for Private Messages?" the default setting is on "NO" if i open "Main Configuration" >> "Personal information, email, password, etc." >> "Do you want an Audio Alert for Private Messages?" the default setting is on "NO" if i change both with a click on "YES" the popub works.
when i go again into the "Main Configuration" >> "Personal information, email, password, etc." both settings show me again "NO" why they changed automatic?
2. if "Do you want a Notification box for Private Messages?" is on "YES" i always hear a sound, the "Do you want an Audio Alert for Private Messages?" didn't work....YES ore NO....always the sound!
3.after a new config from "Personal information, email, password, etc." it shows me a Query
It sounds like you've got a problem in editbasic.php or changebasic.php Double check those intructions. Make sure you've modified the query to grab the current settings of on or off. My guess is that the fields or variables haven't been added, and without a value, its going back to the default.
Then the sound always playing and the query on the bottom of the page, I'm not sure. That query has nothing to do with this.... that's a query to update someone's user Rating. So that makes me think you are missing a } somewhere in ubbt.inc.php. Double check those files as well.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.