use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;
+use Friendica\Database\DBM;
use Friendica\Network\Probe;
require_once 'include/Photo.php';
dbesc($nick)
);
- if (! dbm::is_result($user)) {
+ if (! DBM::is_result($user)) {
return;
}
intval($contact_id),
intval($page_owner_uid)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$can_post = true;
$visitor = $contact_id;
}
intval($page_owner_uid)
);
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
notice( t('Contact information unavailable') . EOL);
logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
killme();
dbesc($album),
intval($page_owner_uid)
);
- if (!dbm::is_result($r)) {
+ if (!DBM::is_result($r)) {
notice( t('Album not found.') . EOL);
goaway($_SESSION['photo_return']);
return; // NOTREACHED
dbesc($album)
);
}
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
foreach ($r as $rr) {
$res[] = "'" . dbesc($rr['rid']) . "'" ;
}
$r = q("SELECT `parent-uri` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
intval($page_owner_uid)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
foreach ($r as $rr) {
q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
dbesc(datetime_convert()),
dbesc($a->argv[2])
);
}
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
intval($page_owner_uid),
dbesc($r[0]['resource-id'])
dbesc($r[0]['resource-id']),
intval($page_owner_uid)
);
- if (dbm::is_result($i)) {
+ if (DBM::is_result($i)) {
q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc($resource_id),
intval($page_owner_uid)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$ph = new Photo($r[0]['data'], $r[0]['type']);
if ($ph->is_valid()) {
$rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 );
dbesc($resource_id),
intval($page_owner_uid)
);
- if (dbm::is_result($p)) {
+ if (DBM::is_result($p)) {
$ext = $phototypes[$p[0]['type']];
$r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
dbesc($desc),
intval($page_owner_uid)
);
}
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$old_tag = $r[0]['tag'];
$old_inform = $r[0]['inform'];
}
intval($page_owner_uid)
);
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
//select someone by attag or nick and the name passed in
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
dbesc($name),
}
}
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$newname = $r[0]['name'];
$profile = $r[0]['url'];
$notify = 'cid:' . $r[0]['id'];
dbesc($album),
intval($page_owner_uid)
);
- if ((! dbm::is_result($r)) || ($album == t('Profile Photos'))) {
+ if ((! DBM::is_result($r)) || ($album == t('Profile Photos'))) {
$visible = 1;
} else {
$visible = 0;
intval($contact_id),
intval($owner_uid)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$can_post = true;
$contact = $r[0];
$remote_contact = true;
intval($contact_id),
intval($owner_uid)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$contact = $r[0];
$remote_contact = true;
}
intval($owner_uid),
dbesc($album)
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(20);
}
$photos = array();
- if (dbm::is_result($r))
+ if (DBM::is_result($r))
$twist = 'rotright';
foreach ($r as $rr) {
if ($twist == 'rotright') {
dbesc($datum)
);
- if (! dbm::is_result($ph)) {
+ if (! DBM::is_result($ph)) {
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
LIMIT 1",
intval($owner_uid),
dbesc($datum)
);
- if (dbm::is_result($ph)) {
+ if (DBM::is_result($ph)) {
notice(t('Permission denied. Access to this item may be restricted.'));
} else {
notice(t('Photo not available') . EOL );
intval($owner_uid)
);
- if (dbm::is_result($prvnxt)) {
+ if (DBM::is_result($prvnxt)) {
foreach ($prvnxt as $z => $entry) {
if ($entry['resource-id'] == $ph[0]['resource-id']) {
$prv = $z - 1;
$map = null;
- if (dbm::is_result($linked_items)) {
+ if (DBM::is_result($linked_items)) {
$link_item = $linked_items[0];
$r = q("SELECT COUNT(*) AS `total`
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$a->set_pager_total($r[0]['total']);
}
}
$comments = '';
- if (! dbm::is_result($r)) {
+ if (! DBM::is_result($r)) {
if (($can_post || can_write_wall($a, $owner_uid)) && $link_item['last-child']) {
$comments .= replace_macros($cmnt_tpl, array(
'$return_path' => '',
);
// display comments
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
foreach ($r as $item) {
builtin_activity_puller($item, $conv_responses);
dbesc('Contact Photos'),
dbesc( t('Contact Photos'))
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$a->set_pager_total(count($r));
$a->set_pager_itemspage(20);
}
);
$photos = array();
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$twist = 'rotright';
foreach ($r as $rr) {
//hide profile photos to others