From: <sy...@us...> - 2006-04-04 22:16:20
|
Update of /cvsroot/tikiwiki/tiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13079/lib Modified Files: commentslib.php Log Message: current contributions are kept in comments logs to see the right contributions if comment edited Index: commentslib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/commentslib.php,v retrieving revision 1.137 retrieving revision 1.138 diff -u -d -r1.137 -r1.138 --- commentslib.php 10 Mar 2006 16:06:26 -0000 1.137 +++ commentslib.php 4 Apr 2006 22:16:07 -0000 1.138 @@ -1776,7 +1776,7 @@ $this->query($query, array( (int) $threadId ) ); } - function update_comment($threadId, $title, $comment_rating, $data, $type = 'n', $summary = '', $smiley = '', $objectId='') { + function update_comment($threadId, $title, $comment_rating, $data, $type = 'n', $summary = '', $smiley = '', $objectId='', $contributions='') { global $feature_actionlog, $feature_contribution; if ($feature_actionlog == 'y') { $object = explode( ":", $objectId, 2); @@ -1785,20 +1785,24 @@ $bytes = diff2($comment['data'] , $data, 'bytes'); global $logslib; include_once('lib/logs/logslib.php'); if ($object[0] == 'forum') - $logslib->add_action('Updated', $object[1], $object[0], "comments_parentId=$threadId&$bytes#threadId$threadId"); + $logslib->add_action('Updated', $object[1], $object[0], "comments_parentId=$threadId&$bytes#threadId$threadId", '', '', '', '', $contributions); else - $logslib->add_action('Updated', $object[1], 'comment', "type=".$object[0]."&$bytes#threadId$threadId"); + $logslib->add_action('Updated', $object[1], 'comment', "type=".$object[0]."&$bytes#threadId$threadId", '', '', '', '', $contributions); } $query = "update `tiki_comments` set `title`=?, `comment_rating`=?, `data`=?, `type`=?, `summary`=?, `smiley`=? where `threadId`=?"; $result = $this->query($query, array( $title, (int) $comment_rating, $data, $type, $summary, $smiley, (int) $threadId ) ); + if ($feature_contribution == 'y') { + global $contributionlib; include_once('lib/contribution/contributionlib.php'); + $contributionlib->assign_contributions($contributions, $threadId, 'comment', $title, '', ''); + } } function post_new_comment($objectId, $parentId, $userName, $title, $data, &$message_id, $in_reply_to = '', $type = 'n', - $summary = '', $smiley = '' + $summary = '', $smiley = '', $contributions = '' ) { if (!$userName) { @@ -1933,10 +1937,14 @@ else $l = $tikilib->strlen_quoted($data); if ($object[0] == 'forum') - $logslib->add_action(($parentId == 0)? 'Posted': 'Replied', $object[1], $object[0], 'comments_parentId='.$threadId.'&add='.$l); + $logslib->add_action(($parentId == 0)? 'Posted': 'Replied', $object[1], $object[0], 'comments_parentId='.$threadId.'&add='.$l, '', '', '', '', $contributions); else - $logslib->add_action(($parentId == 0)? 'Posted': 'Replied', $object[1], 'comment', 'type='.$object[0].'&add='.$l.'#threadId'.$threadId); - + $logslib->add_action(($parentId == 0)? 'Posted': 'Replied', $object[1], 'comment', 'type='.$object[0].'&add='.$l.'#threadId'.$threadId, '', '', '', '', $contributions); + } + global $feature_contribution; + if ($feature_contribution == 'y') { + global $contributionlib; include_once('lib/contribution/contributionlib.php'); + $contributionlib->assign_contributions($contributions, $threadId, 'comment', $title, '', ''); } return $threadId; |