Live Clock in header

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

Previous topic - Next topic

Joker™

Link to Mod

Live clock in header

This modification helps to show a dynamic clock in the header of your forum, instead of static clock which comes with SMF.

All mod settings are available under
Admin center -> Configuration -> Live Clock Admin

Mod comes with an admin panel which provides following features:
?action=admin;area=liveclock;

- General Features
1. Enable/Disable the mod
2. Choose whether you want to show the timezone drop down or not
3. Use 24/12 hr format clock
4. Show date with time

- Timezone features
1. You can edit the timezone configurations from the following link
action=admin;area=liveclock;sa=displaytimezones

Note - If any of the 2 coloumns is left blank, the mod neglects the value of other column, i.e if you have entered value for 'Timezone Name' only but 'Timezone Difference' hasn't been filled. In that case mod neglects both values.


If you made any error while editing default timezone you can reset all the timezones to default values(which comes with the mod), by clicking 'Reset all timezones' from
Admin center -> Configuration -> Live Clock Admin


Change Log

Version 1.3
- Loading scripts in specific order with specific jquery version
- overhauling of JS with revealing modular pattern
- XHTML fixes
- checks refined with usage of typeof, generic function to check null or undefined
- var scoping in JS
- params init only once
- code optimisation
- Obsolete comment removed
- Using anonymous function concept to invoke the clock class


Version 1.2
- Mod not parsed correctly. Fixed.
- Duplicate entries while populating DB on mod installation. Fixed.


Version 1.1.1
- Mod was unable to carry "Western Europe Time, London, Lisbon, Casablanca" as timezone. Fixed.
- Mod timezone bar unable to load due to jQuery conflict. Fixed.
- Github repo moved back to https://github.com/Joker-SMF/SMF-LiveClockInHeader


Version 1.1
- Option added to show timezone dropdown
- Show date with time
- Bug fixes, JS optimisations and improvements
- Github Repo moved to https://github.com/Joker-SMF/SMF-Mods


GitHub Link

License
* This SMF Modification is subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this SMF modification except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
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

4Kstore


¡¡NEW MOD: Sparkles User Names!!!

Mr. Pedram

My Modifications:
» Loading For SMF
» Buddies Block
» Redirect Links
» Birthdate On Registration
» PM Warning
» Instagram
» Add Table,Td,Tr Button
» Search Topic & Board Button
Browse All...

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

French

Nice modification but does not work in all themes (themes are all suitable for SMF version 2.0.4),error messages during test setup (except for the default theme), see screenshot.



Joker™

Try to install the mod manually by parsing it.

Note - Make backup of files before editing them
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

akbora

When I activate this mod date is off.. Like that:

Before mod: 21.march.2013-18:55

After mod: 18:55 (live)

I want it to show with date. Thanks
SMF 2.0.13
Default Theme
Utf8 Turkish
---------------

Joker™

Quote from: akbora on March 22, 2013, 02:57:28 PM
When I activate this mod date is off.. Like that:

Before mod: 21.march.2013-18:55

After mod: 18:55 (live)

I want it to show with date. Thanks
Ohh yeshh.... We canz do it in nextss versionss :D. Addedzz.

Lol, a bit happy today :).
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

Joker I am getting an error.

246:
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>


Also is there a way I can have the font slightly larger?

Mr. Pedram

Quote from: Old Fossil on April 10, 2013, 08:50:51 PM
Also is there a way I can have the font slightly larger?

Do you try to add a class/id to it?
like this:

<li class="current_time">', $context['current_time'], '</li>


.current_time {
   font-size: a size;
}

My Modifications:
» Loading For SMF
» Buddies Block
» Redirect Links
» Birthdate On Registration
» PM Warning
» Instagram
» Add Table,Td,Tr Button
» Search Topic & Board Button
Browse All...

TheListener

Thanks for the suggestion Mr Pedram but there was no change.

:(

Joker™

Fossil, attach index template here :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


Joker™

The reason I can see for the error is that there is no <ul> tag for the block, as it happens to be in the default theme.

Try the attached file.
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

Sorted thanks bud.

Now hows about adding the date to it?  ;)

Shows an hour slow for me but that I guess is the server.


lurkalot

Quote from: Old Fossil on April 14, 2013, 11:12:27 AM

Shows an hour slow for me but that I guess is the server.


Time on your site is showing correct for me.  Did you forget to roll it forward an hour? (British summertime and all that)  Profile > Look and layout.  (but you already know that) lol.. 

TheListener

Have disabled it temporarily still had an error.

Beggars can't be choosers lol.

By they way Lurky there's a post waiting for ya elsewhere.

:P O:)

Joker™

Quote from: Old Fossil on April 14, 2013, 11:12:27 AM
Sorted thanks bud.

Now hows about adding the date to it?  ;)

Shows an hour slow for me but that I guess is the server.


There can be only 2 reasons for it

- You computer/notebook/mobile/xyz device clock is incorrect
- You have enabled the timezone option in the mod, and as suggested your timezone in site is incorrect
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

Will give it another go Joker.

Er while ya here.

* Old Fossil chains Joker to forum.

Is there a way of making the clock larger?

Or a move to below the unread replies?

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

Advertisement: