Merge https://github.com/friendica/red into pending_merge
This commit is contained in:
commit
44cb423f21
@ -189,6 +189,17 @@ function chatroom_list($uid) {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function chatroom_list_count($uid) {
|
||||||
|
require_once('include/security.php');
|
||||||
|
$sql_extra = permissions_sql($uid);
|
||||||
|
|
||||||
|
$r = q("select count(*) as total from chatroom where cr_uid = %d $sql_extra",
|
||||||
|
intval($uid)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $r[0]['total'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a chat message via API.
|
* create a chat message via API.
|
||||||
* It is the caller's responsibility to enter the room.
|
* It is the caller's responsibility to enter the room.
|
||||||
|
@ -1552,8 +1552,8 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
|||||||
}
|
}
|
||||||
|
|
||||||
require_once('include/chat.php');
|
require_once('include/chat.php');
|
||||||
$chats = chatroom_list($uid);
|
$has_chats = chatroom_list_count($uid);
|
||||||
if (count($chats)) {
|
if ($has_chats) {
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Chatrooms'),
|
'label' => t('Chatrooms'),
|
||||||
'url' => $a->get_baseurl() . '/chat/' . $nickname,
|
'url' => $a->get_baseurl() . '/chat/' . $nickname,
|
||||||
@ -1563,7 +1563,9 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($is_owner) {
|
require_once('include/menu.php');
|
||||||
|
$has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK);
|
||||||
|
if($is_owner && $has_bookmarks) {
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Bookmarks'),
|
'label' => t('Bookmarks'),
|
||||||
'url' => $a->get_baseurl() . '/bookmarks',
|
'url' => $a->get_baseurl() . '/bookmarks',
|
||||||
|
@ -124,7 +124,17 @@ function menu_list($channel_id, $name = '', $flags = 0) {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function menu_list_count($channel_id, $name = '', $flags = 0) {
|
||||||
|
|
||||||
|
$sel_options = '';
|
||||||
|
$sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : '');
|
||||||
|
$sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : '');
|
||||||
|
|
||||||
|
$r = q("select count(*) as total from menu where menu_channel_id = %d $sel_options",
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
return $r[0]['total'];
|
||||||
|
}
|
||||||
|
|
||||||
function menu_edit($arr) {
|
function menu_edit($arr) {
|
||||||
|
|
||||||
|
@ -105,14 +105,19 @@ EOT;
|
|||||||
$nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'));
|
$nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'));
|
||||||
|
|
||||||
require_once('include/chat.php');
|
require_once('include/chat.php');
|
||||||
$chats = chatroom_list(local_user());
|
$has_chats = chatroom_list_count(local_user());
|
||||||
if (count($chats)) {
|
if($has_chats) {
|
||||||
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms'));
|
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'],t('Chat'),"",t('Your chatrooms'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks'));
|
require_once('include/menu.php');
|
||||||
|
$has_bookmarks = menu_list_count(local_user(),'',MENU_BOOKMARK) + menu_list_count(local_user(),'',MENU_SYSTEM|MENU_BOOKMARK);
|
||||||
|
if($has_bookmarks) {
|
||||||
|
$nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks'));
|
||||||
|
}
|
||||||
|
|
||||||
if(feature_enabled($channel['channel_id'],'webpages'))
|
if(feature_enabled($channel['channel_id'],'webpages'))
|
||||||
$nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages'));
|
$nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(! get_account_id())
|
if(! get_account_id())
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -687,7 +687,9 @@ function admin_page_users(&$a){
|
|||||||
$order = " order by account_email asc ";
|
$order = " order by account_email asc ";
|
||||||
if($_REQUEST['order'] === 'expires')
|
if($_REQUEST['order'] === 'expires')
|
||||||
$order = " order by account_expires desc ";
|
$order = " order by account_expires desc ";
|
||||||
|
if($_REQUEST['order'] === 'created')
|
||||||
|
$order = " order by account_created desc ";
|
||||||
|
|
||||||
$users =q("SELECT `account_id` , `account_email`, `account_lastlog`, `account_created`, `account_expires`, " . "`account_service_class`, ( account_flags & %d ) > 0 as `blocked`, " .
|
$users =q("SELECT `account_id` , `account_email`, `account_lastlog`, `account_created`, `account_expires`, " . "`account_service_class`, ( account_flags & %d ) > 0 as `blocked`, " .
|
||||||
"(SELECT GROUP_CONCAT( ch.channel_address SEPARATOR ' ') FROM channel as ch " .
|
"(SELECT GROUP_CONCAT( ch.channel_address SEPARATOR ' ') FROM channel as ch " .
|
||||||
"WHERE ch.channel_account_id = ac.account_id and not (ch.channel_pageflags & %d )) as `channels` " .
|
"WHERE ch.channel_account_id = ac.account_id and not (ch.channel_pageflags & %d )) as `channels` " .
|
||||||
|
@ -703,7 +703,7 @@ function photos_content(&$a) {
|
|||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$twist = 'rotright';
|
$twist = 'rotright';
|
||||||
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
|
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
|
||||||
$o .= '<div id="photo-album-contents-' . $a->pager['page'] . '">';
|
$o .= '<div id="photo-album-contents">';
|
||||||
|
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
|
|
||||||
@ -758,20 +758,15 @@ function photos_content(&$a) {
|
|||||||
echo $ajaxout;
|
echo $ajaxout;
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div id="photo-album-contents-' . $a->pager['page'] . '">';
|
|
||||||
echo $ajaxout;
|
echo $ajaxout;
|
||||||
echo '</div>';
|
echo '<script>justifyPhotosAjax();</script>';
|
||||||
echo '<script>justifyPhotos(' . $a->pager['page'] . ');</script>';
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$o .= '</div>'; // photo-album-contents
|
|
||||||
$o .= '<script>justifyPhotos(' . $a->pager['page'] . ');</script>';
|
|
||||||
$o .= '<div id="page-end"></div>';
|
$o .= '<div id="page-end"></div>';
|
||||||
|
$o .= '</div>'; // photo-album-contents
|
||||||
$o .= '<div id="photo-album-end"></div>';
|
$o .= '<div id="photo-album-end"></div>';
|
||||||
$o .= '<script>$(document).ready(function() { loadingPage = false;});</script>';
|
$o .= '<script>$(document).ready(function() { loadingPage = false; justifyPhotos(); });</script>';
|
||||||
$o .= '<div id="page-spinner"></div>';
|
$o .= '<div id="page-spinner"></div>';
|
||||||
// $o .= paginate($a);
|
// $o .= paginate($a);
|
||||||
|
|
||||||
@ -1226,7 +1221,6 @@ function photos_content(&$a) {
|
|||||||
if($photos) {
|
if($photos) {
|
||||||
$o = replace_macros(get_markup_template('photosajax.tpl'),array(
|
$o = replace_macros(get_markup_template('photosajax.tpl'),array(
|
||||||
'$photos' => $photos,
|
'$photos' => $photos,
|
||||||
'$page' => $a->pager['page']
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1243,7 +1237,6 @@ function photos_content(&$a) {
|
|||||||
'$can_post' => $can_post,
|
'$can_post' => $can_post,
|
||||||
'$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'),
|
'$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'),
|
||||||
'$photos' => $photos,
|
'$photos' => $photos,
|
||||||
'$page' => $a->pager['page']
|
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -704,22 +704,26 @@ function updateConvItems(mode,data) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function justifyPhotos(bParam_page) {
|
function justifyPhotos() {
|
||||||
justifiedGalleryActive = true;
|
justifiedGalleryActive = true;
|
||||||
$('#photo-album-contents-' + bParam_page).justifiedGallery({
|
$('#photo-album-contents').justifiedGallery({
|
||||||
lastRow : 'nojustify',
|
|
||||||
margins: 3,
|
margins: 3,
|
||||||
sizeRangeSuffixes : {
|
sizeRangeSuffixes: {
|
||||||
'lt100': '-2',
|
'lt100': '-2',
|
||||||
'lt240': '-2',
|
'lt240': '-2',
|
||||||
'lt320': '-2',
|
'lt320': '-2',
|
||||||
'lt500': '-1',
|
'lt500': '',
|
||||||
'lt640': '-1',
|
'lt640': '-1',
|
||||||
'lt1024': '-0'
|
'lt1024': '-0'
|
||||||
}
|
}
|
||||||
}).on('jg.complete', function(e){ justifiedGalleryActive = false; });
|
}).on('jg.complete', function(e){ justifiedGalleryActive = false; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function justifyPhotosAjax() {
|
||||||
|
justifiedGalleryActive = true;
|
||||||
|
$('#photo-album-contents').justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
|
||||||
|
}
|
||||||
|
|
||||||
function notify_popup_loader(notifyType) {
|
function notify_popup_loader(notifyType) {
|
||||||
|
|
||||||
/* notifications template */
|
/* notifications template */
|
||||||
|
@ -3,14 +3,12 @@
|
|||||||
<a id="photo-top-upload-link" href="{{$upload.1}}">{{$upload.0}}</a>
|
<a id="photo-top-upload-link" href="{{$upload.1}}">{{$upload.0}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div id="photo-album-contents-{{$page}}">
|
<div id="photo-album-contents">
|
||||||
{{foreach $photos as $photo}}
|
{{foreach $photos as $photo}}
|
||||||
{{include file="photo_top.tpl"}}
|
{{include file="photo_top.tpl"}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
|
|
||||||
</div>
|
|
||||||
<script>justifyPhotos({{$page}});</script>
|
|
||||||
<div id="page-end"></div>
|
<div id="page-end"></div>
|
||||||
|
</div>
|
||||||
<div class="photos-end"></div>
|
<div class="photos-end"></div>
|
||||||
<script>$(document).ready(function() { loadingPage = false;});</script>
|
<script>$(document).ready(function() { loadingPage = false; justifyPhotos(); });</script>
|
||||||
<div id="page-spinner"></div>
|
<div id="page-spinner"></div>
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
<!-- -->
|
|
||||||
<div id="photo-album-contents-{{$page}}">
|
|
||||||
{{foreach $photos as $photo}}
|
{{foreach $photos as $photo}}
|
||||||
{{include file="photo_top.tpl"}}
|
{{include file="photo_top.tpl"}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</div>
|
<script>justifyPhotosAjax()</script>
|
||||||
<script>justifyPhotos({{$page}});</script>
|
|
||||||
|
Reference in New Issue
Block a user