]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Database.class.php
I removed my previous commit. We have to create a new branch for that.
[github/wallabag/wallabag.git] / inc / poche / Database.class.php
index a222ed39b76017fc8b758b2d486b429f5e645f92..11cccb7238d9d6a6e16695386152a25fc6789fa8 100755 (executable)
@@ -398,21 +398,6 @@ class Database {
         return $query;
     }
 
-
-    private function _getDomain($url)
-    {
-        return parse_url($url, PHP_URL_HOST);
-    }
-
-    private function _getReadingTime($text) {
-        $word = str_word_count(strip_tags($text));
-        $minutes = floor($word / 200);
-        $seconds = floor($word % 200 / (200 / 60));
-        $time = array('minutes' => $minutes, 'seconds' => $seconds);
-
-        return $minutes;
-    }
-
     /**
      *
      * @param string $url
@@ -422,12 +407,9 @@ class Database {
      * @return integer $id of inserted record
      */
     public function add($url, $title, $content, $user_id, $isFavorite=0, $isRead=0) {
-        $readingTime = $this->_getReadingTime($content);
-        $domainName  = $this->_getDomain($url);
-        $date        = date('Y-m-d H:i:s');
+        $sql_action = 'INSERT INTO entries ( url, title, content, user_id, is_fav, is_read ) VALUES (?, ?, ?, ?, ?, ?)';
+        $params_action = array($url, $title, $content, $user_id, $isFavorite, $isRead);
 
-        $sql_action = 'INSERT INTO entries ( url, title, content, user_id, is_fav, is_read, date, reading_time, domain_name ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)';
-        $params_action = array($url, $title, $content, $user_id, $isFavorite, $isRead, $date, $readingTime, $domainName);
         if ( !$this->executeQuery($sql_action, $params_action) ) {
           $id = null;
         }