By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,191 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,191 IT Pros & Developers. It's quick & easy.

Restricting access to articles based on number viewed

P: 6
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
May 21 '07 #1
Share this Question
Share on Google+
7 Replies


ak1dnar
Expert 100+
P: 1,584
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
First make them to sections and then complete step by step.
for a example do you have completed that article and packages tables so far.

as i concern first step is that.You have to create tables for all the articles with a unique id for each and every article and again you have to divide them to packages.

and then create a table for counting accessed articles from the package.For example we will say Article counter table. here based on the package and based on the user account you have to pass the accessed article ID to the table. as i concern you have to give the permission to the end user for access the same Article again and again.
By counting the the number of articles that has been passed to the article counter table you can disable the account.
May 22 '07 #2

100+
P: 136
I am agreed with ajaxrand that this has to complete step by step. I am trying to provide a development guideline for this.
  1. u need to design a table where u will store unique IDs for different articles [say article Table].
  2. u need a table where u will store userID for different user and the number of article then can access(as per different package).[say this is user table]
  3. u need the third table where u r going to store userID with articleID.
  4. now once a user is accessing a article u will fetch the userID and the articleID and look into the third table for an entry of this. If there is no entry for this then u will insert the rec. and reduce the number article can be accessed by the user by 1 from the user table. Now if u find a entry in the third table then simply show the article to the user[cause this perticular article is already accessed by the user.]
  5. while doing the prev step u need to check if the number of article canbe accessed by the user is LE 0 or not. Once u find that value is 0, u can dissable his account.

I hope this may help u.

susen
May 22 '07 #3

P: 6
Hi Friends,

I am working on the Article Management Site. where in the articles can be viewed only after subscribing it. It is divided into 3 packages of 30 Articles, 50 Articles, 100 Articles. Now i have done with the user registration, article table and Administrator who is going to activate ther users a/c. once after subscribing if a user login to he will see a list of articles title and once he click on those title he will be taken to the detail page. Now i need help on the restriction part. In the Detail page first it will look for the page restriction (where in an signed user can only view the detail article), then it will check whether the article is a new one or one which is already viewed by the user. if it is a new article then it will store it in the db, once all this are check it will reflect the article details.

Please help me out, if you need more details please tell me.

Thanks in advance
Prateek Batabyal
May 30 '07 #4

pbmods
Expert 5K+
P: 5,821
Please help me out, if you need more details please tell me.
How far have you gotten? Which part isn't working properly?

We're happy to help you get your code working, and while sometimes an example is the only good way to demonstrate a solution, TSDN members are still expected to write their own code.
May 30 '07 #5

P: 6
I am agreed with ajaxrand that this has to complete step by step. I am trying to provide a development guideline for this.
  1. u need to design a table where u will store unique IDs for different articles [say article Table].
  2. u need a table where u will store userID for different user and the number of article then can access(as per different package).[say this is user table]
  3. u need the third table where u r going to store userID with articleID.
  4. now once a user is accessing a article u will fetch the userID and the articleID and look into the third table for an entry of this. If there is no entry for this then u will insert the rec. and reduce the number article can be accessed by the user by 1 from the user table. Now if u find a entry in the third table then simply show the article to the user[cause this perticular article is already accessed by the user.]
  5. while doing the prev step u need to check if the number of article canbe accessed by the user is LE 0 or not. Once u find that value is 0, u can dissable his account.

I hope this may help u.

susen

Hi Susen,

Thanks i have followed the steps you have asked me to. Now i m on the final part the most tricky part where the restriction process come into action. i need a set of queries in the article detail page. Where in it will first check for the page restriction(only signed user can access this page). Next it will check whether the article is a new one or one which is already viewed. if new one it will enter the value in the fourth table (Tracking table). Then it will check for the article limits. I have made one field in the User Detail Table where the total article viewed is store and it will be taken from the table which store the userid and article id. now i don't know how to pass a query which will check all this. can you help me out...


Thanks in advance
Prateek Batabyal
May 30 '07 #6

P: 6
How far have you gotten? Which part isn't working properly?

We're happy to help you get your code working, and while sometimes an example is the only good way to demonstrate a solution, TSDN members are still expected to write their own code.
First of all i would like to thank you for your prompt help.

I have to work on the restriction part once a user click on a article title it will take the user to the detail page. and in that detail page i have to put some query wherein it will first check whether the article the user is viewing is a new one or a old one. If it is a new one then it will store it in a table and update the user table with the no. of article view column, then it will check the total no. of article viewed if the total no. of article view is equal to the total no. of articles then it will disable the users a/c to view any new article whereas it can view all the old articles stored in the db. after all this queries the article detail will be viewed.

can you please help me out with the queries.

Thanks in advance
Prateek Batabyal
May 30 '07 #7

pbmods
Expert 5K+
P: 5,821
Merged duplicate threads.

Changed thread title to better match contents.
May 30 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.