fix live update on display page

This commit is contained in:
friendica 2013-01-12 15:08:59 -08:00
parent f620495c7a
commit b5c0714bc4
3 changed files with 256 additions and 252 deletions

View File

@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php'); require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1584' ); define ( 'FRIENDICA_VERSION', '3.1.1586' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1157 ); define ( 'DB_UPDATE_VERSION', 1157 );

View File

@ -37,6 +37,7 @@ function display_content(&$a, $update = 0) {
if($update) { if($update) {
$item_id = $_REQUEST['item_id']; $item_id = $_REQUEST['item_id'];
$a->profile = array('uid' => intval($update), 'profile_uid' => intval($update));
} }
else { else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0); $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
@ -116,6 +117,8 @@ function display_content(&$a, $update = 0) {
$sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups); $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
if($update) { if($update) {
dbg(1);
$r = q("SELECT id FROM item WHERE item.uid = %d $r = q("SELECT id FROM item WHERE item.uid = %d
AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' )) AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
$sql_extra AND unseen = 1", $sql_extra AND unseen = 1",
@ -123,6 +126,7 @@ function display_content(&$a, $update = 0) {
dbesc($item_id), dbesc($item_id),
dbesc($item_id) dbesc($item_id)
); );
dbg(0);
if(!$r) if(!$r)
return ''; return '';
} }

File diff suppressed because it is too large Load Diff