fix updating of bitwise 'unseen' to account for mysql operator precedence
This commit is contained in:
parent
d0d8971a69
commit
e138876199
@ -22,7 +22,7 @@ $arr = array(
|
|||||||
'categories' => t('Post Categories'),
|
'categories' => t('Post Categories'),
|
||||||
'filing' => t('Saved Folders'),
|
'filing' => t('Saved Folders'),
|
||||||
'archives' => t('Search by Date'),
|
'archives' => t('Search by Date'),
|
||||||
|
'dislike' => t('Dislike Posts'),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -20,6 +20,14 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_all_perms($uid,$observer)
|
||||||
|
*
|
||||||
|
* @param $uid : The channel_id associated with the resource owner
|
||||||
|
* @param $observer: The xchan_hash representing the observer
|
||||||
|
*
|
||||||
|
* @returns: array of all permissions, key is permission name, value is integer 0 or 1
|
||||||
|
*/
|
||||||
|
|
||||||
function get_all_perms($uid,$observer) {
|
function get_all_perms($uid,$observer) {
|
||||||
|
|
||||||
|
@ -680,8 +680,8 @@ function network_content(&$a, $update = 0, $load = false) {
|
|||||||
// at the top level network page just mark everything seen.
|
// at the top level network page just mark everything seen.
|
||||||
|
|
||||||
if((! $group) && (! $cid) && (! $star)) {
|
if((! $group) && (! $cid) && (! $star)) {
|
||||||
$r = q("UPDATE `item` SET item_flags = item_flags & (! %d)
|
$r = q("UPDATE `item` SET item_flags = ( item_flags ^ %d)
|
||||||
WHERE item_flags & %d AND `uid` = %d",
|
WHERE (item_flags & %d) AND `uid` = %d",
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
|
@ -127,7 +127,7 @@ function ping_init(&$a) {
|
|||||||
$t1 = dba_timer();
|
$t1 = dba_timer();
|
||||||
|
|
||||||
$r = q("SELECT id, item_restrict, item_flags FROM item
|
$r = q("SELECT id, item_restrict, item_flags FROM item
|
||||||
WHERE item_restrict = %d and item_flags & %d and `item`.`uid` = %d",
|
WHERE item_restrict = %d and ( item_flags & %d ) and uid = %d",
|
||||||
intval(ITEM_VISIBLE),
|
intval(ITEM_VISIBLE),
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
|
@ -247,15 +247,18 @@ function profile_content(&$a, $update = 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($is_owner) {
|
if($is_owner) {
|
||||||
$r = q("UPDATE `item` SET `item_flags` = item_flags - %d
|
$r = q("UPDATE item SET item_flags = (item_flags ^ %d)
|
||||||
WHERE item_flags & %d AND `uid` = %d",
|
WHERE (item_flags & %d) AND (item_flags & %d) AND uid = %d ",
|
||||||
intval(ITEM_UNSEEN),
|
intval(ITEM_UNSEEN),
|
||||||
intval(ITEM_UNSEEN|ITEM_WALL),
|
intval(ITEM_UNSEEN),
|
||||||
|
intval(ITEM_WALL),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$o .= conversation($a,$items,'profile',$update);
|
$o .= conversation($a,$items,'profile',$update);
|
||||||
|
|
||||||
if(! $update)
|
if(! $update)
|
||||||
|
@ -66,7 +66,6 @@
|
|||||||
<a href="#" class="icon like" title="$item.vote.like.0" onclick="dolike($item.id,'like'); return false"></a>
|
<a href="#" class="icon like" title="$item.vote.like.0" onclick="dolike($item.id,'like'); return false"></a>
|
||||||
<a href="#" class="icon dislike" title="$item.vote.dislike.0" onclick="dolike($item.id,'dislike'); return false"></a>
|
<a href="#" class="icon dislike" title="$item.vote.dislike.0" onclick="dolike($item.id,'dislike'); return false"></a>
|
||||||
{{ if $item.vote.share }}<a href="#" class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick="jotShare($item.id); return false"></a>{{ endif }}
|
{{ if $item.vote.share }}<a href="#" class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick="jotShare($item.id); return false"></a>{{ endif }}
|
||||||
<img id="like-rotator-$item.id" class="like-rotator" src="images/rotator.gif" alt="$item.wait" title="$item.wait" style="display: none;" />
|
|
||||||
</div>
|
</div>
|
||||||
{{ endif }}
|
{{ endif }}
|
||||||
{{ if $item.plink }}
|
{{ if $item.plink }}
|
||||||
@ -83,6 +82,7 @@
|
|||||||
{{ if $item.filer }}
|
{{ if $item.filer }}
|
||||||
<a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.filer"></a>
|
<a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.filer"></a>
|
||||||
{{ endif }}
|
{{ endif }}
|
||||||
|
<img id="like-rotator-$item.id" class="like-rotator" src="images/rotator.gif" alt="$item.wait" title="$item.wait" style="display: none;" />
|
||||||
|
|
||||||
<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
|
<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
|
||||||
{{ if $item.drop.dropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}
|
{{ if $item.drop.dropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}
|
||||||
|
Reference in New Issue
Block a user