prateekbtbl Posted May 26, 2007 Share Posted May 26, 2007 Hi Friends, I am new in PHP/MySQL, i am developing article managemenst system for my assignment. Where in the members of the site after registering under different packages will allow to view articles. For eg we have packages like 25 artilces, 50 articles, 100 articles etc. Now if a member have subscribe for 25 articles after viewing the 25th article he will not be allow to view anymore and his a/c will be disabled. After renewal of his a/c he will be allowed to access more artilcle. Now my question is that how can i keep track of the articles viewed by the member in database and the query needed to pass in the database which will match his to no. of subscription and his current viewing so that after the member cross the limit his a/c will get disabled. Please help me Regards Prateek Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/ Share on other sites More sharing options...
Dragen Posted May 26, 2007 Share Posted May 26, 2007 do you have any code to start with? Are you wanting to keep track of exactly what articles they've viewed or just the amount they've viewed? Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/#findComment-262026 Share on other sites More sharing options...
prateekbtbl Posted May 26, 2007 Author Share Posted May 26, 2007 no not yet yea i want to keep track of the article they viewed and if somebody has selected 25 article pack they can view only 25 articles from the list of articles which may be around 100 or more. once they click the 25th article they won't be able to view any new and they will be asked to renew their package. Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/#findComment-262028 Share on other sites More sharing options...
Dragen Posted May 26, 2007 Share Posted May 26, 2007 Well in your database for the users you could have a column titled 'views' or similar which you can record how many articles they've viewed. Just a simple increment each time they view an article. Then you need to check that number against their subscription. If it's a 25 subscription and views equal 25 then dissallow them to view any articles. When they re-subscribe then reset the 'views' number to 0. noting which articles they've viewed would be a little bit trickier, but not much. just another table in the database which stores the article id's seperated by something.. prehaps #. Then this can be read from the database and then exploded to give all the indiovidual numbers. Might be a better way of doing it, but that's what I'd do off the top of my head. Try looking up databases and simple php functions on google, or even better php.net Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/#findComment-262030 Share on other sites More sharing options...
prateekbtbl Posted May 26, 2007 Author Share Posted May 26, 2007 ok it seems great Dragen, one part is solved, but what about the 25 articles the user have subscribed. After view 25 articles the a/c will get disabled so the user won't be allowed to view any new articles but i think during this period until he renew his a/c he should be allowed to view the 25 articles which for which he has already paid. Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/#findComment-262045 Share on other sites More sharing options...
Dragen Posted May 26, 2007 Share Posted May 26, 2007 well Don't disable everything. Not have a function on the article page which checks if the user is allowed to view any articles and if not, then checks if the article is one they've already viewed (stored in the database). If they've already viewed the article then display it, else bring up an error. Quote Link to comment https://forums.phpfreaks.com/topic/53044-help-needed-for-article-management-system/#findComment-262052 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.