Empty commit

This commit is contained in:
Git 2013-06-14 08:18:16 +00:00
parent a2d7c73ab2
commit 94a7d23812
12 changed files with 125 additions and 166 deletions

View File

@ -1,155 +1,11 @@
CHANGELOG
2013-03-01
-This log is extremely out-of-date, and the log is unlikely to be maintained in the future; however, the Gazelle project is still alive and well.
-This log is being kept for historical purposes only.
2013-06-14 by eth
Adds option to load news posts using ajax
2010-08-28
-Upgrade Sphinx to 1.10b
2013-06-14 by Ajax
Show number of subscribers and last updated in collage stats
2010-08-25
-Better handling of special characters in torrent searches
-Improved file name search
-Add negations to request searches
2013-06-14 by Ajax
Hello Change Log
2010-08-11
-Fixed long standing IE Bug. Turns out that IE fails to handle unicode data in the Content-disposition header so this value is now urlencoded ensuring compatibility.
2010-08-10
-Added check for CustomPerms IP protection on login
2010-07-30
-Add collage stats to user profiles
2010-07-04
-Updated sphinx.conf
2010-06-26
-Fixed IP bans and added to public repo
-Added catch for missing system 'host' command
-Logged in users can't hit register.php
-Fix in URL_REGEX to allow URLs of the form http://foo.com/
2010-06-09
-Delete torrent files when torrent is deleted
2010-06-04
-User proper names on bookmark/notify links if a group is already bookmarked or in the notifications
2010-05-21
-Sortable invitee list
2010-05-16
-Escape tag links on user torrent pages
2010-05-12
-Make the "view tags" button change to "hide tags" if tags are shown
-Make editing upload/download amounts work on 32bit systems
-Fix a typo in class_cache, not major
-Add default values to schedule table
2010-05-09
-Add catchup link to subscriptions page
2010-05-05
-Move $Classes fetching code to somewhere globally accessible so that schedule can fetch it
2010-05-03
-Fixed bug in 32bit parser that would allow clients to set private=0
2010-05-01
-Add preview functionality to thread creation page
2010-04-30
-Fix various subscription bugs
2010-04-29
-Properly update cache and database when a forum post is removed
2010-04-28
-Alias IDs now show next to artists in the artist box
-Users with an infinite ratio now get promoted along with those who have a
ratio of 1.05 or higher
2010-04-26
-Fixed bug where snatchlists were not visible to other users at paranoia level
1 (should be 2 or higher)
2010-04-19
-Add requests to sphinx.conf
2010-04-18
-Fix request sorting
2010-04-15
-Added clickable staff notes
2010-04-14
-Add stylesheet and avatar search to advanced user search
2010-04-13
-Require authorization to manually run schedule
-Fix minor bbcode bug which didn't allow question marks in filenames
2010-04-11
-Add "visible" checkbox to user profiles. Unticked, this will remove a user from a peer list.
-Add option to disable PM privileges of user
2010-04-07
-Fix critical bug where users can view staff forum posts by changing the ID on the reports page
2010-03-18
-Clear notifications per torrent or filter
2010-03-16
-Notifications groups actually work now
-Post history and subscriptions pages now default to unread posts with collapsed post bodies
2010-03-14
-Group notifications by filter
2010-03-13
-Added ability to view a user's downloaded torrents as well as snatched
2010-03-12
-Thread subscriptions
-Various bugfixes, see resolved gazelle bug forum
-Standardised Email and Image regexes across gazelle
2010-03-10
-Completed requestsv2, feel free to use it now
2010-03-09
-Add size and files column to notifications page and clone the browse layout
-Don't redirect if ssl url == nonssl url
-Fix some more warnings when calling sphinxapi.php
-Year filter in notifications also checks remaster year
2010-03-07
-Change INSERT INTO to REPLACE INTO to avoid errors when updating the sphinx*_delta tables
2010-03-04
-Added initial version of requestsv2, will need more updates so not advised to
update yet
2010-03-02
-Fixed bug in notifications by tags
2010-03-01
-Fixed bug in notifications by release type
2010-02-28
-Fixed bug which causes stats to be altered if the tracker updates while someone with stat editing powers moderates a profile
-Fixed artist permission
-Fixed two permission bugs
-Removed references to What.CD in takemoderate.php
-Fixed E_NOTICE with regards to taglist on browse2.php
-Removed geodistribution from stats, fixed stats so they don't whitepage
-Fixed the user geodistribution stats and geoip database updater, and added a function for an unsigned ip2long
-Kill poll manager, it doesn't work anymore - use the forums
-Fix width of poll replies, don't display poll if there aren't any
-Re-add reports folder
-Fixed "database schema" tool
-Fix upscale pool blank message
-Fix number of posts in a forum after a thread has been moved out of it
-Strip out SVN revision echo

View File

@ -154,13 +154,6 @@ CREATE TABLE `bookmarks_torrents` (
KEY `GroupID` (`GroupID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `changelog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` datetime DEFAULT NULL,
`message` text COLLATE utf8_swedish_ci,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
CREATE TABLE `collages` (
`ID` int(10) NOT NULL AUTO_INCREMENT,
`Name` varchar(100) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL DEFAULT '',

View File

@ -13,7 +13,7 @@
/* AJAX_LIMIT = array(x,y) = 'x' requests every 'y' seconds.
e.g. array(5,10) = 5 requests every 10 seconds */
$AJAX_LIMIT = array(5,10);
$Limited_Pages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup');
$Limited_Pages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup','news_ajax');
header('Content-Type: application/json; charset=utf-8');
@ -144,6 +144,9 @@
case 'get_friends':
require(SERVER_ROOT . '/sections/ajax/get_friends.php');
break;
case 'news_ajax':
require(SERVER_ROOT . '/sections/ajax/news_ajax.php');
break;
default:
// If they're screwing around with the query string
json_die("failure");

View File

@ -0,0 +1,42 @@
<?php
//Don't allow bigger queries than specified below regardless of called function
$SizeLimit = 10;
$Count = (int) $_GET['count'];
$Offset = (int) $_GET['offset'];
if (!isset($_GET['count']) || !isset($_GET['offset']) || $Count <= 0 || $Offset < 0 || $Count > $SizeLimit) {
json_die('failure');
}
include(SERVER_ROOT . '/classes/text.class.php');
$Text = new TEXT(true);
global $DB;
$DB->query("
SELECT
ID,
Title,
Body,
Time
FROM news
ORDER BY Time DESC
LIMIT " . $Offset . "," . $Count);
$News = $DB->to_array(false, MYSQLI_NUM, false);
$NewsResponse = array();
foreach ($News as $NewsItem) {
list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
array_push(
$NewsResponse,
array(
$NewsID,
$Text->full_format($Title),
time_diff($NewsTime),
$Text->full_format($Body)
)
);
}
json_die('success', json_encode($NewsResponse));

View File

@ -142,7 +142,9 @@
<div class="head"><strong>Stats</strong></div>
<ul class="stats nobullet">
<li>Artists: <?=number_format($NumArtists)?></li>
<li>Subscribers: <?=number_format(count($Subscribers))?></li>
<li>Built by <?=number_format(count($Users))?> user<?=(count($Users) > 1 ? 's' : '')?></li>
<li>Last updated: <?=time_diff($Updated)?></li>
</ul>
</div>
<div class="box box_contributors">

View File

@ -21,11 +21,11 @@ function compare($X, $Y) {
$Data = $Cache->get_value('collage_'.$CollageID);
if ($Data) {
list($K, list($Name, $Description, , , $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)) = each($Data);
list($K, list($Name, $Description, , , $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)) = each($Data);
} else {
$DB->query("SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'");
$DB->query("SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser, Updated, Subscribers FROM collages WHERE ID='$CollageID'");
if ($DB->record_count() > 0) {
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record();
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers) = $DB->next_record();
$TorrentList = '';
$CollageList = '';
} else {

View File

@ -385,7 +385,9 @@
<? if (!empty($TopArtists)) { ?>
<li>Artists: <?=number_format(count($TopArtists))?></li>
<? } ?>
<li>Subscribers: <?=number_format(count($Subscribers))?></li>
<li>Built by <?=number_format(count($Users))?> user<?=(count($Users) > 1 ? 's' : '')?></li>
<li>Last updated: <?=time_diff($Updated)?></li>
</ul>
</div>
<div class="box box_tags">

View File

@ -2,6 +2,7 @@
include(SERVER_ROOT.'/classes/text.class.php');
$Text = new TEXT(true);
$NewsCount = 5;
if (!$News = $Cache->get_value('news')) {
$DB->query("
SELECT
@ -11,7 +12,7 @@
Time
FROM news
ORDER BY Time DESC
LIMIT 5");
LIMIT " . $NewsCount);
$News = $DB->to_array(false, MYSQLI_NUM, false);
$Cache->cache_value('news', $News, 3600 * 24 * 30);
$Cache->cache_value('news_latest_id', $News[0][0], 0);
@ -25,7 +26,7 @@
$LoggedUser['LastReadNews'] = $News[0][0];
}
View::show_header('News','bbcode');
View::show_header('News','bbcode,jquery,news_ajax');
?>
<div class="thin">
<div class="sidebar">
@ -439,18 +440,20 @@
<? if (check_perms('admin_manage_news')) { ?>
- <a href="tools.php?action=editnews&amp;id=<?=$NewsID?>" class="brackets">Edit</a>
<? } ?>
<span style="float: right;"><a href="#" onclick="$('#newsbody<?=$NewsID?>').toggle(); this.innerHTML=(this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span>
</div>
<div class="pad"><?=$Text->full_format($Body)?></div>
<div id="newsbody<?=$NewsID?>" class="pad"><?=$Text->full_format($Body)?></div>
</div>
<?
if (++$Count > 4) {
if (++$Count > ($NewsCount-1)) {
break;
}
}
?>
<div id="more_news" class="box">
<div class="head">
<em>For older news posts, <a href="forums.php?action=viewforum&amp;forumid=19">click here</a>.</em>
<em><span><a href="#" onclick="news_ajax(event, 3, <?=$NewsCount?>, <?= check_perms('admin_manage_news') ? 1 : 0; ?>); return false;">Click to load more news<noscript> (requires Javascript)</noscript></a>. </span>To browse old news posts, <a href="forums.php?action=viewforum&amp;forumid=19">click here</a>.</em>
</div>
</div>
</div>

View File

@ -193,6 +193,7 @@
case 'label_aliases':
include('managers/label_aliases.php');
break;
case 'permissions':
if (!check_perms('admin_manage_permissions')) {
error(403);

View File

@ -33,6 +33,7 @@
<? } if (check_perms('users_mod') || $LoggedUser['ExtraClasses'][DELTA_TEAM]) { ?>
<tr><td><a href="tools.php?action=label_aliases">Label aliases</a></td></tr>
<? } ?>
</table>
</div>
<div class="permission_container">

View File

@ -25,3 +25,4 @@
}
$Cache->replace_value('collage_subs_user_'.$LoggedUser['ID'], $UserSubscriptions, 0);
$Cache->delete_value('collage_subs_user_new_'.$LoggedUser['ID']);
$Cache->delete_value('collage_'.$CollageID);

View File

@ -0,0 +1,55 @@
function news_ajax(event, count, offset, privileged){
/*
* event - The click event, passed to hide the element when necessary.
* count - Number of news items to fetch.
* offset - Database offset for fetching news.
* privilege - Gotta check your privilege (used to show/hide [Edit] on news).
*
* This function isn't wrapped in jQuery, be sure we use it
* instead of the mix-mashed Gazelle $ function.
*/
var $ = jQuery.noConflict();
//Unbind onclick to avoid spamclicks.
$(event.target).attr('onclick', 'return false;');
//Fetch news data, check for errors etc.
$.get("ajax.php", {
action: "news_ajax",
count: count,
offset: offset
})
.done(function(data) {
var response = $.parseJSON(data.response);
if (typeof data == 'undefined' || data == null || data.status != "success" || typeof response == 'undefined' || response == null){
console.log("ERR ajax_news("+(new Error).lineNumber+"): Unknown data or failure returned.");
//Return to original paremeters, no news were added.
$(event.target).attr('onclick', 'news_ajax(event, ' + count + ', '+ offset +', '+privileged+'); return false;');
} else {
if(response.length == 0){
$(event.target).parent().remove();
} else {
var targetClass = $('#more_news').prev().attr('class');
$.each(response, function(){
//Create a new element, insert the news.
$('#more_news').before($('<div/>', {
id: 'news'+this[0],
Class: targetClass
}));
//I'm so happy with this condition statement.
if(privileged){
$('#news'+this[0]).append('<div class="head"><strong>'+this[1]+'</strong> '+this[2]+' - <a href="tools.php?action=editnews&amp;id='+this[0]+'" class="brackets">Edit</a></div>');
} else {
$('#news'+this[0]).append('<div class="head"><strong>'+this[1]+'</strong> '+this[2]+'</div>');
}
$('#news'+this[0]).append('<div class="pad">'+this[3]+'</div>');
});
//Update the onclick parameters to appropriate offset.
$(event.target).attr('onclick', 'news_ajax(event, ' + count + ', '+ (count+offset) +', '+privileged+'); return false;');
}
}
})
.fail(function() {
console.log("WARN ajax_news("+(new Error).lineNumber+"): Ajax get failed.");
//Return to original paremeters, no news were added.
$(event.target).attr('onclick', 'news_ajax(event, ' + count + ', '+ offset +', '+privileged+'); return false;');
});
}