Equinox Posted October 16, 2010 Posted October 16, 2010 This mod wasn't made by me, I'm posting it for Danny969. This mod was a request, here: http://makewebgames.io/board800/33892-javascript-counters/ And here is the code: Upload ajax_caller.php to your public_html: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. In header find: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And add after: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Djkanna Posted October 16, 2010 Posted October 16, 2010 Honestly if you don't already use jQuery in your site, you'd be best just doing the Ajax request with raw JS nonetheless good job Danny :) Quote
VitalEnd Posted October 16, 2010 Posted October 16, 2010 Ah awesome, requested this yester, thank you :) What would i put in the count section on the mainmenu then ? instead of Events ({$ec}) Quote
Swift-Fusion || Fusion Posted October 16, 2010 Posted October 16, 2010 Danny has asked me to post this: Events (<span id='events'>0</span>) Mailbox (<span id='mail'>0</span>) Hospital (<span id='hospital'>0</span>) Jail (<span id='jail'>0</span>) Quote
aburdet Posted November 15, 2010 Posted November 15, 2010 Very well done, indeed =) I used this on my site and all works great, but I went one step further and tried using it for the status bars (Energy, Brave, Will, etc.) and I can't seem to figure out how to update the variable for the bars width, I can only get it to update the echoed text. If it says "Energy: 12/12 (100%)", I can get those numbers to change just fine, but I obviously can't put You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. as the width attribute for the image... Sorry for the rambling, I'm trying to type while keeping my two year old from putting in his two cents and slamming on the keyboard lol. Quote
Danny696 Posted November 15, 2010 Posted November 15, 2010 Umm, you'll have to change the image source. i may try this, but thay'll be tommorow. Quote
aburdet Posted November 16, 2010 Posted November 16, 2010 I actually have a variable for the image source since users can customize the bars, so mine is somewhat of a different scenario. I'll play around with it a bit and see if I can come up with a solution that may work for everyone. I can almost guarantee you it won't be the prettiest looking code if I do get around to it though. Quote
aburdet Posted November 16, 2010 Posted November 16, 2010 Ok, the main problem I'm having so far is a compatibility issue with FF. FireFox tends to show a fade out and fade in transition upon reloading the data, while Internet Explorer does not. This isn't such an issue if you set the interval to 60000 or so, but that seems too slow to me for my intentions. The odd thing is, it only does that SOMETIMES. [align=center]Energy: 75% (9/12) [/align] If I set the entire above example as the portion to be updated, the entire thing flickers/fades/whatever you want to call it every 5 seconds (or whatever your interval is set to). But if I only set the numbers (9/12, or the percent value), then it doesn't show any fade during transition. This code works fine: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. This makes the entire thing flicker: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
kiat87 Posted December 24, 2010 Posted December 24, 2010 any idea how to fix the images flicker/fade problem yet? Quote
Sethenor2 Posted January 21, 2011 Posted January 21, 2011 Where does this go? This code works fine: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. This makes the entire thing flicker: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Danny696 Posted January 22, 2011 Posted January 22, 2011 When ever i used it it was fine, and games ive seen. Otherwise i wouldnt use this as it takes up more querys that mwg..... 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.