UBB.Dev
Posted By: Brett [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 2:05 PM
Modification Name: UBB.Classic Thinking Clock

Author(s): Brett

Description: Shows a ticking clock with both UBB and local time.


Demo:

Requirements: UBB 6.7.0, Mod Wordlets

Download Link: https://www.ubbdev.com/ubb/upload/00006378/clock.txt

Credits: LK

Shoutout: Gizzy

Demo: http://www.pavioni.com/ubb/ultimatebb.php

Too see when logged in:
login: ubbtest
passw: test
Posted By: Gizmo Re: [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 2:06 PM
woot wink ... Very nice wink ... I won't be installing anymore mod's till 6.7.1 but this will definately be my first wink ...
Posted By: d-talk Re: [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 3:16 PM
Hi Brett,

I installed this mod a few minutes ago, but i can not see any time....

http://www.d-talk.tv/cgi-bin/ultimatebb.cgi
Posted By: Brett Re: [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 3:35 PM
Code
###################################################################################
############### DO THIS STEP ONLY IF YOU HAVE NEWS FADER INSTALLED ################
###################################################################################

*****************
* Open fader.js *
*****************

add in at very bottom:
======================

GetTime();
wink
Posted By: d-talk Re: [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 4:16 PM
Hi Brett,

I have added this code to fader.js!

Can you tell me at which point exactly?

Thanks
d-talk
Posted By: d-talk Re: [6.7] [beta] UBB.Classic Thinking Clock - 03/31/2004 5:21 PM
Ups, I forgot to hack vars_wordlets_mods.cgi

Sorry!
I just added this hack and I am not getting any time to show up. I do not have news fader installed and I did reset my time settings and cleared my cache. Any suggestion are appreciated.

http://www.firearmforums.com/cgi/ultimatebb.cgi

Thanks!
Nevermind ... I miss read the last line of the install and chose not to add the code even though I am not running News Fader. I got it all squared away.

Thanks!
Posted By: Clay Autery Re: [6.7] [beta] UBB.Classic Thinking Clock - 04/20/2004 10:04 PM
Nice Hack! But I have some questions/suggestions:

The clock appears in the table under the User/Logout status.... but only on the Forum Summary.

Why not make it consistently appear there everywhere? I dropped the "Subscribed Topics" link right below the username/login stat line stuff in public_common whick makes those two functions always available...

Seems to me, that if the clock is going to be right under another piece of "always available" info/function, that it should be there all the time. Just a thought...

[b]Look at my board if you like...[/b]

I've looked at it myself, but I'm not smart enough to make it work... yet. I know that you'd need to remove the changes from public_forum_summary.pl and apply changes to public_common.pl. duh... wink But I rapidly get lost in how some of the code works, etc.

Some additional things are:

If you move the clock to public_common.pl AND you have News Fader, you are going to have to make some kind of change to the "Get Time()" line added to fader.js...

It'd need to be removed from fader.js and put somewhere else... common? (unless you put the fader in common, which is probably not the best solution....)

Now, in my situation, it gets more complicated...

a) I want the clock to be common under the User/login/pm stuff on every page (public_common.pl), but

b) I want the Fader to appear on the Forun Summary page and each Forum Overview (public-form_summary.pl and public_form.pl, but not on topic view (public_topic.pl)...

A lot of my users enter the site directly to a Forum and not by the Forum Summary...

In any event, I want to make the clock common and the fader appear at Summary and Forum levels...

The only reason I bring up the Fader stuff is because the clock hack has a dependency consideration in it re: News Fader.

Thanks,
Posted By: Brett Re: [6.7] [beta] UBB.Classic Thinking Clock - 04/23/2004 12:27 PM
The clock hack has no dependency on the news fader? They can be installed with or without each other, not sure if i completely understand you there.

Anyhow, the reason that it isn't added to any other except for the forum summary is because most other pages have a one lined login table, so adding it in there would stretch it down. However, if you want to do this, i would suggest the following.

In public_forum_summary

remove both lines dealing with $hf->[0] =~


In public_common.pl

find:
Code
if($vars_registration{SuspendRegister} eq "true") {
add above.

Code
$show_logout .= '
<span id="clock"></span>';
$show_logout_noreg .= '
<span id="clock"></span>';
Posted By: Ian Spence Re: [6.7] [beta] UBB.Classic Thinking Clock - 04/23/2004 10:01 PM
Clay, may I suggest you change your copyright text color to black (or another dark color).

It's light gray on white when I see it
My users are bit...er complaining smile about the fact that (for "Current Time" at least) it displays Noon as 12 AM and Midnight as 00 AM.

How can I fix this?
Posted By: Gizmo Re: [6.7] [beta] UBB.Classic Thinking Clock - 05/03/2004 4:58 PM
Have you set the offset for the clock in your time settings via the control panel?
untested, but give this a shot.

change

Code
	if ("$vars_time{TimeFormat}" == "AMPM") {
ampm = hourzz > 12 ? " PM" : " AM";
hourzz = (hourzz > 12) ? hourzz - 12 : hourzz;
}
to

Code
	if ("$vars_time{TimeFormat}" == "AMPM") {
ampm = hourzz >= 12 ? " PM" : " AM";
hourzz = (hourzz > 12) ? hourzz - 12 : hourzz;
hourzz = (hourzz == 0) ? 12 : hourzz;
}
Quote
Originally posted by Gizzy:

Have you set the offset for the clock in your time settings via the control panel?



Yup!

Originally posted by Ian Spence:
[qb]
untested, but give this a shot.
[/qb]
That worked perfectly ! thumbsup

Thanks!
Posted By: GATOR420 Re: [6.7] [beta] UBB.Classic Thinking Clock - 05/07/2004 4:18 PM
OK, I have no idea what the problem is here at all but after reviewing it for the 20th time, ultimatebb.php seem to be causing a syntax error and then I get object expected errors from fader.js. (Of course, I really have no idea what I'm doing so don't go by my judgement.) Help please? smile

Here is a link to the test board...

http://www.reactek.com:911/cgi/ultimatebb.cgi
Posted By: Ian Spence Re: [6.7] [beta] UBB.Classic Thinking Clock - 05/07/2004 10:14 PM
did you set your GMT offset in the CP?
Posted By: GATOR420 Re: [6.7] [beta] UBB.Classic Thinking Clock - 05/08/2004 1:27 AM
Quote
Originally posted by Ian Spence:

did you set your GMT offset in the CP?
Holy crap... Ian and LK are my heroes. You rock man! Thanks so much.
Odd glitch. The thinking clock works fine except at 12pm and 12am.

12pm shows as 12am until 1pm when it corrects itself to pm.

12am shows up as military time of 00:00am which isn't really a problem but I was wondering if that's what it's supposed to do.

So the only area that's a problem is the noon hour showing up as AM for that one hour. confused

Thanks for any help. smash
https://www.ubbdev.com/ubb/ultimatebb.php/topic/33/152.html#000013

Some sexy beast posted that solution
Thanks IAN I did see that, but I guess I must have goofed it. shocked

Quote
Originally posted by Ian Spence:

untested, but give this a shot.

change

Code
	if ("$vars_time{TimeFormat}" == "AMPM") {
ampm = hourzz > 12 ? " PM" : " AM";
hourzz = (hourzz > 12) ? hourzz - 12 : hourzz;
}
to

Code
	if ("$vars_time{TimeFormat}" == "AMPM") {
ampm = hourzz >= 12 ? " PM" : " AM";
hourzz = (hourzz > 12) ? hourzz - 12 : hourzz;
hourzz = (hourzz == 0) ? 12 : hourzz;
}

The code

Code
	if ("$vars_time{TimeFormat}" == "AMPM") {
ampm = hourzz > 12 ? " PM" : " AM";
hourzz = (hourzz > 12) ? hourzz - 12 : hourzz;
}
Appears twice in the public_forum_summary.pl file, so do I change it for both instances? [Linked Image]
yes
Posted By: The Finman Re: [6.7] [beta] UBB.Classic Thinking Clock - 05/26/2004 10:11 PM
Quote
Originally posted by Ian Spence:

yes
Okay thanks. smash
Posted By: AdamKM Re: [6.7] [beta] UBB.Classic Thinking Clock - 06/21/2004 11:38 PM
Hey guys, I need help please. I am trying to install this mod on version 6.7.0 and I am running into difficulty. I was reading the clock.txt file and it stated that I needed Mod Wordlets and to go to http://www.multihack.com/lk/download.cgi?f=mods.zip to get it. That link doesn't exist but I managed to find mods.zip in another forum on here (https://www.ubbdev.com/ubb/ultimatebb.php/topic/20/506.html).

Now when I am trying to install MOD Wordlets it asks me to modify cp_wordlets.cgi and cp_common.pl. These two files don't exist, and the cp2_wordlets.cgi and cp2_common.pl don't have the code it's looking to modify. So at this point I am kinda lost. Any help would be greatly appreciated. Thanks.
Posted By: Ian Spence Re: [6.7] [beta] UBB.Classic Thinking Clock - 06/21/2004 11:52 PM
https://www.ubbdev.com/ubb/ultimatebb.php/topic/33/71.html

you were using the wrong version. use the one in the page I just linked you to
Posted By: AdamKM Re: [6.7] [beta] UBB.Classic Thinking Clock - 06/22/2004 12:10 AM
Great! Thanks for the help.
© UBB.Developers