mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-23 05:15:14 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
76484f1541
8 changed files with 716 additions and 673 deletions
3
boot.php
3
boot.php
|
@ -863,7 +863,7 @@ class App {
|
|||
&& array_key_exists('baseurl',$this->config['system'])
|
||||
&& strlen($this->config['system']['baseurl'])) {
|
||||
$url = $this->config['system']['baseurl'];
|
||||
|
||||
$url = trim($url,'\\/');
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
@ -881,6 +881,7 @@ class App {
|
|||
&& array_key_exists('baseurl',$this->config['system'])
|
||||
&& strlen($this->config['system']['baseurl'])) {
|
||||
$url = $this->config['system']['baseurl'];
|
||||
$url = trim($url,'\\/');
|
||||
}
|
||||
|
||||
$parsed = @parse_url($url);
|
||||
|
|
|
@ -74,8 +74,11 @@ Some/many of these widgets have restrictions which may restrict the type of page
|
|||
|
||||
* suggestedchats - "interesting" chatrooms chosen for the current observer
|
||||
|
||||
* item - displays a single webpage item by mid
|
||||
* args: mid - message_id of webpage to display (must be webpage, not a conversation item)
|
||||
* item - displays a single webpage item by mid or page title
|
||||
* args:
|
||||
* channel_id - channel that owns the content, defualt is the profile_uid
|
||||
* mid - message_id of webpage to display (must be webpage, not a conversation item)
|
||||
* title - URL page title of webpage (must provide one of either title or mid)
|
||||
<br /> <br />
|
||||
|
||||
* photo - display a single photo
|
||||
|
|
|
@ -924,6 +924,10 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
|
|||
$pdesc = true;
|
||||
$reddress = true;
|
||||
|
||||
if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
|
||||
$block = true;
|
||||
}
|
||||
|
||||
if($block && intval(get_config('system','block_public_blackout')))
|
||||
return $o;
|
||||
|
||||
|
@ -1012,9 +1016,6 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
|
|||
|
||||
// logger('online: ' . $profile['online']);
|
||||
|
||||
if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
|
||||
$block = true;
|
||||
}
|
||||
|
||||
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) {
|
||||
$location = $reddress = $pdesc = $gender = $marital = $homepage = False;
|
||||
|
|
|
@ -817,7 +817,7 @@ function widget_item($arr) {
|
|||
return '';
|
||||
|
||||
|
||||
if(! $arr['mid'])
|
||||
if((! $arr['mid']) && (! $arr['title']))
|
||||
return '';
|
||||
|
||||
if(! perm_is_allowed($channel_id, get_observer_hash(), 'view_pages'))
|
||||
|
@ -826,10 +826,20 @@ function widget_item($arr) {
|
|||
require_once('include/security.php');
|
||||
$sql_extra = item_permissions_sql($channel_id);
|
||||
|
||||
$r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
|
||||
dbesc($arr['mid']),
|
||||
intval($channel_id)
|
||||
);
|
||||
if($arr['title']) {
|
||||
$r = q("select item.* from item left join item_id on item.id = item_id.iid
|
||||
where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and item_type = %d $sql_options $revision limit 1",
|
||||
intval($channel_id),
|
||||
dbesc($arr['title']),
|
||||
intval(ITEM_TYPE_WEBPAGE)
|
||||
);
|
||||
}
|
||||
else {
|
||||
$r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
|
||||
dbesc($arr['mid']),
|
||||
intval($channel_id)
|
||||
);
|
||||
}
|
||||
|
||||
if(! $r)
|
||||
return '';
|
||||
|
|
|
@ -7,6 +7,22 @@ function _well_known_init(&$a){
|
|||
$arr = array('server' => $_SERVER, 'request' => $_REQUEST);
|
||||
call_hooks('well_known', $arr);
|
||||
|
||||
|
||||
if(! check_siteallowed($_SERVER['REMOTE_ADDR'])) {
|
||||
logger('well_known: site not allowed. ' . $_SERVER['REMOTE_ADDR']);
|
||||
killme();
|
||||
}
|
||||
|
||||
// from php.net re: REMOTE_HOST:
|
||||
// Note: Your web server must be configured to create this variable. For example in Apache
|
||||
// you'll need HostnameLookups On inside httpd.conf for it to exist. See also gethostbyaddr().
|
||||
|
||||
if(get_config('system','siteallowed_remote_host') && (! check_siteallowed($_SERVER['REMOTE_HOST']))) {
|
||||
logger('well_known: site not allowed. ' . $_SERVER['REMOTE_HOST']);
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
switch(argv(1)) {
|
||||
case 'zot-info':
|
||||
$a->argc -= 1;
|
||||
|
|
1289
util/hmessages.po
1289
util/hmessages.po
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
|||
2016-01-27.1291H
|
||||
2016-01-29.1293H
|
||||
|
|
|
@ -248,6 +248,7 @@ var updateCountsOnly = false;
|
|||
var divmore_height = 400;
|
||||
var last_filestorage_id = null;
|
||||
var mediaPlaying = false;
|
||||
var contentHeightDiff = 0;
|
||||
|
||||
$(function() {
|
||||
$.ajaxSetup({cache: false});
|
||||
|
@ -630,32 +631,40 @@ function updateConvItems(mode,data) {
|
|||
} else {
|
||||
collapseHeight();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function collapseHeight() {
|
||||
var origContentHeight = parseInt($("#region_2").height());
|
||||
$(".wall-item-content, .directory-collapse").each(function() {
|
||||
var orgHeight = $(this).outerHeight(true);
|
||||
if(orgHeight > divmore_height + 10) {
|
||||
var orgHeight = parseInt($(this).height());
|
||||
if(orgHeight > divmore_height) {
|
||||
if(! $(this).hasClass('divmore')) {
|
||||
$(this).readmore({
|
||||
speed: 0,
|
||||
heightMargin: 50,
|
||||
collapsedHeight: divmore_height,
|
||||
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
|
||||
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
|
||||
beforeToggle: function(trigger, element, expanded) {
|
||||
if(expanded) {
|
||||
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
|
||||
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } );
|
||||
if($(window).scrollTop() + ($(window).height() - divmore_height) < $(this).offset().top) {
|
||||
$(this).readmore({
|
||||
speed: 0,
|
||||
heightMargin: 50,
|
||||
collapsedHeight: divmore_height,
|
||||
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
|
||||
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
|
||||
beforeToggle: function(trigger, element, expanded) {
|
||||
if(expanded) {
|
||||
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
|
||||
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this).addClass('divmore');
|
||||
});
|
||||
$(this).addClass('divmore');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var collapsedContentHeight = parseInt($("#region_2").height());
|
||||
contentHeightDiff = origContentHeight - collapsedContentHeight;
|
||||
|
||||
|
||||
}
|
||||
|
||||
function liveUpdate() {
|
||||
|
@ -707,8 +716,10 @@ function liveUpdate() {
|
|||
$("#page-spinner").spin(false);
|
||||
$("#profile-jot-text-loading").spin(false);
|
||||
|
||||
console.log('contentHeightDiff: ' + contentHeightDiff);
|
||||
|
||||
if(update_mode === 'update') {
|
||||
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight);
|
||||
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
|
||||
}
|
||||
|
||||
in_progress = false;
|
||||
|
|
Loading…
Reference in a new issue