From: <sy...@us...> - 2006-03-10 16:06:29
|
Update of /cvsroot/tikiwiki/tiki/lib/contribution In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11737/lib/contribution Modified Files: contributionlib.php Log Message: remove object & contributions if remove comment Index: contributionlib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/contribution/contributionlib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- contributionlib.php 10 Mar 2006 15:24:02 -0000 1.3 +++ contributionlib.php 10 Mar 2006 16:06:27 -0000 1.4 @@ -88,16 +88,22 @@ $query = 'select * from `tiki_history` where `pageName` = ?'; $result = $this->query($query, array($page)); while ($res = $result->fetchRow()) { - $this->remove_assigned_contributions($res['historyId'], 'history'); - $obejctlib->delete_object('history', $res['historyId']); + $this->remove_history($res['historyId']); } - $this->remove_assigned_contributions($page, 'wiki page'); + $this->remove_assigned_contributions($page, 'wiki page'); } function remove_history($historyId) { + //history object only created for contribution yet. You can remove object global $objectlib; include_once('lib/objectlib.php'); $this->remove_assigned_contributions($historyId, 'history'); $objectlib->delete_object('history', $historyId); } + function remove_comment($commentId) { + //history object only created for contribution yet. You can remove object + global $objectlib; include_once('lib/objectlib.php'); + $this->remove_assigned_contributions($commentId, 'comment'); + $objectlib->delete_object('comment', $commentId); + } } global $dbTiki; $contributionlib = new ContributionLib($dbTiki); |