Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How can I show news articles regardless of date

 
Reply to topic    Forum Index » Help View previous topic
View next topic
How can I show news articles regardless of date
Author Message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post How can I show news articles regardless of date Reply with quote
I'm wonder what file has to be modified so I can show news posts despite the date being in the 'future'?



So say I added a post that was dated 01 January 2007, how can I make that show up on the website regardless of it being November 2006 right now?



As always thanks for any help



-HIM
Wed Nov 15, 2006 12:41 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
1. Open inc/show.news.php and remove this:

Code:
else {

      $where[] = 'date < '.(time() + $config_date_adjust * 60);

   }




2. Find this:

Code:
$query = $sql->select(array(




add above:

Code:
         $where[] = 'and';

         $where[] = 'date < '.(time() + $config_date_adjust * 60);

         $where[] = 'or';

         $where[] = 'date > '.(time() + $config_date_adjust * 60);

         if($where[0] == 'and') array_shift($where);



Last edited by FI-DD on Fri Nov 17, 2006 12:27 am; edited 2 times in total
Wed Nov 15, 2006 8:27 pm View user's profile Send private message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Yesssssssssssss Thank you so much, FI-DD. Knew it was some line of code to remove but couldn't figure out which one. Wow, thanks!! Very Happy Very Happy Very Happy



Also, could you take a gander whenever you have the time to at the post I made below this one? This question and the other one go hand-in-hand.



Thanks again, FI-DD, this program would be useless to me without you.



-HIM
Wed Nov 15, 2006 9:07 pm View user's profile Send private message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Hm, FI-DD when I did that it produced an error



Code:
txtSQL Warning: You have an error in your where clause, (operators allowed: =, !=, <>, =~, !~, <, >, <=, >=) in /home/www/site/site0607/index.php on line 79



Warning: Invalid argument supplied for foreach() in /home/www/site/data/inc/show.news.php on line 87





Any ideas?
Thu Nov 16, 2006 2:50 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
I edited my reply above.
Thu Nov 16, 2006 9:12 pm View user's profile Send private message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Hm, alright it's now showing "future" news except...it's showing every article in every category in my news now instead of just the news category. And the includes have $category set... Any ideas?



Also, thanks for continuing with the help on this one, it's the last part I swear! Very Happy
Thu Nov 16, 2006 9:32 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
Updated.
Fri Nov 17, 2006 12:27 am View user's profile Send private message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Hm, I get that same txtSQL warning mentioned above. Is it because I took out that else statement?
Fri Nov 17, 2006 12:46 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
It's working for me. Maybe you try again with the original unchanged file?
Fri Nov 17, 2006 10:19 am View user's profile Send private message
potts



Joined: 26 Mar 2007
Posts: 11
Location: UK

Post Reply with quote
Hi FI-DD,



I've tried this with the original unchanged file, but I too am getting every article in every category for future dates. However, past dates seem to be correct and don't do this. Any ideas?



This similar solution worked perfectly for me, but unfortunately it removes the news items on the due date, (the day after would be fine):



http://english.cutenews.ru/forum/viewtopic.php?t=1243&highlight=future





Thanks,

Richard
Tue Mar 27, 2007 11:01 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
Then take the other solution and try changing this:

Code:
      if($schedule){

         $where[] = 'date > '.(time() + $config_date_adjust * 60);

      }

      else{

         $where[] = 'date < '.(time() + $config_date_adjust * 60);

      }

      $schedule = false;




to this:

Code:
if($schedule){

  $where[] = 'date > '.(time() + $config_date_adjust * 60 - 86400);

}

else{

  $where[] = 'date < '.(time() + $config_date_adjust * 60);

}

$schedule = false;

Tue Mar 27, 2007 11:34 pm View user's profile Send private message
potts



Joined: 26 Mar 2007
Posts: 11
Location: UK

Post Reply with quote
Absolutely fantastic FI-DD!! Very Happy



Thank you so much. The support here is just brilliant!
Wed Mar 28, 2007 12:02 am View user's profile Send private message
dezza



Joined: 11 Apr 2007
Posts: 13

Post Reply with quote
..


Last edited by dezza on Thu Dec 20, 2007 12:45 am; edited 1 time in total
Fri Apr 13, 2007 1:31 am View user's profile Send private message
Heya Im Me



Joined: 01 Feb 2006
Posts: 189

Post Reply with quote
Hey FI-DD,



I was wondering if you could provide me with some insight on this problem. I followed the instructions and made all of the changes in show.news.php , even with

Code:
  $where[] = 'date > '.(time() + $config_date_adjust * 60 - 86400);

}

else{

  $where[] = 'date < '.(time() + $config_date_adjust * 60);

}

$schedule = false;




My problem is now all the includes will show the same articles regardless of the specified category number but only if the date is set a more than a day in the 'future.' So if I added an article for April 23rd and it's the 22nd today, all includes would show that article regardless of category specified and schedule=true or false. If I add an article for April 22nd at 9pm and its April 22nd 1pm now, then only it'll just show in the specified category in an include, not all of the includes.



Do you have any idea whats going on? I've been trying to figure it out but I really have no idea.



As always, thanks for any help Smile



-HIM
Sun Apr 22, 2007 8:05 am View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Reply with quote
I can't reproduce that behaviour. Confused
Mon Apr 23, 2007 4:59 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.