Lines Matching refs:rev
72 $approved_revs = array_filter($revs, function ($rev) {
73 return $rev['status'] == 'approved';
76 return (int) $row['rev'];
92 $res = $approve_sqlite->query('SELECT rev FROM revision WHERE page=? AND approved IS NOT NULL', $id);
94 return (int) $row['rev'];
98 public function use_ireadit_here($id, $rev) {
101 if ($rev == $last_approved_rev) { // this is last approved version
104 } elseif ($rev == p_get_metadata($id, 'last_change date')) { // check if it is last page revision
110 public function user_can_read_page($ireadit_data, $id, $rev, $user) {
111 if (!$this->use_ireadit_here($id, $rev)) return false;
124 AND rev = ?
125 ORDER BY timestamp', $id, $rev);
163 $res = $sqlite->query('SELECT page, MAX(rev) as "rev", timestamp FROM ireadit WHERE user=? GROUP BY page',
166 $res = $sqlite->query('SELECT page, MAX(rev) as "rev", timestamp FROM ireadit GROUP BY page');
170 $rev = (int) $row['rev'];
173 $pages[$page]['last_read_rev'] = $rev;
189 $res = $sqlite->query('SELECT rev, timestamp FROM ireadit WHERE user=? AND page=? ORDER BY rev DESC',
192 $res = $sqlite->query('SELECT rev, timestamp FROM ireadit WHERE page=? ORDER BY rev DESC', $page);
198 $rev = (int) $row['rev'];
199 if (in_array($rev, $approved_revs)) {
200 $last_read_rev = $rev;