`item`.`inform`,
`item`.`pubmail`,
`item`.`visible`,
-`item`.`spam`,
`item`.`bookmark`,
`item`.`unseen`,
`item`.`deleted`,
`item`.`mention`,
`item`.`global`,
`item`.`shadow`,
+ `item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
+ `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
*/
- return "`item`.`author-id`, `item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
- `item`.`owner-id`, `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
+ return "`item`.`author-id`,
+ `item`.`owner-id`,
`item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`,
`item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
`item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`,
`item`.`allow_cid`, `item`.`allow_gid`, `item`.`deny_cid`, `item`.`deny_gid`,
`item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
- `author`.`thumb` AS `author-thumb`, `owner`.`thumb` AS `owner-thumb`,
+ `author`.`url` AS `author-link`, `author`.`name` AS `author-name`, `author`.`thumb` AS `author-avatar`,
+ `owner`.`url` AS `owner-link`, `owner`.`name` AS `owner-name`, `owner`.`thumb` AS `owner-avatar`,
+ `contact`.`url` AS `contact-link`, `contact`.`name` AS `contact-name`, `contact`.`thumb` AS `contact-avatar`,
`contact`.`network`, `contact`.`url`, `contact`.`name`, `contact`.`writable`,
`contact`.`self`, `contact`.`id` AS `cid`, `contact`.`alias`,
. ((x($_GET, 'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
. ((x($_GET, 'liked')) ? '&liked=' . $_GET['liked'] : '')
. ((x($_GET, 'conv')) ? '&conv=' . $_GET['conv'] : '')
- . ((x($_GET, 'spam')) ? '&spam=' . $_GET['spam'] : '')
. ((x($_GET, 'nets')) ? '&nets=' . $_GET['nets'] : '')
. ((x($_GET, 'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
. ((x($_GET, 'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
continue;
}
+ if ($item['network'] == NETWORK_FEED) {
+ $item['author-avatar'] = $item['contact-avatar'];
+ $item['author-name'] = $item['contact-name'];
+ $item['owner-avatar'] = $item['contact-avatar'];
+ $item['owner-name'] = $item['contact-name'];
+ }
+
$profile_name = (strlen($item['author-name']) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && !$item['author-name']) {
$profile_name = $item['author-link'];
$sparkle = ' sparkle';
}
- if (!x($item, 'author-thumb') || ($item['author-thumb'] == "")) {
- $author_contact = Contact::getDetailsByURL($item['author-link'], $profile_owner);
- if ($author_contact["thumb"]) {
- $item['author-thumb'] = $author_contact["thumb"];
- } else {
- $item['author-thumb'] = $item['author-avatar'];
- }
- }
-
- if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) {
- $owner_contact = Contact::getDetailsByURL($item['owner-link'], $profile_owner);
- if ($owner_contact["thumb"]) {
- $item['owner-thumb'] = $owner_contact["thumb"];
- } else {
- $item['owner-thumb'] = $item['owner-avatar'];
- }
- }
-
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
Addon::callHooks('render_location',$locate);
'name' => $profile_name_e,
'sparkle' => $sparkle,
'lock' => $lock,
- 'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
+ 'thumb' => System::removedBaseUrl(proxy_url($item['author-avatar'], false, PROXY_SIZE_THUMB)),
'title' => $title_e,
'body' => $body_e,
'tags' => $tags_e,
'indent' => '',
'owner_name' => $owner_name_e,
'owner_url' => $owner_url,
- 'owner_photo' => System::removedBaseUrl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
+ 'owner_photo' => System::removedBaseUrl(proxy_url($item['owner-avatar'], false, PROXY_SIZE_THUMB)),
'plink' => get_plink($item),
'edpost' => false,
'isstarred' => $isstarred,
}
// "your post"
- if (DBM::is_result($item) && $item['owner-name'] == $item['author-name'] && $item['wall']) {
+ if (DBM::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]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,
update_table("term", ['url'], $old_url, $new_url);
update_table("contact", ['photo', 'thumb', 'micro', 'url', 'nurl', 'alias', 'request', 'notify', 'poll', 'confirm', 'poco', 'avatar'], $old_url, $new_url);
update_table("gcontact", ['url', 'nurl', 'photo', 'server_url', 'notify', 'alias'], $old_url, $new_url);
- update_table("item", ['owner-link', 'owner-avatar', 'author-link', 'author-avatar', 'body', 'plink', 'tag'], $old_url, $new_url);
+ update_table("item", ['owner-link', 'author-link', 'body', 'plink', 'tag'], $old_url, $new_url);
// update profile addresses in the format "user@server.tld"
update_table("contact", ['addr'], $old_host, $new_host);
// Does the local user have this item?
if (local_user()) {
- $r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
- `author-avatar`, `network`, `body`, `uid`, `owner-link`
+ $r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND `guid` = ? AND `uid` = ? LIMIT 1", $a->argv[1], local_user());
if (DBM::is_result($r)) {
// Is it an item with uid=0?
if (!DBM::is_result($r)) {
- $r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
- `author-avatar`, `network`, `body`, `uid`, `owner-link`
+ $r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0
AND `guid` = ? LIMIT 1", $a->argv[1]);
return;
}
} elseif (($a->argc == 3) && ($nick == 'feed-item')) {
- $r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
- `author-avatar`, `network`, `body`, `uid`, `owner-link`
+ $r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0
AND `id` = ? LIMIT 1", $a->argv[2]);
}
if ($r["id"] != $r["parent"]) {
- $r = dba::fetch_first("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid`, `owner-link` FROM `item`
+ $r = dba::fetch_first("SELECT `id`, `author-id`, `body`, `uid` FROM `item`
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND `id` = ?", $r["parent"]);
}
}
function display_fetchauthor($a, $item) {
+ $author = dba::selectFirst('contact', ['name', 'nick', 'photo', 'network', 'url'], ['id' => $item['author-id']]);
+
$profiledata = [];
- $profiledata["uid"] = -1;
- $profiledata["nickname"] = $item["author-name"];
- $profiledata["name"] = $item["author-name"];
- $profiledata["picdate"] = "";
- $profiledata["photo"] = $item["author-avatar"];
- $profiledata["url"] = $item["author-link"];
- $profiledata["network"] = $item["network"];
+ $profiledata['uid'] = -1;
+ $profiledata['nickname'] = $author['nick'];
+ $profiledata['name'] = $author['name'];
+ $profiledata['picdate'] = '';
+ $profiledata['photo'] = $author['photo'];
+ $profiledata['url'] = $author['url'];
+ $profiledata['network'] = $author['network'];
// Check for a repeated message
$skip = false;
'/new', //new
'', //starred
'', //bookmarked
- '', //spam
];
$tab_args = [
'f=&order=comment', //all
'', //new
'f=&star=1', //starred
'f=&bmark=1', //bookmarked
- 'f=&spam=1', //spam
];
$k = array_search('active', $last_sel_tabs);
* '/network/new', => $new_active = 'active'
* '/network?f=&star=1', => $starred_active = 'active'
* '/network?f=&bmark=1', => $bookmarked_active = 'active'
- * '/network?f=&spam=1', => $spam_active = 'active'
*
- * @return Array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
+ * @return Array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active);
*/
function network_query_get_sel_tab(App $a)
{
$bookmarked_active = '';
$all_active = '';
$conv_active = '';
- $spam_active = '';
$postord_active = '';
if (($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) {
$conv_active = 'active';
}
- if (x($_GET, 'spam')) {
- $spam_active = 'active';
- }
-
- if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') && ($conv_active == '') && ($spam_active == '')) {
+ if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') && ($conv_active == '')) {
$no_active = 'active';
}
}
}
- return [$no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active];
+ return [$no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active];
}
function network_query_get_sel_group(App $a)
// item filter tabs
/// @TODO fix this logic, reduce duplication
/// $a->page['content'] .= '<div class="tabs-wrapper">';
- list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a);
+ list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active) = network_query_get_sel_tab($a);
// if no tabs are selected, defaults to comments
if ($no_active == 'active') {
// save selected tab, but only if not in file mode
if (!x($_GET, 'file')) {
PConfig::set(local_user(), 'network.view', 'tab.selected', [
- $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active
+ $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active
]);
}
do {
$r = q(
- "SELECT `notify`.*, `item`.`visible`, `item`.`spam`, `item`.`deleted`
+ "SELECT `notify`.*, `item`.`visible`, `item`.`deleted`
FROM `notify` LEFT JOIN `item` ON `item`.`id` = `notify`.`iid`
WHERE `notify`.`uid` = %d AND `notify`.`msg` != ''
AND NOT (`notify`.`type` IN (%d, %d))
$notification["visible"] = true;
}
- if (is_null($notification["spam"])) {
- $notification["spam"] = 0;
- }
-
if (is_null($notification["deleted"])) {
$notification["deleted"] = 0;
}
$notification["href"] = System::baseUrl() . "/notify/view/" . $notification["id"];
if ($notification["visible"]
- && !$notification["spam"]
&& !$notification["deleted"]
&& !(x($result, $notification["parent"]) && is_array($result[$notification["parent"]]))
) {
"pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been bookmarked"],
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
"rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
- "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
"pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
return 0;
}
+ //unset($item['author-link']);
+ //unset($item['author-name']);
+ //unset($item['author-avatar']);
+
+ //unset($item['owner-link']);
+ unset($item['owner-name']);
+ unset($item['owner-avatar']);
+
if ($item['network'] == NETWORK_PHANTOM) {
logger('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG);
}
}
- // Is this item available in the global items (with uid=0)?
- if ($item["uid"] == 0) {
- $item["global"] = true;
-
- // Set the global flag on all items if this was a global item entry
- dba::update('item', ['global' => true], ['uri' => $item["uri"]]);
- } else {
- $item["global"] = dba::exists('item', ['uid' => 0, 'uri' => $item["uri"]]);
- }
-
// ACL settings
if (strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid)) {
$private = 1;
$forum_mode = ($prvgroup ? 2 : 1);
$fields = ['wall' => true, 'origin' => true, 'forum_mode' => $forum_mode, 'contact-id' => $self['id'],
- 'owner-id' => $owner_id, 'owner-name' => $self['name'], 'owner-link' => $self['url'],
- 'owner-avatar' => $self['thumb'], 'private' => $private, 'allow_cid' => $user['allow_cid'],
+ 'owner-id' => $owner_id, 'owner-link' => $self['url'], 'private' => $private, 'allow_cid' => $user['allow_cid'],
'allow_gid' => $user['allow_gid'], 'deny_cid' => $user['deny_cid'], 'deny_gid' => $user['deny_gid']];
dba::update('item', $fields, ['id' => $item_id]);
private static function addThread($itemid, $onlyshadow = false)
{
$fields = ['uid', 'created', 'edited', 'commented', 'received', 'changed', 'wall', 'private', 'pubmail',
- 'moderated', 'visible', 'spam', 'starred', 'bookmark', 'contact-id',
+ 'moderated', 'visible', 'starred', 'bookmark', 'contact-id',
'deleted', 'origin', 'forum_mode', 'mention', 'network', 'author-id', 'owner-id'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$item = dba::selectFirst('item', $fields, $condition);
private static function updateThread($itemid, $setmention = false)
{
$fields = ['uid', 'guid', 'title', 'body', 'created', 'edited', 'commented', 'received', 'changed',
- 'wall', 'private', 'pubmail', 'moderated', 'visible', 'spam', 'starred', 'bookmark', 'contact-id',
+ 'wall', 'private', 'pubmail', 'moderated', 'visible', 'starred', 'bookmark', 'contact-id',
'deleted', 'origin', 'forum_mode', 'network', 'author-id', 'owner-id', 'rendered-html', 'rendered-hash'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
+ if ($item['network'] == NETWORK_FEED) {
+ $item['author-avatar'] = $item['contact-avatar'];
+ $item['author-name'] = $item['contact-name'];
+ $item['owner-avatar'] = $item['contact-avatar'];
+ $item['owner-name'] = $item['contact-name'];
+ }
+
$diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && (!$item['author-name'])) {
$sparkle = ' sparkle';
}
- if (($item['network'] == NETWORK_FEED) || empty($item['author-thumb'])) {
- $item['author-thumb'] = $item['author-avatar'];
- }
-
- if (($item['network'] == NETWORK_FEED) || empty($item['owner-thumb'])) {
- $item['owner-thumb'] = $item['owner-avatar'];
- }
-
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
Addon::callHooks('render_location', $locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
- 'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
+ 'thumb' => $a->remove_baseurl(proxy_url($item['author-avatar'], false, PROXY_SIZE_THUMB)),
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $title_e,
'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $this->getOwnerUrl(),
- 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
+ 'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-avatar'], false, PROXY_SIZE_THUMB)),
'owner_name' => htmlentities($owner_name_e),
'plink' => get_plink($item),
'edpost' => Feature::isEnabled($conv->getProfileOwner(), 'edit_posts') ? $edpost : '',