17 $this->db = XoopsDatabaseFactory::getDatabaseConnection();
18 $this->_dbtable = $this->db->prefix(
"users");
27 $this->primary =
'uname';
31 $this->primary =
'uid';
37 if (is_array($groupsArr))
38 $this->
groups =& $groupsArr;
45 $sql =
'SELECT groupid FROM '.$this->db->prefix(
'groups_users_link').
' WHERE uid='.intval($this->
getVar(
'uid'));
51 while ($myrow = $this->db->fetchArray(
$result)) {
52 $this->
groups[] = $myrow[
'groupid'];
64 $sql =
"SELECT ".($fields!=
'' ?
"$fields" :
'').
" FROM ".$this->db->prefix(
"groups").
" WHERE groupid IN(".implode(
',',
$groups).
")";
67 while ($row = $this->db->fetchArray(
$result)){
92 if (!empty($this->
groups)){
94 $this->db->queryF(
"DELETE FROM ".$this->db->prefix(
"groups_users_link").
" WHERE uid='".$this->
getVar(
'uid').
"'");
96 $sql =
"INSERT INTO ".$this->db->prefix(
"groups_users_link").
" (`groupid`,`uid`) VALUES ";
97 foreach ($this->
groups as $k){
98 $sql .=
"('$k','".$this->getVar(
'uid').
"'),";
103 $this->db->queryF(
$sql);