Natalie
|
| Posted: 10/16/2002, 10:56 AM |
|
In the Forum sample supplied with CCS, I would like to add a field to count the number of replies to each message (just like here on this site). I cannot figure this out in CCS for some reason.
Can anyone help?
Thanks,
Natalie
|
|
|
 |
Natalie
|
| Posted: 10/16/2002, 11:01 AM |
|
I am using ASP with an SQL 2000 Server Database.
Thanks
|
|
|
 |
imranz
|
| Posted: 10/16/2002, 12:01 PM |
|
Page 2 of the Counting Sheep example will help you.
http://www.gotocode.com/art.asp?art_id=230&
|
|
|
 |
Natalie
|
| Posted: 10/17/2002, 3:13 PM |
|
Thanks
|
|
|
 |
mike
|
| Posted: 10/19/2002, 4:13 AM |
|
how can i do this with cs2 ?
mike
|
|
|
 |
Nicole
|
| Posted: 10/21/2002, 2:31 AM |
|
Mike,
To display number of replies in CCS sample forum application, follow the steps:
1. add new columns to the table and put Label control to it. Add hidden field control and assign it to message_id field. It is necessary for the replies calculation.
2. create form before show row event to calculate the number of responses and assign the calculated value to the field. Here is sample code:
PHP
$messages->replies->SetValue(CCDLookUp("count(message_id_parent)", "forum_messages", "message_id_parent=" . $messages->message_id->Value, $DBMySQLconn));
ASP
messages.replies.Value = CCDLookUp("count(message_id_parent)", "forum_messages", "message_id_parent=" & messages.message_id.Value, DBmyconnection_name)
where messages is form name, replies is the Label field name, message_id is hidden field name. Also do not forget to replace myconnection_name with real connection name.
|
|
|
 |
henry
|
| Posted: 10/28/2002, 1:24 PM |
|
Is there a similarly easy method to do this counting in CC (not Studio)?
|
|
|
 |
|