Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Time last build took place in a tag

Quote Reply
Time last build took place in a tag
I'd like to be able to show my editors the time the last build took place, just like I see when I do a build changed:

Building HTML Pages: Building Links Changed Since 2002-05-10 18:16:48

Is there a tag for this I can use to put into browser_info.html?




http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
In the globals, you should see one called 'time'. At the moment it just prints the current time, but could easily be changed to print the day/month/year also. Then when you do a rebuild that global will be put into the templates Wink

Hope that helps

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] Time last build took place in a tag In reply to
But the editor pages aren't built they are dynamic Tongue
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
Whoops...misread Wink Sorry.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
I guess this means I don't use <%time%> or <%date%> because it would show the time the page was loaded, and not the last build.

Links must store this time somewhere.... how else can it tell me what time the last build was when I go to build in the admin panel? Hmmmm
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
How about grabbing the last time that index.html (or whatever you use) was last modified? I'm not sure how easy it is to do in Perl, but its really easy in PHP Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] Time last build took place in a tag In reply to
Easier in perl Tongue

http://www.perldoc.com/...1/pod/func/stat.html

You could just use $CFG->{last_build} Tongue

Last edited by:

Paul: May 11, 2002, 8:26 AM
Quote Reply
Re: [Andy.] Time last build took place in a tag In reply to
Hmmm, thats an idea, thanks.

I actually understand PHP (though still learning).... it was an easier transition from ASP and Visual Basic. I used to code in C++ over 10 years ago... and it seems to have similarities to Perl. I have been madly searching the internet for a decent (free) reference to what the syntax for things like $DB->blah->blah->fetchrow; This would improve my chances of writing my own globals instead of hasselling you guys every day!! Anyways I have diverted from the topic here.

Paul, do you know a way to grab dates from files (in Perl) and stick them in a tag? I could use this for my session files and tell when editors logged in then as well!!

Last edited by:

sooke: May 11, 2002, 8:27 AM
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
You must have written the reply at the same time as me. Thanks.
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
Dumb question:

This:

Code:


sub {
# returns the time of the last build

my $lastbuild = $CFG->{last_build};

return $lastbuild;

}




Gives me this:

1021135155.83501

I guess date formatting is required?

This is from the time global:

Code:


my ($sec,$min,$hr) = localtime( time + ($Links::CFG->{date_offset} *3600));
return sprintf ("%02d:%02d:%02d", $hr, $min, $sec);
Somthing like with this mixed in it I bet...

Last edited by:

sooke: May 11, 2002, 9:48 AM
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
Code:
sub {

Links::init_date();
return GT::Date::date_get ($CFG->{last_build} - ($CFG->{date_offset} * 3600), '%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%');

}

Last edited by:

Paul: May 11, 2002, 9:56 AM
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
Paul, don't ever think about leaving GT forum, will ya! Thanks.

For some reason it is three hours out (it shows 12:56 when the actual time was 9:56). I wonder if this is to do with localtime(...)? As my server is three hours ahead of local... but all my other times return the correct local time i.e. I already have date_offset at -3.



Or could it be that two negatives make a positive!! time - (-3) adds on threeWink

Last edited by:

sooke: May 11, 2002, 10:10 AM
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
Hmm try:

Code:
sub {

Links::init_date();
return GT::Date::date_get ($CFG->{last_build} + ($CFG->{date_offset} * 3600), '%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%');

}

I may be way off here but -3 * 3600 is -10800

The original code was minusing a minus which is the same as adding so by changing the - to a + it should work.

Last edited by:

Paul: May 11, 2002, 10:10 AM
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
Wow, thought of it at the same time.... thats got to be good for me!
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
Cool

So you see I did listen in my math classes Angelic
Quote Reply
Re: [Paul] Time last build took place in a tag In reply to
Blush Except 9 o'clock + (-3) gives 6 o'clock!!

I am thinking that the CFG->(lastbuild) is already converted.

This seems to work, thanks for your help Paul.

Code:


sub {
#returns the time of the last build


Links::init_date();
return GT::Date::date_get ($CFG->{last_build}, '%yyyy%-%mmm%-%dd% %HH%:%MM%:%ss%');

}

Last edited by:

sooke: May 11, 2002, 10:24 AM
Quote Reply
Re: [sooke] Time last build took place in a tag In reply to
Ah crap...lol yeah you are right.
Quote Reply
Re: [Ian] Time last build took place in a tag In reply to
What code and tag works with Gossamer Links 3.3.0?
http://www.hopeforyou.com

Quote Reply
Re: [HopeForYou] Time last build took place in a tag In reply to
This one:

Code:
sub {
Links::init_date();
return GT::Date::date_get ($CFG->{last_build}, '%yyyy%-%mmm%-%dd% %HH%:%MM%:%ss%');
}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!