PHP Classes
elePHPant
Icontem

How to store multiple comment sets

Recommend this page to a friend!

      Comment  >  All threads  >  How to store multiple comment sets  >  (Un) Subscribe thread alerts  
Subject:How to store multiple comment sets
Summary:How to use id_for and code_for
Messages:5
Author:Brandon Sussman
Date:2006-09-02 22:48:42
Update:2009-04-08 04:04:55
 

 


  1. How to store multiple comment sets   Reply   Report abuse  
Brandon Sussman - 2006-09-02 22:48:42
if I want several different sets of comments, which field do I set to differentiate between the sets?

  2. Re: How to store multiple comment sets   Reply   Report abuse  
Peter Klauer - 2006-09-03 18:22:02 - In reply to message 1 from Brandon Sussman
I always have only one comment per page, but multiple comments per site.
Maybe you have some sort of CMS and it generates articles. Then the $code_for is "articles" (8 chars max!) and $id_for is the id of the article in the database.
Simple, isn't it?
On the same site you have other items which wait to be commented. A linklist? Set $code_for to 'linklist' and $id_for to '1' (or 0).
I hope this answered the question.

  3. Re: How to store multiple comment sets   Reply   Report abuse  
Jon Ezrin - 2006-09-04 17:07:49 - In reply to message 2 from Peter Klauer
I have a news page with multiple entries. Is it possible to have separate comments for each news item (on the same page)?

  4. Re: How to store multiple comment sets   Reply   Report abuse  
Peter Klauer - 2006-09-04 18:15:18 - In reply to message 3 from Jon Ezrin
I never tried this. Since it is possible to have multiple instances of sqltable on one page, it should work with some exclusion.

At the moment, if every comment item on this same page has the same $code_for and only $id_for is changed, there should be some trouble because the sqltables will all together respond to the buttons. Same as steering your neighbours airplane with your remote. You could go around this issue by putting

$comment->sqltable->instance = $code_for.$id_for;

each time before you put "$comment->put();"
($code_for and $id_for are something like 'articles' and '432', where $id_for is the id of the article in the sql table)


  5. Re: How to store multiple comment sets   Reply   Report abuse  
yig yaj - 2009-04-08 04:04:55 - In reply to message 2 from Peter Klauer
if i am using ...read.php?Pid=1 and so on, how can I get different comment for different id, say ...Pid=2 or 3 or 4. I want them to not share the same comments submitted.

Hope i make much sense.