UBB.Dev
Posted By: LK [6.7] [beta] You Last Visited Wording - 04/07/2004 2:13 PM
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>~,
Posted By: AllenAyres Re: [6.7] [beta] You Last Visited Wording - 04/07/2004 5:46 PM
cool, thank you smile
Posted By: Gizmo Re: [6.7] [beta] You Last Visited Wording - 04/07/2004 5:52 PM
I was actually looking at your forum this morning and thinking to myself "you know, I'd like to have that" lol...
Posted By: autostream Re: [6.7] [beta] You Last Visited Wording - 05/03/2004 11:18 PM
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
Posted By: Ian Spence Re: [6.7] [beta] You Last Visited Wording - 05/04/2004 1:53 AM
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
Posted By: LK Re: [6.7] [beta] You Last Visited Wording - 05/04/2004 9:39 AM
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.
Posted By: havoq Re: [6.7] [beta] You Last Visited Wording - 05/04/2004 6:27 PM
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
Posted By: Ian Spence Re: [6.7] [beta] You Last Visited Wording - 05/04/2004 6:36 PM
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
Posted By: LK Re: [6.7] [beta] You Last Visited Wording - 05/04/2004 10:59 PM
Oh, I thought you only meant $ULTIMATEBB{""} is the problem.

You're correct Ian, my mistake... 6.4+ is needed.
Posted By: GATOR420 Re: [6.7] [beta] You Last Visited Wording - 05/09/2004 5:32 PM
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...
Posted By: Ian Spence Re: [6.7] [beta] You Last Visited Wording - 05/09/2004 5:36 PM
shouldn't interfere at all
Posted By: GATOR420 Re: [6.7] [beta] You Last Visited Wording - 05/09/2004 6:34 PM
Yep, works no problem. Thanks!
Posted By: twslex Re: [6.7] [beta] You Last Visited Wording - 08/19/2005 10:50 AM
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?
Posted By: Ian Spence Re: [6.7] [beta] You Last Visited Wording - 08/19/2005 10:52 PM
actually, something like

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