Jump to content

new message alert


zac_exuro

Recommended Posts

im trying to get new user messages to show up on my site.. i have looked around on google but can only find info on popup alerts.. i just need a simple javscript code that will display the number of new messages next to the link that takes them to their inbox.. if someone could point me to a site or if they have the code handy i would appreciate it more than you know.. thank you

Link to comment
https://forums.phpfreaks.com/topic/228758-new-message-alert/
Share on other sites

thanks for your input.. :) i have this already in database.. and members get alerted when they have a new message but page has to be refreshed in order to see the alert because it is not javascript.. i dont know where to start.. i was looking for a script on google i can modify and make work for me but i cannot find any.. if someone could point me in the right direction..............

Link to comment
https://forums.phpfreaks.com/topic/228758-new-message-alert/#findComment-1180018
Share on other sites

this is the code as is right now.. i dont know why this was moved to php when im needing javascript so messages alerts show in real time.. but im a noob too so you guys probably know why..

 


<div align="center">
    <?
if ($msg_type == "")
{
		$msid = $myrow[id];
		$msql = "SELECT count(*) from og_messages where toid=$msid AND checked=0 AND type like '1%' order by id DESC";
		$mresult = @mysql_query($msql);
		$mmyrow = @mysql_fetch_array($mresult);
		$msql1 = "SELECT count(*) from og_messages where toid=$msid AND checked=0 AND type like '2%' order by id DESC";
		$mresult1 = @mysql_query($msql1);
		$mmyrow1 = @mysql_fetch_array($mresult1);
		$msql2 = "SELECT count(*) from og_messages where toid=$msid AND checked=0 AND type like '3%' order by id DESC";
		$mresult2 = @mysql_query($msql2);
		$mmyrow2 = @mysql_fetch_array($mresult2);
		$sqlpl = "SELECT * from og_userinfo where uid='$uid'";
		$resultpl = @mysql_query($sqlpl);
		$myrowpl1 = @mysql_fetch_array($resultpl);
if ($mmyrow[0] > 0) { ?>
  </p>
</div>

Link to comment
https://forums.phpfreaks.com/topic/228758-new-message-alert/#findComment-1180055
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.