cindreta Posted October 14, 2008 Share Posted October 14, 2008 Hi guys, i need you help...ok so i've made a small news article cms and now i would like to add the option when posting a new article where a user can select from 3 choiches: 1. active news - it will be posted and showed on the list of news 2. expired news- it willl be posted, but user can select a date when the article will exprie and untill then it will show on the list of news 3. postponed news - a user picks a date when to make a news active and only from that day on that news will be shown on the list of news i know maybe its a lot, but i can't find the answers, i tryed googling and stuff but nothing solid, so if anybody has an idea, has experience with this, can help me. thx Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted October 14, 2008 Share Posted October 14, 2008 The reason you haven't found anything on google is because this consists of several concepts. I think I would have an effdate and termdate for each news article entry in the database so you can "select column, column from table where effdate <= now() and termdate > now()" Quote Link to comment Share on other sites More sharing options...
cindreta Posted October 14, 2008 Author Share Posted October 14, 2008 thats great, i had that idea but i didn't know what funcionts to use, thank you ill look into this, and if you get more info plz tell and anybody else can chip in plz thx man Quote Link to comment Share on other sites More sharing options...
cindreta Posted October 14, 2008 Author Share Posted October 14, 2008 come on guys, before this topic gets burried among the masses of topics lol, anybody thx? Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 14, 2008 Share Posted October 14, 2008 I think R0bb0b answered your question pretty much but I'll fill in the gaps for you. Typical table for news would include ID, DateSubmitted, Title, Text. To this you need to add StartDate, EndDate and Active. To set news as always active you should just skip out adding values into the DB under StartDate and EndDate and just submit a 1 into Active. To set news as delayed or only active within a certain timeframe you should set Active to 0 and then set your start/end date parameters. When querying your database for news to display you should have a query that selects all news items with a StartDate > Now() and an EndDate < Now () OR Active =1, usually ordered by DateSubmitted. That way you will get all of the news items that are supposed to show between the dates you say, plus all of the news articles that are set to always show. These querys wont be too hard to construct but I'll leave that to you as it always helps to expand your knowledge if you're forced to look and learn for yourself. Quote Link to comment Share on other sites More sharing options...
cindreta Posted October 14, 2008 Author Share Posted October 14, 2008 GKWelding & R0bb0b thank you very much for the idea, no it won't be a problem to set thosse queryes at all...thank you very much for helping, if mods are reading you can make this into solved cos the answer is here....i just needed an idea of how to make it. Thanks guys Quote Link to comment Share on other sites More sharing options...
trq Posted October 14, 2008 Share Posted October 14, 2008 You can mark the topic solved yourself, no need to 'report to a mod'. The button is in the bottom left corner. Thankyou. Quote Link to comment 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.