Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
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

Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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 ...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
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


Webmaster of d-talk & Kabel-Forum.com
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
Code
###################################################################################
############### DO THIS STEP ONLY IF YOU HAVE NEWS FADER INSTALLED ################
###################################################################################

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

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

GetTime();
wink

Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
Hi Brett,

I have added this code to fader.js!

Can you tell me at which point exactly?

Thanks
d-talk


Webmaster of d-talk & Kabel-Forum.com
Sponsored Links
Joined: May 2001
Posts: 684
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 684
Ups, I forgot to hack vars_wordlets_mods.cgi

Sorry!


Webmaster of d-talk & Kabel-Forum.com
Joined: Apr 2004
Posts: 21
Junior Member
Junior Member
Offline
Joined: Apr 2004
Posts: 21
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!

Joined: Apr 2004
Posts: 21
Junior Member
Junior Member
Offline
Joined: Apr 2004
Posts: 21
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!

Joined: Nov 2003
Posts: 11
Junior Member
Junior Member
Offline
Joined: Nov 2003
Posts: 11
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,


Clay Autery
"More, Better, Faster..."
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
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>';

Sponsored Links
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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

Joined: Dec 2003
Posts: 49
User
User
Offline
Joined: Dec 2003
Posts: 49
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?

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Have you set the offset for the clock in your time settings via the control panel?


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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;
}

Joined: Dec 2003
Posts: 49
User
User
Offline
Joined: Dec 2003
Posts: 49
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!

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
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


-GATOR

"Pain is temporary, Pride is forever"
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
did you set your GMT offset in the CP?

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
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.


-GATOR

"Pain is temporary, Pride is forever"
Joined: Jul 2002
Posts: 42
Member
Member
Offline
Joined: Jul 2002
Posts: 42
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

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2

Joined: Jul 2002
Posts: 42
Member
Member
Offline
Joined: Jul 2002
Posts: 42
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]

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
yes

Joined: Jul 2002
Posts: 42
Member
Member
Offline
Joined: Jul 2002
Posts: 42
Quote
Originally posted by Ian Spence:

yes
Okay thanks. smash

Joined: Jun 2004
Posts: 2
Junior Member
Junior Member
Offline
Joined: Jun 2004
Posts: 2
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.

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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

Joined: Jun 2004
Posts: 2
Junior Member
Junior Member
Offline
Joined: Jun 2004
Posts: 2
Great! Thanks for the help.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)