Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Display Date : Last Build & Next Build

Quote Reply
Display Date : Last Build & Next Build
Any idea on how to display:

1. Last Build Date / Time
2. Next Build Date / Time...

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
If you are doing a build, you should be able to do it just with:


Last built: <%GT::Date::date_get()%>

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
I was using a global so far, but this works just fine.

And I suppose there is no way system can predict the next build time, so I might need to setup some sort of count down script and reset it on every build.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
When do you do builds? Daily? (on a cronjob?)

If so, a little global like this should work:

Code:
sub {
return GT::Date::date_add(GT::Date::date_get(),1);
}

..then just call with: <%global_name%>

This should give you the date of the next day (i.e when the next build will be done)

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
I am thinking about setting up cron job (using your Cron Manager Plugin) for build changed every 2 to 3 hours.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
To be honest, with the size of your site - I wouldn't recommend that =) At the most, maybe once every 12 hours - but IMO, I wouldn't bother doing it more than once a day.

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Alright lets calculate it for 12 hours update.

However how do you propose we can display the timer on the site.

What I am trying to do is insert next build time (yyyy-mm-dd hh:mm:ss) in below code. So it can display time remaining before the next update on the site.

<SCRIPT language="JavaScript" SRC="/count.php?countto=2010-01-25 00:00:00"></SCRIPT>

P.S. Like I mentioned yesterday, 'One of a kind' 404 page is on the way - will send you the link once it ready :)

Vishal
-------------------------------------------------------
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Here is another global from you:

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

This seems to be perfect (except month should be just mm (number).. Now is it possible to display two output with this one

1. Build time
2. Build time + 12 hours.. so the counter can start countdown

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
Here is a possible solution if you can figure out on how to make the global work.

Above global output last build time. Now if it can be edited so it will display Last Build Time + 8 or 10 or 12 hours as set in the global (without breaking days/month/year), it would be 110% perfect solution.

So in final output the counter will only show 10 : mm : ss .. till next build.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
Hi,

What you probably need to do, is have a "countdown" script. I just had a quick look around, but couldn't spend any more time looking at one - as I'm very busy.

To get the split up date/time values - you can use:

gen_build_time
Code:
sub {
my $now = GT::Date::date_get (GT::Date::date_get(), '%yyyy%-%mmm%-%dd% %HH%:%MM%:%ss%');
my ($date,$time) = split / /, $now;

my ($yy,$mm,$dd) = split /-/, $date;
my ($hour,$mins,$secs) = split /:/, $time;

return {
now_year => $yy,
now_month => $mm,
now_day => $dd,
now_hour => $hour,
now_mins => $mins,
now_secs => $secs
}

}


This would give stuff like <%now_year%>, <%now_month%> etc - so you can call them in your script.

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
I know what you mean about looking up for countdown script. I looked at quite a few myself, however either most of them were bulky and had tons of codes or with very little feature. The one I have setup right now only has few lines of code and seems to work like a charm for certain fixed counter, but when it comes to setting up new time, I didn't found anything even remotely closed.

That's an interesting idea, and I suppose using combination of if/elseif I should be able to setup something for this function.

This global would give an exact output, and using if/elseif conditions it might also be possible to make it work, however it seems like code will get bit messy to keep date, month and year current, like only 10 hours behind next build date or trying to display next build time exactly 12 hours after current build date..

This is an optional but highly desired feature for the site, however the more I think of it, the more messy it seems.

Vishal
-------------------------------------------------------
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Andy wrote:
When do you do builds? Daily? (on a cronjob?)

If so, a little global like this should work:

Code:
sub {
return GT::Date::date_add(GT::Date::date_get(),1);
}

..then just call with: <%global_name%>

This should give you the date of the next day (i.e when the next build will be done)

Cheers

Hey I was testing this global and was thinking.. The way you are adding up +1 in above global, would it be possible +12 hours be added in below global?

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

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
Not sure of the format of $CFG->{last_build} , but I think its a normal localtime - so this may work:

Code:
$CFG->{last_build} = $CFG->{last_build} + (12 * 60 * 60);

12 hours * 60 minutes * 60 seconds, to give the new time it should be getting re-built)

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

Untested, but should work.

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Andy wrote:
Not sure of the format of $CFG->{last_build} , but I think its a normal localtime - so this may work:

Code:
$CFG->{last_build} = $CFG->{last_build} + (12 * 60 * 60);

12 hours * 60 minutes * 60 seconds, to give the new time it should be getting re-built)

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

Untested, but should work.

Cheers

Smile Smile Smile

It worked.

Thanks a lot.

Vishal
-------------------------------------------------------
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Andy wrote:
To be honest, with the size of your site - I wouldn't recommend that =) At the most, maybe once every 12 hours - but IMO, I wouldn't bother doing it more than once a day.

Cheers

You are right. I am checking server load during test builds and it seems to go into red even on a good server.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
Yeah, as I said - even once a day is almost overkill (it all really depends on how many reviews / new listings you validate each day - if you are not validating more than a couple of listings/reviews a day, I'd just set it up to run maybe once every 1 day, or even every 2 days.

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!
Quote Reply
Re: [Andy] Display Date : Last Build & Next Build In reply to
Also, I just learned, not to not to do rebuild search and build at the same time !!! not the best idea.

I am expecting to validate reasonable listings every day, so it might be best to stick with your previous suggestion of 12 hours build and then update the build time based on site updates.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Display Date : Last Build & Next Build In reply to
Yeah, don't run indexing and building at the same time - or you are asking for trouble ;)

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!