* likes (etc.) can apply to other things besides posts. Check if they are post children,
* in which case we handle them specially
*/
- $hidden_activities = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE];
+ $hidden_activities = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_FOLLOW];
foreach ($hidden_activities as $act) {
if (activity_match($item['verb'], $act)) {
return false;
. "<script> var profile_uid = " . $_SESSION['uid']
. "; var netargs = '" . substr($a->cmd, 8)
. '?f='
- . ((x($_GET, 'cid')) ? '&cid=' . rawurlencode($_GET['cid']) : '')
- . ((x($_GET, 'search')) ? '&search=' . rawurlencode($_GET['search']) : '')
- . ((x($_GET, 'star')) ? '&star=' . rawurlencode($_GET['star']) : '')
- . ((x($_GET, 'order')) ? '&order=' . rawurlencode($_GET['order']) : '')
- . ((x($_GET, 'bmark')) ? '&bmark=' . rawurlencode($_GET['bmark']) : '')
- . ((x($_GET, 'liked')) ? '&liked=' . rawurlencode($_GET['liked']) : '')
- . ((x($_GET, 'conv')) ? '&conv=' . rawurlencode($_GET['conv']) : '')
- . ((x($_GET, 'nets')) ? '&nets=' . rawurlencode($_GET['nets']) : '')
- . ((x($_GET, 'cmin')) ? '&cmin=' . rawurlencode($_GET['cmin']) : '')
- . ((x($_GET, 'cmax')) ? '&cmax=' . rawurlencode($_GET['cmax']) : '')
- . ((x($_GET, 'file')) ? '&file=' . rawurlencode($_GET['file']) : '')
+ . (!empty($_GET['cid']) ? '&cid=' . rawurlencode($_GET['cid']) : '')
+ . (!empty($_GET['search']) ? '&search=' . rawurlencode($_GET['search']) : '')
+ . (!empty($_GET['star']) ? '&star=' . rawurlencode($_GET['star']) : '')
+ . (!empty($_GET['order']) ? '&order=' . rawurlencode($_GET['order']) : '')
+ . (!empty($_GET['bmark']) ? '&bmark=' . rawurlencode($_GET['bmark']) : '')
+ . (!empty($_GET['liked']) ? '&liked=' . rawurlencode($_GET['liked']) : '')
+ . (!empty($_GET['conv']) ? '&conv=' . rawurlencode($_GET['conv']) : '')
+ . (!empty($_GET['nets']) ? '&nets=' . rawurlencode($_GET['nets']) : '')
+ . (!empty($_GET['cmin']) ? '&cmin=' . rawurlencode($_GET['cmin']) : '')
+ . (!empty($_GET['cmax']) ? '&cmax=' . rawurlencode($_GET['cmax']) : '')
+ . (!empty($_GET['file']) ? '&file=' . rawurlencode($_GET['file']) : '')
. "'; var profile_page = " . $pager->getPage() . "; </script>\r\n";
}
if (!$update) {
$tab = 'posts';
- if (x($_GET, 'tab')) {
+ if (!empty($_GET['tab'])) {
$tab = Strings::escapeTags(trim($_GET['tab']));
}
if ($tab === 'posts') {
}
}
} elseif ($mode === 'notes') {
- $items = conversation_add_children($items, false, $order, $uid);
+ $items = conversation_add_children($items, false, $order, local_user());
$profile_owner = local_user();
if (!$update) {
foreach ($parents AS $parent) {
$condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) ",
- $parent['uri'], local_user()];
+ $parent['uri'], $uid];
if ($block_authors) {
$condition[0] .= "AND NOT `author`.`hidden`";
}
$url = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>';
- if (!x($item, 'thr-parent')) {
+ if (empty($item['thr-parent'])) {
$item['thr-parent'] = $item['parent-uri'];
}
function format_like($cnt, array $arr, $type, $id) {
$o = '';
$expanded = '';
+ $phrase = '';
if ($cnt == 1) {
$likers = $arr[0];
$expanded .= "\t" . '<div class="wall-item-' . $type . '-expanded" id="' . $type . 'list-' . $id . '" style="display: none;" >' . $explikers . EOL . '</div>';
}
- $phrase .= EOL ;
+ $phrase .= EOL;
$o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('voting_fakelink.tpl'), [
'$phrase' => $phrase,
'$type' => $type,
{
$o = '';
- $geotag = x($x, 'allow_location') ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
+ $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
$tpl = Renderer::getMarkupTemplate('jot-header.tpl');
$a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
// Private/public post links for the non-JS ACL form
$private_post = 1;
- if (x($_REQUEST, 'public')) {
+ if (!empty($_REQUEST['public'])) {
$private_post = 0;
}
}
function render_location_dummy(array $item) {
- if (x($item, 'location') && !empty($item['location'])) {
+ if (!empty($item['location']) && !empty($item['location'])) {
return $item['location'];
}
- if (x($item, 'coord') && !empty($item['coord'])) {
+ if (!empty($item['coord']) && !empty($item['coord'])) {
return $item['coord'];
}
}