VitalEnd Posted October 15, 2010 Posted October 15, 2010 For hospital, jail, mail and events is it possibleto have a counter that updates without you refreshing the page, and as seen in facebook could you make a javascript function to change the title of the page from "game name" to "1 New Message". Would appreciate it if someone could either point me in the right direction or post up something they have already made. Thanks Quote
Joshua Posted October 16, 2010 Posted October 16, 2010 Above the <head> </head> bit in your header.php file, i'm sure you could run a query something along the lines of... $x = $db->query("SELECT `newmail` from `mail` WHERE `newmail` > 0 "); Just an example i can't remember what the mail tables are at the moment ^ $y = $db->fetch_row($x); $mail = ($y['newmail'] > 0) ? $y['newmail'] : '' ; Something along those lines, then in your <head> tags just insert the php code <head>' . $mail . '</head> or if your head is html / xhtml <head><?php echo ' . $mail . ' ; ?> </head> Quote
VitalEnd Posted October 17, 2010 Author Posted October 17, 2010 Thanks for the code above joshua but i am curious as to why you did this: $y = $db->fetch_row($x); Could you not have just used $x instead of having to use $y to call $x ? By the way im not questioning your work, im not a great coder lol i just want to know why this was done. Quote
Spudinski Posted October 20, 2010 Posted October 20, 2010 If you want to make a real responsive page, you would need to involve some kind of Ajax implementation. If you are familiar with Ajax, it should be quite easy. If not - well, just leave it as it is now because it will be much simpler. TIP: If you are using MCC v2, look at the ajax handler script(don't know what it's called) that the register page uses. Also look into the register script itself to find out how it works. Ultimately you would have to use a timer as well, to refresh the time value at every X interval. Quote
VitalEnd Posted October 21, 2010 Author Posted October 21, 2010 Check out the free modifications section spud, thanks for the post but it got coded already :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.