2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getListById ($id, $cols = "*")
6 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
9 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
12 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
14 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
16 $sql .= " limit $offset,$limit";
19 $res = sqlStatement($sql);
20 for($iter =0;$row = sqlFetchArray($res);$iter++)
26 function addList ($pid, $type, $title, $comments, $activity = "1")
28 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
31 function disappearList ($id)
33 sqlStatement("update lists set activity = '0' where id='$id'");
37 function reappearList ($id)
39 sqlStatement("update lists set activity = '1' where id='$id'");