Rename DBM method calls to DBA method calls
This commit is contained in:
parent
8ddb94ef06
commit
0ec44f3e8a
153 changed files with 813 additions and 918 deletions
6
boot.php
6
boot.php
|
@ -29,7 +29,7 @@ use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Conversation;
|
use Friendica\Model\Conversation;
|
||||||
|
@ -803,7 +803,7 @@ function run_update_function($x, $prefix)
|
||||||
function check_addons(App $a)
|
function check_addons(App $a)
|
||||||
{
|
{
|
||||||
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
$r = q("SELECT * FROM `addon` WHERE `installed` = 1");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$installed = $r;
|
$installed = $r;
|
||||||
} else {
|
} else {
|
||||||
$installed = [];
|
$installed = [];
|
||||||
|
@ -1002,7 +1002,7 @@ function feed_birthday($uid, $tz)
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($p)) {
|
if (DBA::is_result($p)) {
|
||||||
$tmp_dob = substr($p[0]['dob'], 5);
|
$tmp_dob = substr($p[0]['dob'], 5);
|
||||||
if (intval($tmp_dob)) {
|
if (intval($tmp_dob)) {
|
||||||
$y = DateTimeFormat::timezoneNow($tz, 'Y');
|
$y = DateTimeFormat::timezoneNow($tz, 'Y');
|
||||||
|
|
|
@ -20,7 +20,6 @@ use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -235,7 +234,7 @@ function api_login(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($record)) {
|
if (!DBA::is_result($record)) {
|
||||||
logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
|
logger('API_login failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
|
||||||
header('WWW-Authenticate: Basic realm="Friendica"');
|
header('WWW-Authenticate: Basic realm="Friendica"');
|
||||||
//header('HTTP/1.0 401 Unauthorized');
|
//header('HTTP/1.0 401 Unauthorized');
|
||||||
|
@ -501,7 +500,7 @@ function api_unique_id_to_nurl($id)
|
||||||
{
|
{
|
||||||
$r = DBA::selectFirst('contact', ['nurl'], ['id' => $id]);
|
$r = DBA::selectFirst('contact', ['nurl'], ['id' => $id]);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
return $r["nurl"];
|
return $r["nurl"];
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -631,14 +630,14 @@ function api_get_user(App $a, $contact_id = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the contact wasn't found, fetch it from the contacts with uid = 0
|
// if the contact wasn't found, fetch it from the contacts with uid = 0
|
||||||
if (!DBM::is_result($uinfo)) {
|
if (!DBA::is_result($uinfo)) {
|
||||||
$r = [];
|
$r = [];
|
||||||
|
|
||||||
if ($url != "") {
|
if ($url != "") {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s' LIMIT 1", dbesc(normalise_link($url)));
|
$r = q("SELECT * FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s' LIMIT 1", dbesc(normalise_link($url)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$network_name = ContactSelector::networkToName($r[0]['network'], $r[0]['url']);
|
$network_name = ContactSelector::networkToName($r[0]['network'], $r[0]['url']);
|
||||||
|
|
||||||
// If no nick where given, extract it from the address
|
// If no nick where given, extract it from the address
|
||||||
|
@ -1184,7 +1183,7 @@ function api_statuses_update($type)
|
||||||
intval(requestdata('media_ids')),
|
intval(requestdata('media_ids')),
|
||||||
api_user()
|
api_user()
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$phototypes = Image::supportedTypes();
|
$phototypes = Image::supportedTypes();
|
||||||
$ext = $phototypes[$r[0]['type']];
|
$ext = $phototypes[$r[0]['type']];
|
||||||
$_REQUEST['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $r[0]['nickname'] . '/image/' . $r[0]['resource-id'] . ']';
|
$_REQUEST['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $r[0]['nickname'] . '/image/' . $r[0]['resource-id'] . ']';
|
||||||
|
@ -1280,7 +1279,7 @@ function api_status_show($type)
|
||||||
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
||||||
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
|
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
|
||||||
|
|
||||||
if (DBM::is_result($lastwall)) {
|
if (DBA::is_result($lastwall)) {
|
||||||
$in_reply_to = api_in_reply_to($lastwall);
|
$in_reply_to = api_in_reply_to($lastwall);
|
||||||
|
|
||||||
$converted = api_convert_item($lastwall);
|
$converted = api_convert_item($lastwall);
|
||||||
|
@ -1365,7 +1364,7 @@ function api_users_show($type)
|
||||||
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => false];
|
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => false];
|
||||||
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
|
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
|
||||||
|
|
||||||
if (DBM::is_result($lastwall)) {
|
if (DBA::is_result($lastwall)) {
|
||||||
$in_reply_to = api_in_reply_to($lastwall);
|
$in_reply_to = api_in_reply_to($lastwall);
|
||||||
|
|
||||||
$converted = api_convert_item($lastwall);
|
$converted = api_convert_item($lastwall);
|
||||||
|
@ -1440,11 +1439,11 @@ function api_users_search($type)
|
||||||
if (x($_GET, 'q')) {
|
if (x($_GET, 'q')) {
|
||||||
$r = q("SELECT id FROM `contact` WHERE `uid` = 0 AND `name` = '%s'", dbesc($_GET["q"]));
|
$r = q("SELECT id FROM `contact` WHERE `uid` = 0 AND `name` = '%s'", dbesc($_GET["q"]));
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$r = q("SELECT `id` FROM `contact` WHERE `uid` = 0 AND `nick` = '%s'", dbesc($_GET["q"]));
|
$r = q("SELECT `id` FROM `contact` WHERE `uid` = 0 AND `nick` = '%s'", dbesc($_GET["q"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$k = 0;
|
$k = 0;
|
||||||
foreach ($r as $user) {
|
foreach ($r as $user) {
|
||||||
$user_info = api_get_user($a, $user["id"]);
|
$user_info = api_get_user($a, $user["id"]);
|
||||||
|
@ -1824,12 +1823,12 @@ function api_statuses_show($type)
|
||||||
|
|
||||||
// try to fetch the item for the local user - or the public item, if there is no local one
|
// try to fetch the item for the local user - or the public item, if there is no local one
|
||||||
$uri_item = Item::selectFirst(['uri'], ['id' => $id]);
|
$uri_item = Item::selectFirst(['uri'], ['id' => $id]);
|
||||||
if (!DBM::is_result($uri_item)) {
|
if (!DBA::is_result($uri_item)) {
|
||||||
throw new BadRequestException("There is no status with this id.");
|
throw new BadRequestException("There is no status with this id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Item::selectFirst(['id'], ['uri' => $uri_item['uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
|
$item = Item::selectFirst(['id'], ['uri' => $uri_item['uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
throw new BadRequestException("There is no status with this id.");
|
throw new BadRequestException("There is no status with this id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1846,7 +1845,7 @@ function api_statuses_show($type)
|
||||||
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
|
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
|
||||||
|
|
||||||
/// @TODO How about copying this to above methods which don't check $r ?
|
/// @TODO How about copying this to above methods which don't check $r ?
|
||||||
if (!DBM::is_result($statuses)) {
|
if (!DBA::is_result($statuses)) {
|
||||||
throw new BadRequestException("There is no status with this id.");
|
throw new BadRequestException("There is no status with this id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1904,12 +1903,12 @@ function api_conversation_show($type)
|
||||||
|
|
||||||
// try to fetch the item for the local user - or the public item, if there is no local one
|
// try to fetch the item for the local user - or the public item, if there is no local one
|
||||||
$item = Item::selectFirst(['parent-uri'], ['id' => $id]);
|
$item = Item::selectFirst(['parent-uri'], ['id' => $id]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
throw new BadRequestException("There is no status with this id.");
|
throw new BadRequestException("There is no status with this id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent = Item::selectFirst(['id'], ['uri' => $item['parent-uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
|
$parent = Item::selectFirst(['id'], ['uri' => $item['parent-uri'], 'uid' => [0, api_user()]], ['order' => ['uid' => true]]);
|
||||||
if (!DBM::is_result($parent)) {
|
if (!DBA::is_result($parent)) {
|
||||||
throw new BadRequestException("There is no status with this id.");
|
throw new BadRequestException("There is no status with this id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1926,7 +1925,7 @@ function api_conversation_show($type)
|
||||||
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
|
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
|
||||||
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
|
$statuses = Item::selectForUser(api_user(), [], $condition, $params);
|
||||||
|
|
||||||
if (!DBM::is_result($statuses)) {
|
if (!DBA::is_result($statuses)) {
|
||||||
throw new BadRequestException("There is no status with id $id.");
|
throw new BadRequestException("There is no status with id $id.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1976,7 +1975,7 @@ function api_statuses_repeat($type)
|
||||||
$fields = ['body', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
$fields = ['body', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
||||||
$item = Item::selectFirst($fields, ['id' => $id, 'private' => false]);
|
$item = Item::selectFirst($fields, ['id' => $id, 'private' => false]);
|
||||||
|
|
||||||
if (DBM::is_result($item) && $item['body'] != "") {
|
if (DBA::is_result($item) && $item['body'] != "") {
|
||||||
if (strpos($item['body'], "[/share]") !== false) {
|
if (strpos($item['body'], "[/share]") !== false) {
|
||||||
$pos = strpos($item['body'], "[share");
|
$pos = strpos($item['body'], "[share");
|
||||||
$post = substr($item['body'], $pos);
|
$post = substr($item['body'], $pos);
|
||||||
|
@ -2226,7 +2225,7 @@ function api_favorites_create_destroy($type)
|
||||||
|
|
||||||
$item = Item::selectFirstForUser(api_user(), [], ['id' => $itemid, 'uid' => api_user()]);
|
$item = Item::selectFirstForUser(api_user(), [], ['id' => $itemid, 'uid' => api_user()]);
|
||||||
|
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
throw new BadRequestException("Invalid item.");
|
throw new BadRequestException("Invalid item.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3410,7 +3409,7 @@ function api_ff_ids($type)
|
||||||
WHERE `contact`.`uid` = %s AND NOT `contact`.`self`",
|
WHERE `contact`.`uid` = %s AND NOT `contact`.`self`",
|
||||||
intval(api_user())
|
intval(api_user())
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3486,7 +3485,7 @@ function api_direct_messages_new($type)
|
||||||
dbesc($_POST['screen_name'])
|
dbesc($_POST['screen_name'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
// Selecting the id by priority, friendica first
|
// Selecting the id by priority, friendica first
|
||||||
api_best_nickname($r);
|
api_best_nickname($r);
|
||||||
|
|
||||||
|
@ -3590,7 +3589,7 @@ function api_direct_messages_destroy($type)
|
||||||
);
|
);
|
||||||
|
|
||||||
// error message if specified id is not in database
|
// error message if specified id is not in database
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
if ($verbose == "true") {
|
if ($verbose == "true") {
|
||||||
$answer = ['result' => 'error', 'message' => 'message id not in database'];
|
$answer = ['result' => 'error', 'message' => 'message id not in database'];
|
||||||
return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
|
return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
|
||||||
|
@ -3695,7 +3694,7 @@ function api_direct_messages_box($type, $box, $verbose)
|
||||||
intval($start),
|
intval($start),
|
||||||
intval($count)
|
intval($count)
|
||||||
);
|
);
|
||||||
if ($verbose == "true" && !DBM::is_result($r)) {
|
if ($verbose == "true" && !DBA::is_result($r)) {
|
||||||
$answer = ['result' => 'error', 'message' => 'no mails available'];
|
$answer = ['result' => 'error', 'message' => 'no mails available'];
|
||||||
return api_format_data("direct_messages_all", $type, ['$result' => $answer]);
|
return api_format_data("direct_messages_all", $type, ['$result' => $answer]);
|
||||||
}
|
}
|
||||||
|
@ -3850,7 +3849,7 @@ function api_fr_photoalbum_delete($type)
|
||||||
intval(api_user()),
|
intval(api_user()),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException("album not available");
|
throw new BadRequestException("album not available");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3860,7 +3859,7 @@ function api_fr_photoalbum_delete($type)
|
||||||
$condition = ['uid' => local_user(), 'resource-id' => $rr['resource-id'], 'type' => 'photo'];
|
$condition = ['uid' => local_user(), 'resource-id' => $rr['resource-id'], 'type' => 'photo'];
|
||||||
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
|
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
|
||||||
|
|
||||||
if (!DBM::is_result($photo_item)) {
|
if (!DBA::is_result($photo_item)) {
|
||||||
throw new InternalServerErrorException("problem with deleting items occured");
|
throw new InternalServerErrorException("problem with deleting items occured");
|
||||||
}
|
}
|
||||||
Item::deleteForUser(['id' => $photo_item['id']], api_user());
|
Item::deleteForUser(['id' => $photo_item['id']], api_user());
|
||||||
|
@ -3940,7 +3939,7 @@ function api_fr_photos_list($type)
|
||||||
'image/gif' => 'gif'
|
'image/gif' => 'gif'
|
||||||
];
|
];
|
||||||
$data = ['photo'=>[]];
|
$data = ['photo'=>[]];
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$photo = [];
|
$photo = [];
|
||||||
$photo['id'] = $rr['resource-id'];
|
$photo['id'] = $rr['resource-id'];
|
||||||
|
@ -4012,7 +4011,7 @@ function api_fr_photo_create_update($type)
|
||||||
dbesc($photo_id),
|
dbesc($photo_id),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException("photo not available");
|
throw new BadRequestException("photo not available");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4135,7 +4134,7 @@ function api_fr_photo_delete($type)
|
||||||
intval(api_user()),
|
intval(api_user()),
|
||||||
dbesc($photo_id)
|
dbesc($photo_id)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException("photo not available");
|
throw new BadRequestException("photo not available");
|
||||||
}
|
}
|
||||||
// now we can perform on the deletion of the photo
|
// now we can perform on the deletion of the photo
|
||||||
|
@ -4147,7 +4146,7 @@ function api_fr_photo_delete($type)
|
||||||
$condition = ['uid' => local_user(), 'resource-id' => $photo_id, 'type' => 'photo'];
|
$condition = ['uid' => local_user(), 'resource-id' => $photo_id, 'type' => 'photo'];
|
||||||
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
|
$photo_item = Item::selectFirstForUser(local_user(), ['id'], $condition);
|
||||||
|
|
||||||
if (!DBM::is_result($photo_item)) {
|
if (!DBA::is_result($photo_item)) {
|
||||||
throw new InternalServerErrorException("problem with deleting items occured");
|
throw new InternalServerErrorException("problem with deleting items occured");
|
||||||
}
|
}
|
||||||
// function for setting the items to "deleted = 1" which ensures that comments, likes etc. are not shown anymore
|
// function for setting the items to "deleted = 1" which ensures that comments, likes etc. are not shown anymore
|
||||||
|
@ -4214,7 +4213,7 @@ function api_account_update_profile_image($type)
|
||||||
if ($profile_id != 0) {
|
if ($profile_id != 0) {
|
||||||
$profile = DBA::selectFirst('profile', ['is-default'], ['uid' => api_user(), 'id' => $profile_id]);
|
$profile = DBA::selectFirst('profile', ['is-default'], ['uid' => api_user(), 'id' => $profile_id]);
|
||||||
// error message if specified profile id is not in database
|
// error message if specified profile id is not in database
|
||||||
if (!DBM::is_result($profile)) {
|
if (!DBA::is_result($profile)) {
|
||||||
throw new BadRequestException("profile_id not available");
|
throw new BadRequestException("profile_id not available");
|
||||||
}
|
}
|
||||||
$is_default_profile = $profile['is-default'];
|
$is_default_profile = $profile['is-default'];
|
||||||
|
@ -4346,7 +4345,7 @@ function check_acl_input($acl_string)
|
||||||
intval($cid),
|
intval($cid),
|
||||||
intval(api_user())
|
intval(api_user())
|
||||||
);
|
);
|
||||||
$contact_not_found |= !DBM::is_result($contact);
|
$contact_not_found |= !DBA::is_result($contact);
|
||||||
}
|
}
|
||||||
return $contact_not_found;
|
return $contact_not_found;
|
||||||
}
|
}
|
||||||
|
@ -4608,7 +4607,7 @@ function prepare_photo_data($type, $scale, $photo_id)
|
||||||
];
|
];
|
||||||
|
|
||||||
// prepare output data for photo
|
// prepare output data for photo
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$data = ['photo' => $r[0]];
|
$data = ['photo' => $r[0]];
|
||||||
$data['photo']['id'] = $data['photo']['resource-id'];
|
$data['photo']['id'] = $data['photo']['resource-id'];
|
||||||
if ($scale !== false) {
|
if ($scale !== false) {
|
||||||
|
@ -4703,7 +4702,7 @@ function api_friendica_remoteauth()
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
|
$contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
|
||||||
|
|
||||||
if (!DBM::is_result($contact) || ($contact['network'] !== NETWORK_DFRN)) {
|
if (!DBA::is_result($contact) || ($contact['network'] !== NETWORK_DFRN)) {
|
||||||
throw new BadRequestException("Unknown contact");
|
throw new BadRequestException("Unknown contact");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4854,7 +4853,7 @@ function api_get_nick($profile)
|
||||||
dbesc(normalise_link($profile))
|
dbesc(normalise_link($profile))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$nick = $r[0]["nick"];
|
$nick = $r[0]["nick"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4864,7 +4863,7 @@ function api_get_nick($profile)
|
||||||
dbesc(normalise_link($profile))
|
dbesc(normalise_link($profile))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$nick = $r[0]["nick"];
|
$nick = $r[0]["nick"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4939,7 +4938,7 @@ function api_in_reply_to($item)
|
||||||
|
|
||||||
if (($item['thr-parent'] != $item['uri']) && (intval($item['parent']) != intval($item['id']))) {
|
if (($item['thr-parent'] != $item['uri']) && (intval($item['parent']) != intval($item['id']))) {
|
||||||
$parent = Item::selectFirst(['id'], ['uid' => $item['uid'], 'uri' => $item['thr-parent']]);
|
$parent = Item::selectFirst(['id'], ['uid' => $item['uid'], 'uri' => $item['thr-parent']]);
|
||||||
if (DBM::is_result($parent)) {
|
if (DBA::is_result($parent)) {
|
||||||
$in_reply_to['status_id'] = intval($parent['id']);
|
$in_reply_to['status_id'] = intval($parent['id']);
|
||||||
} else {
|
} else {
|
||||||
$in_reply_to['status_id'] = intval($item['parent']);
|
$in_reply_to['status_id'] = intval($item['parent']);
|
||||||
|
@ -4950,7 +4949,7 @@ function api_in_reply_to($item)
|
||||||
$fields = ['author-nick', 'author-name', 'author-id', 'author-link'];
|
$fields = ['author-nick', 'author-name', 'author-id', 'author-link'];
|
||||||
$parent = Item::selectFirst($fields, ['id' => $in_reply_to['status_id']]);
|
$parent = Item::selectFirst($fields, ['id' => $in_reply_to['status_id']]);
|
||||||
|
|
||||||
if (DBM::is_result($parent)) {
|
if (DBA::is_result($parent)) {
|
||||||
if ($parent['author-nick'] == "") {
|
if ($parent['author-nick'] == "") {
|
||||||
$parent['author-nick'] = api_get_nick($parent['author-link']);
|
$parent['author-nick'] = api_get_nick($parent['author-link']);
|
||||||
}
|
}
|
||||||
|
@ -5127,7 +5126,7 @@ function api_friendica_group_show($type)
|
||||||
intval($gid)
|
intval($gid)
|
||||||
);
|
);
|
||||||
// error message if specified gid is not in database
|
// error message if specified gid is not in database
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException("gid not available");
|
throw new BadRequestException("gid not available");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -5197,7 +5196,7 @@ function api_friendica_group_delete($type)
|
||||||
intval($gid)
|
intval($gid)
|
||||||
);
|
);
|
||||||
// error message if specified gid is not in database
|
// error message if specified gid is not in database
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException('gid not available');
|
throw new BadRequestException('gid not available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5209,7 +5208,7 @@ function api_friendica_group_delete($type)
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
// error message if specified gid is not in database
|
// error message if specified gid is not in database
|
||||||
if (!DBM::is_result($rname)) {
|
if (!DBA::is_result($rname)) {
|
||||||
throw new BadRequestException('wrong group name');
|
throw new BadRequestException('wrong group name');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5294,7 +5293,7 @@ function group_create($name, $uid, $users = [])
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
// error message if specified group name already exists
|
// error message if specified group name already exists
|
||||||
if (DBM::is_result($rname)) {
|
if (DBA::is_result($rname)) {
|
||||||
throw new BadRequestException('group name already exists');
|
throw new BadRequestException('group name already exists');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5305,7 +5304,7 @@ function group_create($name, $uid, $users = [])
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
// error message if specified group name already exists
|
// error message if specified group name already exists
|
||||||
if (DBM::is_result($rname)) {
|
if (DBA::is_result($rname)) {
|
||||||
$reactivate_group = true;
|
$reactivate_group = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5636,7 +5635,7 @@ function api_friendica_notification_seen($type)
|
||||||
if ($note['otype']=='item') {
|
if ($note['otype']=='item') {
|
||||||
// would be really better with an ItemsManager and $im->getByID() :-P
|
// would be really better with an ItemsManager and $im->getByID() :-P
|
||||||
$item = Item::selectFirstForUser(api_user(), [], ['id' => $note['iid'], 'uid' => api_user()]);
|
$item = Item::selectFirstForUser(api_user(), [], ['id' => $note['iid'], 'uid' => api_user()]);
|
||||||
if (DBM::is_result($$item)) {
|
if (DBA::is_result($$item)) {
|
||||||
// we found the item, return it to the user
|
// we found the item, return it to the user
|
||||||
$ret = api_format_items([$item], $user_info, false, $type);
|
$ret = api_format_items([$item], $user_info, false, $type);
|
||||||
$data = ['status' => $ret];
|
$data = ['status' => $ret];
|
||||||
|
@ -5735,7 +5734,7 @@ function api_friendica_direct_messages_search($type, $box = "")
|
||||||
$profile_url = $user_info["url"];
|
$profile_url = $user_info["url"];
|
||||||
|
|
||||||
// message if nothing was found
|
// message if nothing was found
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$success = ['success' => false, 'search_results' => 'problem with query'];
|
$success = ['success' => false, 'search_results' => 'problem with query'];
|
||||||
} elseif (count($r) == 0) {
|
} elseif (count($r) == 0) {
|
||||||
$success = ['success' => false, 'search_results' => 'nothing found'];
|
$success = ['success' => false, 'search_results' => 'nothing found'];
|
||||||
|
@ -5793,7 +5792,7 @@ function api_friendica_profile_show($type)
|
||||||
);
|
);
|
||||||
|
|
||||||
// error message if specified gid is not in database
|
// error message if specified gid is not in database
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
throw new BadRequestException("profile_id not available");
|
throw new BadRequestException("profile_id not available");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,7 +13,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -136,7 +135,7 @@ function localize_item(&$item)
|
||||||
|
|
||||||
$fields = ['author-link', 'author-name', 'verb', 'object-type', 'resource-id', 'body', 'plink'];
|
$fields = ['author-link', 'author-name', 'verb', 'object-type', 'resource-id', 'body', 'plink'];
|
||||||
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
|
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
|
||||||
if (!DBM::is_result($obj)) {
|
if (!DBA::is_result($obj)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +266,7 @@ function localize_item(&$item)
|
||||||
$fields = ['author-id', 'author-link', 'author-name', 'author-network',
|
$fields = ['author-id', 'author-link', 'author-name', 'author-network',
|
||||||
'verb', 'object-type', 'resource-id', 'body', 'plink'];
|
'verb', 'object-type', 'resource-id', 'body', 'plink'];
|
||||||
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
|
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
|
||||||
if (!DBM::is_result($obj)) {
|
if (!DBA::is_result($obj)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +321,7 @@ function localize_item(&$item)
|
||||||
if (strlen($obj->id)) {
|
if (strlen($obj->id)) {
|
||||||
$fields = ['author-link', 'author-name', 'plink'];
|
$fields = ['author-link', 'author-name', 'plink'];
|
||||||
$target = Item::selectFirst($fields, ['uri' => $obj->id, 'uid' => $item['uid']]);
|
$target = Item::selectFirst($fields, ['uri' => $obj->id, 'uid' => $item['uid']]);
|
||||||
if (DBM::is_result($target) && $target['plink']) {
|
if (DBA::is_result($target) && $target['plink']) {
|
||||||
$Bname = $target['author-name'];
|
$Bname = $target['author-name'];
|
||||||
$Blink = $target['author-link'];
|
$Blink = $target['author-link'];
|
||||||
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
|
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
|
||||||
|
@ -830,7 +829,7 @@ function item_photo_menu($item) {
|
||||||
$rel = 0;
|
$rel = 0;
|
||||||
$condition = ['uid' => local_user(), 'nurl' => normalise_link($item['author-link'])];
|
$condition = ['uid' => local_user(), 'nurl' => normalise_link($item['author-link'])];
|
||||||
$contact = DBA::selectFirst('contact', ['id', 'network', 'rel'], $condition);
|
$contact = DBA::selectFirst('contact', ['id', 'network', 'rel'], $condition);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
$network = $contact['network'];
|
$network = $contact['network'];
|
||||||
$rel = $contact['rel'];
|
$rel = $contact['rel'];
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Emailer;
|
use Friendica\Util\Emailer;
|
||||||
|
@ -54,7 +53,7 @@ function notification($params)
|
||||||
['uid' => $params['uid']]);
|
['uid' => $params['uid']]);
|
||||||
|
|
||||||
// There is no need to create notifications for forum accounts
|
// There is no need to create notifications for forum accounts
|
||||||
if (!DBM::is_result($user) || in_array($user["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
|
if (!DBA::is_result($user) || in_array($user["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,7 +107,7 @@ function notification($params)
|
||||||
|
|
||||||
if ($params['type'] == NOTIFY_COMMENT) {
|
if ($params['type'] == NOTIFY_COMMENT) {
|
||||||
$thread = DBA::selectFirst('thread', ['ignored'], ['iid' => $parent_id]);
|
$thread = DBA::selectFirst('thread', ['ignored'], ['iid' => $parent_id]);
|
||||||
if (DBM::is_result($thread) && $thread["ignored"]) {
|
if (DBA::is_result($thread) && $thread["ignored"]) {
|
||||||
logger("Thread ".$parent_id." will be ignored", LOGGER_DEBUG);
|
logger("Thread ".$parent_id." will be ignored", LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +155,7 @@ function notification($params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// "your post"
|
// "your post"
|
||||||
if (DBM::is_result($item) && $item['owner-id'] == $item['author-id'] && $item['wall']) {
|
if (DBA::is_result($item) && $item['owner-id'] == $item['author-id'] && $item['wall']) {
|
||||||
$dest_str = L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]',
|
$dest_str = L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]',
|
||||||
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
|
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
|
||||||
$itemlink,
|
$itemlink,
|
||||||
|
@ -438,7 +437,7 @@ function notification($params)
|
||||||
$hash = random_string();
|
$hash = random_string();
|
||||||
$r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
|
$r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
|
||||||
dbesc($hash));
|
dbesc($hash));
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$dups = true;
|
$dups = true;
|
||||||
}
|
}
|
||||||
} while ($dups == true);
|
} while ($dups == true);
|
||||||
|
@ -690,12 +689,12 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
|
||||||
|
|
||||||
$fields = ['notify-flags', 'language', 'username', 'email', 'nickname'];
|
$fields = ['notify-flags', 'language', 'username', 'email', 'nickname'];
|
||||||
$user = DBA::selectFirst('user', $fields, ['uid' => $uid]);
|
$user = DBA::selectFirst('user', $fields, ['uid' => $uid]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner = DBA::selectFirst('contact', ['url'], ['self' => true, 'uid' => $uid]);
|
$owner = DBA::selectFirst('contact', ['url'], ['self' => true, 'uid' => $uid]);
|
||||||
if (!DBM::is_result($owner)) {
|
if (!DBA::is_result($owner)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,7 +745,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
|
||||||
'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
|
'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
|
||||||
$condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
$condition = ['id' => $itemid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
if (!DBM::is_result($item) || in_array($item['author-id'], $contacts)) {
|
if (!DBA::is_result($item) || in_array($item['author-id'], $contacts)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,7 +772,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
|
||||||
$tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d",
|
$tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d",
|
||||||
intval(TERM_OBJ_POST), intval($itemid), intval(TERM_MENTION), intval($uid));
|
intval(TERM_OBJ_POST), intval($itemid), intval(TERM_MENTION), intval($uid));
|
||||||
|
|
||||||
if (DBM::is_result($tags)) {
|
if (DBA::is_result($tags)) {
|
||||||
foreach ($tags AS $tag) {
|
foreach ($tags AS $tag) {
|
||||||
$condition = ['nurl' => normalise_link($tag["url"]), 'uid' => $uid, 'notify_new_posts' => true];
|
$condition = ['nurl' => normalise_link($tag["url"]), 'uid' => $uid, 'notify_new_posts' => true];
|
||||||
$r = DBA::exists('contact', $condition);
|
$r = DBA::exists('contact', $condition);
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Protocol\DFRN;
|
use Friendica\Protocol\DFRN;
|
||||||
use Friendica\Protocol\Feed;
|
use Friendica\Protocol\Feed;
|
||||||
|
@ -266,7 +265,7 @@ function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0)
|
||||||
WHERE `contact`.`id` = %d AND `user`.`uid` = %d",
|
WHERE `contact`.`id` = %d AND `user`.`uid` = %d",
|
||||||
dbesc($contact["id"]), dbesc($importer["uid"])
|
dbesc($contact["id"]), dbesc($importer["uid"])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
logger("Now import the DFRN feed");
|
logger("Now import the DFRN feed");
|
||||||
DFRN::import($xml, $r[0], true);
|
DFRN::import($xml, $r[0], true);
|
||||||
return;
|
return;
|
||||||
|
@ -290,7 +289,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
|
||||||
* through the direct Diaspora protocol. If we try and use
|
* through the direct Diaspora protocol. If we try and use
|
||||||
* the feed, we'll get duplicates. So don't.
|
* the feed, we'll get duplicates. So don't.
|
||||||
*/
|
*/
|
||||||
if ((!DBM::is_result($r)) || $contact['network'] === NETWORK_DIASPORA) {
|
if ((!DBA::is_result($r)) || $contact['network'] === NETWORK_DIASPORA) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +340,7 @@ function drop_item($id) {
|
||||||
$fields = ['id', 'uid', 'contact-id', 'deleted'];
|
$fields = ['id', 'uid', 'contact-id', 'deleted'];
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
|
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
|
||||||
|
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
notice(L10n::t('Item not found.') . EOL);
|
notice(L10n::t('Item not found.') . EOL);
|
||||||
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
||||||
}
|
}
|
||||||
|
@ -462,7 +461,7 @@ function posted_date_widget($url, $uid, $wall) {
|
||||||
|
|
||||||
$ret = list_post_dates($uid, $wall);
|
$ret = list_post_dates($uid, $wall);
|
||||||
|
|
||||||
if (!DBM::is_result($ret)) {
|
if (!DBA::is_result($ret)) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
|
@ -101,7 +100,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
|
|
||||||
if ((x($_SESSION, 'submanage')) && intval($_SESSION['submanage'])) {
|
if ((x($_SESSION, 'submanage')) && intval($_SESSION['submanage'])) {
|
||||||
$user = DBA::selectFirst('user', [], ['uid' => $_SESSION['submanage']]);
|
$user = DBA::selectFirst('user', [], ['uid' => $_SESSION['submanage']]);
|
||||||
if (DBM::is_result($user)) {
|
if (DBA::is_result($user)) {
|
||||||
$master_record = $user;
|
$master_record = $user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,7 +114,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
// Then add all the children
|
// Then add all the children
|
||||||
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
||||||
['parent-uid' => $master_record['uid'], 'account_removed' => false]);
|
['parent-uid' => $master_record['uid'], 'account_removed' => false]);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,14 +124,14 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
// First entry is our parent
|
// First entry is our parent
|
||||||
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
||||||
['uid' => $master_record['parent-uid'], 'account_removed' => false]);
|
['uid' => $master_record['parent-uid'], 'account_removed' => false]);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->identities = DBA::toArray($r);
|
$a->identities = DBA::toArray($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then add all siblings
|
// Then add all siblings
|
||||||
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
$r = DBA::select('user', ['uid', 'username', 'nickname'],
|
||||||
['parent-uid' => $master_record['parent-uid'], 'account_removed' => false]);
|
['parent-uid' => $master_record['parent-uid'], 'account_removed' => false]);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +142,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
WHERE `user`.`account_removed` = 0 AND `manage`.`uid` = ?",
|
WHERE `user`.`account_removed` = 0 AND `manage`.`uid` = ?",
|
||||||
$master_record['uid']
|
$master_record['uid']
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
$a->identities = array_merge($a->identities, DBA::toArray($r));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +154,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => true]);
|
$contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => true]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$a->contact = $contact;
|
$a->contact = $contact;
|
||||||
$a->cid = $contact['id'];
|
$a->cid = $contact['id'];
|
||||||
$_SESSION['cid'] = $a->cid;
|
$_SESSION['cid'] = $a->cid;
|
||||||
|
@ -247,7 +246,7 @@ function can_write_wall($owner)
|
||||||
intval(PAGE_COMMUNITY)
|
intval(PAGE_COMMUNITY)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$verified = 2;
|
$verified = 2;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -302,7 +301,7 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null)
|
||||||
intval($remote_user),
|
intval($remote_user),
|
||||||
intval($owner_id)
|
intval($owner_id)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$remote_verified = true;
|
$remote_verified = true;
|
||||||
$groups = Group::getIdsByContactId($remote_user);
|
$groups = Group::getIdsByContactId($remote_user);
|
||||||
}
|
}
|
||||||
|
@ -365,7 +364,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul
|
||||||
intval($remote_user),
|
intval($remote_user),
|
||||||
intval($owner_id)
|
intval($owner_id)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$remote_verified = true;
|
$remote_verified = true;
|
||||||
$groups = Group::getIdsByContactId($remote_user);
|
$groups = Group::getIdsByContactId($remote_user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,10 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Event;
|
use Friendica\Model\Event;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
|
||||||
use Friendica\Render\FriendicaSmarty;
|
use Friendica\Render\FriendicaSmarty;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Map;
|
use Friendica\Util\Map;
|
||||||
|
@ -760,7 +759,7 @@ function contact_block() {
|
||||||
dbesc(NETWORK_OSTATUS),
|
dbesc(NETWORK_OSTATUS),
|
||||||
dbesc(NETWORK_DIASPORA)
|
dbesc(NETWORK_DIASPORA)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$total = intval($r[0]['total']);
|
$total = intval($r[0]['total']);
|
||||||
}
|
}
|
||||||
if (!$total) {
|
if (!$total) {
|
||||||
|
@ -779,7 +778,7 @@ function contact_block() {
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
intval($shown)
|
intval($shown)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contacts = [];
|
$contacts = [];
|
||||||
foreach ($r AS $contact) {
|
foreach ($r AS $contact) {
|
||||||
$contacts[] = $contact["id"];
|
$contacts[] = $contact["id"];
|
||||||
|
@ -787,7 +786,7 @@ function contact_block() {
|
||||||
$r = q("SELECT `id`, `uid`, `addr`, `url`, `name`, `thumb`, `network` FROM `contact` WHERE `id` IN (%s)",
|
$r = q("SELECT `id`, `uid`, `addr`, `url`, `name`, `thumb`, `network` FROM `contact` WHERE `id` IN (%s)",
|
||||||
dbesc(implode(",", $contacts)));
|
dbesc(implode(",", $contacts)));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contacts = L10n::tt('%d Contact', '%d Contacts', $total);
|
$contacts = L10n::tt('%d Contact', '%d Contacts', $total);
|
||||||
$micropro = [];
|
$micropro = [];
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
|
@ -1470,7 +1469,7 @@ function generate_user_guid() {
|
||||||
$x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
|
$x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
|
||||||
dbesc($guid)
|
dbesc($guid)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($x)) {
|
if (!DBA::is_result($x)) {
|
||||||
$found = false;
|
$found = false;
|
||||||
}
|
}
|
||||||
} while ($found == true);
|
} while ($found == true);
|
||||||
|
@ -1759,7 +1758,7 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
|
||||||
intval($termtype),
|
intval($termtype),
|
||||||
intval($uid));
|
intval($uid));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
unset($deleted_tags[$key]);
|
unset($deleted_tags[$key]);
|
||||||
} else {
|
} else {
|
||||||
$filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated);
|
$filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated);
|
||||||
|
@ -1783,7 +1782,7 @@ function file_tag_save_file($uid, $item_id, $file)
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
|
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
if (!stristr($item['file'],'[' . file_tag_encode($file) . ']')) {
|
if (!stristr($item['file'],'[' . file_tag_encode($file) . ']')) {
|
||||||
$fields = ['file' => $item['file'] . '[' . file_tag_encode($file) . ']'];
|
$fields = ['file' => $item['file'] . '[' . file_tag_encode($file) . ']'];
|
||||||
Item::update($fields, ['id' => $item_id]);
|
Item::update($fields, ['id' => $item_id]);
|
||||||
|
@ -1812,7 +1811,7 @@ function file_tag_unsave_file($uid, $item_id, $file, $cat = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
|
$item = Item::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1825,7 +1824,7 @@ function file_tag_unsave_file($uid, $item_id, $file, $cat = false)
|
||||||
intval($termtype),
|
intval($termtype),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$saved = PConfig::get($uid, 'system', 'filetags');
|
$saved = PConfig::get($uid, 'system', 'filetags');
|
||||||
PConfig::set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
|
PConfig::set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
use Friendica\Module\Login;
|
use Friendica\Module\Login;
|
||||||
|
|
||||||
|
@ -96,7 +95,7 @@ if (x($_SESSION, 'authenticated') && !x($_SESSION, 'language')) {
|
||||||
// we haven't loaded user data yet, but we need user language
|
// we haven't loaded user data yet, but we need user language
|
||||||
$user = DBA::selectFirst('user', ['language'], ['uid' => $_SESSION['uid']]);
|
$user = DBA::selectFirst('user', ['language'], ['uid' => $_SESSION['uid']]);
|
||||||
$_SESSION['language'] = $lang;
|
$_SESSION['language'] = $lang;
|
||||||
if (DBM::is_result($user)) {
|
if (DBA::is_result($user)) {
|
||||||
$_SESSION['language'] = $user['language'];
|
$_SESSION['language'] = $user['language'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\Content\Widget;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
|
@ -210,7 +209,7 @@ function acl_content(App $a)
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$forums = [];
|
$forums = [];
|
||||||
foreach ($r as $g) {
|
foreach ($r as $g) {
|
||||||
$entry = [
|
$entry = [
|
||||||
|
@ -243,7 +242,7 @@ function acl_content(App $a)
|
||||||
if ($conv_id) {
|
if ($conv_id) {
|
||||||
// In multi threaded posts the conv_id is not the parent of the whole thread
|
// In multi threaded posts the conv_id is not the parent of the whole thread
|
||||||
$parent_item = Item::selectFirst(['parent'], ['id' => $conv_id]);
|
$parent_item = Item::selectFirst(['parent'], ['id' => $conv_id]);
|
||||||
if (DBM::is_result($parent_item)) {
|
if (DBA::is_result($parent_item)) {
|
||||||
$conv_id = $parent_item['parent'];
|
$conv_id = $parent_item['parent'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Database\DBStructure;
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -819,7 +818,7 @@ function admin_page_summary(App $a)
|
||||||
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::databaseName()));
|
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::databaseName()));
|
||||||
$showwarning = false;
|
$showwarning = false;
|
||||||
$warningtext = [];
|
$warningtext = [];
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
$warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console.php dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
|
$warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console.php dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
|
||||||
}
|
}
|
||||||
|
@ -961,7 +960,7 @@ function admin_page_site_post(App $a)
|
||||||
|
|
||||||
$r = q("UPDATE %s SET %s;", $table_name, $upds);
|
$r = q("UPDATE %s SET %s;", $table_name, $upds);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice("Failed updating '$table_name': " . DBA::errorMessage());
|
notice("Failed updating '$table_name': " . DBA::errorMessage());
|
||||||
goaway('admin/site');
|
goaway('admin/site');
|
||||||
}
|
}
|
||||||
|
@ -1581,7 +1580,7 @@ function admin_page_dbsync(App $a)
|
||||||
$failed = [];
|
$failed = [];
|
||||||
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
|
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$upd = intval(substr($rr['k'], 7));
|
$upd = intval(substr($rr['k'], 7));
|
||||||
if ($upd < 1139 || $rr['v'] === 'success') {
|
if ($upd < 1139 || $rr['v'] === 'success') {
|
||||||
|
@ -1731,7 +1730,7 @@ function admin_page_users(App $a)
|
||||||
if ($a->argc > 2) {
|
if ($a->argc > 2) {
|
||||||
$uid = $a->argv[3];
|
$uid = $a->argv[3];
|
||||||
$user = DBA::selectFirst('user', ['username', 'blocked'], ['uid' => $uid]);
|
$user = DBA::selectFirst('user', ['username', 'blocked'], ['uid' => $uid]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
notice('User not found' . EOL);
|
notice('User not found' . EOL);
|
||||||
goaway('admin/users');
|
goaway('admin/users');
|
||||||
return ''; // NOTREACHED
|
return ''; // NOTREACHED
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -37,7 +36,7 @@ function allfriends_content(App $a)
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => local_user()]);
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +48,7 @@ function allfriends_content(App $a)
|
||||||
$a->set_pager_total($total);
|
$a->set_pager_total($total);
|
||||||
|
|
||||||
$r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
|
$r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$o .= L10n::t('No friends to display.');
|
$o .= L10n::t('No friends to display.');
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Module\Login;
|
use Friendica\Module\Login;
|
||||||
|
|
||||||
require_once 'include/api.php';
|
require_once 'include/api.php';
|
||||||
|
@ -22,7 +22,7 @@ function oauth_get_client($request)
|
||||||
WHERE `clients`.`client_id`=`tokens`.`client_id`
|
WHERE `clients`.`client_id`=`tokens`.`client_id`
|
||||||
AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token));
|
AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token));
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -23,7 +22,7 @@ function attach_init(App $a)
|
||||||
// Check for existence, which will also provide us the owner uid
|
// Check for existence, which will also provide us the owner uid
|
||||||
|
|
||||||
$r = DBA::selectFirst('attach', [], ['id' => $item_id]);
|
$r = DBA::selectFirst('attach', [], ['id' => $item_id]);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t('Item was not found.'). EOL);
|
notice(L10n::t('Item was not found.'). EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +35,7 @@ function attach_init(App $a)
|
||||||
dbesc($item_id)
|
dbesc($item_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t('Permission denied.') . EOL);
|
notice(L10n::t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Event;
|
use Friendica\Model\Event;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
@ -38,7 +37,7 @@ function cal_init(App $a)
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
$nick = $a->argv[1];
|
$nick = $a->argv[1];
|
||||||
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]);
|
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@ function cal_content(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($a->profile['profile_uid'])
|
intval($a->profile['profile_uid'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,7 +229,7 @@ function cal_content(App $a)
|
||||||
|
|
||||||
$links = [];
|
$links = [];
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$r = Event::sortByDate($r);
|
$r = Event::sortByDate($r);
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Content\ContactSelector;
|
use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -40,14 +39,14 @@ function common_content(App $a)
|
||||||
if ($cmd === 'loc' && $cid) {
|
if ($cmd === 'loc' && $cid) {
|
||||||
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
|
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['id' => $cid, 'uid' => $uid]);
|
||||||
|
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$a->page['aside'] = "";
|
$a->page['aside'] = "";
|
||||||
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
|
$contact = DBA::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
|
||||||
|
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
|
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
|
||||||
'$name' => htmlentities($contact['name']),
|
'$name' => htmlentities($contact['name']),
|
||||||
'$photo' => $contact['photo'],
|
'$photo' => $contact['photo'],
|
||||||
|
@ -61,17 +60,17 @@ function common_content(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$cid && Profile::getMyURL()) {
|
if (!$cid && Profile::getMyURL()) {
|
||||||
$contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $uid]);
|
$contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $uid]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
} else {
|
} else {
|
||||||
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
|
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
|
||||||
if (DBM::is_result($gcontact)) {
|
if (DBA::is_result($gcontact)) {
|
||||||
$zcid = $gcontact['id'];
|
$zcid = $gcontact['id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +99,7 @@ function common_content(App $a)
|
||||||
$r = GContact::commonFriendsZcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
|
$r = GContact::commonFriendsZcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
function community_init(App $a)
|
function community_init(App $a)
|
||||||
{
|
{
|
||||||
|
@ -138,7 +137,7 @@ function community_content(App $a, $update = 0)
|
||||||
|
|
||||||
$r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content);
|
$r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
info(L10n::t('No results.') . EOL);
|
info(L10n::t('No results.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ function contactgroup_content(App $a)
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$change = intval($a->argv[2]);
|
$change = intval($a->argv[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ function contactgroup_content(App $a)
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
@ -45,7 +44,7 @@ function contacts_init(App $a)
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
if ($contact['self']) {
|
if ($contact['self']) {
|
||||||
if (($a->argc == 3) && intval($a->argv[1]) && ($a->argv[2] == "posts")) {
|
if (($a->argc == 3) && intval($a->argv[1]) && ($a->argv[2] == "posts")) {
|
||||||
goaway('profile/' . $contact['nick']);
|
goaway('profile/' . $contact['nick']);
|
||||||
|
@ -225,14 +224,14 @@ function contacts_post(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
info(L10n::t('Contact updated.') . EOL);
|
info(L10n::t('Contact updated.') . EOL);
|
||||||
} else {
|
} else {
|
||||||
notice(L10n::t('Failed to update contact record.') . EOL);
|
notice(L10n::t('Failed to update contact record.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$a->data['contact'] = $contact;
|
$a->data['contact'] = $contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +243,7 @@ function contacts_post(App $a)
|
||||||
function _contact_update($contact_id)
|
function _contact_update($contact_id)
|
||||||
{
|
{
|
||||||
$contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +264,7 @@ function _contact_update($contact_id)
|
||||||
function _contact_update_profile($contact_id)
|
function _contact_update_profile($contact_id)
|
||||||
{
|
{
|
||||||
$contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', ['uid', 'url', 'network'], ['id' => $contact_id, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +335,7 @@ function _contact_block($contact_id, $orig_record)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
return DBM::is_result($r);
|
return DBA::is_result($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _contact_ignore($contact_id, $orig_record)
|
function _contact_ignore($contact_id, $orig_record)
|
||||||
|
@ -347,7 +346,7 @@ function _contact_ignore($contact_id, $orig_record)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
return DBM::is_result($r);
|
return DBA::is_result($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _contact_archive($contact_id, $orig_record)
|
function _contact_archive($contact_id, $orig_record)
|
||||||
|
@ -358,7 +357,7 @@ function _contact_archive($contact_id, $orig_record)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
return DBM::is_result($r);
|
return DBA::is_result($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _contact_drop($orig_record)
|
function _contact_drop($orig_record)
|
||||||
|
@ -369,7 +368,7 @@ function _contact_drop($orig_record)
|
||||||
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
||||||
intval($a->user['uid'])
|
intval($a->user['uid'])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,7 +396,7 @@ function contacts_content(App $a)
|
||||||
$cmd = $a->argv[2];
|
$cmd = $a->argv[2];
|
||||||
|
|
||||||
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
|
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
|
||||||
if (!DBM::is_result($orig_record)) {
|
if (!DBA::is_result($orig_record)) {
|
||||||
notice(L10n::t('Could not access contact record.') . EOL);
|
notice(L10n::t('Could not access contact record.') . EOL);
|
||||||
goaway('contacts');
|
goaway('contacts');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
@ -788,7 +787,7 @@ function contacts_content(App $a)
|
||||||
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
|
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
$total = $r[0]['total'];
|
$total = $r[0]['total'];
|
||||||
}
|
}
|
||||||
|
@ -802,7 +801,7 @@ function contacts_content(App $a)
|
||||||
intval($a->pager['start']),
|
intval($a->pager['start']),
|
||||||
intval($a->pager['itemspage'])
|
intval($a->pager['itemspage'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$contacts[] = _contact_detail_for_template($rr);
|
$contacts[] = _contact_detail_for_template($rr);
|
||||||
}
|
}
|
||||||
|
@ -911,7 +910,7 @@ function contact_posts($a, $contact_id)
|
||||||
$o = contacts_tab($a, $contact_id, 1);
|
$o = contacts_tab($a, $contact_id, 1);
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id]);
|
$contact = DBA::selectFirst('contact', ['url'], ['id' => $contact_id]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$a->page['aside'] = "";
|
$a->page['aside'] = "";
|
||||||
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
||||||
$o .= Contact::getPostsFromUrl($contact["url"]);
|
$o .= Contact::getPostsFromUrl($contact["url"]);
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ function crepair_init(App $a)
|
||||||
$a->page['aside'] = '';
|
$a->page['aside'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$a->data['contact'] = $contact;
|
$a->data['contact'] = $contact;
|
||||||
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
|
||||||
}
|
}
|
||||||
|
@ -47,7 +46,7 @@ function crepair_post(App $a)
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ function crepair_content(App $a)
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
notice(L10n::t('Contact not found.') . EOL);
|
notice(L10n::t('Contact not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
|
||||||
require_once 'mod/settings.php';
|
require_once 'mod/settings.php';
|
||||||
|
@ -35,7 +34,7 @@ function delegate_post(App $a)
|
||||||
|
|
||||||
if ($parent_uid != 0) {
|
if ($parent_uid != 0) {
|
||||||
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $parent_uid]);
|
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $parent_uid]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
notice(L10n::t('Parent user not found.') . EOL);
|
notice(L10n::t('Parent user not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +65,7 @@ function delegate_content(App $a)
|
||||||
$user_id = $a->argv[2];
|
$user_id = $a->argv[2];
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $user_id]);
|
$user = DBA::selectFirst('user', ['nickname'], ['uid' => $user_id]);
|
||||||
if (DBM::is_result($user)) {
|
if (DBA::is_result($user)) {
|
||||||
$condition = [
|
$condition = [
|
||||||
'uid' => local_user(),
|
'uid' => local_user(),
|
||||||
'nurl' => normalise_link(System::baseUrl() . '/profile/' . $user['nickname'])
|
'nurl' => normalise_link(System::baseUrl() . '/profile/' . $user['nickname'])
|
||||||
|
@ -93,7 +92,7 @@ function delegate_content(App $a)
|
||||||
$r = q("SELECT * FROM `user` WHERE `uid` IN (SELECT `uid` FROM `manage` WHERE `mid` = %d)",
|
$r = q("SELECT * FROM `user` WHERE `uid` IN (SELECT `uid` FROM `manage` WHERE `mid` = %d)",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$delegates = $r;
|
$delegates = $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +114,7 @@ function delegate_content(App $a)
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(NETWORK_DFRN)
|
dbesc(NETWORK_DFRN)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$nicknames = [];
|
$nicknames = [];
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$nicknames[] = "'" . dbesc(basename($rr['nurl'])) . "'";
|
$nicknames[] = "'" . dbesc(basename($rr['nurl'])) . "'";
|
||||||
|
@ -125,7 +124,7 @@ function delegate_content(App $a)
|
||||||
|
|
||||||
// get user records for all potential page delegates who are not already delegates or managers
|
// get user records for all potential page delegates who are not already delegates or managers
|
||||||
$r = q("SELECT `uid`, `username`, `nickname` FROM `user` WHERE `nickname` IN ($nicks)");
|
$r = q("SELECT `uid`, `username`, `nickname` FROM `user` WHERE `nickname` IN ($nicks)");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
if (!in_array($rr['uid'], $uids)) {
|
if (!in_array($rr['uid'], $uids)) {
|
||||||
$potentials[] = $rr;
|
$potentials[] = $rr;
|
||||||
|
@ -140,7 +139,7 @@ function delegate_content(App $a)
|
||||||
|
|
||||||
$parent_user = null;
|
$parent_user = null;
|
||||||
|
|
||||||
if (DBM::is_result($user)) {
|
if (DBA::is_result($user)) {
|
||||||
if (!DBA::exists('user', ['parent-uid' => local_user()])) {
|
if (!DBA::exists('user', ['parent-uid' => local_user()])) {
|
||||||
$parent_uid = $user['parent-uid'];
|
$parent_uid = $user['parent-uid'];
|
||||||
$parents = [0 => L10n::t('No parent user')];
|
$parents = [0 => L10n::t('No parent user')];
|
||||||
|
|
|
@ -22,7 +22,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -68,7 +67,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', [], ['uid' => $uid]);
|
$user = DBA::selectFirst('user', [], ['uid' => $uid]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
notice(L10n::t('Profile not found.') . EOL);
|
notice(L10n::t('Profile not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +121,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
intval($cid),
|
intval($cid),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
logger('Contact not found in DB.');
|
logger('Contact not found in DB.');
|
||||||
notice(L10n::t('Contact not found.') . EOL);
|
notice(L10n::t('Contact not found.') . EOL);
|
||||||
notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
|
notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
|
||||||
|
@ -281,7 +280,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
|
|
||||||
if (($status == 0) && $intro_id) {
|
if (($status == 0) && $intro_id) {
|
||||||
$intro = DBA::selectFirst('intro', ['note'], ['id' => $intro_id]);
|
$intro = DBA::selectFirst('intro', ['note'], ['id' => $intro_id]);
|
||||||
if (DBM::is_result($intro)) {
|
if (DBA::is_result($intro)) {
|
||||||
DBA::update('contact', ['reason' => $intro['note']], ['id' => $contact_id]);
|
DBA::update('contact', ['reason' => $intro['note']], ['id' => $contact_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,14 +385,14 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t('Unable to set contact photo.') . EOL);
|
notice(L10n::t('Unable to set contact photo.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reload contact info
|
// reload contact info
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id]);
|
||||||
if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
|
if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
|
||||||
if (DBM::is_result($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
|
if (DBA::is_result($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
|
||||||
$ret = Diaspora::sendShare($user, $contact);
|
$ret = Diaspora::sendShare($user, $contact);
|
||||||
logger('share returns: ' . $ret);
|
logger('share returns: ' . $ret);
|
||||||
}
|
}
|
||||||
|
@ -444,7 +443,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
|
|
||||||
// Find our user's account
|
// Find our user's account
|
||||||
$user = DBA::selectFirst('user', [], ['nickname' => $node]);
|
$user = DBA::selectFirst('user', [], ['nickname' => $node]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
$message = L10n::t('No user record found for \'%s\' ', $node);
|
$message = L10n::t('No user record found for \'%s\' ', $node);
|
||||||
System::xmlExit(3, $message); // failure
|
System::xmlExit(3, $message); // failure
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
@ -472,7 +471,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['url' => $decrypted_source_url, 'uid' => $local_uid]);
|
$contact = DBA::selectFirst('contact', [], ['url' => $decrypted_source_url, 'uid' => $local_uid]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
if (strstr($decrypted_source_url, 'http:')) {
|
if (strstr($decrypted_source_url, 'http:')) {
|
||||||
$newurl = str_replace('http:', 'https:', $decrypted_source_url);
|
$newurl = str_replace('http:', 'https:', $decrypted_source_url);
|
||||||
} else {
|
} else {
|
||||||
|
@ -480,7 +479,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
|
$contact = DBA::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
// this is either a bogus confirmation (?) or we deleted the original introduction.
|
// this is either a bogus confirmation (?) or we deleted the original introduction.
|
||||||
$message = L10n::t('Contact record was not found for you on our site.');
|
$message = L10n::t('Contact record was not found for you on our site.');
|
||||||
System::xmlExit(3, $message);
|
System::xmlExit(3, $message);
|
||||||
|
@ -522,7 +521,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
dbesc($dfrn_pubkey),
|
dbesc($dfrn_pubkey),
|
||||||
intval($dfrn_record)
|
intval($dfrn_record)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$message = L10n::t('Unable to set your contact credentials on our system.');
|
$message = L10n::t('Unable to set your contact credentials on our system.');
|
||||||
System::xmlExit(3, $message);
|
System::xmlExit(3, $message);
|
||||||
}
|
}
|
||||||
|
@ -538,7 +537,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
|
|
||||||
// We're good but now we have to scrape the profile photo and send notifications.
|
// We're good but now we have to scrape the profile photo and send notifications.
|
||||||
$contact = DBA::selectFirst('contact', ['photo'], ['id' => $dfrn_record]);
|
$contact = DBA::selectFirst('contact', ['photo'], ['id' => $dfrn_record]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$photo = $contact['photo'];
|
$photo = $contact['photo'];
|
||||||
} else {
|
} else {
|
||||||
$photo = System::baseUrl() . '/images/person-175.jpg';
|
$photo = System::baseUrl() . '/images/person-175.jpg';
|
||||||
|
@ -577,7 +576,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
intval($dfrn_record)
|
intval($dfrn_record)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) { // indicates schema is messed up or total db failure
|
if (!DBA::is_result($r)) { // indicates schema is messed up or total db failure
|
||||||
$message = L10n::t('Unable to update your contact profile details on our system');
|
$message = L10n::t('Unable to update your contact profile details on our system');
|
||||||
System::xmlExit(3, $message);
|
System::xmlExit(3, $message);
|
||||||
}
|
}
|
||||||
|
@ -595,7 +594,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
intval($dfrn_record)
|
intval($dfrn_record)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$combined = $r[0];
|
$combined = $r[0];
|
||||||
|
|
||||||
if ($combined['notify-flags'] & NOTIFY_CONFIRM) {
|
if ($combined['notify-flags'] & NOTIFY_CONFIRM) {
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Protocol\DFRN;
|
use Friendica\Protocol\DFRN;
|
||||||
use Friendica\Protocol\Diaspora;
|
use Friendica\Protocol\Diaspora;
|
||||||
|
@ -28,7 +27,7 @@ function dfrn_notify_post(App $a) {
|
||||||
$nick = defaults($a->argv, 1, '');
|
$nick = defaults($a->argv, 1, '');
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
System::httpExit(500);
|
System::httpExit(500);
|
||||||
}
|
}
|
||||||
dfrn_dispatch_private($user, $postdata);
|
dfrn_dispatch_private($user, $postdata);
|
||||||
|
@ -108,7 +107,7 @@ function dfrn_notify_post(App $a) {
|
||||||
dbesc($a->argv[1])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
logger('contact not found for dfrn_id ' . $dfrn_id);
|
logger('contact not found for dfrn_id ' . $dfrn_id);
|
||||||
System::xmlExit(3, 'Contact not found');
|
System::xmlExit(3, 'Contact not found');
|
||||||
//NOTREACHED
|
//NOTREACHED
|
||||||
|
@ -221,7 +220,7 @@ function dfrn_dispatch_public($postdata)
|
||||||
$importer['importer_uid'] = 0;
|
$importer['importer_uid'] = 0;
|
||||||
|
|
||||||
// This should never fail
|
// This should never fail
|
||||||
if (!DBM::is_result($importer)) {
|
if (!DBA::is_result($importer)) {
|
||||||
logger('Contact not found for address ' . $msg['author']);
|
logger('Contact not found for address ' . $msg['author']);
|
||||||
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
|
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
|
||||||
}
|
}
|
||||||
|
@ -258,7 +257,7 @@ function dfrn_dispatch_private($user, $postdata)
|
||||||
$cid);
|
$cid);
|
||||||
|
|
||||||
// This should never fail
|
// This should never fail
|
||||||
if (!DBM::is_result($importer)) {
|
if (!DBA::is_result($importer)) {
|
||||||
logger('Contact not found for address ' . $msg['author']);
|
logger('Contact not found for address ' . $msg['author']);
|
||||||
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
|
System::xmlExit(3, 'Contact ' . $msg['author'] . ' not found');
|
||||||
}
|
}
|
||||||
|
@ -335,7 +334,7 @@ function dfrn_notify_content(App $a) {
|
||||||
dbesc($a->argv[1])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
logger('No user data found for ' . $a->argv[1] . ' - SQL: ' . $sql_extra);
|
logger('No user data found for ' . $a->argv[1] . ' - SQL: ' . $sql_extra);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Module\Login;
|
use Friendica\Module\Login;
|
||||||
use Friendica\Protocol\DFRN;
|
use Friendica\Protocol\DFRN;
|
||||||
use Friendica\Protocol\OStatus;
|
use Friendica\Protocol\OStatus;
|
||||||
|
@ -101,7 +100,7 @@ function dfrn_poll_init(App $a)
|
||||||
dbesc($a->argv[1])
|
dbesc($a->argv[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
|
$s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
|
||||||
|
|
||||||
logger("dfrn_poll: old profile returns " . $s, LOGGER_DATA);
|
logger("dfrn_poll: old profile returns " . $s, LOGGER_DATA);
|
||||||
|
@ -147,7 +146,7 @@ function dfrn_poll_init(App $a)
|
||||||
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
||||||
dbesc($sec)
|
dbesc($sec)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
System::xmlExit(3, 'No ticket');
|
System::xmlExit(3, 'No ticket');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -160,7 +159,7 @@ function dfrn_poll_init(App $a)
|
||||||
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||||
intval($r[0]['cid'])
|
intval($r[0]['cid'])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($c)) {
|
if (!DBA::is_result($c)) {
|
||||||
System::xmlExit(3, 'No profile');
|
System::xmlExit(3, 'No profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +210,7 @@ function dfrn_poll_init(App $a)
|
||||||
DBA::delete('profile_check', ["`expire` < ?", time()]);
|
DBA::delete('profile_check', ["`expire` < ?", time()]);
|
||||||
$r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
|
$r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
|
||||||
dbesc($dfrn_id));
|
dbesc($dfrn_id));
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
System::xmlExit(1);
|
System::xmlExit(1);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -239,7 +238,7 @@ function dfrn_poll_post(App $a)
|
||||||
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
|
||||||
dbesc($sec)
|
dbesc($sec)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
System::xmlExit(3, 'No ticket');
|
System::xmlExit(3, 'No ticket');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -252,7 +251,7 @@ function dfrn_poll_post(App $a)
|
||||||
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||||
intval($r[0]['cid'])
|
intval($r[0]['cid'])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($c)) {
|
if (!DBA::is_result($c)) {
|
||||||
System::xmlExit(3, 'No profile');
|
System::xmlExit(3, 'No profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +300,7 @@ function dfrn_poll_post(App $a)
|
||||||
dbesc($challenge)
|
dbesc($challenge)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,7 +329,7 @@ function dfrn_poll_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
|
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +345,7 @@ function dfrn_poll_post(App $a)
|
||||||
$reputation = 0;
|
$reputation = 0;
|
||||||
$text = '';
|
$text = '';
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$reputation = $r[0]['rating'];
|
$reputation = $r[0]['rating'];
|
||||||
$text = $r[0]['reason'];
|
$text = $r[0]['reason'];
|
||||||
|
|
||||||
|
@ -458,7 +457,7 @@ function dfrn_poll_content(App $a)
|
||||||
AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
|
AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
|
||||||
dbesc($nickname)
|
dbesc($nickname)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$challenge = '';
|
$challenge = '';
|
||||||
$encrypted_id = '';
|
$encrypted_id = '';
|
||||||
$id_str = $my_id . '.' . mt_rand(1000, 9999);
|
$id_str = $my_id . '.' . mt_rand(1000, 9999);
|
||||||
|
@ -499,7 +498,7 @@ function dfrn_poll_content(App $a)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = ((DBM::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
|
$profile = ((DBA::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
|
||||||
|
|
||||||
switch ($destination_url) {
|
switch ($destination_url) {
|
||||||
case 'profile':
|
case 'profile':
|
||||||
|
|
|
@ -17,7 +17,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -88,7 +87,7 @@ function dfrn_request_post(App $a)
|
||||||
dbesc(normalise_link($dfrn_url))
|
dbesc(normalise_link($dfrn_url))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
if (strlen($r[0]['dfrn-id'])) {
|
if (strlen($r[0]['dfrn-id'])) {
|
||||||
// We don't need to be here. It has already happened.
|
// We don't need to be here. It has already happened.
|
||||||
notice(L10n::t("This introduction has already been accepted.") . EOL);
|
notice(L10n::t("This introduction has already been accepted.") . EOL);
|
||||||
|
@ -130,7 +129,7 @@ function dfrn_request_post(App $a)
|
||||||
$photo = $parms["photo"];
|
$photo = $parms["photo"];
|
||||||
|
|
||||||
// Escape the entire array
|
// Escape the entire array
|
||||||
DBM::esc_array($parms);
|
DBA::esc_array($parms);
|
||||||
|
|
||||||
// Create a contact record on our site for the other person
|
// Create a contact record on our site for the other person
|
||||||
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
|
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
|
||||||
|
@ -167,7 +166,7 @@ function dfrn_request_post(App $a)
|
||||||
dbesc($dfrn_url),
|
dbesc($dfrn_url),
|
||||||
$parms['key'] // this was already escaped
|
$parms['key'] // this was already escaped
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
|
Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
|
||||||
|
|
||||||
if (isset($photo)) {
|
if (isset($photo)) {
|
||||||
|
@ -243,7 +242,7 @@ function dfrn_request_post(App $a)
|
||||||
dbesc(DateTimeFormat::utc('now - 24 hours')),
|
dbesc(DateTimeFormat::utc('now - 24 hours')),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r) && count($r) > $maxreq) {
|
if (DBA::is_result($r) && count($r) > $maxreq) {
|
||||||
notice(L10n::t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
|
notice(L10n::t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
|
||||||
notice(L10n::t('Spam protection measures have been invoked.') . EOL);
|
notice(L10n::t('Spam protection measures have been invoked.') . EOL);
|
||||||
notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
|
notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
|
||||||
|
@ -259,7 +258,7 @@ function dfrn_request_post(App $a)
|
||||||
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
|
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
|
||||||
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE "
|
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE "
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
if (!$rr['rel']) {
|
if (!$rr['rel']) {
|
||||||
DBA::delete('contact', ['id' => $rr['cid'], 'self' => false]);
|
DBA::delete('contact', ['id' => $rr['cid'], 'self' => false]);
|
||||||
|
@ -306,7 +305,7 @@ function dfrn_request_post(App $a)
|
||||||
dbesc($url)
|
dbesc($url)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($ret)) {
|
if (DBA::is_result($ret)) {
|
||||||
if (strlen($ret[0]['issued-id'])) {
|
if (strlen($ret[0]['issued-id'])) {
|
||||||
notice(L10n::t('You have already introduced yourself here.') . EOL);
|
notice(L10n::t('You have already introduced yourself here.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -372,7 +371,7 @@ function dfrn_request_post(App $a)
|
||||||
$parms['issued-id'] = $issued_id;
|
$parms['issued-id'] = $issued_id;
|
||||||
$photo = $parms["photo"];
|
$photo = $parms["photo"];
|
||||||
|
|
||||||
DBM::esc_array($parms);
|
DBA::esc_array($parms);
|
||||||
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
|
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
|
||||||
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
|
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
|
||||||
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
|
||||||
|
@ -404,7 +403,7 @@ function dfrn_request_post(App $a)
|
||||||
$parms['url'],
|
$parms['url'],
|
||||||
$parms['issued-id']
|
$parms['issued-id']
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact_record = $r[0];
|
$contact_record = $r[0];
|
||||||
Contact::updateAvatar($photo, $uid, $contact_record["id"], true);
|
Contact::updateAvatar($photo, $uid, $contact_record["id"], true);
|
||||||
}
|
}
|
||||||
|
@ -538,7 +537,7 @@ function dfrn_request_content(App $a)
|
||||||
dbesc($_GET['confirm_key'])
|
dbesc($_GET['confirm_key'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($intro)) {
|
if (DBA::is_result($intro)) {
|
||||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||||
WHERE `contact`.`id` = %d LIMIT 1",
|
WHERE `contact`.`id` = %d LIMIT 1",
|
||||||
intval($intro[0]['contact-id'])
|
intval($intro[0]['contact-id'])
|
||||||
|
@ -546,7 +545,7 @@ function dfrn_request_content(App $a)
|
||||||
|
|
||||||
$auto_confirm = false;
|
$auto_confirm = false;
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
if ($r[0]['page-flags'] != PAGE_NORMAL && $r[0]['page-flags'] != PAGE_PRVGROUP) {
|
if ($r[0]['page-flags'] != PAGE_NORMAL && $r[0]['page-flags'] != PAGE_PRVGROUP) {
|
||||||
$auto_confirm = true;
|
$auto_confirm = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ function directory_content(App $a)
|
||||||
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
|
$cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
|
||||||
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||||
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
|
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
|
||||||
if (DBM::is_result($cnt)) {
|
if (DBA::is_result($cnt)) {
|
||||||
$a->set_pager_total($cnt['total']);
|
$a->set_pager_total($cnt['total']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +100,7 @@ function directory_content(App $a)
|
||||||
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
|
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
|
||||||
$sql_extra $order LIMIT $limit"
|
$sql_extra $order LIMIT $limit"
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
if (in_array('small', $a->argv)) {
|
if (in_array('small', $a->argv)) {
|
||||||
$photo = 'thumb';
|
$photo = 'thumb';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Network\Probe;
|
use Friendica\Network\Probe;
|
||||||
|
@ -113,7 +112,7 @@ function dirfind_content(App $a, $prefix = "") {
|
||||||
|
|
||||||
$search2 = "%".$search."%";
|
$search2 = "%".$search."%";
|
||||||
|
|
||||||
/// @TODO These 2 SELECTs are not checked on validity with DBM::is_result()
|
/// @TODO These 2 SELECTs are not checked on validity with DBA::is_result()
|
||||||
$count = q("SELECT count(*) AS `total` FROM `gcontact`
|
$count = q("SELECT count(*) AS `total` FROM `gcontact`
|
||||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
||||||
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
||||||
|
@ -204,7 +203,7 @@ function dirfind_content(App $a, $prefix = "") {
|
||||||
$connlnk = "";
|
$connlnk = "";
|
||||||
$conntxt = "";
|
$conntxt = "";
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $jj->cid]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $jj->cid]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$photo_menu = Contact::photoMenu($contact);
|
$photo_menu = Contact::photoMenu($contact);
|
||||||
$details = _contact_detail_for_template($contact);
|
$details = _contact_detail_for_template($contact);
|
||||||
$alt_text = $details['alt_text'];
|
$alt_text = $details['alt_text'];
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -53,20 +52,20 @@ function display_init(App $a)
|
||||||
// Does the local user have this item?
|
// Does the local user have this item?
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, ['guid' => $a->argv[1], 'uid' => local_user()]);
|
$item = Item::selectFirstForUser(local_user(), $fields, ['guid' => $a->argv[1], 'uid' => local_user()]);
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$nick = $a->user["nickname"];
|
$nick = $a->user["nickname"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is it an item with uid=0?
|
// Is it an item with uid=0?
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, ['guid' => $a->argv[1], 'private' => [0, 2], 'uid' => 0]);
|
$item = Item::selectFirstForUser(local_user(), $fields, ['guid' => $a->argv[1], 'private' => [0, 2], 'uid' => 0]);
|
||||||
}
|
}
|
||||||
} elseif (($a->argc == 3) && ($nick == 'feed-item')) {
|
} elseif (($a->argc == 3) && ($nick == 'feed-item')) {
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $a->argv[2], 'private' => [0, 2], 'uid' => 0]);
|
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $a->argv[2], 'private' => [0, 2], 'uid' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
$a->error = 404;
|
$a->error = 404;
|
||||||
notice(L10n::t('Item not found.') . EOL);
|
notice(L10n::t('Item not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
@ -92,7 +91,7 @@ function display_init(App $a)
|
||||||
WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
|
WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
|
||||||
$nickname
|
$nickname
|
||||||
);
|
);
|
||||||
if (DBM::is_result($profile)) {
|
if (DBA::is_result($profile)) {
|
||||||
$profiledata = $profile;
|
$profiledata = $profile;
|
||||||
}
|
}
|
||||||
$profiledata["network"] = NETWORK_DFRN;
|
$profiledata["network"] = NETWORK_DFRN;
|
||||||
|
@ -222,7 +221,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
if (local_user()) {
|
if (local_user()) {
|
||||||
$condition = ['guid' => $a->argv[1], 'uid' => local_user()];
|
$condition = ['guid' => $a->argv[1], 'uid' => local_user()];
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, $condition);
|
$item = Item::selectFirstForUser(local_user(), $fields, $condition);
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$item_id = $item["id"];
|
$item_id = $item["id"];
|
||||||
$item_parent = $item["parent"];
|
$item_parent = $item["parent"];
|
||||||
$item_parent_uri = $item['parent-uri'];
|
$item_parent_uri = $item['parent-uri'];
|
||||||
|
@ -232,7 +231,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
if ($item_parent == 0) {
|
if ($item_parent == 0) {
|
||||||
$condition = ['private' => [0, 2], 'guid' => $a->argv[1], 'uid' => 0];
|
$condition = ['private' => [0, 2], 'guid' => $a->argv[1], 'uid' => 0];
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, $condition);
|
$item = Item::selectFirstForUser(local_user(), $fields, $condition);
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$item_id = $item["id"];
|
$item_id = $item["id"];
|
||||||
$item_parent = $item["parent"];
|
$item_parent = $item["parent"];
|
||||||
$item_parent_uri = $item['parent-uri'];
|
$item_parent_uri = $item['parent-uri'];
|
||||||
|
@ -281,7 +280,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
if ($contact_id) {
|
if ($contact_id) {
|
||||||
$groups = Group::getIdsByContactId($contact_id);
|
$groups = Group::getIdsByContactId($contact_id);
|
||||||
$remote_contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $a->profile['uid']]);
|
$remote_contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $a->profile['uid']]);
|
||||||
if (DBM::is_result($remote_contact)) {
|
if (DBA::is_result($remote_contact)) {
|
||||||
$contact = $remote_contact;
|
$contact = $remote_contact;
|
||||||
$is_remote_contact = true;
|
$is_remote_contact = true;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +294,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
$page_contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $a->profile['uid']]);
|
$page_contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $a->profile['uid']]);
|
||||||
if (DBM::is_result($page_contact)) {
|
if (DBA::is_result($page_contact)) {
|
||||||
$a->page_contact = $page_contact;
|
$a->page_contact = $page_contact;
|
||||||
}
|
}
|
||||||
$is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false);
|
$is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false);
|
||||||
|
@ -339,7 +338,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
$params = ['order' => ['uid', 'parent' => true, 'gravity', 'id']];
|
$params = ['order' => ['uid', 'parent' => true, 'gravity', 'id']];
|
||||||
$items_obj = Item::selectForUser(local_user(), [], $condition, $params);
|
$items_obj = Item::selectForUser(local_user(), [], $condition, $params);
|
||||||
|
|
||||||
if (!DBM::is_result($items_obj)) {
|
if (!DBA::is_result($items_obj)) {
|
||||||
notice(L10n::t('Item not found.') . EOL);
|
notice(L10n::t('Item not found.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function editpost_content(App $a) {
|
function editpost_content(App $a) {
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function editpost_content(App $a) {
|
||||||
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
|
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
|
||||||
'type', 'body', 'title', 'file'];
|
'type', 'body', 'title', 'file'];
|
||||||
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
|
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
notice(L10n::t('Item not found') . EOL);
|
notice(L10n::t('Item not found') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ function editpost_content(App $a) {
|
||||||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
|
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$mail_enabled = true;
|
$mail_enabled = true;
|
||||||
if (intval($r[0]['pubmail'])) {
|
if (intval($r[0]['pubmail'])) {
|
||||||
$pubmail_enabled = true;
|
$pubmail_enabled = true;
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Friendica\Core\ACL;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Event;
|
use Friendica\Model\Event;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -346,7 +346,7 @@ function events_content(App $a) {
|
||||||
|
|
||||||
$links = [];
|
$links = [];
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$r = Event::sortByDate($r);
|
$r = Event::sortByDate($r);
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
|
||||||
|
@ -359,7 +359,7 @@ function events_content(App $a) {
|
||||||
$events = [];
|
$events = [];
|
||||||
|
|
||||||
// transform the event in a usable array
|
// transform the event in a usable array
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$r = Event::sortByDate($r);
|
$r = Event::sortByDate($r);
|
||||||
$events = Event::prepareListForTemplate($r);
|
$events = Event::prepareListForTemplate($r);
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,7 @@ function events_content(App $a) {
|
||||||
intval($event_id),
|
intval($event_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$orig_event = $r[0];
|
$orig_event = $r[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -545,7 +545,7 @@ function events_content(App $a) {
|
||||||
$ev = Event::getListById(local_user(), $event_id);
|
$ev = Event::getListById(local_user(), $event_id);
|
||||||
|
|
||||||
// Delete only real events (no birthdays)
|
// Delete only real events (no birthdays)
|
||||||
if (DBM::is_result($ev) && $ev[0]['type'] == 'event') {
|
if (DBA::is_result($ev) && $ev[0]['type'] == 'event') {
|
||||||
$del = Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
|
$del = Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Friendica\Protocol\Diaspora;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Util\XML;
|
use Friendica\Util\XML;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function fetch_init(App $a)
|
function fetch_init(App $a)
|
||||||
{
|
{
|
||||||
|
@ -27,10 +27,10 @@ function fetch_init(App $a)
|
||||||
'event-id', 'resource-id', 'author-link', 'owner-link', 'attach'];
|
'event-id', 'resource-id', 'author-link', 'owner-link', 'attach'];
|
||||||
$condition = ['wall' => true, 'private' => false, 'guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
|
$condition = ['wall' => true, 'private' => false, 'guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
$condition = ['guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
|
$condition = ['guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
|
||||||
$item = Item::selectFirst(['author-link'], $condition);
|
$item = Item::selectFirst(['author-link'], $condition);
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$parts = parse_url($item["author-link"]);
|
$parts = parse_url($item["author-link"]);
|
||||||
$host = $parts["scheme"]."://".$parts["host"];
|
$host = $parts["scheme"]."://".$parts["host"];
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Friendica\Core\System;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
use Friendica\Network\Probe;
|
use Friendica\Network\Probe;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function follow_post(App $a)
|
function follow_post(App $a)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +104,7 @@ function follow_content(App $a)
|
||||||
$ret['url'] = $ret['addr'];
|
$ret['url'] = $ret['addr'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($ret['network'] === NETWORK_DFRN) && !DBM::is_result($r)) {
|
if (($ret['network'] === NETWORK_DFRN) && !DBA::is_result($r)) {
|
||||||
$request = $ret['request'];
|
$request = $ret['request'];
|
||||||
$tpl = get_markup_template('dfrn_request.tpl');
|
$tpl = get_markup_template('dfrn_request.tpl');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function friendica_init(App $a)
|
function friendica_init(App $a)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ function friendica_init(App $a)
|
||||||
$visible_addons = [];
|
$visible_addons = [];
|
||||||
if (is_array($a->addons) && count($a->addons)) {
|
if (is_array($a->addons) && count($a->addons)) {
|
||||||
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
|
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$visible_addons[] = $rr['name'];
|
$visible_addons[] = $rr['name'];
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ function friendica_content(App $a)
|
||||||
$visible_addons = [];
|
$visible_addons = [];
|
||||||
if (is_array($a->addons) && count($a->addons)) {
|
if (is_array($a->addons) && count($a->addons)) {
|
||||||
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
|
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$visible_addons[] = $rr['name'];
|
$visible_addons[] = $rr['name'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
function fsuggest_post(App $a)
|
function fsuggest_post(App $a)
|
||||||
|
@ -26,7 +26,7 @@ function fsuggest_post(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Contact not found.') . EOL);
|
notice(L10n::t('Contact not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ function fsuggest_post(App $a)
|
||||||
intval($new_contact),
|
intval($new_contact),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
|
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
|
||||||
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
|
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
|
@ -59,7 +59,7 @@ function fsuggest_post(App $a)
|
||||||
dbesc($hash),
|
dbesc($hash),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$fsuggest_id = $r[0]['id'];
|
$fsuggest_id = $r[0]['id'];
|
||||||
q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d",
|
q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d",
|
||||||
dbesc($note),
|
dbesc($note),
|
||||||
|
@ -92,7 +92,7 @@ function fsuggest_content(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Contact not found.') . EOL);
|
notice(L10n::t('Contact not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ function group_post(App $a) {
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Group not found.') . EOL);
|
notice(L10n::t('Group not found.') . EOL);
|
||||||
goaway(System::baseUrl() . '/contacts');
|
goaway(System::baseUrl() . '/contacts');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
@ -147,7 +147,7 @@ function group_content(App $a) {
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$result = Group::removeByName(local_user(), $r[0]['name']);
|
$result = Group::removeByName(local_user(), $r[0]['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ function group_content(App $a) {
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$change = intval($a->argv[2]);
|
$change = intval($a->argv[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ function group_content(App $a) {
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Group not found.') . EOL);
|
notice(L10n::t('Group not found.') . EOL);
|
||||||
goaway(System::baseUrl() . '/contacts');
|
goaway(System::baseUrl() . '/contacts');
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ function group_content(App $a) {
|
||||||
$context['$desc'] = L10n::t('Click on a contact to add or remove.');
|
$context['$desc'] = L10n::t('Click on a contact to add or remove.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
// Format the data of the contacts who aren't in the contact group
|
// Format the data of the contacts who aren't in the contact group
|
||||||
foreach ($r as $member) {
|
foreach ($r as $member) {
|
||||||
if (! in_array($member['id'], $preselected)) {
|
if (! in_array($member['id'], $preselected)) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function ignored_init(App $a) {
|
function ignored_init(App $a) {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ function ignored_init(App $a) {
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($message_id)
|
intval($message_id)
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\Core\Install;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Util\Temporal;
|
use Friendica\Util\Temporal;
|
||||||
|
|
||||||
$install_wizard_pass = 1;
|
$install_wizard_pass = 1;
|
||||||
|
@ -114,7 +113,7 @@ function install_content(App $a) {
|
||||||
|
|
||||||
if (DBA::$connected) {
|
if (DBA::$connected) {
|
||||||
$r = q("SELECT COUNT(*) as `total` FROM `user`");
|
$r = q("SELECT COUNT(*) as `total` FROM `user`");
|
||||||
if (DBM::is_result($r) && $r[0]['total']) {
|
if (DBA::is_result($r) && $r[0]['total']) {
|
||||||
$tpl = get_markup_template('install.tpl');
|
$tpl = get_markup_template('install.tpl');
|
||||||
return replace_macros($tpl, [
|
return replace_macros($tpl, [
|
||||||
'$title' => $install_title,
|
'$title' => $install_title,
|
||||||
|
|
23
mod/item.php
23
mod/item.php
|
@ -24,7 +24,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Protocol\Diaspora;
|
use Friendica\Protocol\Diaspora;
|
||||||
|
@ -102,7 +101,7 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if this isn't the real parent of the conversation, find it
|
// if this isn't the real parent of the conversation, find it
|
||||||
if (DBM::is_result($parent_item)) {
|
if (DBA::is_result($parent_item)) {
|
||||||
|
|
||||||
// The URI and the contact is taken from the direct parent which needn't to be the top parent
|
// The URI and the contact is taken from the direct parent which needn't to be the top parent
|
||||||
$thr_parent_uri = $parent_item['uri'];
|
$thr_parent_uri = $parent_item['uri'];
|
||||||
|
@ -113,7 +112,7 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($parent_item)) {
|
if (!DBA::is_result($parent_item)) {
|
||||||
notice(L10n::t('Unable to locate original post.') . EOL);
|
notice(L10n::t('Unable to locate original post.') . EOL);
|
||||||
if (x($_REQUEST, 'return')) {
|
if (x($_REQUEST, 'return')) {
|
||||||
goaway($return_path);
|
goaway($return_path);
|
||||||
|
@ -176,7 +175,7 @@ function item_post(App $a) {
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', [], ['uid' => $profile_uid]);
|
$user = DBA::selectFirst('user', [], ['uid' => $profile_uid]);
|
||||||
|
|
||||||
if (!DBM::is_result($user) && !$parent) {
|
if (!DBA::is_result($user) && !$parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +319,7 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($author)) {
|
if (DBA::is_result($author)) {
|
||||||
$contact_id = $author['id'];
|
$contact_id = $author['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,7 +536,7 @@ function item_post(App $a) {
|
||||||
foreach ($match[2] as $mtch) {
|
foreach ($match[2] as $mtch) {
|
||||||
$fields = ['id', 'filename', 'filesize', 'filetype'];
|
$fields = ['id', 'filename', 'filesize', 'filetype'];
|
||||||
$attachment = DBA::selectFirst('attach', $fields, ['id' => $mtch]);
|
$attachment = DBA::selectFirst('attach', $fields, ['id' => $mtch]);
|
||||||
if (DBM::is_result($attachment)) {
|
if (DBA::is_result($attachment)) {
|
||||||
if (strlen($attachments)) {
|
if (strlen($attachments)) {
|
||||||
$attachments .= ',';
|
$attachments .= ',';
|
||||||
}
|
}
|
||||||
|
@ -637,7 +636,7 @@ function item_post(App $a) {
|
||||||
$datarray['protocol'] = PROTOCOL_DFRN;
|
$datarray['protocol'] = PROTOCOL_DFRN;
|
||||||
|
|
||||||
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $datarray['parent-uri']]);
|
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $datarray['parent-uri']]);
|
||||||
if (DBM::is_result($conversation)) {
|
if (DBA::is_result($conversation)) {
|
||||||
if ($conversation['conversation-uri'] != '') {
|
if ($conversation['conversation-uri'] != '') {
|
||||||
$datarray['conversation-uri'] = $conversation['conversation-uri'];
|
$datarray['conversation-uri'] = $conversation['conversation-uri'];
|
||||||
}
|
}
|
||||||
|
@ -733,7 +732,7 @@ function item_post(App $a) {
|
||||||
|
|
||||||
$datarray = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
|
$datarray = Item::selectFirst(Item::ITEM_FIELDLIST, ['id' => $post_id]);
|
||||||
|
|
||||||
if (!DBM::is_result($datarray)) {
|
if (!DBA::is_result($datarray)) {
|
||||||
logger("Item with id ".$post_id." couldn't be fetched.");
|
logger("Item with id ".$post_id." couldn't be fetched.");
|
||||||
goaway($return_path);
|
goaway($return_path);
|
||||||
}
|
}
|
||||||
|
@ -964,26 +963,26 @@ function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $n
|
||||||
}
|
}
|
||||||
|
|
||||||
// select someone by nick or attag in the current network
|
// select someone by nick or attag in the current network
|
||||||
if (!DBM::is_result($contact) && ($network != "")) {
|
if (!DBA::is_result($contact) && ($network != "")) {
|
||||||
$condition = ["(`nick` = ? OR `attag` = ?) AND `network` = ? AND `uid` = ?",
|
$condition = ["(`nick` = ? OR `attag` = ?) AND `network` = ? AND `uid` = ?",
|
||||||
$name, $name, $network, $profile_uid];
|
$name, $name, $network, $profile_uid];
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
//select someone by name in the current network
|
//select someone by name in the current network
|
||||||
if (!DBM::is_result($contact) && ($network != "")) {
|
if (!DBA::is_result($contact) && ($network != "")) {
|
||||||
$condition = ['name' => $name, 'network' => $network, 'uid' => $profile_uid];
|
$condition = ['name' => $name, 'network' => $network, 'uid' => $profile_uid];
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// select someone by nick or attag in any network
|
// select someone by nick or attag in any network
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
$condition = ["(`nick` = ? OR `attag` = ?) AND `uid` = ?", $name, $name, $profile_uid];
|
$condition = ["(`nick` = ? OR `attag` = ?) AND `uid` = ?", $name, $name, $profile_uid];
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// select someone by name in any network
|
// select someone by name in any network
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
$condition = ['name' => $name, 'uid' => $profile_uid];
|
$condition = ['name' => $name, 'uid' => $profile_uid];
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function lockview_content(App $a) {
|
function lockview_content(App $a) {
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ function lockview_content(App $a) {
|
||||||
dbesc($type),
|
dbesc($type),
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
$item = $r[0];
|
$item = $r[0];
|
||||||
|
@ -59,7 +59,7 @@ function lockview_content(App $a) {
|
||||||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||||
dbesc(implode(', ', $allowed_groups))
|
dbesc(implode(', ', $allowed_groups))
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<b>' . $rr['name'] . '</b>';
|
$l[] = '<b>' . $rr['name'] . '</b>';
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ function lockview_content(App $a) {
|
||||||
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
||||||
dbesc(implode(', ',$allowed_users))
|
dbesc(implode(', ',$allowed_users))
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = $rr['name'];
|
$l[] = $rr['name'];
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ function lockview_content(App $a) {
|
||||||
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
|
||||||
dbesc(implode(', ', $deny_groups))
|
dbesc(implode(', ', $deny_groups))
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
|
$l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ function lockview_content(App $a) {
|
||||||
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
|
||||||
dbesc(implode(', ',$deny_users))
|
dbesc(implode(', ',$deny_users))
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$l[] = '<strike>' . $rr['name'] . '</strike>';
|
$l[] = '<strike>' . $rr['name'] . '</strike>';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ function lostpass_post(App $a)
|
||||||
|
|
||||||
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
|
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
|
||||||
$user = DBA::selectFirst('user', ['uid', 'username', 'email'], $condition);
|
$user = DBA::selectFirst('user', ['uid', 'username', 'email'], $condition);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
notice(L10n::t('No valid account found.') . EOL);
|
notice(L10n::t('No valid account found.') . EOL);
|
||||||
goaway(System::baseUrl());
|
goaway(System::baseUrl());
|
||||||
}
|
}
|
||||||
|
@ -87,7 +86,7 @@ function lostpass_content(App $a)
|
||||||
$pwdreset_token = $a->argv[1];
|
$pwdreset_token = $a->argv[1];
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
|
$user = DBA::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||||
|
|
||||||
return lostpass_form();
|
return lostpass_form();
|
||||||
|
@ -132,7 +131,7 @@ function lostpass_generate_password($user)
|
||||||
|
|
||||||
$new_password = User::generateNewPassword();
|
$new_password = User::generateNewPassword();
|
||||||
$result = User::updatePassword($user['uid'], $new_password);
|
$result = User::updatePassword($user['uid'], $new_password);
|
||||||
if (DBM::is_result($result)) {
|
if (DBA::is_result($result)) {
|
||||||
$tpl = get_markup_template('pwdreset.tpl');
|
$tpl = get_markup_template('pwdreset.tpl');
|
||||||
$o .= replace_macros($tpl, [
|
$o .= replace_macros($tpl, [
|
||||||
'$lbl1' => L10n::t('Password Reset'),
|
'$lbl1' => L10n::t('Password Reset'),
|
||||||
|
|
|
@ -6,7 +6,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
require_once "include/text.php";
|
require_once "include/text.php";
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ function manage_post(App $a) {
|
||||||
$r = q("select * from user where uid = %d limit 1",
|
$r = q("select * from user where uid = %d limit 1",
|
||||||
intval($_SESSION['submanage'])
|
intval($_SESSION['submanage'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$uid = intval($r[0]['uid']);
|
$uid = intval($r[0]['uid']);
|
||||||
$orig_record = $r[0];
|
$orig_record = $r[0];
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ function manage_post(App $a) {
|
||||||
$limited_id = 0;
|
$limited_id = 0;
|
||||||
$original_id = $uid;
|
$original_id = $uid;
|
||||||
|
|
||||||
if (DBM::is_result($submanage)) {
|
if (DBA::is_result($submanage)) {
|
||||||
foreach ($submanage as $m) {
|
foreach ($submanage as $m) {
|
||||||
if ($identity == $m['mid']) {
|
if ($identity == $m['mid']) {
|
||||||
$limited_id = $m['mid'];
|
$limited_id = $m['mid'];
|
||||||
|
@ -64,7 +64,7 @@ function manage_post(App $a) {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check if the target user is one of our siblings
|
// Check if the target user is one of our siblings
|
||||||
if (!DBM::is_result($r) && ($orig_record['parent-uid'] != 0)) {
|
if (!DBA::is_result($r) && ($orig_record['parent-uid'] != 0)) {
|
||||||
$r = q("SELECT * FROM `user` WHERE `uid` = %d AND `parent-uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `uid` = %d AND `parent-uid` = %d LIMIT 1",
|
||||||
intval($identity),
|
intval($identity),
|
||||||
dbesc($orig_record['parent-uid'])
|
dbesc($orig_record['parent-uid'])
|
||||||
|
@ -72,21 +72,21 @@ function manage_post(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if it's our parent
|
// Check if it's our parent
|
||||||
if (!DBM::is_result($r) && ($orig_record['parent-uid'] != 0) && ($orig_record['parent-uid'] == $identity)) {
|
if (!DBA::is_result($r) && ($orig_record['parent-uid'] != 0) && ($orig_record['parent-uid'] == $identity)) {
|
||||||
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||||
intval($identity)
|
intval($identity)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally check if it's out own user
|
// Finally check if it's out own user
|
||||||
if (!DBM::is_result($r) && ($orig_record['uid'] != 0) && ($orig_record['uid'] == $identity)) {
|
if (!DBA::is_result($r) && ($orig_record['uid'] != 0) && ($orig_record['uid'] == $identity)) {
|
||||||
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||||
intval($identity)
|
intval($identity)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,21 +155,21 @@ function manage_content(App $a) {
|
||||||
$r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))",
|
$r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))",
|
||||||
intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL));
|
intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$notifications = sizeof($r);
|
$notifications = sizeof($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`",
|
$r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`",
|
||||||
intval($id['uid']));
|
intval($id['uid']));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$notifications = $notifications + sizeof($r);
|
$notifications = $notifications + sizeof($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT COUNT(*) AS `introductions` FROM `intro` WHERE NOT `blocked` AND NOT `ignore` AND `uid` = %d",
|
$r = q("SELECT COUNT(*) AS `introductions` FROM `intro` WHERE NOT `blocked` AND NOT `ignore` AND `uid` = %d",
|
||||||
intval($id['uid']));
|
intval($id['uid']));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$notifications = $notifications + $r[0]["introductions"];
|
$notifications = $notifications + $r[0]["introductions"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\Content\Widget;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
|
@ -41,7 +41,7 @@ function match_content(App $a)
|
||||||
"SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
"SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
|
if (! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\ACL;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Mail;
|
use Friendica\Model\Mail;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
@ -176,7 +175,7 @@ function message_content(App $a)
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$parent = $r[0]['parent-uri'];
|
$parent = $r[0]['parent-uri'];
|
||||||
$convid = $r[0]['convid'];
|
$convid = $r[0]['convid'];
|
||||||
|
|
||||||
|
@ -215,21 +214,21 @@ function message_content(App $a)
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($a->argv[2])
|
intval($a->argv[2])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
|
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(normalise_link(base64_decode($a->argv[2])))
|
dbesc(normalise_link(base64_decode($a->argv[2])))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
|
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(base64_decode($a->argv[2]))
|
dbesc(base64_decode($a->argv[2]))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$prename = $r[0]['name'];
|
$prename = $r[0]['name'];
|
||||||
$preurl = $r[0]['url'];
|
$preurl = $r[0]['url'];
|
||||||
$preid = $r[0]['id'];
|
$preid = $r[0]['id'];
|
||||||
|
@ -280,13 +279,13 @@ function message_content(App $a)
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
|
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
info(L10n::t('No messages.') . EOL);
|
info(L10n::t('No messages.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -308,7 +307,7 @@ function message_content(App $a)
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($a->argv[1])
|
intval($a->argv[1])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact_id = $r[0]['contact-id'];
|
$contact_id = $r[0]['contact-id'];
|
||||||
$convid = $r[0]['convid'];
|
$convid = $r[0]['convid'];
|
||||||
|
|
||||||
|
@ -327,7 +326,7 @@ function message_content(App $a)
|
||||||
} else {
|
} else {
|
||||||
$messages = false;
|
$messages = false;
|
||||||
}
|
}
|
||||||
if (!DBM::is_result($messages)) {
|
if (!DBA::is_result($messages)) {
|
||||||
notice(L10n::t('Message not available.') . EOL);
|
notice(L10n::t('Message not available.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function modexp_init(App $a) {
|
function modexp_init(App $a) {
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ function modexp_init(App $a) {
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function msearch_post(App $a) {
|
function msearch_post(App $a) {
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ function msearch_post(App $a) {
|
||||||
dbesc($search)
|
dbesc($search)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
$total = $r[0]['total'];
|
$total = $r[0]['total'];
|
||||||
|
|
||||||
$results = [];
|
$results = [];
|
||||||
|
@ -29,7 +29,7 @@ function msearch_post(App $a) {
|
||||||
intval($perpage)
|
intval($perpage)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$results[] = [
|
$results[] = [
|
||||||
'name' => $rr['name'],
|
'name' => $rr['name'],
|
||||||
|
|
|
@ -16,7 +16,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -557,7 +556,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
// If $cid belongs to a communitity forum or a privat goup,.add a mention to the status editor
|
// If $cid belongs to a communitity forum or a privat goup,.add a mention to the status editor
|
||||||
$condition = ["`id` = ? AND (`forum` OR `prv`)", $cid];
|
$condition = ["`id` = ? AND (`forum` OR `prv`)", $cid];
|
||||||
$contact = DBA::selectFirst('contact', ['addr', 'nick'], $condition);
|
$contact = DBA::selectFirst('contact', ['addr', 'nick'], $condition);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
if ($contact['addr'] != '') {
|
if ($contact['addr'] != '') {
|
||||||
$content = '!' . $contact['addr'];
|
$content = '!' . $contact['addr'];
|
||||||
} else {
|
} else {
|
||||||
|
@ -610,7 +609,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
|
|
||||||
if ($gid) {
|
if ($gid) {
|
||||||
$group = DBA::selectFirst('group', ['name'], ['id' => $gid, 'uid' => local_user()]);
|
$group = DBA::selectFirst('group', ['name'], ['id' => $gid, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($group)) {
|
if (!DBA::is_result($group)) {
|
||||||
if ($update) {
|
if ($update) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
@ -626,7 +625,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
|
|
||||||
$contact_str = implode(',', $contacts);
|
$contact_str = implode(',', $contacts);
|
||||||
$self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
|
$self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
|
||||||
if (DBM::is_result($self)) {
|
if (DBA::is_result($self)) {
|
||||||
$contact_str_self = $self['id'];
|
$contact_str_self = $self['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,7 +645,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location'];
|
'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location'];
|
||||||
$condition = ["`id` = ? AND (NOT `blocked` OR `pending`)", $cid];
|
$condition = ["`id` = ? AND (NOT `blocked` OR `pending`)", $cid];
|
||||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$sql_extra = " AND " . $sql_table . ".`contact-id` = " . intval($cid);
|
$sql_extra = " AND " . $sql_table . ".`contact-id` = " . intval($cid);
|
||||||
|
|
||||||
$entries[0] = [
|
$entries[0] = [
|
||||||
|
@ -806,7 +805,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
|
|
||||||
// Only show it when unfiltered (no groups, no networks, ...)
|
// Only show it when unfiltered (no groups, no networks, ...)
|
||||||
if (in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
|
if (in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$top_limit = current($r)['order_date'];
|
$top_limit = current($r)['order_date'];
|
||||||
$bottom_limit = end($r)['order_date'];
|
$bottom_limit = end($r)['order_date'];
|
||||||
if (empty($_SESSION['network_last_top_limit']) || ($_SESSION['network_last_top_limit'] < $top_limit)) {
|
if (empty($_SESSION['network_last_top_limit']) || ($_SESSION['network_last_top_limit'] < $top_limit)) {
|
||||||
|
@ -875,7 +874,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
|
|
||||||
$items = $r;
|
$items = $r;
|
||||||
|
|
||||||
if (DBM::is_result($items)) {
|
if (DBA::is_result($items)) {
|
||||||
$parents_arr = [];
|
$parents_arr = [];
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Content\ContactSelector;
|
use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
function noscrape_init(App $a)
|
function noscrape_init(App $a)
|
||||||
|
@ -55,7 +54,7 @@ function noscrape_init(App $a)
|
||||||
/// @todo What should this value tell us?
|
/// @todo What should this value tell us?
|
||||||
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
|
||||||
intval($a->profile['uid']));
|
intval($a->profile['uid']));
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$json_info["updated"] = date("c", strtotime($r[0]['updated']));
|
$json_info["updated"] = date("c", strtotime($r[0]['updated']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ function noscrape_init(App $a)
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
dbesc(NETWORK_OSTATUS)
|
dbesc(NETWORK_OSTATUS)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$json_info["contacts"] = intval($r[0]['total']);
|
$json_info["contacts"] = intval($r[0]['total']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,13 +74,13 @@ function noscrape_init(App $a)
|
||||||
$last_active = 0;
|
$last_active = 0;
|
||||||
$condition = ['uid' => $a->profile['uid'], 'self' => true];
|
$condition = ['uid' => $a->profile['uid'], 'self' => true];
|
||||||
$contact = DBA::selectFirst('contact', ['last-item'], $condition);
|
$contact = DBA::selectFirst('contact', ['last-item'], $condition);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$last_active = strtotime($contact['last-item']);
|
$last_active = strtotime($contact['last-item']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$condition = ['uid' => $a->profile['uid']];
|
$condition = ['uid' => $a->profile['uid']];
|
||||||
$user = DBA::selectFirst('user', ['login_date'], $condition);
|
$user = DBA::selectFirst('user', ['login_date'], $condition);
|
||||||
if (DBM::is_result($user)) {
|
if (DBA::is_result($user)) {
|
||||||
if ($last_active < strtotime($user['login_date'])) {
|
if ($last_active < strtotime($user['login_date'])) {
|
||||||
$last_active = strtotime($user['login_date']);
|
$last_active = strtotime($user['login_date']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -70,7 +69,7 @@ function notes_content(App $a, $update = false)
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$count = count($r);
|
$count = count($r);
|
||||||
$parents_arr = [];
|
$parents_arr = [];
|
||||||
|
|
||||||
|
@ -82,7 +81,7 @@ function notes_content(App $a, $update = false)
|
||||||
$condition = ['uid' => local_user(), 'parent' => $parents_arr];
|
$condition = ['uid' => local_user(), 'parent' => $parents_arr];
|
||||||
$result = Item::selectForUser(local_user(), [], $condition);
|
$result = Item::selectForUser(local_user(), [], $condition);
|
||||||
|
|
||||||
if (DBM::is_result($result)) {
|
if (DBA::is_result($result)) {
|
||||||
$items = conv_sort(Item::inArray($result), 'commented');
|
$items = conv_sort(Item::inArray($result), 'commented');
|
||||||
$o .= conversation($a, $items, 'notes', $update);
|
$o .= conversation($a, $items, 'notes', $update);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function notice_init(App $a)
|
function notice_init(App $a)
|
||||||
{
|
{
|
||||||
$id = $a->argv[1];
|
$id = $a->argv[1];
|
||||||
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
|
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$nick = $r[0]['nickname'];
|
$nick = $r[0]['nickname'];
|
||||||
$url = System::baseUrl() . "/display/$nick/$id";
|
$url = System::baseUrl() . "/display/$nick/$id";
|
||||||
goaway($url);
|
goaway($url);
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\NotificationsManager;
|
use Friendica\Core\NotificationsManager;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
function notifications_post(App $a)
|
function notifications_post(App $a)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +27,7 @@ function notifications_post(App $a)
|
||||||
if ($request_id) {
|
if ($request_id) {
|
||||||
$intro = DBA::selectFirst('intro', ['id', 'contact-id', 'fid'], ['id' => $request_id, 'uid' => local_user()]);
|
$intro = DBA::selectFirst('intro', ['id', 'contact-id', 'fid'], ['id' => $request_id, 'uid' => local_user()]);
|
||||||
|
|
||||||
if (DBM::is_result($intro)) {
|
if (DBA::is_result($intro)) {
|
||||||
$intro_id = $intro['id'];
|
$intro_id = $intro['id'];
|
||||||
$contact_id = $intro['contact-id'];
|
$contact_id = $intro['contact-id'];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -8,7 +8,7 @@ use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\NotificationsManager;
|
use Friendica\Core\NotificationsManager;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Module\Login;
|
use Friendica\Module\Login;
|
||||||
use Friendica\Util\Temporal;
|
use Friendica\Util\Temporal;
|
||||||
|
@ -64,7 +64,7 @@ function notify_content(App $a)
|
||||||
$not_tpl = get_markup_template('notify.tpl');
|
$not_tpl = get_markup_template('notify.tpl');
|
||||||
|
|
||||||
$r = $nm->getAll(['seen'=>0]);
|
$r = $nm->getAll(['seen'=>0]);
|
||||||
if (DBM::is_result($r) > 0) {
|
if (DBA::is_result($r) > 0) {
|
||||||
foreach ($r as $it) {
|
foreach ($r as $it) {
|
||||||
$notif_content .= replace_macros($not_tpl, [
|
$notif_content .= replace_macros($not_tpl, [
|
||||||
'$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
|
'$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function openid_content(App $a) {
|
function openid_content(App $a) {
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ function openid_content(App $a) {
|
||||||
dbesc($authid), dbesc(normalise_openid($authid))
|
dbesc($authid), dbesc(normalise_openid($authid))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
|
|
||||||
// successful OpenID login
|
// successful OpenID login
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @file mod/photo.php
|
* @file mod/photo.php
|
||||||
*/
|
*/
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Object\Image;
|
use Friendica\Object\Image;
|
||||||
|
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -83,7 +83,7 @@ function photo_init(App $a)
|
||||||
intval($resolution),
|
intval($resolution),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$data = $r[0]['data'];
|
$data = $r[0]['data'];
|
||||||
$mimetype = $r[0]['type'];
|
$mimetype = $r[0]['type'];
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ function photo_init(App $a)
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$sql_extra = permissions_sql($r[0]['uid']);
|
$sql_extra = permissions_sql($r[0]['uid']);
|
||||||
|
|
||||||
// Now we'll see if we can access the photo
|
// Now we'll see if we can access the photo
|
||||||
|
@ -118,7 +118,7 @@ function photo_init(App $a)
|
||||||
dbesc($photo),
|
dbesc($photo),
|
||||||
intval($resolution)
|
intval($resolution)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$resolution = $r[0]['scale'];
|
$resolution = $r[0]['scale'];
|
||||||
$data = $r[0]['data'];
|
$data = $r[0]['data'];
|
||||||
$mimetype = $r[0]['type'];
|
$mimetype = $r[0]['type'];
|
||||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -49,7 +48,7 @@ function photos_init(App $a) {
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +169,7 @@ function photos_post(App $a)
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$visitor = $contact_id;
|
$visitor = $contact_id;
|
||||||
}
|
}
|
||||||
|
@ -202,7 +201,7 @@ function photos_post(App $a)
|
||||||
dbesc($album),
|
dbesc($album),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t('Album not found.') . EOL);
|
notice(L10n::t('Album not found.') . EOL);
|
||||||
goaway($_SESSION['photo_return']);
|
goaway($_SESSION['photo_return']);
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
@ -271,7 +270,7 @@ function photos_post(App $a)
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$res[] = "'" . dbesc($rr['rid']) . "'" ;
|
$res[] = "'" . dbesc($rr['rid']) . "'" ;
|
||||||
}
|
}
|
||||||
|
@ -337,7 +336,7 @@ function photos_post(App $a)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
|
q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
|
||||||
intval($page_owner_uid),
|
intval($page_owner_uid),
|
||||||
dbesc($r[0]['resource-id'])
|
dbesc($r[0]['resource-id'])
|
||||||
|
@ -379,7 +378,7 @@ function photos_post(App $a)
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$image = new Image($r[0]['data'], $r[0]['type']);
|
$image = new Image($r[0]['data'], $r[0]['type']);
|
||||||
|
|
||||||
if ($image->isValid()) {
|
if ($image->isValid()) {
|
||||||
|
@ -432,7 +431,7 @@ function photos_post(App $a)
|
||||||
dbesc($resource_id),
|
dbesc($resource_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($p)) {
|
if (DBA::is_result($p)) {
|
||||||
$ext = $phototypes[$p[0]['type']];
|
$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",
|
$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),
|
dbesc($desc),
|
||||||
|
@ -496,7 +495,7 @@ function photos_post(App $a)
|
||||||
if ($item_id) {
|
if ($item_id) {
|
||||||
$item = Item::selectFirst(['tag', 'inform'], ['id' => $item_id, 'uid' => $page_owner_uid]);
|
$item = Item::selectFirst(['tag', 'inform'], ['id' => $item_id, 'uid' => $page_owner_uid]);
|
||||||
}
|
}
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$old_tag = $item['tag'];
|
$old_tag = $item['tag'];
|
||||||
$old_inform = $item['inform'];
|
$old_inform = $item['inform'];
|
||||||
}
|
}
|
||||||
|
@ -559,7 +558,7 @@ function photos_post(App $a)
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
//select someone by attag or nick and the name passed in
|
//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",
|
$r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
|
||||||
dbesc($name),
|
dbesc($name),
|
||||||
|
@ -569,7 +568,7 @@ function photos_post(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$newname = $r[0]['name'];
|
$newname = $r[0]['name'];
|
||||||
$profile = $r[0]['url'];
|
$profile = $r[0]['url'];
|
||||||
$notify = 'cid:' . $r[0]['id'];
|
$notify = 'cid:' . $r[0]['id'];
|
||||||
|
@ -712,7 +711,7 @@ function photos_post(App $a)
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r) || ($album == L10n::t('Profile Photos'))) {
|
if (!DBA::is_result($r) || ($album == L10n::t('Profile Photos'))) {
|
||||||
$visible = 1;
|
$visible = 1;
|
||||||
} else {
|
} else {
|
||||||
$visible = 0;
|
$visible = 0;
|
||||||
|
@ -985,7 +984,7 @@ function photos_content(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
|
@ -1014,7 +1013,7 @@ function photos_content(App $a)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
}
|
}
|
||||||
|
@ -1114,7 +1113,7 @@ function photos_content(App $a)
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($album)
|
dbesc($album)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total(count($r));
|
$a->set_pager_total(count($r));
|
||||||
$a->set_pager_itemspage(20);
|
$a->set_pager_itemspage(20);
|
||||||
}
|
}
|
||||||
|
@ -1170,7 +1169,7 @@ function photos_content(App $a)
|
||||||
|
|
||||||
$photos = [];
|
$photos = [];
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
// "Twist" is only used for the duepunto theme with style "slackr"
|
// "Twist" is only used for the duepunto theme with style "slackr"
|
||||||
$twist = false;
|
$twist = false;
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
|
@ -1220,13 +1219,13 @@ function photos_content(App $a)
|
||||||
dbesc($datum)
|
dbesc($datum)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($ph)) {
|
if (!DBA::is_result($ph)) {
|
||||||
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
|
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
intval($owner_uid),
|
intval($owner_uid),
|
||||||
dbesc($datum)
|
dbesc($datum)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($ph)) {
|
if (DBA::is_result($ph)) {
|
||||||
notice(L10n::t('Permission denied. Access to this item may be restricted.'));
|
notice(L10n::t('Permission denied. Access to this item may be restricted.'));
|
||||||
} else {
|
} else {
|
||||||
notice(L10n::t('Photo not available') . EOL);
|
notice(L10n::t('Photo not available') . EOL);
|
||||||
|
@ -1257,7 +1256,7 @@ function photos_content(App $a)
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($prvnxt)) {
|
if (DBA::is_result($prvnxt)) {
|
||||||
foreach ($prvnxt as $z => $entry) {
|
foreach ($prvnxt as $z => $entry) {
|
||||||
if ($entry['resource-id'] == $ph[0]['resource-id']) {
|
if ($entry['resource-id'] == $ph[0]['resource-id']) {
|
||||||
$prv = $z - 1;
|
$prv = $z - 1;
|
||||||
|
@ -1354,7 +1353,7 @@ function photos_content(App $a)
|
||||||
$map = null;
|
$map = null;
|
||||||
$link_item = [];
|
$link_item = [];
|
||||||
|
|
||||||
if (DBM::is_result($linked_items)) {
|
if (DBA::is_result($linked_items)) {
|
||||||
// This is a workaround to not being forced to rewrite the while $sql_extra handling
|
// This is a workaround to not being forced to rewrite the while $sql_extra handling
|
||||||
$link_item = Item::selectFirst([], ['id' => $linked_items[0]['id']]);
|
$link_item = Item::selectFirst([], ['id' => $linked_items[0]['id']]);
|
||||||
|
|
||||||
|
@ -1450,7 +1449,7 @@ function photos_content(App $a)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($items)) {
|
if (!DBA::is_result($items)) {
|
||||||
if (($can_post || can_write_wall($owner_uid))) {
|
if (($can_post || can_write_wall($owner_uid))) {
|
||||||
$comments .= replace_macros($cmnt_tpl, [
|
$comments .= replace_macros($cmnt_tpl, [
|
||||||
'$return_path' => '',
|
'$return_path' => '',
|
||||||
|
@ -1477,7 +1476,7 @@ function photos_content(App $a)
|
||||||
];
|
];
|
||||||
|
|
||||||
// display comments
|
// display comments
|
||||||
if (DBM::is_result($items)) {
|
if (DBA::is_result($items)) {
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
builtin_activity_puller($item, $conv_responses);
|
builtin_activity_puller($item, $conv_responses);
|
||||||
}
|
}
|
||||||
|
@ -1620,7 +1619,7 @@ function photos_content(App $a)
|
||||||
dbesc(L10n::t('Contact Photos'))
|
dbesc(L10n::t('Contact Photos'))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total(count($r));
|
$a->set_pager_total(count($r));
|
||||||
$a->set_pager_itemspage(20);
|
$a->set_pager_itemspage(20);
|
||||||
}
|
}
|
||||||
|
@ -1638,7 +1637,7 @@ function photos_content(App $a)
|
||||||
);
|
);
|
||||||
|
|
||||||
$photos = [];
|
$photos = [];
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
// "Twist" is only used for the duepunto theme with style "slackr"
|
// "Twist" is only used for the duepunto theme with style "slackr"
|
||||||
$twist = false;
|
$twist = false;
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
|
|
24
mod/ping.php
24
mod/ping.php
|
@ -13,7 +13,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -135,7 +135,7 @@ function ping_init(App $a)
|
||||||
$params = ['order' => ['created' => true]];
|
$params = ['order' => ['created' => true]];
|
||||||
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
|
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
|
||||||
|
|
||||||
if (DBM::is_result($items)) {
|
if (DBA::is_result($items)) {
|
||||||
$items_unseen = Item::inArray($items);
|
$items_unseen = Item::inArray($items);
|
||||||
$arr = ['items' => $items_unseen];
|
$arr = ['items' => $items_unseen];
|
||||||
Addon::callHooks('network_ping', $arr);
|
Addon::callHooks('network_ping', $arr);
|
||||||
|
@ -153,7 +153,7 @@ function ping_init(App $a)
|
||||||
if (intval(Feature::isEnabled(local_user(), 'groups'))) {
|
if (intval(Feature::isEnabled(local_user(), 'groups'))) {
|
||||||
// Find out how unseen network posts are spread across groups
|
// Find out how unseen network posts are spread across groups
|
||||||
$group_counts = Group::countUnseen();
|
$group_counts = Group::countUnseen();
|
||||||
if (DBM::is_result($group_counts)) {
|
if (DBA::is_result($group_counts)) {
|
||||||
foreach ($group_counts as $group_count) {
|
foreach ($group_counts as $group_count) {
|
||||||
if ($group_count['count'] > 0) {
|
if ($group_count['count'] > 0) {
|
||||||
$groups_unseen[] = $group_count;
|
$groups_unseen[] = $group_count;
|
||||||
|
@ -164,7 +164,7 @@ function ping_init(App $a)
|
||||||
|
|
||||||
if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
|
if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
|
||||||
$forum_counts = ForumManager::countUnseenItems();
|
$forum_counts = ForumManager::countUnseenItems();
|
||||||
if (DBM::is_result($forum_counts)) {
|
if (DBA::is_result($forum_counts)) {
|
||||||
foreach ($forum_counts as $forum_count) {
|
foreach ($forum_counts as $forum_count) {
|
||||||
if ($forum_count['count'] > 0) {
|
if ($forum_count['count'] > 0) {
|
||||||
$forums_unseen[] = $forum_count;
|
$forums_unseen[] = $forum_count;
|
||||||
|
@ -208,7 +208,7 @@ function ping_init(App $a)
|
||||||
WHERE `contact`.`self` = 1"
|
WHERE `contact`.`self` = 1"
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($regs)) {
|
if (DBA::is_result($regs)) {
|
||||||
$register_count = count($regs);
|
$register_count = count($regs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,12 +224,12 @@ function ping_init(App $a)
|
||||||
dbesc(DateTimeFormat::utc('now + 7 days')),
|
dbesc(DateTimeFormat::utc('now + 7 days')),
|
||||||
dbesc(DateTimeFormat::utcNow())
|
dbesc(DateTimeFormat::utcNow())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($ev)) {
|
if (DBA::is_result($ev)) {
|
||||||
Cache::set($cachekey, $ev, CACHE_HOUR);
|
Cache::set($cachekey, $ev, CACHE_HOUR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($ev)) {
|
if (DBA::is_result($ev)) {
|
||||||
$all_events = count($ev);
|
$all_events = count($ev);
|
||||||
|
|
||||||
if ($all_events) {
|
if ($all_events) {
|
||||||
|
@ -267,7 +267,7 @@ function ping_init(App $a)
|
||||||
$data['birthdays'] = $birthdays;
|
$data['birthdays'] = $birthdays;
|
||||||
$data['birthdays-today'] = $birthdays_today;
|
$data['birthdays-today'] = $birthdays_today;
|
||||||
|
|
||||||
if (DBM::is_result($notifs)) {
|
if (DBA::is_result($notifs)) {
|
||||||
foreach ($notifs as $notif) {
|
foreach ($notifs as $notif) {
|
||||||
if ($notif['seen'] == 0) {
|
if ($notif['seen'] == 0) {
|
||||||
$sysnotify_count ++;
|
$sysnotify_count ++;
|
||||||
|
@ -276,7 +276,7 @@ function ping_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// merge all notification types in one array
|
// merge all notification types in one array
|
||||||
if (DBM::is_result($intros)) {
|
if (DBA::is_result($intros)) {
|
||||||
foreach ($intros as $intro) {
|
foreach ($intros as $intro) {
|
||||||
$notif = [
|
$notif = [
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
|
@ -292,7 +292,7 @@ function ping_init(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($mails)) {
|
if (DBA::is_result($mails)) {
|
||||||
foreach ($mails as $mail) {
|
foreach ($mails as $mail) {
|
||||||
$notif = [
|
$notif = [
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
|
@ -308,7 +308,7 @@ function ping_init(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBM::is_result($regs)) {
|
if (DBA::is_result($regs)) {
|
||||||
foreach ($regs as $reg) {
|
foreach ($regs as $reg) {
|
||||||
$notif = [
|
$notif = [
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
|
@ -345,7 +345,7 @@ function ping_init(App $a)
|
||||||
};
|
};
|
||||||
usort($notifs, $sort_function);
|
usort($notifs, $sort_function);
|
||||||
|
|
||||||
if (DBM::is_result($notifs)) {
|
if (DBA::is_result($notifs)) {
|
||||||
// Are the nofications called from the regular process or via the friendica app?
|
// Are the nofications called from the regular process or via the friendica app?
|
||||||
$regularnotifications = (intval($_GET['uid']) && intval($_GET['_']));
|
$regularnotifications = (intval($_GET['uid']) && intval($_GET['_']));
|
||||||
|
|
||||||
|
|
10
mod/poco.php
10
mod/poco.php
|
@ -9,7 +9,7 @@ use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Cache;
|
use Friendica\Core\Cache;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Protocol\PortableContact;
|
use Friendica\Protocol\PortableContact;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ function poco_init(App $a) {
|
||||||
}
|
}
|
||||||
if (empty($user)) {
|
if (empty($user)) {
|
||||||
$c = q("SELECT * FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1");
|
$c = q("SELECT * FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1");
|
||||||
if (!DBM::is_result($c)) {
|
if (!DBA::is_result($c)) {
|
||||||
System::httpExit(401);
|
System::httpExit(401);
|
||||||
}
|
}
|
||||||
$system_mode = true;
|
$system_mode = true;
|
||||||
|
@ -67,7 +67,7 @@ function poco_init(App $a) {
|
||||||
where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
|
where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
|
||||||
dbesc($user)
|
dbesc($user)
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
|
if (! DBA::is_result($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
|
||||||
System::httpExit(404);
|
System::httpExit(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ function poco_init(App $a) {
|
||||||
dbesc(NETWORK_STATUSNET)
|
dbesc(NETWORK_STATUSNET)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (DBM::is_result($contacts)) {
|
if (DBA::is_result($contacts)) {
|
||||||
$totalResults = intval($contacts[0]['total']);
|
$totalResults = intval($contacts[0]['total']);
|
||||||
} else {
|
} else {
|
||||||
$totalResults = 0;
|
$totalResults = 0;
|
||||||
|
@ -203,7 +203,7 @@ function poco_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($contacts)) {
|
if (is_array($contacts)) {
|
||||||
if (DBM::is_result($contacts)) {
|
if (DBA::is_result($contacts)) {
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
if (!isset($contact['updated'])) {
|
if (!isset($contact['updated'])) {
|
||||||
$contact['updated'] = '';
|
$contact['updated'] = '';
|
||||||
|
|
|
@ -18,7 +18,7 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -61,7 +61,7 @@ function poke_init(App $a) {
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
logger('poke: no contact ' . $contact_id);
|
logger('poke: no contact ' . $contact_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ function poke_init(App $a) {
|
||||||
$condition = ['id' => $parent, 'parent' => $parent, 'uid' => $uid];
|
$condition = ['id' => $parent, 'parent' => $parent, 'uid' => $uid];
|
||||||
$item = Item::selectFirst($fields, $condition);
|
$item = Item::selectFirst($fields, $condition);
|
||||||
|
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
$parent_uri = $item['uri'];
|
$parent_uri = $item['uri'];
|
||||||
$private = $item['private'];
|
$private = $item['private'];
|
||||||
$allow_cid = $item['allow_cid'];
|
$allow_cid = $item['allow_cid'];
|
||||||
|
@ -154,7 +154,7 @@ function poke_content(App $a) {
|
||||||
intval($_GET['c']),
|
intval($_GET['c']),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$name = $item['name'];
|
$name = $item['name'];
|
||||||
$id = $item['id'];
|
$id = $item['id'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -31,7 +30,7 @@ function profile_init(App $a)
|
||||||
$which = htmlspecialchars($a->argv[1]);
|
$which = htmlspecialchars($a->argv[1]);
|
||||||
} else {
|
} else {
|
||||||
$r = q("SELECT `nickname` FROM `user` WHERE `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 ORDER BY RAND() LIMIT 1");
|
$r = q("SELECT `nickname` FROM `user` WHERE `blocked` = 0 AND `account_expired` = 0 AND `account_removed` = 0 AND `verified` = 1 ORDER BY RAND() LIMIT 1");
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
|
goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
|
||||||
} else {
|
} else {
|
||||||
logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
|
logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
|
||||||
|
@ -155,7 +154,7 @@ function profile_content(App $a, $update = 0)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($a->profile['profile_uid'])
|
intval($a->profile['profile_uid'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +249,7 @@ function profile_content(App $a, $update = 0)
|
||||||
intval($a->profile['profile_uid']), intval(GRAVITY_ACTIVITY)
|
intval($a->profile['profile_uid']), intval(GRAVITY_ACTIVITY)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -281,7 +280,7 @@ function profile_content(App $a, $update = 0)
|
||||||
intval(PAGE_PRVGROUP)
|
intval(PAGE_PRVGROUP)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$sql_extra3 = sprintf(" AND `thread`.`contact-id` = %d ", intval(intval($a->profile['contact_id'])));
|
$sql_extra3 = sprintf(" AND `thread`.`contact-id` = %d ", intval(intval($a->profile['contact_id'])));
|
||||||
} else {
|
} else {
|
||||||
$sql_extra3 = "";
|
$sql_extra3 = "";
|
||||||
|
@ -328,7 +327,7 @@ function profile_content(App $a, $update = 0)
|
||||||
// search for new items (update routine)
|
// search for new items (update routine)
|
||||||
$_SESSION['last_updated'][$last_updated_key] = time();
|
$_SESSION['last_updated'][$last_updated_key] = time();
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$parents_arr[] = $rr['item_id'];
|
$parents_arr[] = $rr['item_id'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Photo;
|
use Friendica\Model\Photo;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -42,7 +42,7 @@ function profile_photo_post(App $a)
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r) && (!intval($r[0]['is-default']))) {
|
if (DBA::is_result($r) && (!intval($r[0]['is-default']))) {
|
||||||
$is_default_profile = 0;
|
$is_default_profile = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,8 +73,7 @@ function profile_photo_post(App $a)
|
||||||
dbesc(local_user()), intval($scale));
|
dbesc(local_user()), intval($scale));
|
||||||
|
|
||||||
$url = System::baseUrl() . '/profile/' . $a->user['nickname'];
|
$url = System::baseUrl() . '/profile/' . $a->user['nickname'];
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
|
|
||||||
$base_image = $r[0];
|
$base_image = $r[0];
|
||||||
|
|
||||||
$Image = new Image($base_image['data'], $base_image['type']);
|
$Image = new Image($base_image['data'], $base_image['type']);
|
||||||
|
@ -195,7 +194,7 @@ function profile_photo_content(App $a)
|
||||||
dbesc($resource_id)
|
dbesc($resource_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t('Permission denied.') . EOL);
|
notice(L10n::t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -35,7 +34,7 @@ function profiles_init(App $a) {
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Profile not found.') . EOL);
|
notice(L10n::t('Profile not found.') . EOL);
|
||||||
goaway('profiles');
|
goaway('profiles');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
|
@ -54,7 +53,7 @@ function profiles_init(App $a) {
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
info(L10n::t('Profile deleted.').EOL);
|
info(L10n::t('Profile deleted.').EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +68,7 @@ function profiles_init(App $a) {
|
||||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||||
intval(local_user()));
|
intval(local_user()));
|
||||||
|
|
||||||
$num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
|
$num_profiles = (DBA::is_result($r0) ? count($r0) : 0);
|
||||||
|
|
||||||
$name = L10n::t('Profile-') . ($num_profiles + 1);
|
$name = L10n::t('Profile-') . ($num_profiles + 1);
|
||||||
|
|
||||||
|
@ -91,7 +90,7 @@ function profiles_init(App $a) {
|
||||||
);
|
);
|
||||||
|
|
||||||
info(L10n::t('New profile created.') . EOL);
|
info(L10n::t('New profile created.') . EOL);
|
||||||
if (DBM::is_result($r3) && count($r3) == 1) {
|
if (DBA::is_result($r3) && count($r3) == 1) {
|
||||||
goaway('profiles/' . $r3[0]['id']);
|
goaway('profiles/' . $r3[0]['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,14 +104,14 @@ function profiles_init(App $a) {
|
||||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||||
intval(local_user()));
|
intval(local_user()));
|
||||||
|
|
||||||
$num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
|
$num_profiles = (DBA::is_result($r0) ? count($r0) : 0);
|
||||||
|
|
||||||
$name = L10n::t('Profile-') . ($num_profiles + 1);
|
$name = L10n::t('Profile-') . ($num_profiles + 1);
|
||||||
$r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
$r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
intval($a->argv[2])
|
intval($a->argv[2])
|
||||||
);
|
);
|
||||||
if(! DBM::is_result($r1)) {
|
if(! DBA::is_result($r1)) {
|
||||||
notice(L10n::t('Profile unavailable to clone.') . EOL);
|
notice(L10n::t('Profile unavailable to clone.') . EOL);
|
||||||
killme();
|
killme();
|
||||||
return;
|
return;
|
||||||
|
@ -130,7 +129,7 @@ function profiles_init(App $a) {
|
||||||
dbesc($name)
|
dbesc($name)
|
||||||
);
|
);
|
||||||
info(L10n::t('New profile created.') . EOL);
|
info(L10n::t('New profile created.') . EOL);
|
||||||
if ((DBM::is_result($r3)) && (count($r3) == 1)) {
|
if ((DBA::is_result($r3)) && (count($r3) == 1)) {
|
||||||
goaway('profiles/'.$r3[0]['id']);
|
goaway('profiles/'.$r3[0]['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +144,7 @@ function profiles_init(App $a) {
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Profile not found.') . EOL);
|
notice(L10n::t('Profile not found.') . EOL);
|
||||||
killme();
|
killme();
|
||||||
return;
|
return;
|
||||||
|
@ -192,7 +191,7 @@ function profiles_post(App $a) {
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($orig)) {
|
if (! DBA::is_result($orig)) {
|
||||||
notice(L10n::t('Profile not found.') . EOL);
|
notice(L10n::t('Profile not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -287,13 +286,13 @@ function profiles_post(App $a) {
|
||||||
dbesc($newname),
|
dbesc($newname),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($lookup),
|
dbesc($lookup),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$prf = $r[0]['url'];
|
$prf = $r[0]['url'];
|
||||||
$newname = $r[0]['name'];
|
$newname = $r[0]['name'];
|
||||||
}
|
}
|
||||||
|
@ -522,7 +521,7 @@ function profiles_content(App $a) {
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Profile not found.') . EOL);
|
notice(L10n::t('Profile not found.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -654,7 +653,7 @@ function profiles_content(App $a) {
|
||||||
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
|
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
|
||||||
local_user()
|
local_user()
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
//Go to the default profile.
|
//Go to the default profile.
|
||||||
goaway('profiles/' . $r[0]['id']);
|
goaway('profiles/' . $r[0]['id']);
|
||||||
}
|
}
|
||||||
|
@ -663,7 +662,7 @@ function profiles_content(App $a) {
|
||||||
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
|
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
|
||||||
local_user());
|
local_user());
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
|
|
||||||
$tpl = get_markup_template('profile_entry.tpl');
|
$tpl = get_markup_template('profile_entry.tpl');
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
function profperm_init(App $a)
|
function profperm_init(App $a)
|
||||||
|
@ -51,7 +51,7 @@ function profperm_content(App $a) {
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
$change = intval($a->argv[2]);
|
$change = intval($a->argv[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ function profperm_content(App $a) {
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('Invalid profile identifier.') . EOL );
|
notice(L10n::t('Invalid profile identifier.') . EOL );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ function profperm_content(App $a) {
|
||||||
);
|
);
|
||||||
|
|
||||||
$ingroup = [];
|
$ingroup = [];
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $member)
|
foreach($r as $member)
|
||||||
$ingroup[] = $member['id'];
|
$ingroup[] = $member['id'];
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ function profperm_content(App $a) {
|
||||||
$members = $r;
|
$members = $r;
|
||||||
|
|
||||||
$ingroup = [];
|
$ingroup = [];
|
||||||
if (DBM::is_result($r))
|
if (DBA::is_result($r))
|
||||||
foreach($r as $member)
|
foreach($r as $member)
|
||||||
$ingroup[] = $member['id'];
|
$ingroup[] = $member['id'];
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ function profperm_content(App $a) {
|
||||||
dbesc(NETWORK_DFRN)
|
dbesc(NETWORK_DFRN)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
|
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
|
||||||
foreach($r as $member) {
|
foreach($r as $member) {
|
||||||
if(! in_array($member['id'],$ingroup)) {
|
if(! in_array($member['id'],$ingroup)) {
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Photo;
|
use Friendica\Model\Photo;
|
||||||
use Friendica\Object\Image;
|
use Friendica\Object\Image;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
@ -151,7 +150,7 @@ function proxy_init(App $a) {
|
||||||
$photo = null;
|
$photo = null;
|
||||||
if (!$direct_cache && ($cachefile == '')) {
|
if (!$direct_cache && ($cachefile == '')) {
|
||||||
$photo = DBA::selectFirst('photo', ['data', 'desc'], ['resource-id' => $urlhash]);
|
$photo = DBA::selectFirst('photo', ['data', 'desc'], ['resource-id' => $urlhash]);
|
||||||
if (DBM::is_result($photo)) {
|
if (DBA::is_result($photo)) {
|
||||||
$img_str = $photo['data'];
|
$img_str = $photo['data'];
|
||||||
$mime = $photo['desc'];
|
$mime = $photo['desc'];
|
||||||
if ($mime == '') {
|
if ($mime == '') {
|
||||||
|
@ -160,7 +159,7 @@ function proxy_init(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($photo)) {
|
if (!DBA::is_result($photo)) {
|
||||||
// It shouldn't happen but it does - spaces in URL
|
// It shouldn't happen but it does - spaces in URL
|
||||||
$_REQUEST['url'] = str_replace(' ', '+', $_REQUEST['url']);
|
$_REQUEST['url'] = str_replace(' ', '+', $_REQUEST['url']);
|
||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Protocol\OStatus;
|
use Friendica\Protocol\OStatus;
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
|
@ -45,7 +44,7 @@ function pubsub_init(App $a)
|
||||||
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
|
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
|
||||||
|
|
||||||
$owner = DBA::selectFirst('user', ['uid'], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
$owner = DBA::selectFirst('user', ['uid'], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
||||||
if (!DBM::is_result($owner)) {
|
if (!DBA::is_result($owner)) {
|
||||||
logger('Local account not found: ' . $nick);
|
logger('Local account not found: ' . $nick);
|
||||||
hub_return(false, '');
|
hub_return(false, '');
|
||||||
}
|
}
|
||||||
|
@ -57,7 +56,7 @@ function pubsub_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', ['id', 'poll'], $condition);
|
$contact = DBA::selectFirst('contact', ['id', 'poll'], $condition);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
logger('Contact ' . $contact_id . ' not found.');
|
logger('Contact ' . $contact_id . ' not found.');
|
||||||
hub_return(false, '');
|
hub_return(false, '');
|
||||||
}
|
}
|
||||||
|
@ -94,21 +93,21 @@ function pubsub_post(App $a)
|
||||||
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
|
||||||
|
|
||||||
$importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
$importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
|
||||||
if (!DBM::is_result($importer)) {
|
if (!DBA::is_result($importer)) {
|
||||||
hub_post_return();
|
hub_post_return();
|
||||||
}
|
}
|
||||||
|
|
||||||
$condition = ['id' => $contact_id, 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
|
$condition = ['id' => $contact_id, 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
|
||||||
$contact = DBA::selectFirst('contact', [], $condition);
|
$contact = DBA::selectFirst('contact', [], $condition);
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
$author = OStatus::salmonAuthor($xml, $importer);
|
$author = OStatus::salmonAuthor($xml, $importer);
|
||||||
if (!empty($author['contact-id'])) {
|
if (!empty($author['contact-id'])) {
|
||||||
$condition = ['id' => $author['contact-id'], 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
|
$condition = ['id' => $author['contact-id'], 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
|
||||||
$contact = DBA::selectFirst('contact', [], $condition);
|
$contact = DBA::selectFirst('contact', [], $condition);
|
||||||
logger('No record for ' . $nick .' with contact id ' . $contact_id . ' - using '.$author['contact-id'].' instead.');
|
logger('No record for ' . $nick .' with contact id ' . $contact_id . ' - using '.$author['contact-id'].' instead.');
|
||||||
}
|
}
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
logger('Contact ' . $author["author-link"] . ' (' . $contact_id . ') for user ' . $nick . " wasn't found - ignored. XML: " . $xml);
|
logger('Contact ' . $author["author-link"] . ' (' . $contact_id . ') for user ' . $nick . " wasn't found - ignored. XML: " . $xml);
|
||||||
hub_post_return();
|
hub_post_return();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\PushSubscriber;
|
use Friendica\Model\PushSubscriber;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ function pubsubhubbub_init(App $a) {
|
||||||
// fetch user from database given the nickname
|
// fetch user from database given the nickname
|
||||||
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
|
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
|
||||||
$owner = DBA::selectFirst('user', ['uid', 'hidewall'], $condition);
|
$owner = DBA::selectFirst('user', ['uid', 'hidewall'], $condition);
|
||||||
if (!DBM::is_result($owner)) {
|
if (!DBA::is_result($owner)) {
|
||||||
logger('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
|
logger('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
|
||||||
System::httpExit(404);
|
System::httpExit(404);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +79,7 @@ function pubsubhubbub_init(App $a) {
|
||||||
$condition = ['uid' => $owner['uid'], 'blocked' => false,
|
$condition = ['uid' => $owner['uid'], 'blocked' => false,
|
||||||
'pending' => false, 'self' => true];
|
'pending' => false, 'self' => true];
|
||||||
$contact = DBA::selectFirst('contact', ['poll'], $condition);
|
$contact = DBA::selectFirst('contact', ['poll'], $condition);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
logger('Self contact for user ' . $owner['uid'] . ' not found.');
|
logger('Self contact for user ' . $owner['uid'] . ' not found.');
|
||||||
System::httpExit(404);
|
System::httpExit(404);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Protocol\Diaspora;
|
use Friendica\Protocol\Diaspora;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +34,7 @@ function receive_post(App $a)
|
||||||
$guid = $a->argv[2];
|
$guid = $a->argv[2];
|
||||||
|
|
||||||
$importer = DBA::selectFirst('user', [], ['guid' => $guid, 'account_expired' => false, 'account_removed' => false]);
|
$importer = DBA::selectFirst('user', [], ['guid' => $guid, 'account_expired' => false, 'account_removed' => false]);
|
||||||
if (!DBM::is_result($importer)) {
|
if (!DBA::is_result($importer)) {
|
||||||
System::httpExit(500);
|
System::httpExit(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ function redir_init(App $a) {
|
||||||
if (!empty($cid)) {
|
if (!empty($cid)) {
|
||||||
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex'];
|
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex'];
|
||||||
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
|
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
notice(L10n::t('Contact not found.'));
|
notice(L10n::t('Contact not found.'));
|
||||||
goaway(System::baseUrl());
|
goaway(System::baseUrl());
|
||||||
}
|
}
|
||||||
|
@ -44,7 +43,7 @@ function redir_init(App $a) {
|
||||||
// between the puplic contact we have found and the local user.
|
// between the puplic contact we have found and the local user.
|
||||||
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
|
||||||
|
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Module\Login;
|
use Friendica\Module\Login;
|
||||||
|
|
||||||
|
@ -24,7 +23,7 @@ function user_allow($hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (!DBM::is_result($register)) {
|
if (!DBA::is_result($register)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ function user_allow($hash)
|
||||||
intval($register[0]['uid'])
|
intval($register[0]['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +47,7 @@ function user_allow($hash)
|
||||||
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
|
$r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default` = 1",
|
||||||
intval($user[0]['uid'])
|
intval($user[0]['uid'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r) && $r[0]['net-publish']) {
|
if (DBA::is_result($r) && $r[0]['net-publish']) {
|
||||||
$url = System::baseUrl() . '/profile/' . $user[0]['nickname'];
|
$url = System::baseUrl() . '/profile/' . $user[0]['nickname'];
|
||||||
if ($url && strlen(Config::get('system', 'directory'))) {
|
if ($url && strlen(Config::get('system', 'directory'))) {
|
||||||
Worker::add(PRIORITY_LOW, "Directory", $url);
|
Worker::add(PRIORITY_LOW, "Directory", $url);
|
||||||
|
@ -81,7 +80,7 @@ function user_deny($hash)
|
||||||
dbesc($hash)
|
dbesc($hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($register)) {
|
if (!DBA::is_result($register)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
|
||||||
require_once 'include/enotify.php';
|
require_once 'include/enotify.php';
|
||||||
|
@ -40,7 +39,7 @@ function removeme_post(App $a)
|
||||||
$admin_mails = explode(",", str_replace(" ", "", Config::get('config', 'admin_email')));
|
$admin_mails = explode(",", str_replace(" ", "", Config::get('config', 'admin_email')));
|
||||||
foreach ($admin_mails as $mail) {
|
foreach ($admin_mails as $mail) {
|
||||||
$admin = DBA::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]);
|
$admin = DBA::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]);
|
||||||
if (!DBM::is_result($admin)) {
|
if (!DBA::is_result($admin)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
notification([
|
notification([
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Protocol\OStatus;
|
use Friendica\Protocol\OStatus;
|
||||||
use Friendica\Protocol\Salmon;
|
use Friendica\Protocol\Salmon;
|
||||||
|
@ -27,7 +27,7 @@ function salmon_post(App $a, $xml = '') {
|
||||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
System::httpExit(500);
|
System::httpExit(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ function salmon_post(App $a, $xml = '') {
|
||||||
dbesc(normalise_link($author_link)),
|
dbesc(normalise_link($author_link)),
|
||||||
intval($importer['uid'])
|
intval($importer['uid'])
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
logger('Author ' . $author_link . ' unknown to user ' . $importer['uid'] . '.');
|
logger('Author ' . $author_link . ' unknown to user ' . $importer['uid'] . '.');
|
||||||
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
|
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
|
||||||
$result = Contact::createFromProbe($importer['uid'], $author_link);
|
$result = Contact::createFromProbe($importer['uid'], $author_link);
|
||||||
|
@ -171,8 +171,8 @@ function salmon_post(App $a, $xml = '') {
|
||||||
// Have we ignored the person?
|
// Have we ignored the person?
|
||||||
// If so we can not accept this post.
|
// If so we can not accept this post.
|
||||||
|
|
||||||
//if((DBM::is_result($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
|
//if((DBA::is_result($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
|
||||||
if (DBM::is_result($r) && $r[0]['blocked']) {
|
if (DBA::is_result($r) && $r[0]['blocked']) {
|
||||||
logger('Ignoring this author.');
|
logger('Ignoring this author.');
|
||||||
System::httpExit(202);
|
System::httpExit(202);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
@ -181,7 +181,7 @@ function salmon_post(App $a, $xml = '') {
|
||||||
// Placeholder for hub discovery.
|
// Placeholder for hub discovery.
|
||||||
$hub = '';
|
$hub = '';
|
||||||
|
|
||||||
$contact_rec = ((DBM::is_result($r)) ? $r[0] : null);
|
$contact_rec = ((DBA::is_result($r)) ? $r[0] : null);
|
||||||
|
|
||||||
OStatus::import($data, $importer, $contact_rec, $hub);
|
OStatus::import($data, $importer, $contact_rec, $hub);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -30,7 +29,7 @@ function search_saved_searches() {
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$saved = [];
|
$saved = [];
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$saved[] = [
|
$saved[] = [
|
||||||
|
@ -68,7 +67,7 @@ function search_init(App $a) {
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($search)
|
dbesc($search)
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
DBA::insert('search', ['uid' => local_user(), 'term' => $search]);
|
DBA::insert('search', ['uid' => local_user(), 'term' => $search]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +236,7 @@ function search_content(App $a) {
|
||||||
$r = Item::inArray($items);
|
$r = Item::inArray($items);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
info(L10n::t('No results.') . EOL);
|
info(L10n::t('No results.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
@ -240,7 +239,7 @@ function settings_post(App $a)
|
||||||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
DBA::insert('mailacct', ['uid' => local_user()]);
|
DBA::insert('mailacct', ['uid' => local_user()]);
|
||||||
}
|
}
|
||||||
if (strlen($mail_pass)) {
|
if (strlen($mail_pass)) {
|
||||||
|
@ -265,7 +264,7 @@ function settings_post(App $a)
|
||||||
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$eacct = $r[0];
|
$eacct = $r[0];
|
||||||
$mb = Email::constructMailboxName($eacct);
|
$mb = Email::constructMailboxName($eacct);
|
||||||
|
|
||||||
|
@ -404,7 +403,7 @@ function settings_post(App $a)
|
||||||
|
|
||||||
if (!$err) {
|
if (!$err) {
|
||||||
$result = User::updatePassword(local_user(), $newpass);
|
$result = User::updatePassword(local_user(), $newpass);
|
||||||
if (DBM::is_result($result)) {
|
if (DBA::is_result($result)) {
|
||||||
info(L10n::t('Password changed.') . EOL);
|
info(L10n::t('Password changed.') . EOL);
|
||||||
} else {
|
} else {
|
||||||
notice(L10n::t('Password update failed. Please try again.') . EOL);
|
notice(L10n::t('Password update failed. Please try again.') . EOL);
|
||||||
|
@ -605,7 +604,7 @@ function settings_post(App $a)
|
||||||
dbesc($language),
|
dbesc($language),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
info(L10n::t('Settings updated.') . EOL);
|
info(L10n::t('Settings updated.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,7 +681,7 @@ function settings_content(App $a)
|
||||||
dbesc($a->argv[3]),
|
dbesc($a->argv[3]),
|
||||||
local_user());
|
local_user());
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
notice(L10n::t("You can't edit this application."));
|
notice(L10n::t("You can't edit this application."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -711,7 +710,7 @@ function settings_content(App $a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @TODO validate result with DBM::is_result()
|
/// @TODO validate result with DBA::is_result()
|
||||||
$r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my
|
$r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my
|
||||||
FROM clients
|
FROM clients
|
||||||
LEFT JOIN tokens ON clients.client_id=tokens.client_id
|
LEFT JOIN tokens ON clients.client_id=tokens.client_id
|
||||||
|
@ -740,7 +739,7 @@ function settings_content(App $a)
|
||||||
$settings_addons = "";
|
$settings_addons = "";
|
||||||
|
|
||||||
$r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
|
$r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
$settings_addons = L10n::t('No Addon settings configured');
|
$settings_addons = L10n::t('No Addon settings configured');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -813,15 +812,15 @@ function settings_content(App $a)
|
||||||
$r = null;
|
$r = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mail_server = ((DBM::is_result($r)) ? $r[0]['server'] : '');
|
$mail_server = ((DBA::is_result($r)) ? $r[0]['server'] : '');
|
||||||
$mail_port = ((DBM::is_result($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
|
$mail_port = ((DBA::is_result($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
|
||||||
$mail_ssl = ((DBM::is_result($r)) ? $r[0]['ssltype'] : '');
|
$mail_ssl = ((DBA::is_result($r)) ? $r[0]['ssltype'] : '');
|
||||||
$mail_user = ((DBM::is_result($r)) ? $r[0]['user'] : '');
|
$mail_user = ((DBA::is_result($r)) ? $r[0]['user'] : '');
|
||||||
$mail_replyto = ((DBM::is_result($r)) ? $r[0]['reply_to'] : '');
|
$mail_replyto = ((DBA::is_result($r)) ? $r[0]['reply_to'] : '');
|
||||||
$mail_pubmail = ((DBM::is_result($r)) ? $r[0]['pubmail'] : 0);
|
$mail_pubmail = ((DBA::is_result($r)) ? $r[0]['pubmail'] : 0);
|
||||||
$mail_action = ((DBM::is_result($r)) ? $r[0]['action'] : 0);
|
$mail_action = ((DBA::is_result($r)) ? $r[0]['action'] : 0);
|
||||||
$mail_movetofolder = ((DBM::is_result($r)) ? $r[0]['movetofolder'] : '');
|
$mail_movetofolder = ((DBA::is_result($r)) ? $r[0]['movetofolder'] : '');
|
||||||
$mail_chk = ((DBM::is_result($r)) ? $r[0]['last_check'] : NULL_DATE);
|
$mail_chk = ((DBA::is_result($r)) ? $r[0]['last_check'] : NULL_DATE);
|
||||||
|
|
||||||
|
|
||||||
$tpl = get_markup_template('settings/connectors.tpl');
|
$tpl = get_markup_template('settings/connectors.tpl');
|
||||||
|
@ -990,7 +989,7 @@ function settings_content(App $a)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$profile = DBA::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
|
$profile = DBA::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($profile)) {
|
if (!DBA::is_result($profile)) {
|
||||||
notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
|
notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
function share_init(App $a) {
|
function share_init(App $a) {
|
||||||
|
@ -15,7 +15,7 @@ function share_init(App $a) {
|
||||||
'guid', 'created', 'plink', 'title'];
|
'guid', 'created', 'plink', 'title'];
|
||||||
$item = Item::selectFirst($fields, ['id' => $post_id]);
|
$item = Item::selectFirst($fields, ['id' => $post_id]);
|
||||||
|
|
||||||
if (!DBM::is_result($item) || $item['private'] == 1) {
|
if (!DBA::is_result($item) || $item['private'] == 1) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
function starred_init(App $a) {
|
function starred_init(App $a) {
|
||||||
|
@ -22,7 +22,7 @@ function starred_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $message_id]);
|
$item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $message_id]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -25,7 +25,7 @@ function subthread_content(App $a) {
|
||||||
$condition = ["`parent` = ? OR `parent-uri` = ? AND `parent` = `id`", $item_id, $item_id];
|
$condition = ["`parent` = ? OR `parent-uri` = ? AND `parent` = `id`", $item_id, $item_id];
|
||||||
$item = Item::selectFirst([], $condition);
|
$item = Item::selectFirst([], $condition);
|
||||||
|
|
||||||
if (empty($item_id) || !DBM::is_result($item)) {
|
if (empty($item_id) || !DBA::is_result($item)) {
|
||||||
logger('subthread: no item ' . $item_id);
|
logger('subthread: no item ' . $item_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ function subthread_content(App $a) {
|
||||||
intval($item['contact-id']),
|
intval($item['contact-id']),
|
||||||
intval($item['uid'])
|
intval($item['uid'])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$r[0]['self']) {
|
if (!$r[0]['self']) {
|
||||||
|
@ -60,7 +60,7 @@ function subthread_content(App $a) {
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$owner = $r[0];
|
$owner = $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ function subthread_content(App $a) {
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Content\Widget;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
|
|
||||||
|
@ -70,7 +69,7 @@ function suggest_content(App $a) {
|
||||||
|
|
||||||
$r = GContact::suggestionQuery(local_user());
|
$r = GContact::suggestionQuery(local_user());
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
$o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.');
|
$o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.');
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -34,7 +34,7 @@ function tagger_content(App $a) {
|
||||||
|
|
||||||
$item = Item::selectFirst([], ['id' => $item_id]);
|
$item = Item::selectFirst([], ['id' => $item_id]);
|
||||||
|
|
||||||
if (!$item_id || !DBM::is_result($item)) {
|
if (!$item_id || !DBA::is_result($item)) {
|
||||||
logger('tagger: no item ' . $item_id);
|
logger('tagger: no item ' . $item_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ function tagger_content(App $a) {
|
||||||
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
|
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$owner_nick = $r[0]['nickname'];
|
$owner_nick = $r[0]['nickname'];
|
||||||
$blocktags = $r[0]['blocktags'];
|
$blocktags = $r[0]['blocktags'];
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ function tagger_content(App $a) {
|
||||||
$r = q("select * from contact where self = 1 and uid = %d limit 1",
|
$r = q("select * from contact where self = 1 and uid = %d limit 1",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
} else {
|
} else {
|
||||||
logger('tagger: no contact_id');
|
logger('tagger: no contact_id');
|
||||||
|
@ -175,7 +175,7 @@ EOT;
|
||||||
|
|
||||||
// if the original post is on this site, update it.
|
// if the original post is on this site, update it.
|
||||||
$original_item = Item::selectFirst(['tag', 'id', 'uid'], ['origin' => true, 'uri' => $item['uri']]);
|
$original_item = Item::selectFirst(['tag', 'id', 'uid'], ['origin' => true, 'uri' => $item['uri']]);
|
||||||
if (DBM::is_result($original_item)) {
|
if (DBA::is_result($original_item)) {
|
||||||
$x = q("SELECT `blocktags` FROM `user` WHERE `uid`=%d LIMIT 1",
|
$x = q("SELECT `blocktags` FROM `user` WHERE `uid`=%d LIMIT 1",
|
||||||
intval($original_item['uid'])
|
intval($original_item['uid'])
|
||||||
);
|
);
|
||||||
|
@ -184,7 +184,7 @@ EOT;
|
||||||
dbesc($term)
|
dbesc($term)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
|
if (DBA::is_result($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
|
||||||
q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
|
q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
|
||||||
intval($original_item['id']),
|
intval($original_item['id']),
|
||||||
$term_objtype,
|
$term_objtype,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
function tagrm_post(App $a)
|
function tagrm_post(App $a)
|
||||||
|
@ -24,7 +24,7 @@ function tagrm_post(App $a)
|
||||||
$item_id = (x($_POST,'item') ? intval($_POST['item']) : 0);
|
$item_id = (x($_POST,'item') ? intval($_POST['item']) : 0);
|
||||||
|
|
||||||
$item = Item::selectFirst(['tag'], ['id' => $item_id, 'uid' => local_user()]);
|
$item = Item::selectFirst(['tag'], ['id' => $item_id, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
|
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ function tagrm_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Item::selectFirst(['tag'], ['id' => $item_id, 'uid' => local_user()]);
|
$item = Item::selectFirst(['tag'], ['id' => $item_id, 'uid' => local_user()]);
|
||||||
if (!DBM::is_result($item)) {
|
if (!DBA::is_result($item)) {
|
||||||
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
|
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
|
|
||||||
function uexport_init(App $a) {
|
function uexport_init(App $a) {
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
|
@ -57,7 +57,7 @@ function uexport_content(App $a) {
|
||||||
function _uexport_multirow($query) {
|
function _uexport_multirow($query) {
|
||||||
$result = [];
|
$result = [];
|
||||||
$r = q($query);
|
$r = q($query);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$p = [];
|
$p = [];
|
||||||
foreach ($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
|
@ -72,7 +72,7 @@ function _uexport_multirow($query) {
|
||||||
function _uexport_row($query) {
|
function _uexport_row($query) {
|
||||||
$result = [];
|
$result = [];
|
||||||
$r = q($query);
|
$r = q($query);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
foreach ($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
$result[$k] = $v;
|
$result[$k] = $v;
|
||||||
|
@ -145,7 +145,7 @@ function uexport_all(App $a) {
|
||||||
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
|
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$total = $r[0]['total'];
|
$total = $r[0]['total'];
|
||||||
}
|
}
|
||||||
// chunk the output to avoid exhausting memory
|
// chunk the output to avoid exhausting memory
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -32,7 +31,7 @@ function unfollow_post(App $a)
|
||||||
normalise_link($url), $url, NETWORK_STATUSNET];
|
normalise_link($url), $url, NETWORK_STATUSNET];
|
||||||
$contact = DBA::selectFirst('contact', [], $condition);
|
$contact = DBA::selectFirst('contact', [], $condition);
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
notice(L10n::t("Contact wasn't found or can't be unfollowed."));
|
notice(L10n::t("Contact wasn't found or can't be unfollowed."));
|
||||||
} else {
|
} else {
|
||||||
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN])) {
|
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN])) {
|
||||||
|
@ -40,7 +39,7 @@ function unfollow_post(App $a)
|
||||||
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
Contact::terminateFriendship($r[0], $contact);
|
Contact::terminateFriendship($r[0], $contact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +70,7 @@ function unfollow_content(App $a)
|
||||||
normalise_link($url), $url, NETWORK_STATUSNET];
|
normalise_link($url), $url, NETWORK_STATUSNET];
|
||||||
$contact = DBA::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
|
$contact = DBA::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
|
||||||
|
|
||||||
if (!DBM::is_result($contact)) {
|
if (!DBA::is_result($contact)) {
|
||||||
notice(L10n::t("You aren't a friend of this contact.").EOL);
|
notice(L10n::t("You aren't a friend of this contact.").EOL);
|
||||||
$submit = "";
|
$submit = "";
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
|
|
@ -9,7 +9,7 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -158,7 +158,7 @@ function videos_post(App $a) {
|
||||||
dbesc($video_id)
|
dbesc($video_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
q("DELETE FROM `attach` WHERE `uid` = %d AND `id` = '%s'",
|
q("DELETE FROM `attach` WHERE `uid` = %d AND `id` = '%s'",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc($video_id)
|
dbesc($video_id)
|
||||||
|
@ -168,7 +168,7 @@ function videos_post(App $a) {
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBM::is_result($i)) {
|
if (DBA::is_result($i)) {
|
||||||
Item::deleteForUser(['id' => $i[0]['id']], local_user());
|
Item::deleteForUser(['id' => $i[0]['id']], local_user());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ function videos_content(App $a) {
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
|
@ -291,7 +291,7 @@ function videos_content(App $a) {
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$contact = $r[0];
|
$contact = $r[0];
|
||||||
$remote_contact = true;
|
$remote_contact = true;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ function videos_content(App $a) {
|
||||||
$sql_extra GROUP BY hash",
|
$sql_extra GROUP BY hash",
|
||||||
intval($a->data['user']['uid'])
|
intval($a->data['user']['uid'])
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total(count($r));
|
$a->set_pager_total(count($r));
|
||||||
$a->set_pager_itemspage(20);
|
$a->set_pager_itemspage(20);
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ function videos_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$videos = [];
|
$videos = [];
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$alt_e = $rr['filename'];
|
$alt_e = $rr['filename'];
|
||||||
$name_e = $rr['album'];
|
$name_e = $rr['album'];
|
||||||
|
|
|
@ -7,7 +7,7 @@ use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ function viewcontacts_init(App $a)
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ function viewcontacts_content(App $a)
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
dbesc(NETWORK_OSTATUS)
|
dbesc(NETWORK_OSTATUS)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$a->set_pager_total($r[0]['total']);
|
$a->set_pager_total($r[0]['total']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ function viewcontacts_content(App $a)
|
||||||
intval($a->pager['start']),
|
intval($a->pager['start']),
|
||||||
intval($a->pager['itemspage'])
|
intval($a->pager['itemspage'])
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
info(L10n::t('No contacts.').EOL);
|
info(L10n::t('No contacts.').EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*/
|
*/
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
|
||||||
function viewsrc_content(App $a)
|
function viewsrc_content(App $a)
|
||||||
|
@ -25,7 +25,7 @@ function viewsrc_content(App $a)
|
||||||
|
|
||||||
$item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $item_id]);
|
$item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $item_id]);
|
||||||
|
|
||||||
if (DBM::is_result($item)) {
|
if (DBA::is_result($item)) {
|
||||||
if (is_ajax()) {
|
if (is_ajax()) {
|
||||||
echo str_replace("\n", '<br />', $item['body']);
|
echo str_replace("\n", '<br />', $item['body']);
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -8,7 +8,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Mimetype;
|
use Friendica\Util\Mimetype;
|
||||||
|
|
||||||
|
@ -21,7 +20,7 @@ function wall_attach_post(App $a) {
|
||||||
$r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
|
$r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1",
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
echo json_encode(['error'=>L10n::t('Invalid request.')]);
|
echo json_encode(['error'=>L10n::t('Invalid request.')]);
|
||||||
killme();
|
killme();
|
||||||
|
@ -64,7 +63,7 @@ function wall_attach_post(App $a) {
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$visitor = $contact_id;
|
$visitor = $contact_id;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +149,7 @@ function wall_attach_post(App $a) {
|
||||||
dbesc($hash)
|
dbesc($hash)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
$msg = L10n::t('File upload failed.');
|
$msg = L10n::t('File upload failed.');
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
echo json_encode(['error'=>$msg]);
|
echo json_encode(['error'=>$msg]);
|
||||||
|
|
|
@ -12,7 +12,7 @@ use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Photo;
|
use Friendica\Model\Photo;
|
||||||
use Friendica\Object\Image;
|
use Friendica\Object\Image;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
dbesc($nick)
|
dbesc($nick)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
if ($r_json) {
|
if ($r_json) {
|
||||||
echo json_encode(['error' => L10n::t('Invalid request.')]);
|
echo json_encode(['error' => L10n::t('Invalid request.')]);
|
||||||
killme();
|
killme();
|
||||||
|
@ -89,7 +89,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
intval($contact_id),
|
intval($contact_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$visitor = $contact_id;
|
$visitor = $contact_id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBM;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Mail;
|
use Friendica\Model\Mail;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ function wallmessage_post(App $a) {
|
||||||
dbesc($recipient)
|
dbesc($recipient)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
logger('wallmessage: no recipient');
|
logger('wallmessage: no recipient');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ function wallmessage_content(App $a) {
|
||||||
dbesc($recipient)
|
dbesc($recipient)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! DBM::is_result($r)) {
|
if (! DBA::is_result($r)) {
|
||||||
notice(L10n::t('No recipient.') . EOL);
|
notice(L10n::t('No recipient.') . EOL);
|
||||||
logger('wallmessage: no recipient');
|
logger('wallmessage: no recipient');
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -7,7 +7,6 @@ use Friendica\App;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Protocol\Salmon;
|
use Friendica\Protocol\Salmon;
|
||||||
|
|
||||||
function xrd_init(App $a)
|
function xrd_init(App $a)
|
||||||
|
@ -40,7 +39,7 @@ function xrd_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', [], ['nickname' => $name]);
|
$user = DBA::selectFirst('user', [], ['nickname' => $name]);
|
||||||
if (!DBM::is_result($user)) {
|
if (!DBA::is_result($user)) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'boot.php';
|
require_once 'boot.php';
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
@ -1032,7 +1031,7 @@ class App
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$processlist = DBM::processlist();
|
$processlist = DBA::processlist();
|
||||||
if ($processlist['list'] != '') {
|
if ($processlist['list'] != '') {
|
||||||
logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);
|
logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);
|
||||||
|
|
||||||
|
@ -1397,7 +1396,7 @@ class App
|
||||||
// Allow folks to override user themes and always use their own on their own site.
|
// Allow folks to override user themes and always use their own on their own site.
|
||||||
// This works only if the user is on the same server
|
// This works only if the user is on the same server
|
||||||
$user = DBA::selectFirst('user', ['theme'], ['uid' => $this->profile_uid]);
|
$user = DBA::selectFirst('user', ['theme'], ['uid' => $this->profile_uid]);
|
||||||
if (DBM::is_result($user) && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
|
if (DBA::is_result($user) && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
|
||||||
$page_theme = $user['theme'];
|
$page_theme = $user['theme'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ namespace Friendica\Content;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ContactSelector class
|
* @brief ContactSelector class
|
||||||
|
@ -29,7 +28,7 @@ class ContactSelector
|
||||||
$s = DBA::select('profile', ['id', 'profile-name', 'is-default'], ['uid' => $_SESSION['uid']]);
|
$s = DBA::select('profile', ['id', 'profile-name', 'is-default'], ['uid' => $_SESSION['uid']]);
|
||||||
$r = DBA::toArray($s);
|
$r = DBA::toArray($s);
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
$selected = (($rr['id'] == $current || ($current == 0 && $rr['is-default'] == 1)) ? " selected=\"selected\" " : "");
|
$selected = (($rr['id'] == $current || ($current == 0 && $rr['is-default'] == 1)) ? " selected=\"selected\" " : "");
|
||||||
$o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
|
$o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile-name']}</option>\r\n";
|
||||||
|
@ -106,7 +105,7 @@ class ContactSelector
|
||||||
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
|
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
|
||||||
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
|
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
|
||||||
|
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$networkname = $r['platform'];
|
$networkname = $r['platform'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ use Friendica\Content\Feature;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
@ -99,7 +98,7 @@ class ForumManager
|
||||||
$total = count($contacts);
|
$total = count($contacts);
|
||||||
$visible_forums = 10;
|
$visible_forums = 10;
|
||||||
|
|
||||||
if (DBM::is_result($contacts)) {
|
if (DBA::is_result($contacts)) {
|
||||||
$id = 0;
|
$id = 0;
|
||||||
|
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
|
||||||
require_once 'boot.php';
|
require_once 'boot.php';
|
||||||
|
@ -107,7 +106,7 @@ class Nav
|
||||||
// user info
|
// user info
|
||||||
$contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
|
$contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
|
||||||
$userinfo = [
|
$userinfo = [
|
||||||
'icon' => (DBM::is_result($contact) ? $a->remove_baseurl($contact['micro']) : 'images/person-48.jpg'),
|
'icon' => (DBA::is_result($contact) ? $a->remove_baseurl($contact['micro']) : 'images/person-48.jpg'),
|
||||||
'name' => $a->user['username'],
|
'name' => $a->user['username'],
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,7 +16,6 @@ use Friendica\Core\Config;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
use Friendica\Util\ParseUrl;
|
use Friendica\Util\ParseUrl;
|
||||||
|
@ -64,7 +63,7 @@ class OEmbed
|
||||||
|
|
||||||
$condition = ['url' => normalise_link($embedurl), 'maxwidth' => $a->videowidth];
|
$condition = ['url' => normalise_link($embedurl), 'maxwidth' => $a->videowidth];
|
||||||
$oembed = DBA::selectFirst('oembed', ['content'], $condition);
|
$oembed = DBA::selectFirst('oembed', ['content'], $condition);
|
||||||
if (DBM::is_result($oembed)) {
|
if (DBA::is_result($oembed)) {
|
||||||
$txt = $oembed["content"];
|
$txt = $oembed["content"];
|
||||||
} else {
|
} else {
|
||||||
$txt = Cache::get($a->videowidth . $embedurl);
|
$txt = Cache::get($a->videowidth . $embedurl);
|
||||||
|
|
|
@ -12,7 +12,6 @@ use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
@ -277,11 +276,11 @@ class Widget
|
||||||
if (Profile::getMyURL()) {
|
if (Profile::getMyURL()) {
|
||||||
$contact = DBA::selectFirst('contact', ['id'],
|
$contact = DBA::selectFirst('contact', ['id'],
|
||||||
['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]);
|
['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]);
|
||||||
if (DBM::is_result($contact)) {
|
if (DBA::is_result($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
} else {
|
} else {
|
||||||
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
|
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
|
||||||
if (DBM::is_result($gcontact)) {
|
if (DBA::is_result($gcontact)) {
|
||||||
$zcid = $gcontact['id'];
|
$zcid = $gcontact['id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ namespace Friendica\Content\Widget;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
require_once 'include/security.php';
|
require_once 'include/security.php';
|
||||||
|
@ -99,7 +98,7 @@ class TagCloud
|
||||||
$type,
|
$type,
|
||||||
TERM_OBJ_POST
|
TERM_OBJ_POST
|
||||||
);
|
);
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBA::is_result($r)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ namespace Friendica\Core;
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\GContact;
|
use Friendica\Model\GContact;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
|
@ -113,7 +112,7 @@ class ACL extends BaseObject
|
||||||
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
|
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
|
||||||
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
|
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
|
||||||
|
|
||||||
if (DBM::is_result($contacts)) {
|
if (DBA::is_result($contacts)) {
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
if (in_array($contact['id'], $preselected)) {
|
if (in_array($contact['id'], $preselected)) {
|
||||||
$selected = ' selected="selected" ';
|
$selected = ' selected="selected" ';
|
||||||
|
@ -180,7 +179,7 @@ class ACL extends BaseObject
|
||||||
|
|
||||||
$receiverlist = [];
|
$receiverlist = [];
|
||||||
|
|
||||||
if (DBM::is_result($contacts)) {
|
if (DBA::is_result($contacts)) {
|
||||||
foreach ($contacts as $contact) {
|
foreach ($contacts as $contact) {
|
||||||
if (in_array($contact['id'], $preselected)) {
|
if (in_array($contact['id'], $preselected)) {
|
||||||
$selected = ' selected="selected"';
|
$selected = ' selected="selected"';
|
||||||
|
@ -274,7 +273,7 @@ class ACL extends BaseObject
|
||||||
|
|
||||||
if (!$imap_disabled) {
|
if (!$imap_disabled) {
|
||||||
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]);
|
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]);
|
||||||
if (DBM::is_result($mailacct)) {
|
if (DBA::is_result($mailacct)) {
|
||||||
$mail_enabled = true;
|
$mail_enabled = true;
|
||||||
$pubmail_enabled = !empty($mailacct['pubmail']);
|
$pubmail_enabled = !empty($mailacct['pubmail']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ namespace Friendica\Core;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
|
||||||
|
@ -80,7 +79,7 @@ class Addon
|
||||||
$addons = Config::get('system', 'addon');
|
$addons = Config::get('system', 'addon');
|
||||||
if (strlen($addons)) {
|
if (strlen($addons)) {
|
||||||
$r = DBA::select('addon', [], ['installed' => 1]);
|
$r = DBA::select('addon', [], ['installed' => 1]);
|
||||||
if (DBM::is_result($r)) {
|
if (DBA::is_result($r)) {
|
||||||
$installed = DBA::toArray($r);
|
$installed = DBA::toArray($r);
|
||||||
} else {
|
} else {
|
||||||
$installed = [];
|
$installed = [];
|
||||||
|
|
|
@ -4,7 +4,6 @@ namespace Friendica\Core\Cache;
|
||||||
|
|
||||||
use Friendica\Core\Cache;
|
use Friendica\Core\Cache;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +17,7 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
|
||||||
{
|
{
|
||||||
$cache = DBA::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
$cache = DBA::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
||||||
|
|
||||||
if (DBM::is_result($cache)) {
|
if (DBA::is_result($cache)) {
|
||||||
$cached = $cache['v'];
|
$cached = $cache['v'];
|
||||||
$value = @unserialize($cached);
|
$value = @unserialize($cached);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ namespace Friendica\Core\Config;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ class JITConfigAdapter extends BaseObject implements IConfigAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
||||||
if (DBM::is_result($config)) {
|
if (DBA::is_result($config)) {
|
||||||
// manage array value
|
// manage array value
|
||||||
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
|
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ namespace Friendica\Core\Config;
|
||||||
|
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ class JITPConfigAdapter extends BaseObject implements IPConfigAdapter
|
||||||
$a = self::getApp();
|
$a = self::getApp();
|
||||||
|
|
||||||
$pconfigs = DBA::select('pconfig', ['v', 'k'], ['cat' => $cat, 'uid' => $uid]);
|
$pconfigs = DBA::select('pconfig', ['v', 'k'], ['cat' => $cat, 'uid' => $uid]);
|
||||||
if (DBM::is_result($pconfigs)) {
|
if (DBA::is_result($pconfigs)) {
|
||||||
while ($pconfig = DBA::fetch($pconfigs)) {
|
while ($pconfig = DBA::fetch($pconfigs)) {
|
||||||
$k = $pconfig['k'];
|
$k = $pconfig['k'];
|
||||||
|
|
||||||
|
@ -59,7 +58,7 @@ class JITPConfigAdapter extends BaseObject implements IPConfigAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
$pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
$pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
||||||
if (DBM::is_result($pconfig)) {
|
if (DBA::is_result($pconfig)) {
|
||||||
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $pconfig['v']) ? unserialize($pconfig['v']) : $pconfig['v']);
|
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $pconfig['v']) ? unserialize($pconfig['v']) : $pconfig['v']);
|
||||||
|
|
||||||
self::getApp()->setPConfigValue($uid, $cat, $k, $val);
|
self::getApp()->setPConfigValue($uid, $cat, $k, $val);
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace Friendica\Core\Config;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ class PreloadConfigAdapter extends BaseObject implements IConfigAdapter
|
||||||
{
|
{
|
||||||
if ($refresh) {
|
if ($refresh) {
|
||||||
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
||||||
if (DBM::is_result($config)) {
|
if (DBA::is_result($config)) {
|
||||||
self::getApp()->setConfigValue($cat, $k, $config['v']);
|
self::getApp()->setConfigValue($cat, $k, $config['v']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace Friendica\Core\Config;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\BaseObject;
|
use Friendica\BaseObject;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Database\DBM;
|
|
||||||
|
|
||||||
require_once 'include/dba.php';
|
require_once 'include/dba.php';
|
||||||
|
|
||||||
|
@ -52,7 +51,7 @@ class PreloadPConfigAdapter extends BaseObject implements IPConfigAdapter
|
||||||
|
|
||||||
if ($refresh) {
|
if ($refresh) {
|
||||||
$config = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
$config = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
||||||
if (DBM::is_result($config)) {
|
if (DBA::is_result($config)) {
|
||||||
self::getApp()->setPConfigValue($uid, $cat, $k, $config['v']);
|
self::getApp()->setPConfigValue($uid, $cat, $k, $config['v']);
|
||||||
} else {
|
} else {
|
||||||
self::getApp()->deletePConfigValue($uid, $cat, $k);
|
self::getApp()->deletePConfigValue($uid, $cat, $k);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue