diff --git a/include/main.js b/include/main.js index fcb6677d3..6d743c4f4 100644 --- a/include/main.js +++ b/include/main.js @@ -135,9 +135,9 @@ $(node).css('height',16); } - // Since ajax is asynchronous, we will give a few seconds for - // the first ajax call (setting like/dislike), then run the - // updater to pick up any changes and display on the page. + // Since our ajax calls are asynchronous, we will give a few + // seconds for the first ajax call (setting like/dislike), then + // run the updater to pick up any changes and display on the page. // The updater will turn any rotators off when it's done. // This function will have returned long before any of these // events have completed and therefore there won't be any @@ -151,3 +151,48 @@ if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,3000); } + + function getPosition(e) { + e = e || window.event; + var cursor = {x:0, y:0}; + if ( e.pageX > 0 || e.pageY > 0 ) { + cursor.x = e.pageX; + cursor.y = e.pageY; + } + else { + if( e.clientX > 0 || e.clientY > 0 ) { + cursor.x = e.clientX; + cursor.y = e.clientY; + } + else { + if( e.x > 0 || e.y > 0 ) { + cursor.x = e.x; + cursor.y = e.y; + } + } + } + return cursor; + } + + var lockvisible = false; + + function lockview(event,id) { + if(lockvisible) { + lockviewhide(); + } + else { + lockvisible = true; + $.get('lockview/' + id, function(data) { + cursor = getPosition(event); + $('#panel').html(data); + $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5}); + $('#panel').show(); + }); + } + } + + function lockviewhide() { + lockvisible = false; + $('#panel').hide(); + } + diff --git a/include/nav.php b/include/nav.php index 7f6aea17f..48b935aae 100644 --- a/include/nav.php +++ b/include/nav.php @@ -1,5 +1,7 @@ page['nav'] .= '
' ; + if(x($_SESSION['uid'])) { $a->page['nav'] .= '' . t('Logout') . "\r\n"; } diff --git a/index.php b/index.php index 898a1c37a..f86fbe138 100644 --- a/index.php +++ b/index.php @@ -86,7 +86,8 @@ if(x($_SESSION,'sysmsg')) { // Feel free to comment out this line on production sites. $a->page['content'] .= $debug_text; -$a->page['content'] .= ''; + +$a->page['content'] .= ''; // build page diff --git a/mod/display.php b/mod/display.php index d0bbf54bf..451b9d644 100644 --- a/mod/display.php +++ b/mod/display.php @@ -151,10 +151,9 @@ function display_content(&$a) { $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) - ? '' + ? '' : ''); - if(can_write_wall($a,$a->profile['uid'])) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( diff --git a/mod/lockview.php b/mod/lockview.php new file mode 100644 index 000000000..b8f4318df --- /dev/null +++ b/mod/lockview.php @@ -0,0 +1,67 @@ +argc > 1) ? intval($a->argv[1]) : 0); + if(! $item_id) + killme(); + + $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1", + intval($item_id) + ); + if(! count($r)) + killme(); + $item = $r[0]; + if($item['uid'] != local_user()) + killme(); + + + $allowed_users = expand_acl($item['allow_cid']); + $allowed_groups = expand_acl($item['allow_gid']); + $deny_users = expand_acl($item['deny_cid']); + $deny_groups = expand_acl($item['deny_gid']); + + $o = t('Visible to:') . '