Update of /cvsroot/phpwebapp/top10/templates/confirm
In directory sc8-pr-cvs1:/tmp/cvs-serv15358/templates/confirm
Modified Files:
confirm.php confirm.db
Log Message:
keep comment count up to date
Index: confirm.php
===================================================================
RCS file: /cvsroot/phpwebapp/top10/templates/confirm/confirm.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** confirm.php 29 Dec 2003 15:00:50 -0000 1.5
--- confirm.php 29 Dec 2003 15:56:38 -0000 1.6
***************
*** 160,163 ****
--- 160,169 ----
}
+ //update the comment count of the project
+ $rs = WebApp::openRS("comment_count", compact("proj_id"));
+ $nr_comments = $rs->Field("nr_comments");
+ $params = compact("proj_id", "nr_comments");
+ WebApp::execDBCmd("update_comment_count", $params);
+
//display the 'proj_details' module
WebApp::setSVar("username", $username);
Index: confirm.db
===================================================================
RCS file: /cvsroot/phpwebapp/top10/templates/confirm/confirm.db,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** confirm.db 29 Dec 2003 14:14:17 -0000 1.2
--- confirm.db 29 Dec 2003 15:56:38 -0000 1.3
***************
*** 66,70 ****
</dbCommand>
! <!--# +++++++++++++++++++++++++++++++++++++ #-->
<dbCommand ID="delete_comment">
--- 66,70 ----
</dbCommand>
! <!--# ++++++++++++ delete_comment +++++++++++++++ #-->
<dbCommand ID="delete_comment">
***************
*** 75,76 ****
--- 75,91 ----
</dbCommand>
+ <Recordset ID="comment_count">
+ <Query>
+ SELECT count(comment) AS nr_comments
+ FROM comments
+ WHERE proj_id = '{{proj_id}}'
+ </Query>
+ </Recordset>
+
+ <dbCommand ID="update_comment_count">
+ <Query>
+ UPDATE proj_list
+ SET nr_comments = '{{nr_comments}}'
+ WHERE proj_id = '{{proj_id}}'
+ </Query>
+ </dbCommand>
|