[DEV] Live time clock

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

[DEV] Live time clock

Post by all4phone » Mon Dec 28, 2015 3:59 am

Extension name: Live Time Clock
Author: all4phone

Description: This extension allows full configuration of format the day, date, year, and clock on index page and replaces static clock with live time clock. 24 or 12 hr format clock dependent on UCP settings ("My date format:" - except Custom...)

Credit: Special thanks goes to dmzx and Sniper_E.

IMPORTANT
This extension is't validated, so as always do not install on a live board!

Version: 0.1.7

Installation:
  1. Copy the entire contents of the repository to ext/all4phone/ltc/
  2. Navigate in the ACP to Customise -> Extension Management -> Extensions.
  3. Click Enable.
screens:
Image
Image

Demo: demo
Download: download
Last edited by all4phone on Thu Aug 18, 2016 5:18 pm, edited 17 times in total.

User avatar
dmzx
Registered User
Posts: 723
Joined: Fri Sep 05, 2014 6:48 am
Location: The Netherlands
Contact:

Re: [RC] Live time clock

Post by dmzx » Mon Dec 28, 2015 7:46 am

Your download has 3 extensions in is this correct?

Image
dmzx-web.net - Need a Host? - Want to Donate

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [RC] Live time clock

Post by all4phone » Mon Dec 28, 2015 1:52 pm

Of course not :)
Thanks for reporting.
Mistake has been corrected ;)

User avatar
dmzx
Registered User
Posts: 723
Joined: Fri Sep 05, 2014 6:48 am
Location: The Netherlands
Contact:

Re: [RC] Live time clock

Post by dmzx » Mon Dec 28, 2015 8:31 pm

If I look at your service.yml I see a class controller where is it in the files?
Also event listener is comment out some code.
And overall_header_head_append.html uses ../

Is this [RC] ?
dmzx-web.net - Need a Host? - Want to Donate

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [RC] Live time clock

Post by all4phone » Mon Dec 28, 2015 9:13 pm

Thanks again dmzx, mentioned files corrected.
dmzx wrote:And overall_header_head_append.html uses ../
At the moment I have no other idea.

travel
Registered User
Posts: 130
Joined: Sun Jan 11, 2015 7:21 pm

Re: [RC] Live time clock

Post by travel » Mon Dec 28, 2015 9:27 pm

Well done. Thanks.
I have checked on my live board.
I think, the "It is currently:" is not necessary. 8-)

User avatar
dmzx
Registered User
Posts: 723
Joined: Fri Sep 05, 2014 6:48 am
Location: The Netherlands
Contact:

Re: [RC] Live time clock

Post by dmzx » Mon Dec 28, 2015 9:28 pm

js in footer overall_footer_after.html like

Code: Select all

<!-- INCLUDEJS @all4phone_ltc/js/en/ltc_short_days_short_month.js -->
<!-- INCLUDEJS @all4phone_ltc/js/en/ltc_clock_12.js -->
And css in overall_header_head_append.html like:

Code: Select all

<!-- INCLUDECSS @all4phone_ltc/ltc.css -->
dmzx-web.net - Need a Host? - Want to Donate

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [RC] Live time clock

Post by all4phone » Mon Dec 28, 2015 10:21 pm

@travel, thanks.
travel wrote:I have checked on my live board.
This can be dangerous, be careful!
all4phone wrote:IMPORTANT
This extension is't validated, so as always do not install on a live board!
travel wrote:I think, the "It is currently:" is not necessary. 8-)
I decided to leave it, becouse it exists also when the extension is disabled ;)

@dmzx, you are master, works perfectly, your help is greatly appreciated :)

ThePowersThatBe
Registered User
Posts: 7
Joined: Sat Nov 23, 2013 10:08 pm

Re: [RC] Live time clock

Post by ThePowersThatBe » Fri Apr 15, 2016 3:25 am

Is it possible to edit this extension to use the server time instead of using the time from the user's computer? I have a forum where users post auctions with a set end time and the time stamp on posts is used to determine whether or not a bid is valid. They would like to have a live clock available to time their bidding/posting, but it would have to use server time instead of their individual computer time to be in sync with the time stamps on posts.

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [RC] Live time clock

Post by all4phone » Mon Jun 13, 2016 7:40 pm

Sorry, so late.
Yes, it's possible. If you're still interested, check out this clock please: clock
For me works well.

User avatar
zardos
Registered User
Posts: 113
Joined: Mon Feb 29, 2016 12:23 pm
Location: England, uk

Re: [RC] Live time clock

Post by zardos » Tue Jun 14, 2016 5:34 pm

Nice work, thankyou

ThePowersThatBe
Registered User
Posts: 7
Joined: Sat Nov 23, 2013 10:08 pm

Re: [RC] Live time clock

Post by ThePowersThatBe » Tue Jun 14, 2016 5:50 pm

all4phone wrote:Sorry, so late.
Yes, it's possible. If you're still interested, check out this clock please: clock
For me works well.
Yes, that would be great! What do I change in the extension files to use server time?

Thanks!

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [RC] Live time clock

Post by all4phone » Tue Jun 14, 2016 5:57 pm

You should change js code of clock. I'll give you some when I'll be back home. Wait few hours please.

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [DEV] Live time clock

Post by all4phone » Tue Jun 14, 2016 8:38 pm

@ThePowersThatBe, create a new file (ie. clock.php) in the root/ directory:

Code: Select all

<script type="text/javascript">
var offset = Math.round(new Date().getTime() / 1000);

function GetClock(){
	var d=new Date();
	d.setSeconds(d.getSeconds() + <?php echo time(); ?> - offset);
	var hour=d.getHours(),min=d.getMinutes(),sec=d.getSeconds();
		if(min<=9) min="0"+min;
		if(sec<=9) sec="0"+sec;
	document.getElementById('clock').innerHTML=""+hour+":"+min+":"+sec+"";
}
	window.onload=function(){
	GetClock();
	setInterval(GetClock,1000);
}
</script>
Then open ext/all4phone/ltc/styles/prosilver/template/js/en/ltc_clock_12.js file and replace all of the code on:

Code: Select all

$.ajax({
        type: "POST",
        data:"",
        url: "clock.php",
        success: function(result){
                $("#clock").html(result);
            }
        });
Check it out please, should work.

Please remember that my extension doesn't work like that and I will not continue it that way.
Last edited by all4phone on Thu Jun 16, 2016 6:26 am, edited 1 time in total.

User avatar
all4phone
Registered User
Posts: 593
Joined: Fri Mar 18, 2011 11:56 am
Location: Poland
Name: Piotr
Contact:

Re: [DEV] Live time clock

Post by all4phone » Wed Jun 15, 2016 11:07 pm

dmzx wrote: Is this [RC] ?
That's right, better change to DEV. I will develop this extension. I'll add a few more options soon.

Now available v 0.1.0:
- ACP added
- possibility change color of day, date and clock
- two options of clock (12/24)

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: No registered users and 18 guests