Live Clock in header

Started by Joker™, March 15, 2013, 09:59:36 AM

Previous topic - Next topic

GL700Wing

Quote from: Joker™ on June 09, 2013, 10:27:51 AM
Forbidden

You don't have permission to access /forum5 on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Should be OK now (access problem caused by combination of using .htaccess to block IPs of known spammers/hackers and your IP address being in a blocked IP range in India).

As an aside I also get lots of '8: Undefined index: lc_ajax_in_progress' messages in the error log but this message doesn't get generated every time I load the main page - probably only about half the time.  The workaround for this is to either add the text string for 'lc_ajax_in_progress' to the relevant 'index' language file (eg, index.english.php) or to load the 'LiveClock' language file in index.template.php (I've gone for the second option).
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Well this problem is getting curiouser and curiouser ...

I've just discovered that the clock works properly (ie, the time updates and the drop-down list is populated) when I'm viewing my profile, personal messages or a topic.

However it doesn't work (ie, the time does not update and the drop-down list is empty) the rest of the time.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Joker™

Well the issue is simple, jQuery is getting loaded after LiveClock.js is loaded.

LiveClock.js make usage of jQuery and as jQuery instance is not there, hence LiveClock.js falls into error.

Also it seems like some other mod is also loading jquery which is even further delaying the load of jQuery. Will try to fix the issue and roll out a new version. Lets hope your issue will be solved in the upcoming version :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

To GL700Wing,

Go to Sources folder and make backup of LiveClock.php.

After making the backup, place the attached file "LiveClock.php" in Sources(replace :P) and see if it resolves the issue.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

GL700Wing

Quote from: Joker™ on June 12, 2013, 09:59:14 AM
.. place the attached file "LiveClock.php" in Sources and see if it resolves the issue.
Done and no change ... :(
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Quote from: GL700Wing on June 12, 2013, 06:04:57 PM
Done and no change ... :(
After searching through all the './Sources/' files for 'jQuery' calls and uninstalling the relevant packages I finally found the mod that's breaking Live Clock - it's BBC User Info V2.  After uninstalling that mod the Live Clock started working perfectly (ie, the time updates and the timezone drop-down list is populated).  Weird thing is I didn't think that mod would come into play until a message in which that BB code has been used is displayed or one of the message/PM editors is open (showing my complete Java scripting ignorance here).

I still get lots of '8: Undefined index: lc_ajax_in_progress' messages in the error log if the language file isn't explicitly loaded in the index.template.php file so I've let that fix in place.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Joker™

Quote from: GL700Wing on June 15, 2013, 08:03:37 AM
Quote from: GL700Wing on June 12, 2013, 06:04:57 PM
Done and no change ... :(
After searching through all the './Sources/' files for 'jQuery' calls and uninstalling the relevant packages I finally found the mod that's breaking Live Clock - it's BBC User Info V2.  After uninstalling that mod the Live Clock started working perfectly (ie, the time updates and the timezone drop-down list is populated).  Weird thing is I didn't think that mod would come into play until a message in which that BB code has been used is displayed or one of the message/PM editors is open (showing my complete Java scripting ignorance here).

I still get lots of '8: Undefined index: lc_ajax_in_progress' messages in the error log if the language file isn't explicitly loaded in the index.template.php file so I've let that fix in place.
Wow. Joker claps for 'GL700Wing' for such a great debugging.

First of all I really want to thank you, for trimming down the issue for me as most of the times its just a single handed battle for mod authors.

I'll be installing the mod you have mentioned and will try to replicate the issue. Also very soon I'll be rolling out an upgrade having various fixes.

Thanks once again :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

I hope this version resolved our issues :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

GL700Wing

Quote from: Joker™ on June 18, 2013, 09:59:10 AM
Wow. Joker claps for 'GL700Wing' for such a great debugging.

First of all I really want to thank you, for trimming down the issue for me as most of the times its just a single handed battle for mod authors.

I'll be installing the mod you have mentioned and will try to replicate the issue. Also very soon I'll be rolling out an upgrade having various fixes.

Thanks once again :).
You're welcome - I'm a Unix sys admin and I kinda enjoy troubleshooting and bug fixing.


Quote from: Joker™ on June 18, 2013, 10:32:32 AM
I hope this version resolved our issues :).
A few issues ... :(
1.  There is a problem with the new package file you created that prevents the package from being uploaded or parsed (it contains a folder with a different name to the mod - after extracting/zipping it to the correct name I was able to upload and install the new version);
2.  After uninstalling the previous version and installing the new version the list of 'Different TimeZones' is duplicated and you have to select the 'Reset Timezones' option to remove the duplicates; and
3.  Using 'Reset Timezones' removes the option for 'Western Europe Time, London, Lisbon, Casablanca' (which has an offset of 0) from the list (see LC_TZ-Default.jpg).  My workaround for this is to prefix each list option with the UTC offset (see LC_TZ-Fixed.jpg).

On the upside I don't get any language file related errors since installing the update. :)
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Joker™

Quote from: GL700Wing on June 19, 2013, 06:04:24 AM
1.  There is a problem with the new package file you created that prevents the package from being uploaded or parsed (it contains a folder with a different name to the mod - after extracting/zipping it to the correct name I was able to upload and install the new version);
2.  After uninstalling the previous version and installing the new version the list of 'Different TimeZones' is duplicated and you have to select the 'Reset Timezones' option to remove the duplicates; and
3.  Using 'Reset Timezones' removes the option for 'Western Europe Time, London, Lisbon, Casablanca' (which has an offset of 0) from the list (see LC_TZ-Default.jpg).  My workaround for this is to prefix each list option with the UTC offset (see LC_TZ-Fixed.jpg).

On the upside I don't get any language file related errors since installing the update. :)
1st issue known and fixed.
2nd issue fixed.
Unable to replicate 3rd. Can you tell me exact STR for 3rd issue so that I can roll out the new version.

Thanks for the debugging once again :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

GL700Wing

QuoteUnable to replicate 3rd.
Hmm - definitely saw this problem with the previous release and thought it was also happening with most recent release but now I can't reproduce it ...
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Joker™

Hehehe, Jokerzz placed his spell on the code :P.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

cap269

Great mod, Joker, but for some reason it doesn't work on my forum for non-logged-on users (eg. a guest browsing)

Joker™

Quote from: cap269 on July 14, 2013, 04:23:58 AM
Great mod, Joker, but for some reason it doesn't work on my forum for non-logged-on users (eg. a guest browsing)
It'd be more helpful if you can provide me the site link :). Also you must be having a custom theme, if so please provide the theme name also.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

cap269

Thanks for your quick reply; I apologize for leaving out those details. The site is using the Blackstorm theme from HostX. Other mods installed are: SimplePortal, EmailValidator, GamerIDs, and Mibbit Ajax IRC Chat Mod.  I PM'd the site link to you, as the site isn't public yet.

Joker™

Quote from: cap269 on July 14, 2013, 06:25:06 PM
Thanks for your quick reply; I apologize for leaving out those details. The site is using the Blackstorm theme from HostX. Other mods installed are: SimplePortal, EmailValidator, GamerIDs, and Mibbit Ajax IRC Chat Mod.  I PM'd the site link to you, as the site isn't public yet.
Just loaded your forum and these were the following errors

- No images for me :(
- Opened chrome's debugger and saw this error
Uncaught ReferenceError: $ is not defined

Issue is you are trying to activate 'noConflict' mode of jQuery even before it is loaded. Try to move it inside on document.ready or something of your liking.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

cap269

Ok, that code was in a misbehaving block. I have de-activated the offender for now, please try again.

Joker™

The theme you are using, has 2 separate blocks of code to show clock to user:

1.  For logged in user,
2. For guests.

Make sure you have edited both of the instances in index.template.php

Code (Around line 190) Select
<li>', $context['current_time'],'</li>

Code (Around line 206) Select
</form>', $context['current_time'],'<br />';
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

revwill

Hello Joker,

I have been in and out of the hospital and many more visits for the future but had time to look at my site and seen you had this now with a mod.  Installed it and everything works fine except when I try to view the page with IE8 upgraded from IE6.  It just gets stuck on Loading and a blank pull down menu.  When I load it in Chrome or Firefox all runs well.  Nice Mod.  One small other thing.  If in US, wish we had some time zones for our silly Daylight savings time besides for Hawaii and Arizona.  Those 2 states do not participate in Daylight savings time.

Any help to get it working with IE8 would be great.

William

Thanks again Joker!

Joker™

Quote from: revwill on July 30, 2013, 01:19:06 AM
Hello Joker,

I have been in and out of the hospital and many more visits for the future but had time to look at my site and seen you had this now with a mod.  Installed it and everything works fine except when I try to view the page with IE8 upgraded from IE6.  It just gets stuck on Loading and a blank pull down menu.  When I load it in Chrome or Firefox all runs well.  Nice Mod.  One small other thing.  If in US, wish we had some time zones for our silly Daylight savings time besides for Hawaii and Arizona.  Those 2 states do not participate in Daylight savings time.

Any help to get it working with IE8 would be great.

William

Thanks again Joker!
First of all, I hope you get well real soon.

Coming back to the things you pointed out, personally I hate IE more than anything on web, but I'll try to get my head around it. I don't have a real IE(mac), so I'll be trying to emulate safari to user-agent of IE.

For daylight savings, can you provide me the timezone and names of those 2 states.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: