If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: Javascript FAQ ::: ezinbox alert window
New Topic    Add Reply
Topic: ezinbox alert window  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
Nutrocker

ezboard Moderator
ezSupporter
Posts: 15877
Posted: 6/15/05 3:48 pm    
ezinbox alert window
Summary: Popup a window or javascript alert when there are new messages in your ezInbox.

HEAD (box #1):
 
<script type="text/javascript">
/* EZINBOX ALERT FUNCTION */
// call with true for a popup window and with false for a javascript OK alert
function inboxalert(bWindow) {
        for (al = 0; al < document.links.length; al++) {
                if ( document.links[al].href.match(".boardRedirectToInboxServer|.showInBoxFolder") ) {
                        if (document.links[al].parentNode.innerHTML.match("NEW!")) {
                                x = document.links[al].parentNode.innerHTML.match("([0-9]+) NEW!")[1];
                                if (!bWindow) {
                                        alert(x + " new messages!");
                                } else {
                                        inbox = window.open("","","height=40,width=260,status=no,toolbar=no,address=no");
                                        inbox.document.write("<p style=\"font-family: Verdana, Arial, Helvetica;\">You have " + x + " new messages...<br><a target=\"_new\" href=\"" + document.links[al].href + "\">go to ezInbox</a></p>");
                                }
                        }
                }
        }
}
/* END EZINBOX ALERT FUNCTION */
</script>

FOOTER (box #4):
 
<script type="text/javascript">
/* LAUNCH EZINBOX ALERT FUNCTION */
inboxalert(true);
/* END LAUNCH EZINBOX ALERT FUNCTION */
</script>

Use inboxalert(true) if you want to pop up a little window with a link to the inbox. Use inboxalert(false) if you just want a javascript alert.

History:
6/26/2003 - fixed error in where it looked for "1 NEW!"
6/26/2003 - written by phalen180

Credits:
written by phalen180
suggested by Dan1113


  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - Javascript FAQ -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.