Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Modification Name: You Last Visited Wording

Author(s): LK

Description: This is a very simple modification, which tells the users the last time they had visited your board in Forum Summary, under "Hello, X", according to their cookie. It also welcomes the new users, who don't have any cookie, and it links to the Update Post Indicators page. Uses your TimeZone setting.
The only reason it's not finished is because it isn't Wordletized.

Demo: http://www.lkworld.com

Requirements: UBB.classic 6.7.0+

Credits: Charles Capps for making this up @ "Flave"

Open public_forum_summary.pl.
Find:
Code
		navbar_replace_right => qq~<b>$memberline</b>~,
Add below:
Code
		navbar_under_left => qq~
<script type="text/javascript">
var atime = unescape(session_dt);
if (atime != "NEW") {
var btime = atime.split("-");
btime[0] = Math.round(btime[0]);
btime[0]--;
var ctime = btime[2].split(" ");
dtime = ctime[1].split(":");
dtime[0] = Math.round(dtime[0]);
if (ctime[2] == "PM" && dtime[0] < 12) {
dtime[0] += 12;
} else if (ctime[2] == "AM" && dtime[0] == 12) {
dtime[0] = 0;
}
document.write('You last visited: <b>'+timestamp(new Date(ctime[0],btime[0],btime[1],
dtime[0],dtime[1],0),dfrm,tfrm,0,0,0,0)+
'  [<a href="$ULTIMATEBB{"ubb=markallread"}">Update Post Indicators</a>]</b>');
} else {
document.write('Welcome to '+unescape('~.UBBCGI::escape($vars_config{BBName}).
qq~')+'!<b>  [<a href="$ULTIMATEBB{"ubb=markallread"}">Update Post Indicators</a>]</b>');
}
</script>~,

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
cool, thank you smile


- Allen wavey
- What Drives You?
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
I was actually looking at your forum this morning and thinking to myself "you know, I'd like to have that" lol...


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: 55
Member
Member
Offline
Joined: May 2001
Posts: 55
hey i thought i could use this on 6.3.1.1
by just putting it after:
Quote
quote:
$show_logout
but nothing really happened....?
Should pretty similar, anyone know what is different?
thanks
scott

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
all of the links wouldn't work. Neither would the timestamps.

Also, there's a small possibility your frames could be a problem.


That and it's not even in the source code. There's pretty much no way this would work on anything lower than 6.4 smile

Sponsored Links
Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
I think it should work on 6.0+, if you put it under $show_logout and without the navbar_under_left => qq~ and ~, parts.

Make sure you clear cache, and also I don't know if you put it on the correct show_logout place, I don't have a 6.3.1.1 forum active but maybe there is more than one $show_logout in public_forum_summary.

Joined: Sep 2001
Posts: 672
Member
Member
Offline
Joined: Sep 2001
Posts: 672
Naw I've tried it as well, and can't get it to work on my forums. Took out everything u said LK, before u even posted this. Cleared cache. Has to do with the javascript code, timestamp maybe

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
it has to do with what I said. I know what I'm talking about. timestamp was added in 6.4. ULTIMATEBB{"***"} was added in 6.7

Joined: Mar 2001
Posts: 7,394
LK
Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Oh, I thought you only meant $ULTIMATEBB{""} is the problem.

You're correct Ian, my mistake... 6.4+ is needed.

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
Does this have any problems with the Thinking Clock already installed? It looks like it would take up the space where I have the clock already...


-GATOR

"Pain is temporary, Pride is forever"
Sponsored Links
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
shouldn't interfere at all

Joined: Jan 2003
Posts: 118
Member
Member
Offline
Joined: Jan 2003
Posts: 118
Yep, works no problem. Thanks!


-GATOR

"Pain is temporary, Pride is forever"
Joined: Jun 2002
Posts: 111
Member
Member
Offline
Joined: Jun 2002
Posts: 111
Hiya,

I'm getting debug errors on this script.

And i think i know what is wrong:

Code
if (atime != "NEW") {
should have been:
Code
if (atime != "NEW" && atime != "0") {
What do u think?

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

Code
if( atime.search(/d{2}/) != -1 ) {
would be simpler. You make sure it isn't NEW, or 0, so anything


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)