| Author |
Message |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
How can I show news articles regardless of date |
|
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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
1. Open inc/show.news.php and remove this:
 |  | else {
$where[] = 'date < '.(time() + $config_date_adjust * 60);
} |
2. Find this:
 |  | $query = $sql->select(array( |
add above:
 |  | $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 |
|
 |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
|
|
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!!
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 |
|
 |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
|
|
Hm, FI-DD when I did that it produced an error
 |  | 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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
I edited my reply above.
|
|
| Thu Nov 16, 2006 9:12 pm |
|
 |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
|
|
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! 
|
|
| Thu Nov 16, 2006 9:32 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
Updated.
|
|
| Fri Nov 17, 2006 12:27 am |
|
 |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
|
|
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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
It's working for me. Maybe you try again with the original unchanged file?
|
|
| Fri Nov 17, 2006 10:19 am |
|
 |
potts
Joined: 26 Mar 2007 Posts: 11 Location: UK |
|
|
|
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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
Then take the other solution and try changing this:
 |  | if($schedule){
$where[] = 'date > '.(time() + $config_date_adjust * 60);
}
else{
$where[] = 'date < '.(time() + $config_date_adjust * 60);
}
$schedule = false; |
to this:
 |  | 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 |
|
 |
potts
Joined: 26 Mar 2007 Posts: 11 Location: UK |
|
|
|
Absolutely fantastic FI-DD!!
Thank you so much. The support here is just brilliant!
|
|
| Wed Mar 28, 2007 12:02 am |
|
 |
dezza
Joined: 11 Apr 2007 Posts: 13
|
|
|
|
..
Last edited by dezza on Thu Dec 20, 2007 12:45 am; edited 1 time in total |
|
| Fri Apr 13, 2007 1:31 am |
|
 |
Heya Im Me
Joined: 01 Feb 2006 Posts: 189
|
|
|
|
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
 |  | $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
-HIM
|
|
| Sun Apr 22, 2007 8:05 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
|
|
I can't reproduce that behaviour. 
|
|
| Mon Apr 23, 2007 4:59 pm |
|
 |
|