i am developing a website where i want every registered user must be able to view only one profile per day
how can i achieve this?
could anyone guide me with the code plz
| SitePoint Sponsor |


i am developing a website where i want every registered user must be able to view only one profile per day
how can i achieve this?
could anyone guide me with the code plz
Last edited by sneha24; May 11, 2009 at 23:08.


This is pretty vague. View one profile? Do you have some code we can help you with?




Well you could have a column in the users table such as "last_profile_viewed_at" where you would store a datetime of the last time the user viewed any profile.
Then on the profile page - just fetch user from the table and check if 24 hours has already passed since his last profile view. If not, redirect him back to homepage, if yes, allow him to see the profile and update the "last_profile_viewed_at" column in the database.




To add to risoknop's suggestion...
When the user logs in, you could pull the timestamp from the db then, and set it to a session var.
Then compare that with the current time to disable any link that would allow them to view a profile.
No, I REALLY dislike having to use Joomla.


thanks a lot
ll work it out and reply soon
Bookmarks