Live Clock in header

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

Previous topic - Next topic

TheListener

In me sig ya lazy lump,

:P

www.miltonkeynescommforum.info

* Old Fossil looks for fatman I mean batman

Joker™

Hey fatty, send me a test account too, so that i can look at hot clock in live action :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

TheListener

247: if (!empty($modSettings['lc_mod_enable'])) {
248: if(function_exists('LC_mainIndex')) {
249: LC_mainIndex();
250: }
251: echo '
==>252: <li id="live_clock">', $txt['LC_loading'],'</li>
253: <select id="live_clock_timezone_options" onChange="liveClock.onTimezoneChange(this.value)"></select>';
254: echo '
255: </ul>';
256: } else {
257: echo '
258: <li>', $context['current_time'], '</li>
259: </ul>';
260: }


This is the section of code in the error.

Time is correct now though :)

QuoteHey fatty,
OI I wasn't calling you fat ya nana.  :)

Will send ya a test account via pm.

Joker™

Few issues:

1. Ok the clock is not running for me.
2. Clock is showing incorrect time for me.
3. I saw a JS error in console saying
QuoteGET tapatalkdetect.js
couldn't be loaded.

Also, try the attached file, the clock should be beneath the unread replies block.
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

GZ06

Good mod, Joker.
Should be such clock by default in smf.

One question: how can I remove drop down menu with time zones on header? I think this is not such necessary for me, unless it's correcting from profiles.

Thnaks.
Georgia and Ukraine -FOREVER!

TheListener

Quote from: GZ06 on May 18, 2013, 01:21:56 AM
Good mod, Joker.
Should be such clock by default in smf.

One question: how can I remove drop down menu with time zones on header? I think this is not such necessary for me, unless it's correcting from profiles.

Thnaks.

The dropdown was causiing errors in my forum.

I managed to solve it by using the original code in the Tips and tricks board.

Let me know if you want it and I'll post it here.

(Joker's scared of my fryingpan).

:D

GZ06

Quote from: Old Fossil on May 18, 2013, 01:24:51 AM
Quote from: GZ06 on May 18, 2013, 01:21:56 AM
Good mod, Joker.
Should be such clock by default in smf.

One question: how can I remove drop down menu with time zones on header? I think this is not such necessary for me, unless it's correcting from profiles.

Thnaks.

The dropdown was causiing errors in my forum.

I managed to solve it by using the original code in the Tips and tricks board.

Let me know if you want it and I'll post it here.

(Joker's scared of my fryingpan).

:D

yes, sure. it's interesting.
Georgia and Ukraine -FOREVER!

TheListener

open themes\default\index.template.php
Find:

    echo '
<li>', $context['current_time'], '</li>
</ul>';



Replace with:

echo '

<li>',timeformat(time(),'%B, %d, %Y'), '
<li id="clock">Loading...</li>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=h + ":" + m + ":" + s + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
// ]]></script>
</li></ul>';

GZ06

Thanks.
code has been replaced but same drop down with time zones menu is presenting on page.
Have any idea how to remove such menu?
Thanks again.
Georgia and Ukraine -FOREVER!

Joker™

Quote from: Old Fossil on May 18, 2013, 01:24:51 AM
Quote from: GZ06 on May 18, 2013, 01:21:56 AM
Good mod, Joker.
Should be such clock by default in smf.

One question: how can I remove drop down menu with time zones on header? I think this is not such necessary for me, unless it's correcting from profiles.

Thnaks.

The dropdown was causiing errors in my forum.

I managed to solve it by using the original code in the Tips and tricks board.

Let me know if you want it and I'll post it here.

(Joker's scared of my fryingpan).

:D
I'll be trying my best to figure out the issue with the dropdown and making it an admin choice dropdown.

Moreover can you guys point out the exact issue with the dropdown and suggestion about how we can make this mod more efficient ;).
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

GZ06

would be good if we will have option in admin panel to remove drop down menu from page. Really excess, at least for me. To choose time zone in profile is enough. Overload the view of page with drop down causes some dissonance in design of appearance 
Georgia and Ukraine -FOREVER!

Joker™

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

yutcu

#32
By this time I would like to set my language is normally the first day after month after year. But here the day after the first month of the year after the correction setting is there also that month, another language?

After using the system tray clock live
May 26, 2013, 21:37:05

before using
26 Mayıs, 2013 21:37:05

Can you fix it? thanks

akbora

In our country We use time format is Date/Month/years. Your format is Month/date/years. How can we change it? Thanks
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Joker™

I'll try to update the mod with a feature through which admins can change the date string as they like :).
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

GZ06

Quote from: Joker™ on May 26, 2013, 05:59:29 AM
Checkout the new version ;)

OK, but looks small bug appear. If no "Drop down menu" clock not works. Just as usual by default in smf. If "Drop down menu" presenting on page -clock also work.   

======

Just updating info: after several turning On/Off "Show Timezone dropdown", it's started to work. 
Georgia and Ukraine -FOREVER!

Joker™

Well I can only fix those bugs, which I can replicate.

It'd be more helpful that if you guys come across certain bug, post a link to your forum and provide a test account :).
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

#37
Quote from: Joker™ on May 29, 2013, 09:28:20 AM
It'd be more helpful that if you guys come across certain bug, post a link to your forum and provide a test account :).
This mod installed without any errors on two SMF 2.0.4 forums with different results:
. the first forum has only a few mods installed and the clock works perfectly.  :)
. the second forum has lots of mods installed and the clock doesn't work at all (the time does not update and the drop-down list is empty).  :(

Login details for test account on second forum:
Forum:  http://australiancx.asn.au/forum5
Login:  SMFTest
Password:  09-June-2013

TIA


Update #1:  If I disable the timezone list drop-down the time starts updating.  ???
Update #2:  If I use the code from here I get a clock that updates the time and a drop down list that isn't empty. :)
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

uklocksport

Just installed live clock, and its showing fine, works on all time zones i choose.

but it reverts back to "Brussels, Copenhagen, Madrid, Paris"

when ever i choose "Western Europe Time, London, Lisbon, Casablanca"

any ideas please,

Joker™

Quote from: GL700Wing on June 08, 2013, 08:29:51 PM
Quote from: Joker™ on May 29, 2013, 09:28:20 AM
It'd be more helpful that if you guys come across certain bug, post a link to your forum and provide a test account :).
This mod installed without any errors on two SMF 2.0.4 forums with different results:
. the first forum has only a few mods installed and the clock works perfectly.  :)
. the second forum has lots of mods installed and the clock doesn't work at all (the time does not update and the drop-down list is empty).  :(

Login details for test account on second forum:
Forum:  http://australiancx.asn.au/forum5
Login:  SMFTest
Password:  09-June-2013

TIA


Update #1:  If I disable the timezone list drop-down the time starts updating.  ???
Update #2:  If I use the code from here I get a clock that updates the time and a drop down list that isn't empty. :)

QuoteForbidden

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.



Quote from: pickwizard on June 09, 2013, 07:22:24 AM
Just installed live clock, and its showing fine, works on all time zones i choose.

but it reverts back to "Brussels, Copenhagen, Madrid, Paris"

when ever i choose "Western Europe Time, London, Lisbon, Casablanca"

any ideas please,
I'd say an awesome catch. Got the issue and fixed it on github. I'll be releasing an new issue as soon as I can trim down the issue 'GL700Wing' is facing :).
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: