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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.