$img_st_close++; // make it point to AFTER the closing bracket
$img_end += $img_start;
- if (! strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
+ if (!strcmp(substr($orig_body, $img_start + $img_st_close, 5), 'data:')) {
// This is an embedded image
$saved_image[$cnt] = substr($orig_body, $img_start + $img_st_close, $img_end - ($img_start + $img_st_close));
}
if (stristr($item['verb'], ACTIVITY_POKE)) {
$verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1));
- if (! $verb) {
+ if (!$verb) {
return;
}
if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) {
$matches = null;
if (preg_match_all('/@\[url=(.*?)\]/is', $item['body'], $matches, PREG_SET_ORDER)) {
foreach ($matches as $mtch) {
- if (! strpos($mtch[1], 'zrl=')) {
+ if (!strpos($mtch[1], 'zrl=')) {
$item['body'] = str_replace($mtch[0], '@[url=' . Profile::zrl($mtch[1]) . ']', $item['body']);
}
}
if ($total > 0) {
foreach ($item['children'] as $child) {
- if (! visible_activity($child)) {
+ if (!visible_activity($child)) {
$total --;
}
$total += count_descendants($child);
}
if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE) {
- if (! (($item['self']) && ($item['uid'] == local_user()))) {
+ if (!($item['self'] && ($item['uid'] == local_user()))) {
return false;
}
}
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`,
`item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`,
- `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`,
+ `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
`item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`,
`item`.`verb`, `item`.`object-type`, `item`.`postopts`, `item`.`plink`,
`item`.`guid`, `item`.`wall`, `item`.`private`, `item`.`starred`,
foreach ($items as $item) {
+ if (!visible_activity($item)) {
+ continue;
+ }
+
if ($arr_blocked) {
$blocked = false;
foreach ($arr_blocked as $b) {
continue;
}
- $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
- if ($item['author-link'] && (! $item['author-name'])) {
+ $profile_name = (strlen($item['author-name']) ? $item['author-name'] : $item['name']);
+ if ($item['author-link'] && !$item['author-name']) {
$profile_name = $item['author-link'];
}
continue;
}
- if (! visible_activity($item)) {
+ if (!visible_activity($item)) {
continue;
}
}
}
}
- if (! $best_url) {
+ if (!$best_url) {
if ($url != '') {
$best_url = $url;
} elseif (strlen($item['author-link'])) {
$photos_link = '';
$posts_link = '';
- if ((local_user()) && local_user() == $item['uid'] && $item['parent'] == $item['id'] && (! $item['self'])) {
+ if (local_user() && local_user() == $item['uid'] && $item['parent'] == $item['id'] && !$item['self']) {
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
}
return;
}
- if ((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) {
+ if (activity_match($item['verb'], $verb) && ($item['id'] != $item['parent'])) {
$url = $item['author-link'];
- if ((local_user()) && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && (! $item['self']) && (link_compare($item['author-link'], $item['url']))) {
+ if (local_user() && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && !$item['self'] && link_compare($item['author-link'], $item['url'])) {
$url = 'redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" ';
} else {
$url = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>';
- if (! $item['thr-parent']) {
+ if (!$item['thr-parent']) {
$item['thr-parent'] = $item['parent-uri'];
}
- if (! ((isset($conv_responses[$mode][$item['thr-parent'] . '-l']))
- && (is_array($conv_responses[$mode][$item['thr-parent'] . '-l'])))) {
+ if (!(isset($conv_responses[$mode][$item['thr-parent'] . '-l'])
+ && is_array($conv_responses[$mode][$item['thr-parent'] . '-l']))) {
$conv_responses[$mode][$item['thr-parent'] . '-l'] = [];
}
continue;
}
- if (! isset($conv_responses[$mode][$item['thr-parent']])) {
+ if (!isset($conv_responses[$mode][$item['thr-parent']])) {
$conv_responses[$mode][$item['thr-parent']] = 1;
} else {
$conv_responses[$mode][$item['thr-parent']] ++;
break;
case 'attendmaybe':
$phrase = L10n::t('<span %1$s>%2$d people</span> attend maybe', $spanatts, $cnt);
- $explikers = L10n::t('%s anttend maybe.', $likers);
+ $explikers = L10n::t('%s attend maybe.', $likers);
break;
}
*/
function smart_flatten_conversation(array $parent)
{
- if (! isset($parent['children']) || count($parent['children']) == 0) {
+ if (!isset($parent['children']) || count($parent['children']) == 0) {
return $parent;
}
foreach ($response_verbs as $v) {
$ret[$v] = [];
$ret[$v]['count'] = defaults($conv_responses[$v], $item['uri'], '');
- $ret[$v]['list'] = defaults($conv_responses[$v], $item['uri'] . '-l', '');
+ $ret[$v]['list'] = defaults($conv_responses[$v], $item['uri'] . '-l', []);
$ret[$v]['self'] = defaults($conv_responses[$v], $item['uri'] . '-self', '0');
if (count($ret[$v]['list']) > MAX_LIKERS) {
$ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS);