mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 19:06:27 +00:00
Empty commit
This commit is contained in:
parent
b5fd54d1d2
commit
f20fe4b1aa
@ -221,6 +221,7 @@
|
||||
$JsonPosts[] = array(
|
||||
'postId' => (int) $PostID,
|
||||
'addedTime' => $AddedTime,
|
||||
'bbBody' => $Body,
|
||||
'body' => $Text->full_format($Body),
|
||||
'editedUserId' => (int) $EditedUserID,
|
||||
'editedTime' => $EditedTime,
|
||||
|
@ -71,6 +71,7 @@
|
||||
'senderId' => (int) $SenderID,
|
||||
'senderName' => $Users[(int)$SenderID]['Username'],
|
||||
'sentDate' => $SentDate,
|
||||
'bbBody' => $Body,
|
||||
'body' => $Text->full_format($Body)
|
||||
);
|
||||
$JsonMessages[] = $JsonMessage;
|
||||
|
@ -47,6 +47,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
// News
|
||||
$MyNews = $LoggedUser['LastReadNews'];
|
||||
$CurrentNews = $Cache->get_value('news_latest_id');
|
||||
if ($CurrentNews === false) {
|
||||
$DB->query("SELECT ID FROM news ORDER BY Time DESC LIMIT 1");
|
||||
if ($DB->record_count() == 1) {
|
||||
list($CurrentNews) = $DB->next_record();
|
||||
} else {
|
||||
$CurrentNews = -1;
|
||||
}
|
||||
$Cache->cache_value('news_latest_id', $CurrentNews, 0);
|
||||
}
|
||||
|
||||
// Blog
|
||||
$MyBlog = $LoggedUser['LastReadBlog'];
|
||||
$CurrentBlog = $Cache->get_value('blog_latest_id');
|
||||
if ($CurrentBlog === false) {
|
||||
$DB->query("SELECT ID FROM blog WHERE Important = 1 ORDER BY Time DESC LIMIT 1");
|
||||
if ($DB->record_count() == 1) {
|
||||
list($CurrentBlog) = $DB->next_record();
|
||||
} else {
|
||||
$CurrentBlog = -1;
|
||||
}
|
||||
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0);
|
||||
}
|
||||
|
||||
print json_encode(
|
||||
array(
|
||||
'status' => 'success',
|
||||
@ -57,7 +83,9 @@
|
||||
'passkey'=> $LoggedUser['torrent_pass'],
|
||||
'notifications' => array(
|
||||
'messages'=> (int) $NewMessages,
|
||||
'notifications' => (int) $NewNotifications
|
||||
'notifications' => (int) $NewNotifications,
|
||||
'newAnnouncement' => $MyNews < $CurrentNews,
|
||||
'newBlog' => $MyBlog < $CurrentBlog
|
||||
),
|
||||
'userstats' => array(
|
||||
'uploaded' => (int) $LoggedUser['BytesUploaded'],
|
||||
@ -65,7 +93,7 @@
|
||||
'ratio' => (float) $Ratio,
|
||||
'requiredratio' => (float) $LoggedUser['RequiredRatio'],
|
||||
'class' => $ClassLevels[$LoggedUser['Class']]['Name']
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -62,6 +62,7 @@
|
||||
$JsonComments[] = array(
|
||||
'postId' => (int) $PostID,
|
||||
'addedTime' => $AddedTime,
|
||||
'bbBody' => $Body,
|
||||
'body' => $Text->full_format($Body),
|
||||
'editedUserId' => (int) $EditedUserID,
|
||||
'editedTime' => $EditedTime,
|
||||
|
@ -8,11 +8,23 @@ function toggleChecks(formElem,masterElem) {
|
||||
}
|
||||
|
||||
//Lightbox stuff
|
||||
|
||||
/*
|
||||
* If loading from a thumbnail the lightbox is shown first with a "loading" screen
|
||||
* while the full size image loads, then the html of the lightbox is replaced with the image.
|
||||
*/
|
||||
|
||||
var lightbox = {
|
||||
init: function (image, size) {
|
||||
if(typeof(image)=='string') {
|
||||
$('#lightbox').show().listen('click',lightbox.unbox).raw().innerHTML =
|
||||
'<p size="7" style="color:gray;font-size:50px">Loading...<p>';
|
||||
$('#curtain').show().listen('click',lightbox.unbox);
|
||||
var src = image;
|
||||
image = new Image();
|
||||
image.onload = function() {
|
||||
lightbox.box_async(image);
|
||||
}
|
||||
image.src = src;
|
||||
}
|
||||
if (image.naturalWidth === undefined) {
|
||||
@ -36,6 +48,15 @@ var lightbox = {
|
||||
$('#curtain').show().listen('click',lightbox.unbox);
|
||||
}
|
||||
},
|
||||
box_async: function (image) {
|
||||
var hasA = false;
|
||||
if(image.parentNode != null && image.parentNode.tagName.toUpperCase() == 'A') {
|
||||
hasA = true;
|
||||
}
|
||||
if(!hasA) {
|
||||
$('#lightbox').raw().innerHTML = '<img src="' + image.src + '" />';
|
||||
}
|
||||
},
|
||||
unbox: function (data) {
|
||||
$('#curtain').hide();
|
||||
$('#lightbox').hide().raw().innerHTML = '';
|
||||
|
Loading…
Reference in New Issue
Block a user