[phpwebapp-commits] CVS: top10/templates/proj_details/comments new_comment.html,1.2,1.3 comments.php
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2003-12-29 14:59:53
|
Update of /cvsroot/phpwebapp/top10/templates/proj_details/comments In directory sc8-pr-cvs1:/tmp/cvs-serv3550/templates/proj_details/comments Modified Files: new_comment.html comments.php comments.js comments.html comments.db Log Message: field 'title' of the comments Index: new_comment.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/new_comment.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** new_comment.html 25 Sep 2003 15:50:25 -0000 1.2 --- new_comment.html 29 Dec 2003 14:59:40 -0000 1.3 *************** *** 9,15 **** </tr> <tr> ! <td>Subject:</td> <td> ! <input type="text" name="subject" size="80"> </td> </tr> --- 9,15 ---- </tr> <tr> ! <td>Title:</td> <td> ! <input type="text" name="title" size="80"> </td> </tr> Index: comments.php =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comments.php 29 Dec 2003 14:14:17 -0000 1.3 --- comments.php 29 Dec 2003 14:59:40 -0000 1.4 *************** *** 4,13 **** function on_add_comment($event_args) { ! $params = $event_args; $params["date"] = date("Y-m-d"); $params["ip"] = $_SERVER["REMOTE_ADDR"]; - $comment = $params["comment"]; - $allowed_tags = "<b><i><a><br><p><ol><ul><li><hr>"; - $params["comment"] = strip_tags($comment, $allowed_tags); WebApp::execDBCmd("insert_comment", $params); } --- 4,14 ---- function on_add_comment($event_args) { ! $params["username"] = $event_args["username"]; ! $params["title"] = $event_args["title"]; ! $comment = $event_args["comment"]; ! $allowed_tags = "<b><i><a><br><p><ol><ul><li><hr><pre><xmp>"; ! $params["comment"] = strip_tags($comment, $allowed_tags); $params["date"] = date("Y-m-d"); $params["ip"] = $_SERVER["REMOTE_ADDR"]; WebApp::execDBCmd("insert_comment", $params); } Index: comments.js =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** comments.js 29 Dec 2003 14:14:17 -0000 1.2 --- comments.js 29 Dec 2003 14:59:40 -0000 1.3 *************** *** 5,9 **** var form = document.new_comment; var username = form.username.value; ! var subject = form.subject.value; var comment = form.comment.value; --- 5,9 ---- var form = document.new_comment; var username = form.username.value; ! var title = form.title.value; var comment = form.comment.value; *************** *** 15,24 **** } ! if (subject=='') { ! var msg = "You did not specify a subject. Send the comment anyway?"; if (!confirm(msg)) { ! form.subject.focus(); return; } --- 15,24 ---- } ! if (title=='') { ! var msg = "You did not specify a title. Send the comment anyway?"; if (!confirm(msg)) { ! form.title.focus(); return; } *************** *** 26,31 **** var event_args = "username=" + username + ";" ! + "subject=" + subject + ";" + "comment=" + comment; SendEvent("comments", "add_comment", event_args); } --- 26,32 ---- var event_args = "username=" + username + ";" ! + "title=" + title + ";" + "comment=" + comment; + alert(event_args); SendEvent("comments", "add_comment", event_args); } Index: comments.html =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comments.html 29 Dec 2003 14:14:17 -0000 1.3 --- comments.html 29 Dec 2003 14:59:40 -0000 1.4 *************** *** 16,20 **** <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> ! <td><b>{{subject}}</b></td> <td align="right"> <a class="button" href="javascript:del_comment('{{comment_id}}')">X</a> --- 16,20 ---- <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> ! <td><b>{{title}}</b></td> <td align="right"> <a class="button" href="javascript:del_comment('{{comment_id}}')">X</a> Index: comments.db =================================================================== RCS file: /cvsroot/phpwebapp/top10/templates/proj_details/comments/comments.db,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** comments.db 29 Dec 2003 14:14:17 -0000 1.3 --- comments.db 29 Dec 2003 14:59:40 -0000 1.4 *************** *** 3,7 **** <Recordset ID="comment_list"> <Query> ! SELECT comment_id, username, date, comment FROM comments WHERE proj_id = '{{proj_id}}' --- 3,7 ---- <Recordset ID="comment_list"> <Query> ! SELECT comment_id, username, date, title, comment FROM comments WHERE proj_id = '{{proj_id}}' *************** *** 15,18 **** --- 15,19 ---- proj_id = '{{proj_id}}', username = '{{username}}', + title = '{{title}}', comment = '{{comment}}', date = '{{date}}', *************** *** 20,24 **** </Query> </dbCommand> - <!--# ToDo: add the field 'subject' #--> <dbCommand ID="delete_comment"> --- 21,24 ---- |