skip days

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

skip days

Postby web » Sat Oct 13, 2007 7:10 am

have problem with skipping days.
when i enter to skip 1 day, it skips 2 days, when enter 2 days - it skips 3 days.
I'm using 1.24

how can I improve that problem?
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby web » Sun Oct 14, 2007 6:08 am

upgraded to 1.25.1
nothing helps. is there any solution?
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby web » Tue Oct 16, 2007 1:28 pm

what file is responsible for "skip days"?
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby Dale Ray » Tue Oct 16, 2007 2:07 pm

This is from crcore.pl lines 1047-1066:

if ($newsprofiles{$i}->{'skipdays'}){
# PROFILE FILTER DAYS

# Subtract x days from current time
my $first_item_time = time() - ($newsprofiles{$i}->{'skipdays'} * (60*60*24));

# Get date vars
BasicDateVars($first_item_time);

# Get timestamp for x days ago, at 12:00AM
my $time = YMDtoUNIX($Year, $Month_Number, $Month_Day);

if ($newstime > $first_item_time){
# if ($newstime > $time){
# skip items less than x days old
next PROFLOOP;
}

# END PROFILE FILTER DAYS
}


I commented out the blue line above and added the red line, this seems to fix the problem.


You may want to look at the Filter by News Days addon. It takes a different approach to filtering by days.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby web » Tue Oct 16, 2007 2:37 pm

it didn't help.
I've used Filter by News Days too, but that addon has no effect at all. I've skipped 1 day and filteres by 1 day. It show me as if i have set filter by 2 days.
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby Dale Ray » Tue Oct 16, 2007 3:41 pm

web wrote:it didn't help.
I've used Filter by News Days too, but that addon has no effect at all. I've skipped 1 day and filteres by 1 day. It show me as if i have set filter by 2 days.

The fix I posted above solved the problem for me on my local test server.

Did you read the docs for Filter by Newsdays? To skip days you must have a style that looks like:

<If: Sub: skipDays>
<If: Field: newDateFlag><Field: Date></If>
<Field: Subject>
</If>

Place your normal news style between the <If: Sub: limitDays> and the </If> tag. Because the isNewDate sub is used by the addon you have to use the newDateFlag field to test for the start of a new date. The style above would show the date only before the first item of each day.

The line in red is replaced with you normal style. The line in blue displays the date once for all items with the same date.

Are you using standard profiles or Maginot profiles?

If you have values entered into both the filter by time setting and the skip days setting you could get some unusual results. Try each setting on its own (with the other blank) to see if that setting is working.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby web » Tue Oct 16, 2007 5:57 pm

no effect. that's my style

Code: Select all
<If: Sub: limitDays>
<If: Sub: skipDays>

<table width=100% class="news-block">  <tr>
         <td colspan="2" class="news-border" valign="top">
<span class="news-item"> <Field: Hour>:<Field: Minute>&nbsp;&nbsp;

<a href="<MaginotURL: news_m>"><strong><Field: Subject></strong> </a>

<If: Field: CustomField_Snip>
<div class="news-item-text"><Snip 150: Field: CustomField_Snip></div>
<If: Else>
<div class="news-item-text"><Snip 150: Field: Text></div>
</If>

</td></tr><tr>
                <td  height="1" class="bg"></td>
              </tr></table>
</If>
</If>


I want to limit by 1 day and skip 1 day
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby Dale Ray » Tue Oct 16, 2007 6:55 pm

Filter by Newsdys isn't designed to do what you want to do. You can't use both the skip days and limit days at the same time the way that it is written.

Try (in the standard profile settings) setting the skip days value to 1 and the filter by time setting to 2 or 3 and see what results you get.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby web » Thu Oct 18, 2007 6:39 am

tried. no effect. shows blank screen
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 4 guests

cron