2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getOnoteById ($id, $cols = "*")
6 return sqlQuery("select $cols from onotes where id='$id' order by date DESC limit 0,1");
9 function getOnoteByDate ($date, $activity = "1", $cols = "*", $limit="all", $offset="0")
15 $sql = "select $cols from onotes where date like '%$date%' ";
16 if ($activity != "all")
17 $sql .= "and activity='$activity' ";
18 $sql .= "order by date DESC";
22 $sql = "select $cols from onotes where date like '%$date%' ";
23 if ($activity != "all")
24 $sql .= "and activity ='$activity' ";
25 $sql .= "order by date DESC LIMIT $offset,$limit";
28 $res = sqlStatement($sql);
29 // if ($res == FALSE) { return FALSE; }
30 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
35 function addOnote($body, $activity = "1")
37 $body = mysql_escape_string($body);
38 return sqlInsert("insert into onotes (date, body, user, groupname, activity) values (NOW(), '$body', '". $_SESSION['authUser'] ."', '". $_SESSION['authProvider'] ."', '$activity')");
41 function disappearOnote($id)
43 sqlStatement("update onotes set activity = '0' where id='$id'");
47 function reappearOnote ($id)
49 sqlStatement("update onotes set activity = '1' where id='$id'");