hamza Posted July 7, 2010 Share Posted July 7, 2010 news table i made title , short description , long desction but client require to have current news and old news. how i can make current news and old news. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/ Share on other sites More sharing options...
trq Posted July 7, 2010 Share Posted July 7, 2010 how i can make current news and old news. When you add new news it becomes current and all other news becomes old. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082391 Share on other sites More sharing options...
hamza Posted July 7, 2010 Author Share Posted July 7, 2010 how i can make current news and old news. When you add new news it becomes current and all other news becomes old. dear but what about today if i have 34 news in list so should i show 34 news current and other last days new old news. how i can differenciate or get from db. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082396 Share on other sites More sharing options...
trq Posted July 7, 2010 Share Posted July 7, 2010 dear but what about today if i have 34 news in list so should i show 34 news current and other last days new old news. That would completely depend on your spec. how i can differenciate or get from db. Store them along with a timestamp. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082405 Share on other sites More sharing options...
hamza Posted July 7, 2010 Author Share Posted July 7, 2010 Anyone else like to give me any suggestion on it, Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082409 Share on other sites More sharing options...
trq Posted July 7, 2010 Share Posted July 7, 2010 Anyone else like to give me any suggestion on it, How about you be a bit more specific with your problem? Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082419 Share on other sites More sharing options...
Pikachu2000 Posted July 7, 2010 Share Posted July 7, 2010 After they're stored with a timestamp, determine how many hours/days/weeks old they need to be to be considered "old" and incorporate logic into your code to differentiate between current and old. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082490 Share on other sites More sharing options...
phpology Posted July 7, 2010 Share Posted July 7, 2010 I agree with Pikachu2000 with the timestamp of creation but are you also not planning to have a general date of the article too? a d/m/Y format which the user controls and the news is ordered by that. Generally, you should show 5/10 items and have view archive or something which shows all. Or add in a trigger field to mark it as archived. But probably making it "complicated" as that is a manual process after. Quote Link to comment https://forums.phpfreaks.com/topic/206997-news-logic/#findComment-1082566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.