- <?php
- echo "<ul>\n";
- $today = date("Y-m-d");
- $sql = "SELECT num, heading, body, DATE_FORMAT(date, '%Y-%m-%d') AS eventdate, DATE_FORMAT(date, '%H:%i') AS eventtime FROM ex_events WHERE DATE_FORMAT(date, '%Y-%m-%d') = '$today' ORDER BY num";
- $result = mysql_query($sql) or die('nope, not working');
- while ($row = mysql_fetch_assoc($result)){
- $eventdate = $row["eventdate"];
- $eventtime = $row["eventtime"];
- $event_title = $row["heading"];
- $event_body = $row["body"];
- $event_number = $row["num"];
- echo "<li><a id=\"smoke$event_number\" title=\"Appointment Notification\" href=\"#\">$event_title</a></li>\n";
- ?>
- <script type=text/javascript charset=utf-8>
- $('smoke<?php echo "$event_number" ?>').onclick = function() {
- Growl.Smoke({
- title: '<?php echo "$event_title @ $eventtime"; ?>',
- text: '<?php echo "<p>$event_body</p>"; ?>',
- image: 'images/growl.jpg',
- duration: 10
- });
- return false;
- };
- </script>
- <?php
- }
- echo "\n</ul>\n\n";
- ?>
I am having some trouble modifying a growl script. I have searched the net and this forum as we ll as many others and have come up with nothing so far.
so far the growl works as standard, click a link with the correct properties and a growl window pops up. This is all set up and working nicely. What I have so far is this:
I have set up an event calendar, beneath it is a list of all events for today and tomorrow with a clickable link that opens a growl containing the info for that particular event. This works fine. I am using the mootools 1.11 for compatibility with my other code that is not on v1.2 yet.
what I would like to do:
I would like to have the growl set to execute when the page loads if there are events for the day then repeat every 30 minutes until the event time/day has passed. if no events, no execution (this will be dealt with on the php side) my problem is, how do i get this function to execute on page load instead of listening for a click?
The growl is from here - http://icebeat.bitacoras.com/mootools/growl/
the function i have is thus
as you can see it is listening for an onclick event and i need to change this. I am new to JS and mootools so please bear with me. any and all help appreciated
TIA
Mark


