require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
-/*
- * Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
- * is identical to the code in mod/message.php for 'item_extract_images' and
- * 'item_redir_and_replace_images'
- */
-if (! function_exists('item_extract_images')) {
function item_extract_images($body) {
$saved_image = array();
$new_body = $new_body . $orig_body;
return array('body' => $new_body, 'images' => $saved_image);
-}}
+}
-if (! function_exists('item_redir_and_replace_images')) {
function item_redir_and_replace_images($body, $images, $cid) {
$origbody = $body;
$cnt++;
}
return $newbody;
-}}
+}
/**
* Render actions localized
return "`item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`";
}
-if (!function_exists('conversation')) {
/**
* "Render" a conversation or list of items for HTML display.
* There are two major forms of display:
$ssl_state = ((local_user()) ? true : false);
$profile_owner = 0;
- $page_writeable = false;
$live_update_div = '';
$arr_blocked = null;
if ($mode === 'network') {
$profile_owner = local_user();
- $page_writeable = true;
if (!$update) {
/*
* The special div is needed for liveUpdate to kick in for this page.
}
} elseif ($mode === 'profile') {
$profile_owner = $a->profile['profile_uid'];
- $page_writeable = can_write_wall($a,$profile_owner);
if (!$update) {
$tab = notags(trim($_GET['tab']));
}
} elseif ($mode === 'notes') {
$profile_owner = local_user();
- $page_writeable = true;
if (!$update) {
$live_update_div = '<div id="live-notes"></div>' . "\r\n"
. "<script> var profile_uid = " . local_user()
}
} elseif ($mode === 'display') {
$profile_owner = $a->profile['uid'];
- $page_writeable = can_write_wall($a,$profile_owner);
if (!$update) {
$live_update_div = '<div id="live-display"></div>' . "\r\n"
. "<script> var profile_uid = " . $_SESSION['uid'] . ";"
}
} elseif ($mode === 'community') {
$profile_owner = 0;
- $page_writeable = false;
if (!$update) {
$live_update_div = '<div id="live-community"></div>' . "\r\n"
. "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
$page_template = get_markup_template("conversation.tpl");
if ($items && count($items)) {
+ // Currently behind a config value. This allows the commenting and sharing of every public item.
+ if (Config::get('system', 'comment_public')) {
+ $writable = ($items[0]['uid'] == 0) && in_array($items[0]['network'], array(NETWORK_OSTATUS, NETWORK_DIASPORA));
+ } else {
+ $writable = false;
+ }
if ($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
// Normal View
$page_template = get_markup_template("threaded_conversation.tpl");
- $conv = new Thread($mode, $preview);
+ $conv = new Thread($mode, $preview, $writable);
/*
* get all the topmost parents
));
return $o;
-}}
+}
function best_link_url($item, &$sparkle, $url = '') {
return $o;
}
-if (! function_exists('builtin_activity_puller')) {
/**
* @brief Checks item to see if it is one of the builtin activities (like/dislike, event attendance, consensus items, etc.)
* Increments the count of each matching activity and adds a link to the author as needed.
return;
}
}
-}}
+}
-if (! function_exists('format_like')) {
/**
* Format the vote text for a profile item
* @param int $cnt = number of people who vote the item
$o .= $expanded;
return $o;
-}}
+}
function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
$o = '';