function db_QueryFetchHash($query) { $res = db_Fetch(db_doQuery($query)); foreach ($res as $data) { $ret[$data['id']] = $data; } return $ret; }
function node_GetPosts($limit = 10, $offset = 0) { global $NODE_SCHEMA; db_Connect(); $items = db_Fetch("SELECT * FROM `" . CMW_TABLE_NODE . "` WHERE " . "`time_published` != " . "'0000-00-00 00:00:00'" . " AND " . "`type`=" . "\"post\"" . " ORDER BY `time_published` DESC" . " LIMIT " . $limit . " OFFSET " . $offset . ";", $NODE_SCHEMA); return $items; }
function user_GetIdAndHashByMail($mail) { db_Connect(); // TODO: Use time-attack safe fetch function $data = db_Fetch("SELECT `node` AS `id`,`hash` FROM `" . CMW_TABLE_USER . "` WHERE " . "`mail`=\"" . $mail . "\"" . " LIMIT 1" . ";"); if (count($data)) { return $data[0]; } return null; }