$ssl_state = ((local_user()) ? true : false);
$profile_owner = 0;
- $page_writeable = false;
+ $page_writeable = false;
+ $live_update_div = '';
$previewing = (($preview) ? ' preview ' : '');
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.
+ // We only launch liveUpdate if you aren't filtering in some incompatible
+ // way and also you aren't writing a comment (discovered in javascript).
+
+ $live_update_div = '<div id="live-network"></div>' . "\r\n"
+ . "<script> var profile_uid = " . $_SESSION['uid']
+ . "; var netargs = '" . substr($a->cmd,8)
+ . '?f='
+ . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
+ . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '')
+ . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
+ . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '')
+ . ((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'] : '')
+ . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '')
+
+ . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+ }
}
-
- if($mode === 'profile') {
+ else if($mode === 'profile') {
$profile_owner = $a->profile['profile_uid'];
$page_writeable = can_write_wall($a,$profile_owner);
- }
- if($mode === 'notes') {
+ if(!$update) {
+ $tab = notags(trim($_GET['tab']));
+ if($tab === 'posts') {
+ // This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
+ // because browser prefetching might change it on us. We have to deliver it with the page.
+
+ $live_update_div = '<div id="live-profile"></div>' . "\r\n"
+ . "<script> var profile_uid = " . $a->profile['profile_uid']
+ . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+ }
+ }
+ }
+ else if($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()
+ . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+ }
}
-
- if($mode === 'display') {
+ else if($mode === 'display') {
$profile_owner = $a->profile['uid'];
$page_writeable = can_write_wall($a,$profile_owner);
+ $live_update_div = '<div id="live-display"></div>' . "\r\n";
}
-
- if($mode === 'community') {
+ else if($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";
+ }
+ }
+ else if($mode === 'search') {
+ $live_update_div = '<div id="live-search"></div>' . "\r\n";
}
$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
$o = replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl($ssl_state),
- '$remove' => t('remove'),
+ '$live_update' => $live_update_div,
+ '$remove' => t('remove'),
'$mode' => $mode,
'$user' => $a->user,
'$threads' => $threads,
$o .= '<h3>' . t('Community') . '</h3>';
if(! $update) {
nav_set_selected('community');
- $o .= '<div id="live-community"></div>' . "\r\n";
- $o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}
if(x($a->data,'search'))
require_once('include/acl_selectors.php');
- $o = '<div id="live-display"></div>' . "\r\n";
+ $o = '';
$a->page['htmlhead'] .= get_markup_template('display-head.tpl');
return;
}
- if ($is_owner)
+ if ($is_owner) {
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
$x = array(
'profile_uid' => local_user()
);
$o .= status_editor($a,$x,0,true);
-
+ }
$sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
$o .= get_events();
}
- if(! $update) {
- // The special div is needed for liveUpdate to kick in for this page.
- // We only launch liveUpdate if you aren't filtering in some incompatible
- // way and also you aren't writing a comment (discovered in javascript).
-
- $o .= '<div id="live-network"></div>' . "\r\n";
- $o .= "<script> var profile_uid = " . $_SESSION['uid']
- . "; var netargs = '" . substr($a->cmd,8)
- . '?f='
- . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
- . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '')
- . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '')
- . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '')
- . ((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'] : '')
- . ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '')
-
- . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
- }
-
$sql_extra3 = '';
if($datequery) {
$o .= status_editor($a,$x,$a->contact['id']);
- $o .= '<div id="live-notes"></div>' . "\r\n";
- $o .= "<script> var profile_uid = " . local_user()
- . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
-
}
// Construct permissions
if(! x($a->page,'aside'))
$a->page['aside'] = '';
- $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
-
if($a->argc > 1)
$which = $a->argv[1];
else {
profile_load($a,$which,$profile);
+ $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
$userblock = (($a->profile['hidewall'] && (! local_user()) && (! remote_user())) ? true : false);
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
$o .= get_events();
}
- if((! $update) && ($tab === 'posts')) {
-
- // This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
- // because browser prefetching might change it on us. We have to deliver it with the page.
-
- $o .= '<div id="live-profile"></div>' . "\r\n";
- $o .= "<script> var profile_uid = " . $a->profile['profile_uid']
- . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
- }
-
if($is_owner) {
$r = q("UPDATE `item` SET `unseen` = 0
require_once('include/security.php');
require_once('include/conversation.php');
- $o = '<div id="live-search"></div>' . "\r\n";
-
- $o .= '<h3>' . t('Search') . '</h3>';
+ $o = '<h3>' . t('Search') . '</h3>';
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
+$live_update
+
{{ for $threads as $thread }}
<div id="tread-wrapper-$thread.id" class="tread-wrapper">
{{ for $thread.items as $item }}
+$live_update
+
{{ for $threads as $thread }}
<div id="tread-wrapper-$thread.id" class="tread-wrapper">
{{ for $thread.items as $item }}
--- /dev/null
+$live_update
+
+{{ for $threads as $item }}
+{{ inc $item.template }}{{ endinc }}
+{{ endfor }}
+
+<div id="conversation-end"></div>
+
+{{ if $dropping }}
+<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems(); return false;">
+ <div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
+ <div id="item-delete-selected-desc" >$dropping</div>
+</div>
+<div id="item-delete-selected-end"></div>
+{{ endif }}
+$live_update
+
{{ for $threads as $thread }}
<div id="tread-wrapper-$thread.id" class="tread-wrapper">
{{ for $thread.items as $item }}
+$live_update
+
{{ for $threads as $thread }}
<div id="tread-wrapper-$thread.id" class="tread-wrapper">
{{ for $thread.items as $item }}
+$live_update
+
{{ for $threads as $item }}
{{ inc $item.template }}{{ endinc }}
{{ endfor }}
+$live_update
+
{{ for $threads as $thread }}
<div id="tread-wrapper-$thread.id" class="tread-wrapper">
{{ for $thread.items as $item }}
+$live_update
+
{{ for $threads as $item }}
<div id="tread-wrapper-$item.id" class="tread-wrapper {{ if $item.threaded }}threaded{{ endif }}">
+$live_update
+
{{ for $threads as $item }}
{{ inc $item.template }}{{ endinc }}
{{ endfor }}