{
$cond = '';
if ($this->visibility) {
- $cond = ' AND pub IN ' . XDB::formatArray($this->visibility);
+ $cond = XDB::format(' AND pub IN {?}', $this->visibility);
}
$res = XDB::query("SELECT *
FROM profile_photos
$where .= ' AND FIND_IN_SET(\'mail\', pa.flags)';
}
if ($this->visibility) {
- $where .= ' AND pa.pub IN ' . XDB::formatArray($this->visibility);
+ $where .= XDB::format(' AND pa.pub IN {?}', $this->visibility);
}
$type = array();
if ($flags & self::ADDRESS_PRO) {
$type[] = 'home';
}
if (count($type) > 0) {
- $where .= ' AND pa.type IN ' . XDB::formatArray($type);
+ $where .= XDB::format(' AND pa.type IN {?}', $type);
}
$limit = is_null($limit) ? '' : XDB::format('LIMIT {?}', (int)$limit);
return XDB::iterator('SELECT pa.text, pa.postalCode, pa.type, pa.latitude, pa.longitude,
$where .= ' AND pn.network_type = 0'; // XXX hardcoded reference to web site index
}
if ($this->visibility) {
- $where .= ' AND pn.pub IN ' . XDB::formatArray($this->visibility);
+ $where .= XDB::format(' AND pn.pub IN {?}', $this->visibility);
}
$limit = is_null($limit) ? '' : XDB::format('LIMIT {?}', (int)$limit);
return XDB::iterator('SELECT pne.name, pne.icon,
$where = XDB::format('pj.pid = {?}', $this->id());
$cond = 'TRUE';
if ($this->visibility) {
- $where .= ' AND pj.pub IN ' . XDB::formatArray($this->visibility);
- $cond = 'pj.email_pub IN ' . XDB::formatArray($this->visibility);
+ $where .= XDB::format(' AND pj.pub IN {?}', $this->visibility);
+ $cond = XDB::format('pj.email_pub IN {?}', $this->visibility);
}
$limit = is_null($limit) ? '' : XDB::format('LIMIT {?}', (int)$limit);
return XDB::iterator('SELECT pje.name, pje.acronym, pje.url, pje.email, pje.NAF_code,
LEFT JOIN profile_phones AS pp ON (pp.pid = p.pid AND pp.link_type = \'user\' AND tel_type = \'mobile\')
LEFT JOIN profile_photos AS ph ON (ph.pid = p.pid)
LEFT JOIN account_profiles AS ap ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', ap.perms))
- WHERE p.pid IN ' . XDB::formatArray($pids) . '
+ WHERE p.pid IN {?}
GROUP BY p.pid
- ' . $order);
+ ' . $order, $pids);
}
public static function getPID($login)
return XDB::fetchAllAssoc('uid', 'SELECT ap.uid, ap.pid
FROM account_profiles AS ap
WHERE FIND_IN_SET(\'owner\', ap.perms)
- AND ap.uid IN ' . XDB::formatArray($uids) .'
- ' . $order);
+ AND ap.uid IN {?}
+ ' . $order, $uids);
}
/** Return the profile associated with the given login.
public function buildCondition(PlFilter &$uf)
{
$ufc->requireAccounts();
- return 'a.hruid IN ' . XDB::formatArray($this->hruids);
+ return XDB::format('a.hruid IN {?}', $this->hruids);
}
}
// }}}
public function buildCondition(PlFilter &$uf)
{
$uf->requireProfiles();
- return 'p.hrpid IN ' . XDB::formatArray($this->hrpids);
+ return XDB::format('p.hrpid IN {?}', $this->hrpids);
}
}
// }}}
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addEducationFilter();
- return 'pe' . $sub . '.eduid IN ' . XDB::formatArray($this->val);
+ return XDB::format('pe' . $sub . '.eduid IN {?}', $this->val);
}
}
// }}}
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addEducationFilter();
- return 'pee' . $sub . '.degreeid IN ' . XDB::formatArray($this->val);
+ return XDB::format('pee' . $sub . '.degreeid IN {?}', $this->val);
}
}
// }}}
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addEducationFilter();
- return 'pee' . $sub . '.fieldid IN ' . XDB::formatArray($this->val);
+ return XDB::format('pee' . $sub . '.fieldid IN {?}', $this->val);
}
}
// }}}
$sub = $uf->addNameTokensFilter(!($this->exact || $this->soundex));
$conds = array();
if ($this->soundex) {
- $conds[] = $sub . '.soundex IN ' . XDB::formatArray($this->tokens);
+ $conds[] = XDB::format($sub . '.soundex IN {?}', $this->tokens);
} else if ($this->exact) {
- $conds[] = $sub . '.token IN ' . XDB::formatArray($this->tokens);
+ $conds[] = XDB::format($sub . '.token IN {?}', $this->tokens);
} else {
$tokconds = array();
foreach ($this->tokens as $token) {
}
if ($this->flags != null) {
- $conds[] = $sub . '.flags IN ' . XDB::formatArray($this->flags);
+ $conds[] = XDB::format($sub . '.flags IN {?}', $this->flags);
}
return implode(' AND ', $conds);
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addBinetsFilter();
- return $sub . '.binet_id IN ' . XDB::formatArray($this->val);
+ return XDB::format($sub . '.binet_id IN {?}', $this->val);
}
}
// }}}
if (count($foreign) > 0) {
$sub = $uf->addEmailRedirectFilter($foreign);
- $cond[] = 'e' . $sub . '.email IS NOT NULL OR a.email IN ' . XDB::formatArray($foreign);
+ $cond[] = XDB::format('e' . $sub . '.email IS NOT NULL OR a.email IN {?}', $foreign);
}
if (count($virtual) > 0) {
$sub = $uf->addVirtualEmailFilter($virtual);
}
}
if (count($types)) {
- $conds[] = $sub . '.type IN ' . XDB::formatArray($types);
+ $conds[] = XDB::foramt($sub . '.type IN {?}', $types);
}
if ($this->flags != self::FLAG_ANY) {
default:
Platal::page()->killError('Invalid address field type: ' . $this->fieldtype);
}
- $conds[] = $sub . '.' . $field . ' IN ' . XDB::formatArray($this->val);
+ $conds[] = XDB::format($sub . '.' . $field . ' IN {?}', $this->val);
return implode(' AND ', $conds);
}
if (count($uids) == 0) {
return PlFilterCondition::COND_FALSE;
} else {
- return '$UID IN ' . XDB::formatArray($uids);
+ return XDB::format('$UID IN {?}', $uids);
}
}
}
} else {
$sube = $uf->addEducationFilter(true, $this->grade);
$field = 'pe' . $sube . '.' . UserFilter::promoYear($this->grade);
- return $field . ' IN ' . XDB::formatArray($promos);
+ return XDB::format($field . ' IN {?}', $promos);
}
}
}
$lim = $limit->getSql();
$cond = '';
if (!is_null($uids)) {
- $cond = ' AND a.uid IN ' . XDB::formatArray($uids);
+ $cond = XDB::format(' AND a.uid IN {?}', $uids);
}
$fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS a.uid
' . $this->query . $cond . '
$lim = $limit->getSql();
$cond = '';
if (!is_null($pids)) {
- $cond = ' AND p.pid IN ' . XDB::formatArray($pids);
+ $cond = XDB::format(' AND p.pid IN {?}', $pids);
}
$fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS p.pid
' . $this->query . $cond . '
if (!is_array($key)) {
$key = array($key);
}
- $joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\' AND $ME.email IN ' . XDB::formatArray($key));
+ $joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\'
+ AND $ME.email IN {?}' . $key);
}
}
foreach ($this->al as $sub=>$key) {
if (!is_array($key)) {
$key = array($key);
}
- $joins['al' . $sub] = PlSqlJoin::left('aliases', '$ME.uid = $UID AND $ME.type IN (\'alias\', \'a_vie\') AND $ME.alias IN ' . XDB::formatArray($key));
+ $joins['al' . $sub] = PlSqlJoin::left('aliases', '$ME.uid = $UID AND $ME.type IN (\'alias\', \'a_vie\')
+ AND $ME.alias IN {?}', $key);
}
}
foreach ($this->ve as $sub=>$key) {
if (!is_array($key)) {
$key = array($key);
}
- $joins['v' . $sub] = PlSqlJoin::left('virtual', '$ME.type = \'user\' AND $ME.alias IN ' . XDB::formatArray($key));
+ $joins['v' . $sub] = PlSqlJoin::left('virtual', '$ME.type = \'user\' AND $ME.alias IN {?}', $key);
}
$joins['vr' . $sub] = PlSqlJoin::left('virtual_redirect',
'$ME.vid = v' . $sub . '.vid