='))
WS.append(cond.date('end', REQ.get('datetime'), '<='))
if 'A' in PERMS:
WS.append(cond.like('recipient', REQ.get('recipient')))
else:
WS.append(cond.eq('recipient', REMOTE_USER))
WS=[x for x in WS if x]
if WS:
QS+=" WHERE "+" AND ".join(WS)
QA=WA
QS+=" ORDER BY datetime DESC LIMIT %s OFFSET %s"
QA.append(SHOW_ROWS)
QA.append(int(REQ.get('offset', 0)))
result=DB.query(QS,QA)
except Exception,e:
result=[]
?>