aboutsummaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/commondescriptionservice.php14
1 files changed, 14 insertions, 0 deletions
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);