Changing Archive Weekday

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Changing Archive Weekday

Postby Mantoine » Mon Mar 11, 2002 7:06 pm

Is it possible to change the way coranto chooses the day on which to archive it weekly?

I would like to archive weekly from Saturday to next Friday instead is it doing it from Sunday to next Saturday.

Is this possible? if so, how do i make this change.

thanks in advance

Mantoine
Last edited by Mantoine on Mon Mar 11, 2002 11:36 pm, edited 1 time in total.
User avatar
Mantoine
 
Posts: 3
Joined: Mon Mar 11, 2002 7:02 pm

Postby brightsunshine » Tue Mar 12, 2002 12:57 am

I tried the same (starting the week on monday) - and I gave up. Elvii coded the routine with a clever trick (first check if it is sunday - weekday=0 - if not, then some if's). I think, you would have to rewrite perl, not coranto, if you want to stay on his way. Or do a total new weekday-check - then you have also to rewrite some 10 lines afterwards the link-names in crcore. It's kind of assembler - perl here.
But especially for "european weeks" it would be a nice feature!
brightsunshine
 
Posts: 36
Joined: Sun Mar 10, 2002 2:08 am

Postby Mantoine » Tue Mar 12, 2002 8:34 am

thanks for the reply, is there any other people that can give me this code or is there an addon about that can change this. Im terrible with code :(
User avatar
Mantoine
 
Posts: 3
Joined: Mon Mar 11, 2002 7:02 pm

Postby vesa_h » Thu Jun 06, 2002 11:38 am

For those of us, who want to have their archive week start on Monday.
First, make a backup of crcore.pl
In crcore.pl, look for the code below
Code: Select all
if ($Week_Day)
   {
   # We're not on Sunday. Find the previous Sunday.
   $CorrectedWeeklyTime = ($newstime - ($Week_Day * 86400));

and replace it with
Code: Select all
if ($Week_Day != 1)
   {
   # We're not on Monday. Find the previous Monday.
   $CorrectedWeeklyTime = ($newstime - (($Week_Day-1)* 86400));

Rebuild (or maybe even 'Full Rebuild', don't remember) and your weekly archives should start correctly.
vesa_h
 
Posts: 72
Joined: Wed Mar 13, 2002 9:41 am

Postby brightsunshine » Fri Jun 07, 2002 9:07 pm

Real clever trick ...if ($Week_Day != 1). I tried just all imagineable things in the follow-up (...*86400) -> now I understand, why I got monday-starting-archives, but not corresponding archive-links.
Thank you, guy.
brightsunshine
 
Posts: 36
Joined: Sun Mar 10, 2002 2:08 am

Postby Mantoine » Sun Jun 09, 2002 11:09 pm

Thanks for the replys guys. Ive added that but i seem to now get multiple archive entries for both sunday and monday entries.

Is there anyway to get round this?

Cheers
User avatar
Mantoine
 
Posts: 3
Joined: Mon Mar 11, 2002 7:02 pm

Postby vesa_h » Mon Jun 10, 2002 12:33 am

Do a 'Full Rebuild', that should fix it.
vesa_h
 
Posts: 72
Joined: Wed Mar 13, 2002 9:41 am


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron