Empty commit

This commit is contained in:
Git 2012-02-04 08:00:25 +00:00
parent a868ce13ba
commit 0a6f90f451
15 changed files with 51 additions and 51 deletions

View File

@ -454,7 +454,7 @@ function to_html($Array) {
$Str.='<a href="artist.php?artistname='.urlencode(undisplay_str($Block['Val'])).'">'.$Block['Val'].'</a>'; $Str.='<a href="artist.php?artistname='.urlencode(undisplay_str($Block['Val'])).'">'.$Block['Val'].'</a>';
break; break;
case 'torrent': case 'torrent':
$Pattern = '/('.NONSSL_SITE_URL.'\/torrents\.php?.*id=)?(\d+)($|&|#)/i'; $Pattern = '/('.NONSSL_SITE_URL.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i';
$Matches = array(); $Matches = array();
if (preg_match($Pattern, $Block['Val'], $Matches)) { if (preg_match($Pattern, $Block['Val'], $Matches)) {
if (isset($Matches[2])) { if (isset($Matches[2])) {
@ -467,7 +467,7 @@ function to_html($Array) {
} }
} }
} else { } else {
$Str .= '[torrent]'.$Block['Val'].'[/torrent]'; $Str .= '[torrent]'.str_replace('[inlineurl]','',$Block['Val']).'[/torrent]';
} }
break; break;
case 'wiki': case 'wiki':

View File

@ -65,12 +65,15 @@ function head() {
<input type="hidden" name="action" value="takeedit" /> <input type="hidden" name="action" value="takeedit" />
<input type="hidden" name="torrentid" value="<?=display_str($this->TorrentID)?>" /> <input type="hidden" name="torrentid" value="<?=display_str($this->TorrentID)?>" />
<input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID'])?>" /> <input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID'])?>" />
<? } else if($this->Torrent && $this->Torrent['GroupID']) { ?> <? } else {
if($this->Torrent && $this->Torrent['GroupID']) { ?>
<input type="hidden" name="groupid" value="<?=display_str($this->Torrent['GroupID'])?>" /> <input type="hidden" name="groupid" value="<?=display_str($this->Torrent['GroupID'])?>" />
<input type="hidden" name="type" value="Music" /> <input type="hidden" name="type" value="Music" />
<? } else if($this->Torrent && $this->Torrent['RequestID']) { ?> <? }
if($this->Torrent && $this->Torrent['RequestID']) { ?>
<input type="hidden" name="requestid" value="<?=display_str($this->Torrent['RequestID'])?>" /> <input type="hidden" name="requestid" value="<?=display_str($this->Torrent['RequestID'])?>" />
<? } ?> <? }
} ?>
</div> </div>
<? if($this->NewTorrent) { ?> <? if($this->NewTorrent) { ?>
<table cellpadding="3" cellspacing='1' border='0' class='border' width="100%"> <table cellpadding="3" cellspacing='1' border='0' class='border' width="100%">

View File

@ -1898,13 +1898,13 @@ function update_sphinx_requests($RequestID) {
$DB->query("REPLACE INTO sphinx_requests_delta ( $DB->query("REPLACE INTO sphinx_requests_delta (
ID, UserID, TimeAdded, LastVote, CategoryID, Title, ID, UserID, TimeAdded, LastVote, CategoryID, Title,
Year, ReleaseType, RecordLabel, CatalogueNumber, BitrateList, Year, ReleaseType, CatalogueNumber, BitrateList,
FormatList, MediaList, LogCue, FillerID, TorrentID, FormatList, MediaList, LogCue, FillerID, TorrentID,
TimeFilled, Visible, Votes, Bounty) TimeFilled, Visible, Votes, Bounty)
SELECT SELECT
ID, r.UserID, UNIX_TIMESTAMP(TimeAdded) AS TimeAdded, ID, r.UserID, UNIX_TIMESTAMP(TimeAdded) AS TimeAdded,
UNIX_TIMESTAMP(LastVote) AS LastVote, CategoryID, UNIX_TIMESTAMP(LastVote) AS LastVote, CategoryID,
Title, Year, ReleaseType, RecordLabel, CatalogueNumber, BitrateList, Title, Year, ReleaseType, CatalogueNumber, BitrateList,
FormatList, MediaList, LogCue, FillerID, TorrentID, FormatList, MediaList, LogCue, FillerID, TorrentID,
UNIX_TIMESTAMP(TimeFilled) AS TimeFilled, Visible, UNIX_TIMESTAMP(TimeFilled) AS TimeFilled, Visible,
COUNT(rv.UserID) AS Votes, SUM(rv.Bounty) >> 10 AS Bounty COUNT(rv.UserID) AS Votes, SUM(rv.Bounty) >> 10 AS Bounty

Binary file not shown.

BIN
ocelot-0.3.2.tar.bz2 Normal file

Binary file not shown.

View File

@ -49,6 +49,7 @@
break; break;
case 'browse': case 'browse':
require(SERVER_ROOT.'/sections/ajax/browse.php'); require(SERVER_ROOT.'/sections/ajax/browse.php');
break;
case 'usersearch': case 'usersearch':
require(SERVER_ROOT.'/sections/ajax/usersearch.php'); require(SERVER_ROOT.'/sections/ajax/usersearch.php');
break; break;
@ -57,8 +58,7 @@
break; break;
case 'requests': case 'requests':
require(SERVER_ROOT.'/sections/ajax/requests.php'); require(SERVER_ROOT.'/sections/ajax/requests.php');
case 'bookmarks': break;
require(SERVER_ROOT.'/sections/ajax/bookmarks/index.php');
case 'artist': case 'artist':
require(SERVER_ROOT.'/sections/ajax/artist.php'); require(SERVER_ROOT.'/sections/ajax/artist.php');
break; break;

View File

@ -3,51 +3,31 @@
//authorize(true); //authorize(true);
global $DB, $Cache;
$HeavyInfo = $Cache->get_value('user_info_heavy_'.$UserID);
$DB->query("SELECT
m.Username,
m.torrent_pass,
i.AuthKey,
Uploaded AS BytesUploaded,
Downloaded AS BytesDownloaded,
RequiredRatio,
p.Level AS Class
FROM users_main AS m
INNER JOIN users_info AS i ON i.UserID=m.ID
LEFT JOIN permissions AS p ON p.ID=m.PermissionID
WHERE m.ID='$UserID'");
list($Username,$torrent_pass,$AuthKey,$Uploaded,$Downloaded,$RequiredRatio,$Class) = $DB->next_record(MYSQLI_NUM, array(9,11));
//calculate ratio --Gwindow //calculate ratio --Gwindow
//returns 0 for DNE and -1 for infiinity, because we dont want strings being returned for a numeric value in our java //returns 0 for DNE and -1 for infiinity, because we dont want strings being returned for a numeric value in our java
if($Uploaded == 0 && $Downloaded == 0) { if($LoggedUser['BytesUploaded'] == 0 && $LoggedUser['BytesDownloaded'] == 0) {
$Ratio = '0'; $Ratio = '0';
} elseif($Downloaded == 0) { } elseif($LoggedUser['BytesDownloaded'] == 0) {
$Ratio = '-1'; $Ratio = '-1';
} else { } else {
$Ratio = number_format(max($Uploaded/$Downloaded-0.005,0), 2); //Subtract .005 to floor to 2 decimals $Ratio = number_format(max($LoggedUser['BytesUploaded']/$LoggedUser['BytesDownloaded']-0.005,0), 2); //Subtract .005 to floor to 2 decimals
} }
print json_encode( print json_encode(
array( array(
'status' => 'success', 'status' => 'success',
'response' => array( 'response' => array(
'username' => $Username, 'username' => $LoggedUser['Username'],
'id' => $UserID, 'id' => $LoggedUser['ID'],
'authkey'=>$AuthKey, 'authkey'=> $LoggedUser['AuthKey'],
'passkey'=>$torrent_pass, 'passkey'=> $LoggedUser['torrent_pass'],
'userstats' => array( 'userstats' => array(
'uploaded' => (int) $Uploaded, 'uploaded' => (int) $LoggedUser['BytesUploaded'],
'downloaded' => (int) $Downloaded, 'downloaded' => (int) $LoggedUser['BytesDownloaded'],
'ratio' => (float) $Ratio, 'ratio' => (float) $LoggedUser['Ratio'],
'requiredratio' => (float) $RequiredRatio, 'requiredratio' => (float) $LoggedUser['RequiredRatio'],
//'class' => $Class //'class' => $Class
'class' => $ClassLevels[$Class]['Name'] 'class' => $ClassLevels[$LoggedUser['Class']]['Name']
), ),
) )
) )

View File

@ -23,7 +23,7 @@
} }
list($RequestID, $RequestorID, $RequestorName, $TimeAdded, $LastVote, $CategoryID, $Title, $Year, $Image, $Description, $CatalogueNumber, $RecordLabel, $ReleaseType, list($RequestID, $RequestorID, $RequestorName, $TimeAdded, $LastVote, $CategoryID, $Title, $Year, $Image, $Description, $CatalogueNumber, $RecordLabel, $ReleaseType,
$BitrateList, $FormatList, $MediaList, $LogCue, $FillerID, $FillerName, $TorrentID, $TimeFilled) = $Request; $BitrateList, $FormatList, $MediaList, $LogCue, $FillerID, $FillerName, $TorrentID, $TimeFilled, $GroupID) = $Request;
//Convenience variables //Convenience variables
$IsFilled = !empty($TorrentID); $IsFilled = !empty($TorrentID);
@ -97,7 +97,7 @@
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>,'[Remove bookmark]');return false;">[Bookmark]</a> <a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>,'[Remove bookmark]');return false;">[Bookmark]</a>
<? } ?> <? } ?>
<a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>">[Report Request]</a> <a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>">[Report Request]</a>
<a href="upload.php?requestid=<?=$RequestID?>">[Upload Request]</a> <a href="upload.php?requestid=<?=$RequestID?><?=($GroupID?"&groupid=$GroupID":'')?>">[Upload Request]</a>
<? if(!$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0))) { ?> <? if(!$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0))) { ?>
<a href="reports.php?action=report&amp;type=request_update&amp;id=<?=$RequestID?>">[Request Update]</a> <a href="reports.php?action=report&amp;type=request_update&amp;id=<?=$RequestID?>">[Request Update]</a>
<? } ?> <? } ?>

View File

@ -481,7 +481,7 @@
// $Tags, $TimeAdded, $TimeFilled, $Title, $TorrentID, $RequestorID, $RequestorName, $Year, $RequestID, $Categoryid, $FillerID, $LastVote, // $Tags, $TimeAdded, $TimeFilled, $Title, $TorrentID, $RequestorID, $RequestorName, $Year, $RequestID, $Categoryid, $FillerID, $LastVote,
// $ReleaseType, $TagIDs, $TimeAdded, $TimeFilled, $TorrentID, $RequestorID, $Voters) = array_values($Request); // $ReleaseType, $TagIDs, $TimeAdded, $TimeFilled, $TorrentID, $RequestorID, $Voters) = array_values($Request);
list($RequestID, $RequestorID, $RequestorName, $TimeAdded, $LastVote, $CategoryID, $Title, $Year, $Image, $Description, $CatalogueNumber, list($RequestID, $RequestorID, $RequestorName, $TimeAdded, $LastVote, $CategoryID, $Title, $Year, $Image, $Description, $CatalogueNumber, $RecordLabel,
$ReleaseType, $BitrateList, $FormatList, $MediaList, $LogCue, $FillerID, $FillerName, $TorrentID, $TimeFilled) = $Request; $ReleaseType, $BitrateList, $FormatList, $MediaList, $LogCue, $FillerID, $FillerName, $TorrentID, $TimeFilled) = $Request;
$RequestVotes = get_votes_array($RequestID); $RequestVotes = get_votes_array($RequestID);

View File

@ -48,8 +48,14 @@
// Assign to class // Assign to class
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', Level=$NewLevel, AssignedToUser=NULL WHERE ID=$ConvID"); $DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', Level=$NewLevel, AssignedToUser=NULL WHERE ID=$ConvID");
} else { } else {
$UserInfo = user_info($NewLevel);
$Level = $Classes[$UserInfo['PermissionID']]['Level'];
if (!$Level) {
error("Assign to user not found.");
}
// Assign to user // Assign to user
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', AssignedToUser=$NewLevel WHERE ID=$ConvID"); $DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', AssignedToUser=$NewLevel, Level=$Level WHERE ID=$ConvID");
} }
echo '1'; echo '1';

View File

@ -260,7 +260,7 @@ function js_pages($Action, $TorrentID, $NumResults, $CurrentPage) {
WHERE tc.ID='".db_string($_POST['post'])."'"); WHERE tc.ID='".db_string($_POST['post'])."'");
list($OldBody, $AuthorID,$GroupID,$AddedTime)=$DB->next_record(); list($OldBody, $AuthorID,$GroupID,$AddedTime)=$DB->next_record();
$DB->query("SELECT ceil(COUNT(ID) / ".POSTS_PER_PAGE.") AS Page FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $_POST[post]"); $DB->query("SELECT ceil(COUNT(ID) / ".TORRENT_COMMENTS_PER_PAGE.") AS Page FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $_POST[post]");
list($Page) = $DB->next_record(); list($Page) = $DB->next_record();
if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); } if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); }
@ -321,14 +321,15 @@ function js_pages($Action, $TorrentID, $NumResults, $CurrentPage) {
$DB->query("DELETE FROM torrents_comments WHERE ID='".db_string($_GET['postid'])."'"); $DB->query("DELETE FROM torrents_comments WHERE ID='".db_string($_GET['postid'])."'");
//We need to clear all subsequential catalogues as they've all been bumped with the absence of this post //We need to clear all subsequential catalogues as they've all been bumped with the absence of this post
$ThisCatalogue = floor((POSTS_PER_PAGE*$Page-POSTS_PER_PAGE)/THREAD_CATALOGUE); $ThisCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
$LastCatalogue = floor((POSTS_PER_PAGE*$Pages-POSTS_PER_PAGE)/THREAD_CATALOGUE); $LastCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Pages-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
for($i=$ThisCatalogue;$i<=$LastCatalogue;$i++) { for($i=$ThisCatalogue;$i<=$LastCatalogue;$i++) {
$Cache->delete('torrent_comments_'.$GroupID.'_catalogue_'.$i); $Cache->delete('torrent_comments_'.$GroupID.'_catalogue_'.$i);
} }
// Delete thread info cache (eg. number of pages) // Delete thread info cache (eg. number of pages)
$Cache->delete('torrent_comments_'.$GroupID); $Cache->delete('torrent_comments_'.$GroupID);
break; break;
case 'regen_filelist' : case 'regen_filelist' :
if(check_perms('users_mod') && !empty($_GET['torrentid']) && is_number($_GET['torrentid'])) { if(check_perms('users_mod') && !empty($_GET['torrentid']) && is_number($_GET['torrentid'])) {

View File

@ -40,9 +40,10 @@
WHERE tt.GroupID='$_GET[groupid]'"); WHERE tt.GroupID='$_GET[groupid]'");
list($Properties['TagList']) = $DB->next_record(); list($Properties['TagList']) = $DB->next_record();
} if (!empty($_GET['requestid']) && is_number($_GET['requestid'])) {
$Properties['RequestID'] = $_GET['requestid'];
if(empty($Properties) && !empty($_GET['requestid']) && is_number($_GET['requestid'])) { }
} elseif (empty($Properties) && !empty($_GET['requestid']) && is_number($_GET['requestid'])) {
include(SERVER_ROOT.'/sections/requests/functions.php'); include(SERVER_ROOT.'/sections/requests/functions.php');
$DB->query("SELECT $DB->query("SELECT
r.ID AS RequestID, r.ID AS RequestID,

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<? authorize(); include(SERVER_ROOT.'/sections/user/linkedfunctions.php'); if (!check_perms('users_mod')) { error(403); } $UserID = $_REQUEST['userid']; switch ($_REQUEST['dupeaction']) { case 'remove': unlink_user($_REQUEST['removeid']); break; case 'add': $Target = $_REQUEST['target']; $DB->query("SELECT ID FROM users_main WHERE Username LIKE '".db_string($Target)."'"); if (list($TargetID) = $DB->next_record()) { link_users($UserID, $TargetID); } else { error("User '$Target' not found."); } break; case 'comments': dupe_comments($_REQUEST['groupid'], $_REQUEST['dupecomments']); break; default: error(403); } echo '\o/'; header("Location: user.php?id=$UserID"); ?>

View File

@ -715,6 +715,13 @@ function check_paranoia_here($Setting) {
} }
// Linked accounts
if(check_perms('users_mod')) {
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
user_dupes_table($UserID);
}
if ((check_perms('users_view_invites')) && $Invited > 0) { if ((check_perms('users_view_invites')) && $Invited > 0) {
include(SERVER_ROOT.'/classes/class_invite_tree.php'); include(SERVER_ROOT.'/classes/class_invite_tree.php');
$Tree = new INVITE_TREE($UserID, array('visible'=>false)); $Tree = new INVITE_TREE($UserID, array('visible'=>false));