public static function getLastStorageSync($userID) { $lastModified = false; $libraryIDs = Zotero_Libraries::getUserLibraries($userID); $shardIDs = Zotero_Shards::getUserShards($userID); foreach ($shardIDs as $shardID) { $sql = "SELECT UNIX_TIMESTAMP(serverDateModified) AS time FROM items\n\t\t\t\t\tJOIN storageFileItems USING (itemID)\n\t\t\t\t\tWHERE libraryID IN (" . implode(', ', array_fill(0, sizeOf($libraryIDs), '?')) . ")\n\t\t\t\t\tORDER BY time DESC LIMIT 1"; $time = Zotero_DB::valueQuery($sql, $libraryIDs, $shardID); if ($time > $lastModified) { $lastModified = $time; } } return $lastModified; }