New user based item function

pull/624/head
Michael 2018-06-17 17:04:23 +00:00
parent ef0a2f6f8d
commit c66dcf96ac
5 changed files with 7 additions and 7 deletions

View File

@ -405,7 +405,7 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques
$condition = ["`guid` = ? AND (`uid` = ? OR `uid` = 0)", $args['guid'], local_user()];
$params = ['order' => ['uid' => true]];
$item = Item::selectFirst(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
$item = Item::selectFirstForUser(local_user(), [], $condition, $params);
if (!\Friendica\Database\DBM::is_result($item)) {
throw new HTTPException\NotFoundException(L10n::t('Unknown post with guid: %s', $args['guid']));

View File

@ -336,7 +336,7 @@ function mailstream_cron($a, $b) {
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
logger('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id', LOGGER_NORMAL);
}
$item = Item::selectFirst($ms_item_id['uid'], Item::DISPLAY_FIELDLIST, ['id' => $ms_item_id['id']]);
$item = Item::selectFirst([], ['id' => $ms_item_id['id']]);
$users = q("SELECT * FROM `user` WHERE `uid` = %d", intval($item['uid']));
$user = $users[0];
if ($user && $item) {

View File

@ -462,7 +462,7 @@ function statusnet_post_hook(App $a, &$b)
}
$condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]];
$orig_post = Item::selectFirst($b["uid"], ['author-link', 'uri'], $condition);
$orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
if (!count($orig_post)) {
logger("statusnet_post_hook: no parent found " . $b["thr-parent"]);
return;
@ -683,7 +683,7 @@ function statusnet_prepare_body(App $a, &$b)
$item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
$orig_post = Item::selectFirst(local_user(), ['author-link', 'uri'], $condition);
$orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
if (count($orig_post)) {
$nick = preg_replace("=https?://(.*)/(.*)=ism", "$2", $orig_post["author-link"]);

View File

@ -454,7 +454,7 @@ function twitter_post_hook(App $a, &$b)
}
$condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]];
$orig_post = Item::selectFirst($b["uid"], [], $condition);
$orig_post = Item::selectFirst([], $condition);
if (!DBM::is_result($orig_post)) {
logger("twitter_post_hook: no parent found " . $b["thr-parent"]);
return;
@ -758,7 +758,7 @@ function twitter_prepare_body(App $a, &$b)
$item["plink"] = $a->get_baseurl() . "/display/" . $a->user["nickname"] . "/" . $item["parent"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
$orig_post = Item::selectFirst(local_user(), ['author-link'], $condition);
$orig_post = Item::selectFirst(['author-link'], $condition);
if (DBM::is_result($orig_post)) {
$nicknameplain = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $orig_post["author-link"]);
$nickname = "@[url=" . $orig_post["author-link"] . "]" . $nicknameplain . "[/url]";

View File

@ -197,7 +197,7 @@ function windowsphonepush_cron()
$senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext');
if ($senditemtext == 1) {
// load item with the max id
$item = Item::selectFirst(local_user(), ['author-name', 'body'], ['id' => $count[0]['max']]);
$item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]);
// as user allows to send the item, we want to show the sender of the item in the toast
// toasts are limited to one line, therefore place is limited - author shall be in