<?php
+use Friendica\Core\PConfig;
function group_add($uid,$name) {
intval($uid),
dbesc($name)
);
- notice( t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
+ notice( t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
}
return true;
}
- $r = q("INSERT INTO `group` ( `uid`, `name` )
- VALUES( %d, '%s' ) ",
- intval($uid),
- dbesc($name)
- );
+ $r = dba::insert('group', array('uid' => $uid, 'name' => $name));
$ret = $r;
}
return $ret;
// we indicate success because the group member was in fact created
// -- It was just created at another time
if (! dbm::is_result($r)) {
- $r = q("INSERT INTO `group_member` (`uid`, `gid`, `contact-id`)
- VALUES( %d, %d, %d ) ",
- intval($uid),
- intval($gid),
- intval($member)
- );
+ $r = dba::insert('group_member', array('uid' => $uid, 'gid' => $gid, 'contact-id' => $member));
}
return $r;
}
if (dbm::is_result($r))
foreach ($r as $rr)
$ret[] = $rr['contact-id'];
- if ($check_dead AND !$use_gcontact) {
+ if ($check_dead && !$use_gcontact) {
require_once('include/acl_selectors.php');
$ret = prune_deadguys($ret);
}
$default_group = 0;
if ($network == NETWORK_OSTATUS)
- $default_group = get_pconfig($uid, "ostatus", "default_group");
+ $default_group = PConfig::get($uid, "ostatus", "default_group");
if ($default_group != 0)
return $default_group;