Re: Facebook like notification
On Sun, Mar 6, 2011 at 3:28 PM, newguy <aimanparvaiz@gmail.com> wrote:
> Hi
> I have a admin section and a user section in my website, I want to
> give admin the option that when he enters a note in a particular table
> and selects that this note should be available to the user then on the
> user side user should be able to see some sort of alert stating that
> admin wants the user to see a note and on clicking that alert teh user
> is able to see that particular note.
>
> Any suggestions how to implement this???
>
> I thought that when ever "body" column for that user in this table is
> not null we generate a alert on the user side(every user has a unique
> id and there is a separate table for storing these notes, this table
> has a column named "body"), if this is a decent way can anyone please
> help in how to implement this.
Fetch any notes when the User logs in. So, in AppController::beforeFilter():
$this->Auth->autoRedirect = false;
In UsersController::login(), get a Note if it exists. Use
$this->Auth->user('id') for the condition.
You should probably consider having another column, seen, and have
another condition that seen => 0. When you fetch the note, make a
second query to set seen => 1.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home