From 76ed2e494b220780d8e247f9348f8f09a9d5fee8 Mon Sep 17 00:00:00 2001 From: mensonge Date: Tue, 19 Feb 2008 14:43:00 +0000 Subject: Interface fix: add a link to last editor profile in common description. Don't count a change if a user saves with no modifications. git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@46 b3834d28-1941-0410-a4f8-b48e95affb8f --- services/commondescriptionservice.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'services/commondescriptionservice.php') diff --git a/services/commondescriptionservice.php b/services/commondescriptionservice.php index 7e34219..6c591a9 100644 --- a/services/commondescriptionservice.php +++ b/services/commondescriptionservice.php @@ -16,6 +16,13 @@ class CommonDescriptionService { } function addTagDescription($tag, $desc, $uId, $time) { + // Check if no modification + $lastDesc = $this->getLastTagDescription($tag); + if($lastDesc['cdDescription'] == $desc) { + return true; + } + + // If modification $datetime = gmdate('Y-m-d H:i:s', $time); $values = array('tag'=>$tag, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); @@ -81,6 +88,13 @@ class CommonDescriptionService { } function addBookmarkDescription($bHash, $title, $desc, $uId, $time) { + // Check if no modification + $lastDesc = $this->getLastBookmarkDescription($bHash); + if($lastDesc['cdTitle'] == $title && $lastDesc['cdDescription'] == $desc) { + return true; + } + + // If modification $datetime = gmdate('Y-m-d H:i:s', $time); $values = array('bHash'=>$bHash, 'cdTitle'=>$title, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime); $sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values); -- cgit v1.2.3-54-g00ecf