/**
* @file include/conversation.php
*/
+
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
-use Friendica\Object\Thread;
use Friendica\Object\Post;
use Friendica\Util\XML;
+use Friendica\Object\Thread;
+use Friendica\Util\Temporal;
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
. " var profile_page = 1; </script>";
}
} elseif ($mode === 'community') {
- if (!$community_readonly) {
- $items = community_add_items($items);
- }
+ $items = community_add_items($items);
$profile_owner = 0;
if (!$update) {
$live_update_div = '<div id="live-community"></div>' . "\r\n"
$page_template = get_markup_template("conversation.tpl");
if ($items && count($items)) {
- $community_readonly = ($mode === 'community');
-
- // Currently behind a config value. This allows the commenting and sharing of every public item.
- if (Config::get('system', 'comment_public')) {
- if ($mode === 'community') {
- $community_readonly = false;
- $writable = true;
- } else {
- $writable = ($items[0]['uid'] == 0) && in_array($items[0]['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN]);
- }
+ if ($mode === 'community') {
+ $writable = true;
} else {
- $writable = false;
+ $writable = ($items[0]['uid'] == 0) && in_array($items[0]['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN]);
}
if (!local_user()) {
$writable = false;
}
- if (in_array($mode, ['network-new', 'search', 'contact-posts']) || $community_readonly) {
+ if (in_array($mode, ['network-new', 'search', 'contact-posts'])) {
/*
* "New Item View" on network page or search page results
* - just loop through the items and format them minimally for display
*/
- /// @TODO old lost code?
- // $tpl = get_markup_template('search_item.tpl');
$tpl = 'search_item.tpl';
foreach ($items as $item) {
'categories' => $categories,
'folders' => $folders,
'text' => strip_tags($body_e),
- 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
+ 'localtime' => Temporal::local($item['created'], 'r'),
'ago' => (($item['app']) ? L10n::t('%s from %s', relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'location' => $location_e,
'indent' => '',