Empty commit

This commit is contained in:
Git 2012-08-28 08:00:14 +00:00
parent 82a17daa21
commit e783e4b59c
8 changed files with 115 additions and 57 deletions

View File

@ -2,6 +2,7 @@
class TEXT {
// tag=>max number of attributes
private $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0,
);
private $Smileys = array(
':angry:' => 'angry.gif',

View File

@ -35,8 +35,6 @@ define('MEMCACHED_PORT', 0);
define('SPHINX_HOST', 'localhost');
define('SPHINX_PORT', 9312);
define('SPHINX_MAX_MATCHES', 1000); // Must be <= the server's max_matches variable (default 1000)
define('SPHINX_MATCHES_START', 100); // Number of matches to load on first page
define('SPHINX_MATCHES_STEP', 50); // Load more torrents every SPHINX_MATCHES_STEP/TORRENTS_PER_PAGE page (Should be lower than SPHINX_MATCHES_START)
define('SPHINX_INDEX', 'torrents');
// Ocelot details

View File

@ -1435,6 +1435,12 @@ CREATE TABLE `users_torrent_history_temp` (
PRIMARY KEY (`UserID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `users_warnings_forums` (
`UserID` int(10) unsigned NOT NULL,
`Comment` text NOT NULL,
PRIMARY KEY (`UserID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `wiki_aliases` (
`Alias` varchar(50) NOT NULL,
`UserID` int(10) NOT NULL,

View File

@ -17,6 +17,10 @@
warn_user($UserID, $Time, "$URL - " . $Reason);
$Subject = "You have received a warning";
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
$WarnTime = time_plus($Time);
$AdminComment = date("Y-m-d").' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $URL - $Reason\n\n";
} else {
$Subject = "You have received a verbal warning";
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
@ -28,6 +32,9 @@
AdminComment=CONCAT(\'' . db_string($AdminComment) . '\',AdminComment)
WHERE UserID=\'' . db_string($UserID) . '\'');
}
$DB -> query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment) . "')
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
//edit the post

View File

@ -18,6 +18,8 @@
warn_user($UserID, $Time, "$URL - ". $Reason);
$Subject = "You have received a warning";
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
$WarnTime = time_plus($Time);
$AdminComment = date("Y-m-d").' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $URL - $Reason\n\n";
} else {
$Subject = "You have received a verbal warning";
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
@ -28,7 +30,9 @@
WarnedTimes=WarnedTimes+1,
AdminComment=CONCAT(\'' . db_string($AdminComment) . '\',AdminComment)
WHERE UserID=\'' . db_string($UserID) . '\'');
}
}
$DB -> query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment) . "')
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
// Mainly

View File

@ -965,7 +965,21 @@ function check_paranoia_here($Setting) {
<br />
<?
if($LoggedUser['Class'] == 650 && check_perms('users_warn', $Class)) {
$DB->query("SELECT Comment FROM users_warnings_forums WHERE UserID = '$UserID'");
list($ForumWarnings) = $DB->next_record();
if($DB->record_count() > 0) {
?>
<div class="box">
<div class="head">Forum Warnings</div>
<div class="pad">
<div id="forumwarningslinks" class="AdminComment box" style="width:98%;"><?=$Text->full_format($ForumWarnings)?></div>
</div>
</div>
<br />
<?
}
}
if (check_perms('users_mod', $Class)) { ?>
<form id="form" action="user.php" method="post">
<input type="hidden" name="action" value="moderate" />

View File

@ -1,18 +1,39 @@
# We use /var/data, because sphinx created it on FreeBSD
# In other distros/operating systems, you may want to use /var/lib/sphinx or /var/lib/sphinxsearch
source torrents {
source connect {
type = mysql
sql_host = localhost
sql_port = 3306
sql_sock = /var/run/mysqld/mysql.sock
sql_user =
sql_pass =
sql_sock = /var/run/mysql/mysql.sock
sql_user =
sql_pass =
sql_db = gazelle
}
source torrents : connect {
#By inheriting from connect, we keep all the connection info
sql_attr_uint = time
sql_attr_uint = categoryid
sql_attr_uint = releasetype
sql_attr_bigint = size
sql_attr_uint = snatched
sql_attr_uint = seeders
sql_attr_uint = leechers
sql_attr_uint = logscore
sql_attr_uint = year
sql_attr_bool = scene
sql_attr_bool = vanityhouse
sql_attr_bool = haslog
sql_attr_bool = hascue
sql_attr_uint = freetorrent
sql_query_pre = TRUNCATE TABLE sphinx_hash
sql_query_pre = SET group_concat_max_len=10140
sql_query_pre = SET @StartTime=NOW()
sql_query_pre = SET group_concat_max_len = 10140
sql_query_pre = SET @StartTime = NOW()
sql_query_pre = INSERT INTO sphinx_hash ( \
ID, GroupName, TagList, Year, RecordLabel, CatalogueNumber, CategoryID, Time, ReleaseType, \
@ -57,34 +78,23 @@ source torrents {
sql_query_post = DELETE FROM sphinx_delta WHERE Time<=UNIX_TIMESTAMP(@StartTime) OR Time IS NULL
sql_attr_uint = time
sql_attr_uint = categoryid
sql_attr_uint = releasetype
sql_attr_uint = size
sql_attr_uint = snatched
sql_attr_uint = seeders
sql_attr_uint = leechers
sql_attr_uint = logscore
sql_attr_uint = year
sql_attr_bool = scene
sql_attr_bool = vanityhouse
sql_attr_bool = haslog
sql_attr_bool = hascue
sql_attr_uint = freetorrent
sql_query_info = SELECT ID, GroupName, ArtistName, TagList, Filelist FROM sphinx_hash WHERE ID = $id
}
source delta : torrents {
sql_query_pre = SHOW STATUS
sql_query_pre = SET @nothing = 0 # Overwrite the inherited sql_query_pre directive
sql_query = SELECT ID, GroupName, ArtistName, TagList, Year, Year AS YearFullText, \
RecordLabel, CatalogueNumber, CategoryID, Time, ReleaseType, Size, \
Snatched, Seeders, Leechers, LogScore, Scene, VanityHouse, HasLog, HasCue, \
FreeTorrent, Media, Format, Encoding, RemasterYear, RemasterTitle, \
RemasterRecordLabel, RemasterCatalogueNumber, FileList \
Snatched, Seeders, Leechers, LogScore, Scene, VanityHouse, \
HasLog, HasCue, FreeTorrent, Media, Format, Encoding, RemasterYear, \
RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, FileList \
FROM sphinx_delta
sql_query_post = SHOW STATUS
sql_query_pre = SET @nothing = 0
sql_query_info = SELECT ID, GroupName, ArtistName, TagList, FileList FROM sphinx_delta WHERE ID = $id
sql_query_killlist = SELECT ID FROM sphinx_delta
}
@ -96,8 +106,13 @@ index torrents {
morphology = none
min_word_len = 2
charset_type = utf-8
phrase_boundary = U+000A
phrase_boundary_step = 20
# Note: \n cannot be used as phrase boundary character in Sphinx 2.0.4 and later.
# This makes searching the file lists inaccurate since there's
# no way to ensure that all keywords match the same file.
# If an older version of Sphinx is used, uncomment the following two lines.
# phrase_boundary = U+000A
# phrase_boundary_step = 20
charset_table = \
U+00C0->a, U+00C1->a, U+00C2->a, U+00C3->a, U+00C4->a, U+00C5->a, U+00E0->a, U+00E1->a, U+00E2->a, \
@ -290,8 +305,7 @@ index torrents {
U+0B92, U+0B93, U+0B95, U+0B99, U+0B9A, U+0B9C, U+0B9E, U+0B9F, U+0BA3, U+0BA4, U+0BA8..U+0BAA, U+0BAE..U+0BB9, U+0BE6..U+0BEF, U+0E01..U+0E30, U+0E32, U+0E33, U+0E40..U+0E46, U+0E50..U+0E5B, U+FF10..U+FF19->0..9, U+FF21..U+FF3A->a..z, U+FF41..U+FF5A->a..z, \
0..9, A..Z->a..z, a..z, _
# Recommended, but requires 1.10-beta or above.
# blend_chars = !, U+23, $, %, &, ', *, +, U+2C, -, ., /, :, U+3B, <, =, >, ?, @, [, U+5C, ], U+A1..U+BF
blend_chars = !, U+23, $, %, &, ', (, ), *, +, U+2C, -, ., /, :, U+3B, <, =, >, ?, @, [, U+5C, ], U+A1..U+BF
}
index delta : torrents {
@ -299,13 +313,25 @@ index delta : torrents {
path = /var/data/sphinx/delta
}
source requests : torrents {
#By inheriting from torrents, we keep all the connection info
#By overwriting sql_query_pre (etc.) once, we overwrite all of them
source requests : connect {
sql_attr_uint = UserID
sql_attr_uint = TimeAdded
sql_attr_uint = LastVote
sql_attr_uint = CategoryID
sql_attr_uint = Year
sql_attr_uint = ReleaseType
sql_attr_uint = FillerID
sql_attr_uint = TorrentID
sql_attr_uint = TimeFilled
sql_attr_uint = Visible
sql_attr_uint = Votes
sql_attr_uint = Bounty
sql_query_pre = TRUNCATE TABLE sphinx_requests
sql_query_pre = SET group_concat_max_len=10140
sql_query_pre = SET @StartTime=NOW()
sql_query_pre = SET group_concat_max_len = 10140
sql_query_pre = SET @StartTime = NOW()
sql_query_pre = INSERT INTO sphinx_requests ( \
ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
@ -344,21 +370,6 @@ source requests : torrents {
sql_query_post = DELETE FROM sphinx_requests_delta WHERE TimeAdded<=UNIX_TIMESTAMP(@StartTime)
sql_query_info = SELECT * FROM sphinx_requests WHERE ID = $id
sql_attr_uint = UserID
sql_attr_uint = TimeAdded
sql_attr_uint = LastVote
sql_attr_uint = CategoryID
sql_attr_uint = Year
sql_attr_uint = ReleaseType
sql_attr_uint = FillerID
sql_attr_uint = TorrentID
sql_attr_uint = TimeFilled
sql_attr_uint = Visible
sql_attr_uint = Votes
sql_attr_uint = Bounty
sql_attr_multi = uint TagID from query; \
SELECT RequestID AS ID, TagID FROM requests_tags
@ -368,10 +379,11 @@ source requests : torrents {
sql_attr_multi = uint Bookmarker from query; \
SELECT RequestID AS ID, UserID FROM bookmarks_requests
sql_query_info = SELECT * FROM sphinx_requests WHERE ID = $id
}
source requests_delta : requests {
sql_query_pre = SHOW STATUS
sql_query_pre = SET @nothing = 0
sql_query = SELECT ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
Year, ArtistList, ReleaseType, CatalogueNumber, \
@ -382,7 +394,19 @@ source requests_delta : requests {
sql_query_killlist = SELECT ID FROM sphinx_requests_delta
sql_query_info = SELECT * FROM sphinx_requests_delta WHERE ID = $id
sql_query_post = SHOW STATUS
sql_query_post = SET @nothing = 0
sql_attr_multi = uint TagID from query; \
SELECT RequestID AS ID, TagID FROM requests_tags \
JOIN sphinx_requests_delta ON ID=RequestID
sql_attr_multi = uint Voter from query; \
SELECT RequestID AS ID, v.UserID FROM requests_votes v \
JOIN sphinx_requests_delta ON ID=RequestID
sql_attr_multi = uint Bookmarker from query; \
SELECT RequestID AS ID, b.UserID FROM bookmarks_requests b \
JOIN sphinx_requests_delta ON ID=RequestID
}
index requests : torrents {
@ -395,6 +419,10 @@ index requests_delta : requests {
path = /var/data/sphinx/requests_delta
}
indexer {
mem_limit = 64M
}
searchd {
listen = localhost:9312
log = /var/log/searchd/searchd.log

View File

@ -64,7 +64,7 @@ function Calculate() {
$('#button').raw().disabled = true;
} else if(isNaN($('#amount_box').raw().value)
|| (window.location.search.indexOf('action=new') != -1 && $('#amount_box').raw().value*mul < 100*1024*1024)
|| (window.location.search.indexOf('action=view') != -1 && $('#amount_box').raw().value*mul < 10*1024*1024)) {
|| (window.location.search.indexOf('action=view') != -1 && $('#amount_box').raw().value*mul < 20*1024*1024)) {
$('#new_uploaded').raw().innerHTML = get_size(($('#current_uploaded').raw().value));
$('#new_bounty').raw().innerHTML = "0.00 MB";
$('#button').raw().disabled = true;