$book->parametres = $r->parametres;\r
$book->extras = $r->extras;\r
$book->numerotation = $r->numerotation;\r
+ $book->changedate = $r->changedate;\r
+ $book->compiledate = $r->compiledate;\r
\r
return $book;\r
}\r
$c->hash = md5(rand(0, 1234567893));\r
$c->compteur_visites = 20;\r
$c->parametres = serialize(new wsParametres());\r
+ $c->changedate = TIME;\r
$book_id = $c->book_id = $this->getNextId();\r
\r
$c->insert();\r
} else {\r
+ $c->changedate = TIME;\r
$book_id = $data['book_id'];\r
$c->update('WHERE book_id=\'' . $this->con->escape($data['book_id']) . '\'');\r
}\r
$c->parametres = $r->parametres;\r
$c->nom = $r->nom;\r
$c->theme = $r->theme;\r
+ $c->changedate = TIME;\r
+ $c->compiledate = 0;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
\r
$c->parametres = serialize(new wsParametres());\r
$c->theme = 1;\r
$c->lang = $lang;\r
+ $c->changedate = TIME;\r
+ $c->compiledate = TIME;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
return $this->selectById($book_id);\r
{\r
$c = $this->con->openCursor('books');\r
$c->chapters = json_encode(json_decode($json, false));\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
$c = $this->con->openCursor('books');\r
$c->links = json_encode(json_decode($links, false));\r
$c->rulers = json_encode(json_decode($rulers, false));\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
\r
$c = $this->con->openCursor('books');\r
$c->extras = $extras;\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
return true;\r
}\r
$c = $this->con->openCursor('books');\r
$c->lang = $base;\r
$c->traductions = json_encode(json_decode($traductions, false));\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
$c = $this->con->openCursor('books');\r
$c->nom = $parametres->title;\r
$c->parametres = serialize($parametres);\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
}\r
\r
+ public function touch($book_id)\r
+ {\r
+ $c = $this->con->openCursor('books');\r
+ $c->changedate = TIME;\r
+ $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+ }\r
+\r
+ public function touchCompile($book_id)\r
+ {\r
+ $c = $this->con->openCursor('books');\r
+ $c->compiledate = TIME;\r
+ $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+ }\r
+\r
+ public function isUpToDate($book_id)\r
+ {\r
+ $r = $this->con->select('SELECT changedate,compiledate FROM books WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+ return $r->compiledate > $r->updatedate;\r
+ }\r
+\r
public function setComposition($book_id, $pages)\r
{\r
$numerotation = array();\r
$c = $this->con->openCursor('books');\r
$c->parametres = serialize($parametres);\r
$c->numerotation = implode(',', $numerotation);\r
+ $c->changedate = TIME;\r
$c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
\r
$this->con->execute('DELETE FROM book_pages WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
if ($version == 3) {\r
return $this->compile3($book_id, $complete);\r
}\r
+ $this->touchCompile($book_id);\r
}\r
\r
/**\r
}\r
}\r
\r
+ $this->touchCompile($book_id);\r
+\r
return $res;\r
}\r
}\r