Empty commit

This commit is contained in:
Git 2013-04-19 08:00:55 +00:00
parent 792f5077cb
commit ba33634e19
77 changed files with 2361 additions and 1853 deletions

51
api.php
View File

@ -1,10 +1,10 @@
<?
/*-- API Start Class -----------------------------------*/
/*------------------------------------------------------*/
/*-- API Start Class -------------------------------*/
/*--------------------------------------------------*/
/* Simplified version of script_start, used for the */
/* site API calls */
/*------------------------------------------------------*/
/********************************************************/
/*--------------------------------------------------*/
/****************************************************/
$ScriptStartTime=microtime(true); //To track how long a page takes to create
@ -41,47 +41,58 @@ function error($Code) {
function make_secret($Length = 32) {
$Secret = '';
$Chars='abcdefghijklmnopqrstuvwxyz0123456789';
for($i=0; $i<$Length; $i++) {
$Rand = mt_rand(0, strlen($Chars)-1);
for ($i = 0; $i < $Length; $i++) {
$Rand = mt_rand(0, strlen($Chars) - 1);
$Secret .= substr($Chars, $Rand, 1);
}
return str_shuffle($Secret);
}
function is_number($Str) {
if ($Str < 0) { return false; }
if ($Str < 0) {
return false;
}
// We're converting input to a int, then string and comparing to original
return ($Str == strval(intval($Str)) ? true : false);
}
function display_str($Str) {
if ($Str!="") {
$Str=make_utf8($Str);
$Str=mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8");
$Str=preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&amp;",$Str);
if ($Str != '') {
$Str = make_utf8($Str);
$Str = mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8");
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&amp;",$Str);
$Replace = array(
"'",'"',"<",">",
'&#128;','&#130;','&#131;','&#132;','&#133;','&#134;','&#135;','&#136;','&#137;','&#138;','&#139;','&#140;','&#142;','&#145;','&#146;','&#147;','&#148;','&#149;','&#150;','&#151;','&#152;','&#153;','&#154;','&#155;','&#156;','&#158;','&#159;'
);
$With=array(
$With = array(
'&#39;','&quot;','&lt;','&gt;',
'&#8364;','&#8218;','&#402;','&#8222;','&#8230;','&#8224;','&#8225;','&#710;','&#8240;','&#352;','&#8249;','&#338;','&#381;','&#8216;','&#8217;','&#8220;','&#8221;','&#8226;','&#8211;','&#8212;','&#732;','&#8482;','&#353;','&#8250;','&#339;','&#382;','&#376;'
);
$Str=str_replace($Replace,$With,$Str);
$Str = str_replace($Replace,$With,$Str);
}
return $Str;
}
function make_utf8($Str) {
if ($Str!="") {
if (is_utf8($Str)) { $Encoding="UTF-8"; }
if (empty($Encoding)) { $Encoding=mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); }
if (empty($Encoding)) { $Encoding="ISO-8859-1"; }
if ($Encoding=="UTF-8") { return $Str; }
else { return @mb_convert_encoding($Str,"UTF-8",$Encoding); }
if ($Str != '') {
if (is_utf8($Str)) {
$Encoding = 'UTF-8';
}
if (empty($Encoding)) {
$Encoding = mb_detect_encoding($Str,'UTF-8, ISO-8859-1');
}
if (empty($Encoding)) {
$Encoding = 'ISO-8859-1';
}
if ($Encoding == 'UTF-8') {
return $Str;
} else {
return @mb_convert_encoding($Str,'UTF-8',$Encoding);
}
}
}
@ -101,7 +112,7 @@ function is_utf8($Str) {
function display_array($Array, $Escape = array()) {
foreach ($Array as $Key => $Val) {
if((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
$Array[$Key] = display_str($Val);
}
}

View File

@ -3,7 +3,7 @@ class IRC_DB extends DB_MYSQL {
function halt($Msg) {
global $Bot;
global $DB;
$Bot->send_to($Bot->get_channel(),'The database is currently unavailable try again later');
$Bot->send_to($Bot->get_channel(),'The database is currently unavailable; try again later.');
}
}

View File

@ -113,7 +113,7 @@
}
//Handles escaping
function db_string($String,$DisableWildcards=false) {
function db_string($String, $DisableWildcards = false) {
global $DB;
//Escape
$String = $DB->escape_str($String);
@ -167,12 +167,12 @@ function __construct($Database = SQLDB, $User = SQLLOGIN, $Pass = SQLPASS, $Serv
function halt($Msg) {
global $LoggedUser, $Cache, $Debug, $argv;
$DBError='MySQL: '.strval($Msg).' SQL error: '.strval($this->Errno).' ('.strval($this->Error).')';
$DBError = 'MySQL: '.strval($Msg).' SQL error: '.strval($this->Errno).' ('.strval($this->Error).')';
if ($this->Errno == 1194) { send_irc('PRIVMSG '.ADMIN_CHAN.' :'.$this->Error); }
/*if ($this->Errno == 1194) {
preg_match("Table '(\S+)' is marked as crashed and should be repaired", $this->Error, $Matches);
} */
$Debug->analysis('!dev DB Error',$DBError,3600*24);
$Debug->analysis('!dev DB Error', $DBError, 3600 * 24);
if (DEBUG_MODE || check_perms('site_debug') || isset($argv[1])) {
echo '<pre>'.display_str($DBError).'</pre>';
if (DEBUG_MODE || check_perms('site_debug')) {
@ -195,24 +195,24 @@ function connect() {
}
}
function query($Query,$AutoHandle=1) {
function query($Query, $AutoHandle = 1) {
global $LoggedUser, $Debug;
$QueryStartTime=microtime(true);
$QueryStartTime = microtime(true);
$this->connect();
//In the event of a mysql deadlock, we sleep allowing mysql time to unlock then attempt again for a maximum of 5 tries
for($i = 1; $i < 6; $i++) {
$this->QueryID = mysqli_query($this->LinkID,$Query);
// In the event of a MySQL deadlock, we sleep allowing MySQL time to unlock, then attempt again for a maximum of 5 tries
for ($i = 1; $i < 6; $i++) {
$this->QueryID = mysqli_query($this->LinkID, $Query);
if (!in_array(mysqli_errno($this->LinkID), array(1213, 1205))) {
break;
}
$Debug->analysis('Non-Fatal Deadlock:',$Query,3600*24);
$Debug->analysis('Non-Fatal Deadlock:', $Query, 3600 * 24);
trigger_error("Database deadlock, attempt $i");
sleep($i*rand(2, 5)); // Wait longer as attempts increase
sleep($i * rand(2, 5)); // Wait longer as attempts increase
}
$QueryEndTime=microtime(true);
$this->Queries[]=array(display_str($Query),($QueryEndTime-$QueryStartTime)*1000);
$this->Time+=($QueryEndTime-$QueryStartTime)*1000;
$QueryEndTime = microtime(true);
$this->Queries[] = array(display_str($Query), ($QueryEndTime - $QueryStartTime) * 1000);
$this->Time += ($QueryEndTime-$QueryStartTime) * 1000;
if (!$this->QueryID) {
$this->Errno = mysqli_errno($this->LinkID);
@ -229,12 +229,14 @@ function query($Query,$AutoHandle=1) {
/*
if ($QueryType == 'DELETE' || $QueryType == 'UPDATE') {
if ($this->affected_rows() > 50) {
$Debug->analysis($this->affected_rows().' rows altered:',$Query,3600*24);
$Debug->analysis($this->affected_rows().' rows altered:', $Query, 3600 * 24);
}
}
*/
$this->Row = 0;
if ($AutoHandle) { return $this->QueryID; }
if ($AutoHandle) {
return $this->QueryID;
}
}
function query_unb($Query) {

View File

@ -34,7 +34,7 @@ public static function site_ban_ip($IP) {
* @return string the long it represents.
*/
public static function ip_to_unsigned($IP) {
return sprintf("%u", ip2long($IP));
return sprintf('%u', ip2long($IP));
}
/**
@ -71,13 +71,12 @@ public static function geoip($IP) {
* @param $IP the IP to get the hostname for
* @return hostname fetched
*/
public static function get_host_by_ip($IP)
{
public static function get_host_by_ip($IP) {
$testar = explode('.',$IP);
if (count($testar)!=4) {
if (count($testar) != 4) {
return $IP;
}
for ($i=0;$i<4;++$i) {
for ($i = 0; $i < 4; ++$i) {
if (!is_numeric($testar[$i])) {
return $IP;
}
@ -206,7 +205,9 @@ public static function disable_users($UserIDs, $AdminComment, $BanReason = 1) {
public static function warn_user($UserID, $Duration, $Reason) {
global $LoggedUser, $DB, $Cache, $Time;
$DB->query("SELECT Warned FROM users_info
$DB->query("
SELECT Warned
FROM users_info
WHERE UserID=".$UserID."
AND Warned <> '0000-00-00 00:00:00'");
if ($DB->record_count() > 0) {
@ -215,10 +216,10 @@ public static function warn_user($UserID, $Duration, $Reason) {
$NewExpDate = date('Y-m-d H:i:s', strtotime($OldDate) + $Duration);
Misc::send_pm($UserID, 0,
"You have received multiple warnings.",
"When you received your latest warning (Set to expire on ".date("Y-m-d", (time() + $Duration))."), you already had a different warning (Set to expire on ".date("Y-m-d", strtotime($OldDate)).").\n\n Due to this collision, your warning status will now expire at ".$NewExpDate.".");
'You have received multiple warnings.',
"When you received your latest warning (set to expire on ".date('Y-m-d', (time() + $Duration)).'), you already had a different warning (set to expire on '.date('Y-m-d', strtotime($OldDate)).").\n\n Due to this collision, your warning status will now expire at ".$NewExpDate.'.');
$AdminComment = date("Y-m-d").' - Warning (Clash) extended to expire at '.$NewExpDate.' by '.$LoggedUser['Username']."\nReason: $Reason\n\n";
$AdminComment = date('Y-m-d').' - Warning (Clash) extended to expire at '.$NewExpDate.' by '.$LoggedUser['Username']."\nReason: $Reason\n\n";
$DB->query('UPDATE users_info SET
Warned=\''.db_string($NewExpDate).'\',
@ -233,7 +234,7 @@ public static function warn_user($UserID, $Duration, $Reason) {
$Cache->update_row(false, array('Warned' => $WarnTime));
$Cache->commit_transaction(0);
$AdminComment = date("Y-m-d").' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $Reason\n\n";
$AdminComment = date('Y-m-d').' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $Reason\n\n";
$DB->query('UPDATE users_info SET
Warned=\''.db_string($WarnTime).'\',
@ -254,6 +255,5 @@ public static function update_user_notes($UserID, $AdminComment) {
AdminComment=CONCAT(\''.db_string($AdminComment).'\',AdminComment)
WHERE UserID=\''.db_string($UserID).'\'');
}
}
?>

View File

@ -534,7 +534,7 @@ public static function get_bookmarks ($UserID)
}
/**
* Generate HTML for a user's avatar or just return the avatar url
* Generate HTML for a user's avatar or just return the avatar URL
* @param unknown $Avatar
* @param unknown $Username
* @param unknown $Setting
@ -544,62 +544,62 @@ public static function get_bookmarks ($UserID)
*/
public static function show_avatar($Avatar, $Username, $Setting, $Size=150, $ReturnHTML = True) {
global $LoggedUser;
//case 1 is avatars disabled
switch($Setting) {
// case 1 is avatars disabled
switch ($Setting) {
case 0:
if (!empty($Avatar)) {
$ToReturn = $ReturnHTML ? "<img src='$Avatar' width='$Size' style='max-height:400px;' alt='$Username avatar' />" : $Avatar;
$ToReturn = $ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" style=\"max-height: 400px;\" alt=\"$Username avatar\" />" : $Avatar;
} else {
$URL = STATIC_SERVER."common/avatars/default.png";
$ToReturn = $ReturnHTML ? "<img src='$URL' width='$Size' style='max-height:400px;' alt='Default Avatar'/>" : $URL;
$URL = STATIC_SERVER.'common/avatars/default.png';
$ToReturn = $ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" style=\"max-height: 400px;\" alt=\"Default avatar\" />" : $URL;
}
break;
case 2:
$ShowAvatar = True;
case 3:
switch($LoggedUser['Identicons']) {
switch ($LoggedUser['Identicons']) {
case 0:
$Type = "identicon";
$Type = 'identicon';
break;
case 1:
$Type = "monsterid";
$Type = 'monsterid';
break;
case 2:
$Type = "wavatar";
$Type = 'wavatar';
break;
case 3:
$Type = "retro";
$Type = 'retro';
break;
case 4:
$Type = "1";
$Type = '1';
$Robot = True;
break;
case 5:
$Type = "2";
$Type = '2';
$Robot = True;
break;
case 6:
$Type = "3";
$Type = '3';
$Robot = True;
break;
default:
$Type = "identicon";
$Type = 'identicon';
}
$Rating = "pg";
$Rating = 'pg';
if (!$Robot) {
$URL = "https://secure.gravatar.com/avatar/".md5(strtolower(trim($Username)))."?s=$Size&d=$Type&r=$Rating";
$URL = 'https://secure.gravatar.com/avatar/'.md5(strtolower(trim($Username)))."?s=$Size&amp;d=$Type&amp;r=$Rating";
} else {
$URL = "https://static1.robohash.org/".md5($Username)."?set=set".$Type."&size=".$Size."x".$Size;
$URL = 'https://robohash.org/'.md5($Username).'?set=set'.$Type.'&amp;size='.$Size.'x'.$Size;
}
if ($ShowAvatar == True && !empty($Avatar)) {
$ToReturn = $ReturnHTML ? "<img src='$Avatar' width='$Size' style='max-height:400px;' alt='$Username avatar' />" : $Avatar;
$ToReturn = $ReturnHTML ? "<img src=\"$Avatar\" width=\"$Size\" style=\"max-height: 400px;\" alt=\"$Username avatar\" />" : $Avatar;
} else {
$ToReturn = $ReturnHTML ? "<img src='$URL' width='$Size' style='max-height:400px;' alt='Default Avatar'/>" : $URL;
$ToReturn = $ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" style=\"max-height: 400px;\" alt=\"Default avatar\" />" : $URL;
}
break;
default:
$URL = STATIC_SERVER."common/avatars/default.png";
$ToReturn = $ReturnHTML ? "<img src='$URL' width='$Size' style='max-height:400px;' alt='Default Avatar'/>" : $URL;
$URL = STATIC_SERVER.'common/avatars/default.png';
$ToReturn = $ReturnHTML ? "<img src=\"$URL\" width=\"$Size\" style=\"max-height: 400px;\" alt=\"Default avatar\" />" : $URL;
}
return $ToReturn;
}

View File

@ -7,7 +7,7 @@
** user custom permissions form. **
********************************************************************************/
$PermissionsArray = array(
$PermissionsArray = array(
'site_leech' => 'Can leech (Does this work?).',
'site_upload' => 'Upload torrent access.',
'site_vote' => 'Request vote access.',
@ -113,7 +113,7 @@
'artist_edit_vanityhouse' => 'Can mark artists as part of Vanity House.',
'site_tag_aliases_read' => 'Can view the list of tag aliases.'
);
);
function permissions_form(){ ?>
<div class="permissions">

View File

@ -539,7 +539,7 @@ function _Send ( $handle, $data, $length )
/// enter mbstring workaround mode
function _MBPush ()
{
$this->_mbenc = "";
$this->_mbenc = '';
if ( ini_get ( "mbstring.func_overload" ) & 2 )
{
$this->_mbenc = mb_internal_encoding();
@ -931,10 +931,10 @@ function ResetFilters ()
/// clear groupby settings (for multi-queries)
function ResetGroupBy ()
{
$this->_groupby = "";
$this->_groupby = '';
$this->_groupfunc = SPH_GROUPBY_DAY;
$this->_groupsort = "@group desc";
$this->_groupdistinct= "";
$this->_groupdistinct= '';
}
/// clear all attribute value overrides (for multi-queries)

View File

@ -4,14 +4,14 @@ function compare($X, $Y){
return($Y['count'] - $X['count']);
}
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/sections/requests/functions.php');
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
$ArtistID = $_GET['id'];
if(!is_number($ArtistID)) {
if (!is_number($ArtistID)) {
print json_encode(array('status' => 'failure'));
die();
}
@ -29,7 +29,7 @@ function compare($X, $Y){
}
}
if(!empty($_GET['revisionid'])) { // if they're viewing an old revision
if (!empty($_GET['revisionid'])) { // if they're viewing an old revision
$RevisionID=$_GET['revisionid'];
if (!is_number($RevisionID)) {
error(0);
@ -39,7 +39,7 @@ function compare($X, $Y){
$Data = $Cache->get_value('artist_'.$ArtistID);
$RevisionID = false;
}
if($Data) {
if ($Data) {
if (!is_array($Data)) {
$Data = unserialize($Data);
}
@ -47,7 +47,8 @@ function compare($X, $Y){
} else {
if ($RevisionID) {
$sql = "SELECT
$sql = "
SELECT
a.Name,
wiki.Image,
wiki.body,
@ -56,7 +57,8 @@ function compare($X, $Y){
LEFT JOIN artists_group AS a ON wiki.RevisionID=a.RevisionID
WHERE wiki.RevisionID='$RevisionID' ";
} else {
$sql = "SELECT
$sql = "
SELECT
a.Name,
wiki.Image,
wiki.body,
@ -68,7 +70,7 @@ function compare($X, $Y){
$sql .= " GROUP BY a.ArtistID";
$DB->query($sql);
if($DB->record_count() == 0) {
if ($DB->record_count() == 0) {
print json_encode(array('status' => 'failure'));
}
@ -78,7 +80,8 @@ function compare($X, $Y){
// Requests
$Requests = $Cache->get_value('artists_requests_'.$ArtistID);
if (!is_array($Requests)) {
$DB->query("SELECT
$DB->query("
SELECT
r.ID,
r.CategoryID,
r.Title,
@ -94,7 +97,7 @@ function compare($X, $Y){
GROUP BY r.ID
ORDER BY Votes DESC");
if($DB->record_count() > 0) {
if ($DB->record_count() > 0) {
$Requests = $DB->to_array();
} else {
$Requests = array();
@ -104,7 +107,8 @@ function compare($X, $Y){
$NumRequests = count($Requests);
if (($Importances = $Cache->get_value('artist_groups_'.$ArtistID)) === false) {
$DB->query("SELECT
$DB->query("
SELECT
DISTINCTROW ta.GroupID, ta.Importance, tg.VanityHouse, tg.Year
FROM torrents_artists AS ta
JOIN torrents_group AS tg ON tg.ID=ta.GroupID
@ -129,38 +133,38 @@ function compare($X, $Y){
//Get list of used release types
$UsedReleases = array();
foreach($TorrentList as $GroupID=>$Group) {
if($Importances[$GroupID]['Importance'] == '2') {
foreach ($TorrentList as $GroupID=>$Group) {
if ($Importances[$GroupID]['Importance'] == '2') {
$TorrentList[$GroupID]['ReleaseType'] = 1024;
$GuestAlbums = true;
}
if($Importances[$GroupID]['Importance'] == '3') {
if ($Importances[$GroupID]['Importance'] == '3') {
$TorrentList[$GroupID]['ReleaseType'] = 1023;
$RemixerAlbums = true;
}
if($Importances[$GroupID]['Importance'] == '4') {
if ($Importances[$GroupID]['Importance'] == '4') {
$TorrentList[$GroupID]['ReleaseType'] = 1022;
$ComposerAlbums = true;
}
if($Importances[$GroupID]['Importance'] == '7') {
if ($Importances[$GroupID]['Importance'] == '7') {
$TorrentList[$GroupID]['ReleaseType'] = 1021;
$ProducerAlbums = true;
}
if(!in_array($TorrentList[$GroupID]['ReleaseType'], $UsedReleases)) {
if (!in_array($TorrentList[$GroupID]['ReleaseType'], $UsedReleases)) {
$UsedReleases[] = $TorrentList[$GroupID]['ReleaseType'];
}
}
if(!empty($GuestAlbums)) {
if (!empty($GuestAlbums)) {
$ReleaseTypes[1024] = "Guest Appearance";
}
if(!empty($RemixerAlbums)) {
if (!empty($RemixerAlbums)) {
$ReleaseTypes[1023] = "Remixed By";
}
if(!empty($ComposerAlbums)) {
if (!empty($ComposerAlbums)) {
$ReleaseTypes[1022] = "Composition";
}
if(!empty($ProducerAlbums)) {
if (!empty($ProducerAlbums)) {
$ReleaseTypes[1021] = "Produced By";
}
@ -176,8 +180,8 @@ function compare($X, $Y){
$TagList = explode(' ',str_replace('_','.',$TagList));
// $Tags array is for the sidebar on the right
foreach($TagList as $Tag) {
if(!isset($Tags[$Tag])) {
foreach ($TagList as $Tag) {
if (!isset($Tags[$Tag])) {
$Tags[$Tag] = array('name'=>$Tag, 'count'=>1);
} else {
$Tags[$Tag]['count']++;
@ -231,7 +235,7 @@ function compare($X, $Y){
}
$JsonSimilar = array();
if(empty($SimilarArray)) {
if (empty($SimilarArray)) {
$DB->query("
SELECT
s2.ArtistID,

View File

@ -583,9 +583,9 @@ function header_link($SortKey,$DefaultWay = 'desc') {
);
}
} else {
$DisplayName='';
$DisplayName = '';
}
if ($GroupResults && (count($Torrents)>1 || isset($GroupedCategories[$CategoryID-1]))) {
if ($GroupResults && (count($Torrents) > 1 || isset($GroupedCategories[$CategoryID-1]))) {
// These torrents are in a group
$LastRemasterYear = '-';
$LastRemasterTitle = '';
@ -702,7 +702,7 @@ function header_link($SortKey,$DefaultWay = 'desc') {
'status' => 'success',
'response' => array(
'currentPage' => intval($Page),
'pages' => ceil($TorrentCount/TORRENTS_PER_PAGE),
'pages' => ceil($TorrentCount / TORRENTS_PER_PAGE),
'results' => $JsonGroups
)
)

View File

@ -146,8 +146,7 @@
print json_encode(array('status' => 'failure'));
}
function pullmediainfo($Array)
{
function pullmediainfo($Array) {
$NewArray = array();
foreach ($Array as $Item) {
$NewArray[] = array(

View File

@ -1,7 +1,6 @@
<?
//calculate ratio
//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 infinity, because we don't want strings being returned for a numeric value in our java
$Ratio = 0;
if ($LoggedUser['BytesUploaded'] == 0 && $LoggedUser['BytesDownloaded'] == 0) {
$Ratio = 0;
@ -23,7 +22,6 @@
$Cache->cache_value('news_latest_id', $CurrentNews, 0);
}
$NewMessages = $Cache->get_value('inbox_new_' . $LoggedUser['ID']);
if ($NewMessages === false) {
$DB->query("SELECT COUNT(UnRead) FROM pm_conversations_users WHERE UserID='" . $LoggedUser['ID'] . "' AND UnRead = '1' AND InInbox = '1'");
@ -36,7 +34,7 @@
if ($NewNotifications === false) {
$DB->query("SELECT COUNT(UserID) FROM users_notify_torrents WHERE UserID='$LoggedUser[ID]' AND UnRead='1'");
list($NewNotifications) = $DB->next_record();
/* if($NewNotifications && !check_perms('site_torrents_notify')) {
/* if ($NewNotifications && !check_perms('site_torrents_notify')) {
$DB->query("DELETE FROM users_notify_torrents WHERE UserID='$LoggedUser[ID]'");
$DB->query("DELETE FROM users_notify_filters WHERE UserID='$LoggedUser[ID]'");
} */
@ -78,7 +76,8 @@
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
$DB->query("SELECT COUNT(s.TopicID)
$DB->query("
SELECT COUNT(s.TopicID)
FROM users_subscriptions AS s
JOIN forums_last_read_topics AS l ON s.UserID = l.UserID AND s.TopicID = l.TopicID
JOIN forums_topics AS t ON l.TopicID = t.ID
@ -87,7 +86,7 @@
AND l.PostID < t.LastPostID
AND s.UserID = " . $LoggedUser['ID'] .
(!empty($RestrictedForums) ? "
AND f.ID NOT IN ('" . $RestrictedForums . "')" : ""));
AND f.ID NOT IN ('" . $RestrictedForums . "')" : ''));
list($NewSubscriptions) = $DB->next_record();
$Cache->cache_value('subscriptions_user_new_' . $LoggedUser['ID'], $NewSubscriptions, 0);
}

View File

@ -1,11 +1,10 @@
<?
$RequestTax = 0.1;
// Minimum and default amount of upload to remove from the user when they vote.
// Also change in static/functions/requests.js
$MinimumVote = 20*1024*1024;
$MinimumVote = 20 * 1024 * 1024;
/*
* This is the page that displays the request to the end user after being created.
@ -13,7 +12,7 @@
include(SERVER_ROOT.'/sections/requests/functions.php');
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT;
@ -96,7 +95,7 @@
//Votes time
$RequestVotes = get_votes_array($RequestID);
$VoteCount = count($RequestVotes['Voters']);
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0)));
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == 'Music' && $Year == 0)));
$UserCanEdit = (!$IsFilled && $LoggedUser['ID'] == $RequestorID && $VoteCount < 2);
$CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
@ -121,7 +120,7 @@
$JsonTopContributors = array();
$VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
for($i = 0; $i < $VoteMax; $i++) {
for ($i = 0; $i < $VoteMax; $i++) {
$User = array_shift($RequestVotes['Voters']);
$JsonTopContributors[] = array(
'userId' => (int) $User['UserID'],

View File

@ -4,31 +4,34 @@
$ID = (int) $_POST['id'];
$Note = $_POST['note'];
if(empty($FriendID) || empty($Type) || empty($ID)) {
if (empty($FriendID) || empty($Type) || empty($ID)) {
echo json_encode(array("status" => "error", "response" => "Error."));
die();
}
// Make sure the recipient is on your friends list and not some random dude.
$DB->query("SELECT
f.FriendID, u.Username
$DB->query("
SELECT
f.FriendID,
u.Username
FROM friends AS f
RIGHT JOIN users_enable_recommendations AS r
ON r.ID = f.FriendID AND r.Enable = 1
RIGHT JOIN users_main AS u
ON u.ID = f.FriendID
WHERE f.UserID = '$LoggedUser[ID]' AND f.FriendID = '$FriendID'");
WHERE f.UserID = '$LoggedUser[ID]'
AND f.FriendID = '$FriendID'");
if($DB->record_count() == 0) {
if ($DB->record_count() == 0) {
echo json_encode(array("status" => "error", "response" => "Not on friend list."));
die();
}
$Type = strtolower($Type);
$Link = "";
$Link = '';
// "a" vs "an", english language is so confusing.
// http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an
$Article = "a";
switch($Type) {
$Article = 'a';
switch ($Type) {
case 'torrent':
$Link = "torrents.php?id=".$ID;
$DB->query("SELECT Name FROM torrents_group WHERE ID = '$ID'");
@ -45,8 +48,8 @@
}
list($Name) = $DB->next_record();
$Subject = $LoggedUser['Username'] . " recommended you $Article " . $Type . "!";
$Body = $LoggedUser['Username'] . " recommended you the ".$Type." [url=https://".NONSSL_SITE_URL."/".$Link."]".$Name."[/url].";
if(!empty($Note)) {
$Body = $LoggedUser['Username'] . " recommended you the ".$Type." [url=https://".SSL_SITE_URL."/$Link]$Name".'[/url].';
if (!empty($Note)) {
$Body = $Body . "\n\n". $Note;
}

View File

@ -1,8 +1,8 @@
<?
if(isset($_GET['details'])) {
if(in_array($_GET['details'], array('day','week','overall','snatched','data','seeded'))) {
if (isset($_GET['details'])) {
if (in_array($_GET['details'], array('day','week','overall','snatched','data','seeded'))) {
$Details = $_GET['details'];
} else {
print json_encode(array('status' => 'failure'));
@ -45,7 +45,7 @@
$OuterResults = array();
if($Details == 'all' || $Details == 'day') {
if ($Details == 'all' || $Details == 'day') {
if (!$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
$DayAgo = time_minus(86400);
@ -65,7 +65,7 @@
}
$OuterResults[] = generate_torrent_json('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
}
if($Details == 'all' || $Details == 'week') {
if ($Details == 'all' || $Details == 'week') {
if (!$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
$WeekAgo = time_minus(604800);
@ -86,7 +86,7 @@
$OuterResults[] = generate_torrent_json('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
}
if($Details == 'all' || $Details == 'overall') {
if ($Details == 'all' || $Details == 'overall') {
if (!$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
// IMPORTANT NOTE - we use WHERE t.Seeders>500 in order to speed up this query. You should remove it!
@ -107,7 +107,7 @@
$OuterResults[] = generate_torrent_json('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
}
if(($Details == 'all' || $Details == 'snatched') && empty($Where)) {
if (($Details == 'all' || $Details == 'snatched') && empty($Where)) {
if (!$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
$Query = $BaseQuery;
@ -125,7 +125,7 @@
$OuterResults[] = generate_torrent_json('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
}
if(($Details == 'all' || $Details == 'data') && empty($Where)) {
if (($Details == 'all' || $Details == 'data') && empty($Where)) {
if (!$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
// IMPORTANT NOTE - we use WHERE t.Snatched>100 in order to speed up this query. You should remove it!
@ -145,7 +145,7 @@
$OuterResults[] = generate_torrent_json('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
}
if(($Details == 'all' || $Details == 'seeded') && empty($Where)) {
if (($Details == 'all' || $Details == 'seeded') && empty($Where)) {
if (!$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum)) {
if ($Cache->get_query_lock('top10')) {
$Query = $BaseQuery."
@ -191,13 +191,13 @@ function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
$Artist = Artists::display_artists(Artists::get_artist($GroupID), false, true);
$TruncArtist = substr($Artist, 0, strlen($Artist)-3);
$TagList=array();
$TagList = array();
if($TorrentTags!='') {
$TorrentTags=explode(' ',$TorrentTags);
if ($TorrentTags != '') {
$TorrentTags = explode(' ',$TorrentTags);
foreach ($TorrentTags as $TagKey => $TagName) {
$TagName = str_replace('_','.',$TagName);
$TagList[]=$TagName;
$TagList[] = $TagName;
}
}

View File

@ -1,6 +1,5 @@
<?php
require(SERVER_ROOT.'/sections/torrents/functions.php');
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
@ -11,19 +10,21 @@
$GroupID = (int)$_GET['id'];
if ($GroupID == 0) { error('bad id parameter', true); }
if ($GroupID == 0) {
error('bad id parameter', true);
}
$TorrentCache = get_group_info($GroupID, true, 0);
list($TorrentDetails, $TorrentList) = $TorrentCache;
$ArtistForm = Artists::get_artist($GroupID);
if($TorrentDetails['CategoryID'] == 0) {
$CategoryName = "Unknown";
if ($TorrentDetails['CategoryID'] == 0) {
$CategoryName = 'Unknown';
} else {
$CategoryName = $Categories[$TorrentDetails['CategoryID'] - 1];
}
$JsonMusicInfo = array();
if ($CategoryName == "Music") {
if ($CategoryName == 'Music') {
$JsonMusicInfo = array(
'composers' => $ArtistForm[4] == null ? array() : pullmediainfo($ArtistForm[4]),
'dj' => $ArtistForm[6] == null ? array() : pullmediainfo($ArtistForm[6]),
@ -33,8 +34,7 @@
'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]),
'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7])
);
}
else {
} else {
$JsonMusicInfo = NULL;
}

View File

@ -6,7 +6,7 @@ function compare($X, $Y) {
return($Y['count'] - $X['count']);
}
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
@ -501,8 +501,7 @@ function compare($X, $Y) {
<?
}
?>
<!-- <a href="#" id="recommend" class="brackets">Recommend</a>
-->
<!-- <a href="#" id="recommend" class="brackets">Recommend</a> -->
<?
if (check_perms('site_edit_wiki')) {
?>

View File

@ -1,5 +1,5 @@
<?
if(($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
if (($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
$DB->query("SELECT t.ID AS TorrentID,
t.GroupID AS GroupID
FROM xbt_files_users AS x
@ -7,7 +7,8 @@
WHERE t.Format='FLAC'
GROUP BY x.fid
HAVING COUNT(x.uid) = 1
ORDER BY t.LogScore DESC, t.Time ASC LIMIT 30");
ORDER BY t.LogScore DESC, t.Time ASC
LIMIT 30");
$GroupIDs = $DB->to_array('GroupID');
$Cache->cache_value('better_single_groupids', $GroupIDs, 30*60);
@ -41,11 +42,15 @@
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&amp;torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
if ($GroupYear > 0) {
$DisplayName.=" [$GroupYear]";
}
if ($ReleaseType > 0) {
$DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]";
}
$ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
if($ExtraInfo) {
if ($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
}
?>

View File

@ -6,11 +6,11 @@
require(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT;
if(check_perms('admin_manage_blog')) {
if(!empty($_REQUEST['action'])) {
switch($_REQUEST['action']) {
if (check_perms('admin_manage_blog')) {
if (!empty($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'deadthread' :
if(is_number($_GET['id'])){
if (is_number($_GET['id'])){
$DB->query("UPDATE blog SET ThreadID=NULL WHERE ID=".$_GET['id']);
$Cache->delete_value('blog');
$Cache->delete_value('feed_blog');
@ -19,7 +19,7 @@
break;
case 'takeeditblog':
authorize();
if(is_number($_POST['blogid']) && is_number($_POST['thread'])){
if (is_number($_POST['blogid']) && is_number($_POST['thread'])){
$DB->query("UPDATE blog SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."', ThreadID=".$_POST['thread']." WHERE ID='".db_string($_POST['blogid'])."'");
$Cache->delete_value('blog');
$Cache->delete_value('feed_blog');
@ -27,14 +27,14 @@
header('Location: blog.php');
break;
case 'editblog':
if(is_number($_GET['id'])){
if (is_number($_GET['id'])){
$BlogID = $_GET['id'];
$DB->query("SELECT Title, Body, ThreadID FROM blog WHERE ID=$BlogID");
list($Title, $Body, $ThreadID) = $DB->next_record();
}
break;
case 'deleteblog':
if(is_number($_GET['id'])){
if (is_number($_GET['id'])){
authorize();
$DB->query("DELETE FROM blog WHERE ID='".db_string($_GET['id'])."'");
$Cache->delete_value('blog');
@ -48,15 +48,15 @@
$Title = db_string($_POST['title']);
$Body = db_string($_POST['body']);
$ThreadID = $_POST['thread'];
if($ThreadID && is_number($ThreadID)) {
if ($ThreadID && is_number($ThreadID)) {
$DB->query("SELECT ForumID FROM forums_topics WHERE ID=".$ThreadID);
if($DB->record_count() < 1) {
if ($DB->record_count() < 1) {
error("No such thread exists!");
header('Location: blog.php');
}
} else {
$ThreadID = Misc::create_thread(ANNOUNCEMENT_FORUM_ID, $LoggedUser[ID], $Title, $Body);
if($ThreadID < 1) {
if ($ThreadID < 1) {
error(0);
}
}
@ -66,13 +66,13 @@
'".db_string($_POST['title'])."',
'".db_string($_POST['body'])."',
'".sqltime()."',
".$ThreadID.",
'".(($_POST['important']=='1')?'1':'0')."')");
$ThreadID,
'".(($_POST['important'] == '1') ? '1' : '0')."')");
$Cache->delete_value('blog');
if ($_POST['important']=='1') {
if ($_POST['important'] == '1') {
$Cache->delete_value('blog_latest_id');
}
if(isset($_POST['subscribe'])) {
if (isset($_POST['subscribe'])) {
$DB->query("INSERT IGNORE INTO users_subscriptions VALUES ('$LoggedUser[ID]', $ThreadID)");
$Cache->delete_value('subscriptions_user_'.$LoggedUser['ID']);
}
@ -91,19 +91,19 @@
<div class="pad">
<input type="hidden" name="action" value="<?=((empty($_GET['action'])) ? 'takenewblog' : 'takeeditblog')?>" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<? if(!empty($_GET['action']) && $_GET['action'] == 'editblog'){?>
<? if (!empty($_GET['action']) && $_GET['action'] == 'editblog'){?>
<input type="hidden" name="blogid" value="<?=$BlogID; ?>" />
<? }?>
<? } ?>
<h3>Title</h3>
<input type="text" name="title" size="95" <? if(!empty($Title)) { echo 'value="'.display_str($Title).'"'; } ?> /><br />
<input type="text" name="title" size="95"<? if (!empty($Title)) { echo ' value="'.display_str($Title).'"'; } ?> /><br />
<h3>Body</h3>
<textarea name="body" cols="95" rows="15"><? if(!empty($Body)) { echo display_str($Body); } ?></textarea> <br />
<input type="checkbox" value='1' name="important" id="important" <?=$Important?'checked="checked" ':''?>/><label for="important">Important</label><br />
<textarea name="body" cols="95" rows="15"><? if (!empty($Body)) { echo display_str($Body); } ?></textarea> <br />
<input type="checkbox" value="1" name="important" id="important"<?=$Important ? ' checked="checked"' : '' ?> /><label for="important">Important</label><br />
<h3>Thread ID</h3>
<input type="text" name="thread" size="8"<? if(!empty($ThreadID)) { echo 'value="'.display_str($ThreadID).'"'; } ?> />
<input type="text" name="thread" size="8"<? if (!empty($ThreadID)) { echo ' value="'.display_str($ThreadID).'"'; } ?> />
(Leave blank to create thread automatically)
<br /><br />
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe'])?' checked="checked"':''?> tabindex="2" />
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : '' ?> tabindex="2" />
<label for="subscribebox">Subscribe</label>
<div class="center">
@ -126,7 +126,8 @@
b.Body,
b.Time,
b.ThreadID
FROM blog AS b LEFT JOIN users_main AS um ON b.UserID=um.ID
FROM blog AS b
LEFT JOIN users_main AS um ON b.UserID=um.ID
ORDER BY Time DESC
LIMIT 20");
$Blog = $DB->to_array();
@ -147,19 +148,19 @@
<div id="blog<?=$BlogID?>" class="box">
<div class="head">
<strong><?=$Title?></strong> - posted <?=time_diff($BlogTime);?> by <?=$Author?>
<? if(check_perms('admin_manage_blog')) { ?>
<? if (check_perms('admin_manage_blog')) { ?>
- <a href="blog.php?action=editblog&amp;id=<?=$BlogID?>" class="brackets">Edit</a>
<a href="blog.php?action=deleteblog&amp;id=<?=$BlogID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Delete</a>
<? } ?>
<? } ?>
</div>
<div class="pad">
<?=$Text->full_format($Body)?>
<? if($ThreadID) { ?>
<? if ($ThreadID) { ?>
<br /><br />
<em><a href="forums.php?action=viewthread&amp;threadid=<?=$ThreadID?>">Discuss this post here</a></em>
<? if(check_perms('admin_manage_blog')) { ?>
<? if (check_perms('admin_manage_blog')) { ?>
<a href="blog.php?action=deadthread&amp;id=<?=$BlogID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Remove link</a>
<? }
<? }
} ?>
</div>
</div>

View File

@ -13,33 +13,35 @@
$WayTable = array('Ascending'=>'ASC', 'Descending'=>'DESC');
// Are we searching in bodies, or just names?
if(!empty($_GET['type'])) {
if (!empty($_GET['type'])) {
$Type = $_GET['type'];
if(!in_array($Type, array('c.name', 'description'))) {
if (!in_array($Type, array('c.name', 'description'))) {
$Type = 'c.name';
}
} else {
$Type = 'c.name';
}
if(!empty($_GET['search'])) {
if (!empty($_GET['search'])) {
// What are we looking for? Let's make sure it isn't dangerous.
$Search = db_string(trim($_GET['search']));
// Break search string down into individual words
$Words = explode(' ', $Search);
}
if(!empty($_GET['tags'])) {
if (!empty($_GET['tags'])) {
$Tags = explode(',',db_string(trim($_GET['tags'])));
foreach($Tags as $ID=>$Tag) {
foreach ($Tags as $ID=>$Tag) {
$Tags[$ID] = Misc::sanitize_tag($Tag);
}
}
if(!empty($_GET['cats'])) {
if (!empty($_GET['cats'])) {
$Categories = $_GET['cats'];
foreach($Categories as $Cat=>$Accept) {
if(empty($CollageCats[$Cat]) || !$Accept) { unset($Categories[$Cat]); }
foreach ($Categories as $Cat=>$Accept) {
if (empty($CollageCats[$Cat]) || !$Accept) {
unset($Categories[$Cat]);
}
}
$Categories = array_keys($Categories);
} else {
@ -47,13 +49,13 @@
}
// Ordering
if(!empty($_GET['order_by']) && !empty($OrderTable[$_GET['order_by']])) {
if (!empty($_GET['order_by']) && !empty($OrderTable[$_GET['order_by']])) {
$Order = $OrderTable[$_GET['order_by']];
} else {
$Order = 'ID';
}
if(!empty($_GET['order_way']) && !empty($WayTable[$_GET['order_way']])) {
if (!empty($_GET['order_way']) && !empty($WayTable[$_GET['order_way']])) {
$Way = $WayTable[$_GET['order_way']];
} else {
$Way = 'DESC';
@ -85,7 +87,7 @@
if(!empty($Search)) {
if (!empty($Search)) {
$SQL .= " AND $Type LIKE '%";
$SQL .= implode("%' AND $Type LIKE '%", $Words);
$SQL .= "%'";
@ -97,7 +99,7 @@
$_GET['tags_type'] = 1;
}
if(!empty($Tags)) {
if (!empty($Tags)) {
$SQL.= " AND (TagList LIKE '%";
if ($_GET['tags_type'] == 0) {
$SQL .= implode("%' OR TagList LIKE '%", $Tags);
@ -107,9 +109,9 @@
$SQL .= "%')";
}
if(!empty($_GET['userid'])) {
if (!empty($_GET['userid'])) {
$UserID = $_GET['userid'];
if(!is_number($UserID)) {
if (!is_number($UserID)) {
error(404);
}
$User = Users::user_info($UserID);
@ -117,11 +119,13 @@
$UserClass = $Perms['Class'];
$UserLink = '<a href="user.php?id='.$UserID.'">'.$User['Username'].'</a>';
if(!empty($_GET['contrib'])) {
if (!check_paranoia('collagecontribs', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if (!empty($_GET['contrib'])) {
if (!check_paranoia('collagecontribs', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$DB->query("SELECT DISTINCT CollageID FROM collages_torrents WHERE UserID = $UserID");
$CollageIDs = $DB->collect('CollageID');
if(empty($CollageIDs)) {
if (empty($CollageIDs)) {
$SQL .= " AND 0";
} else {
$SQL .= " AND c.ID IN(".db_string(implode(',', $CollageIDs)).")";
@ -133,7 +137,7 @@
$Categories[] = 0;
}
if(!empty($Categories)) {
if (!empty($Categories)) {
$SQL.=" AND CategoryID IN(".db_string(implode(',',$Categories)).")";
}
@ -180,8 +184,8 @@
<tr id="categories">
<td class="label">Categories:</td>
<td>
<? foreach($CollageCats as $ID=>$Cat) { ?>
<input type="checkbox" value="1" name="cats[<?=$ID?>]" id="cats_<?=$ID?>"<?if(in_array($ID, $Categories)) { echo ' checked="checked"'; }?> />
<? foreach ($CollageCats as $ID=>$Cat) { ?>
<input type="checkbox" value="1" name="cats[<?=$ID?>]" id="cats_<?=$ID?>"<? if (in_array($ID, $Categories)) { echo ' checked="checked"'; }?> />
<label for="cats_<?=$ID?>"><?=$Cat?></label>&nbsp;&nbsp;
<? } ?>
</td>
@ -189,21 +193,21 @@
<tr id="search_name_description">
<td class="label">Search in:</td>
<td>
<input type="radio" name="type" value="c.name" <? if($Type == 'c.name') { echo 'checked="checked" '; }?>/> Names&nbsp;&nbsp;
<input type="radio" name="type" value="description" <? if($Type == 'description') { echo 'checked="checked" '; }?>/> Descriptions
<input type="radio" name="type" value="c.name" <? if ($Type == 'c.name') { echo 'checked="checked" '; }?>/> Names&nbsp;&nbsp;
<input type="radio" name="type" value="description" <? if ($Type == 'description') { echo 'checked="checked" '; }?>/> Descriptions
</td>
</tr>
<tr id="order_by">
<td class="label">Order by:</td>
<td>
<select name="order_by" class="ft_order_by">
<? foreach($OrderVals as $Cur){ ?>
<option value="<?=$Cur?>"<? if(isset($_GET['order_by']) && $_GET['order_by'] == $Cur || (!isset($_GET['order_by']) && $Cur == 'Time')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? foreach ($OrderVals as $Cur) { ?>
<option value="<?=$Cur?>"<? if (isset($_GET['order_by']) && $_GET['order_by'] == $Cur || (!isset($_GET['order_by']) && $Cur == 'Time')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? } ?>
</select>
<select name="order_way" class="ft_order_way">
<? foreach($WayVals as $Cur){ ?>
<option value="<?=$Cur?>"<? if(isset($_GET['order_way']) && $_GET['order_way'] == $Cur || (!isset($_GET['order_way']) && $Cur == 'Descending')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? foreach ($WayVals as $Cur) { ?>
<option value="<?=$Cur?>"<? if (isset($_GET['order_way']) && $_GET['order_way'] == $Cur || (!isset($_GET['order_way']) && $Cur == 'Descending')) { echo ' selected="selected"'; } ?>><?=$Cur?></option>
<? } ?>
</select>
</td>
@ -219,10 +223,10 @@
<? } // if (!$BookmarkView) ?>
<div class="linkbox">
<? if (!$BookmarkView) {
if (check_perms('site_collages_create')) { ?>
if (check_perms('site_collages_create')) { ?>
<a href="collages.php?action=new" class="brackets">New collage</a>
<? }
if (check_perms('site_collages_personal')) {
if (check_perms('site_collages_personal')) {
$DB->query("SELECT ID FROM collages WHERE UserID='$LoggedUser[ID]' AND CategoryID='0' AND Deleted='0'");
$CollageCount = $DB->record_count();
@ -234,22 +238,19 @@
<? } elseif ($CollageCount > 1) { ?>
<a href="collages.php?action=mine" class="brackets">Personal collages</a>
<? }
}
if (check_perms('site_collages_subscribe')) { ?>
}
if (check_perms('site_collages_subscribe')) { ?>
<a href="userhistory.php?action=subscribed_collages" class="brackets">Subscribed collages</a>
<? } ?>
<a href="bookmarks.php?type=collages" class="brackets">Bookmarked collages</a>
<?
if (check_perms('site_collages_recover')) { ?>
if (check_perms('site_collages_recover')) { ?>
<a href="collages.php?action=recover" class="brackets">Recover collage</a>
<?
}
if (check_perms('site_collages_create') || check_perms('site_collages_personal') || check_perms('site_collages_recover')) {
<? }
if (check_perms('site_collages_create') || check_perms('site_collages_personal') || check_perms('site_collages_recover')) {
?>
<br />
<?
}
?>
<? } ?>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>" class="brackets">Collages you started</a>
<a href="collages.php?userid=<?=$LoggedUser['ID']?>&amp;contrib=1" class="brackets">Collages you contributed to</a>
<? } else { ?>
@ -260,7 +261,7 @@
<? } ?>
<br /><br />
<?
$Pages=Format::get_pages($Page,$NumResults,COLLAGES_PER_PAGE,9);
$Pages = Format::get_pages($Page,$NumResults,COLLAGES_PER_PAGE,9);
echo $Pages;
?>
</div>
@ -274,8 +275,9 @@
<? } ?>
</div><!--box-->
</div><!--content-->
<? View::show_footer(); die();
} ?>
<? View::show_footer();
die();
} ?>
<table width="100%" class="collage_table">
<tr class="colhead">
<td>Category</td>
@ -299,7 +301,7 @@
<td>
<a href="collages.php?id=<?=$ID?>"><?=$Name?></a>
<? if ($BookmarkView) { ?>
<span style="float:right">
<span style="float: right;">
<a href="#" onclick="Unbookmark('collage', <?=$ID?>,'');return false;" class="brackets">Remove bookmark</a>
</span>
<? } ?>
@ -308,7 +310,8 @@
<td><?=number_format((int)$NumTorrents)?></td>
<td><?=Users::format_username($UserID, false, false, false)?></td>
</tr>
<? } ?>
<?
} ?>
</table>
<div class="linkbox"><?=$Pages?></div>
</div>

View File

@ -7,7 +7,7 @@ function compare($X, $Y){
return($Y['count'] - $X['count']);
}
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
$Text = new TEXT;
@ -30,8 +30,8 @@ function compare($X, $Y){
$DB->query("SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'");
if ($DB->record_count() > 0) {
list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record();
$TorrentList='';
$CollageList='';
$TorrentList = '';
$CollageList = '';
} else {
$Deleted = '1';
}
@ -258,7 +258,7 @@ function compare($X, $Y){
</td>
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
<td><?=number_format($Torrent['Snatched'])?></td>
<td<?=($Torrent['Seeders']==0)?' class="r00"':''?>><?=number_format($Torrent['Seeders'])?></td>
<td<?=($Torrent['Seeders'] == 0) ? ' class="r00"' : '' ?>><?=number_format($Torrent['Seeders'])?></td>
<td><?=number_format($Torrent['Leechers'])?></td>
</tr>
<?
@ -279,7 +279,7 @@ function compare($X, $Y){
}
$DisplayName .= $GroupName;
if ($GroupYear > 0) {
$DisplayName = $DisplayName. ' ['. $GroupYear .']';
$DisplayName = $DisplayName. " [$GroupYear]";
}
?>
<li class="image_group_<?=$GroupID?>">
@ -296,7 +296,7 @@ function compare($X, $Y){
</a>
</li>
<?
$Collage[]=ob_get_clean();
$Collage[] = ob_get_clean();
}
if (!check_perms('site_collages_delete') && ($Locked || ($MaxGroups > 0 && $NumGroups >= $MaxGroups) || ($MaxGroupsPerUser > 0 && $NumGroupsByUser >= $MaxGroupsPerUser))) {
@ -350,10 +350,9 @@ function compare($X, $Y){
<a href="#" id="bookmarklink_collage_<?=$CollageID?>" class="brackets" onclick="Bookmark('collage', <?=$CollageID?>,'Remove bookmark');return false;">Bookmark</a>
<? }
?>
<!-- <a href="#" id="recommend" class="brackets">Recommend</a>
-->
<!-- <a href="#" id="recommend" class="brackets">Recommend</a> -->
<?
if (check_perms('site_collages_manage') && !$Locked) { ?>
if (check_perms('site_collages_manage') && !$Locked) { ?>
<a href="collages.php?action=manage&amp;collageid=<?=$CollageID?>" class="brackets">Manage torrents</a>
<? } ?>
<a href="reports.php?action=report&amp;type=collage&amp;id=<?=$CollageID?>" class="brackets">Report collage</a>
@ -395,20 +394,20 @@ function compare($X, $Y){
<input type="hidden" name="list[]" value="<?=$ListItem?>" />
<span class="float_left"><?=$ZIPOptions[$ListItem]['2']?></span>
<span class="remove remove_collector"><a href="#" onclick="remove_selection('<?=$ListItem?>');return false;" class="float_right brackets">X</a></span>
<br style="clear:all;" />
<br style="clear: all;" />
</li>
<? } ?>
</ul>
<select id="formats" style="width:180px">
<?
$OpenGroup = false;
$LastGroupID=-1;
$LastGroupID = -1;
foreach ($ZIPOptions as $Option) {
list($GroupID,$OptionID,$OptName) = $Option;
if ($GroupID!=$LastGroupID) {
$LastGroupID=$GroupID;
if ($GroupID != $LastGroupID) {
$LastGroupID = $GroupID;
if ($OpenGroup) { ?>
</optgroup>
<? } ?>
@ -446,7 +445,7 @@ function compare($X, $Y){
<div class="box box_tags">
<div class="head"><strong>Top tags</strong></div>
<div class="pad">
<ol style="padding-left:5px;">
<ol style="padding-left: 5px;">
<?
Tags::format_top(5, 'collages.php?action=search&amp;tags=');
?>
@ -457,7 +456,7 @@ function compare($X, $Y){
<div class="box box_artists">
<div class="head"><strong>Top artists</strong></div>
<div class="pad">
<ol style="padding-left:5px;">
<ol style="padding-left: 5px;">
<?
uasort($TopArtists, 'compare');
$i = 0;

View File

@ -1,36 +1,52 @@
<?
enforce_login();
if(empty($_REQUEST['action'])) { $_REQUEST['action']=''; }
if (empty($_REQUEST['action'])) {
$_REQUEST['action'] = '';
}
switch($_REQUEST['action']) {
switch ($_REQUEST['action']) {
case 'new':
if(!check_perms('site_collages_create')) { error(403); }
if (!check_perms('site_collages_create')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/new.php');
break;
case 'new_handle':
if(!check_perms('site_collages_create')) { error(403); }
if (!check_perms('site_collages_create')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/new_handle.php');
break;
case 'add_torrent':
case 'add_torrent_batch':
if(!check_perms('site_collages_manage')) { error(403); }
if (!check_perms('site_collages_manage')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/add_torrent.php');
break;
case 'manage':
if(!check_perms('site_collages_manage')) { error(403); }
if (!check_perms('site_collages_manage')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/manage.php');
break;
case 'manage_handle':
if(!check_perms('site_collages_manage')) { error(403); }
if (!check_perms('site_collages_manage')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/manage_handle.php');
break;
case 'edit':
if(!check_perms('site_edit_wiki')) { error(403); }
if (!check_perms('site_edit_wiki')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/edit.php');
break;
case 'edit_handle':
if(!check_perms('site_edit_wiki')) { error(403); }
if (!check_perms('site_edit_wiki')) {
error(403);
}
require(SERVER_ROOT.'/sections/collages/edit_handle.php');
break;
case 'delete':
@ -59,30 +75,42 @@
require(SERVER_ROOT.'/sections/collages/download.php');
break;
case 'recover':
//if(!check_perms('')) { error(403); }
//if (!check_perms('')) {
// error(403);
//}
require(SERVER_ROOT.'/sections/collages/recover.php');
break;
case 'create_personal':
if(!check_perms('site_collages_personal')) {
if (!check_perms('site_collages_personal')) {
error(403);
}
$DB->query("SELECT COUNT(ID) FROM collages WHERE UserID='$LoggedUser[ID]' AND CategoryID='0' AND Deleted='0'");
$DB->query("
SELECT
COUNT(ID)
FROM collages
WHERE UserID='$LoggedUser[ID]'
AND CategoryID='0'
AND Deleted='0'");
list($CollageCount) = $DB->next_record();
if($CollageCount >= $LoggedUser['Permissions']['MaxCollages']) {
if ($CollageCount >= $LoggedUser['Permissions']['MaxCollages']) {
list($CollageID) = $DB->next_record();
header('Location: collage.php?id='.$CollageID);
die();
}
$NameStr = ($CollageCount > 0)?" no. " . ($CollageCount + 1):'';
$DB->query("INSERT INTO collages (Name, Description, CategoryID, UserID) VALUES ('$LoggedUser[Username]\'s personal collage$NameStr', 'Personal collage for $LoggedUser[Username]. The first 5 albums will appear on his or her [url=http:\/\/".NONSSL_SITE_URL."\/user.php?id=$LoggedUser[ID]]profile[\/url].', '0', $LoggedUser[ID])");
$DB->query("
INSERT INTO collages
(Name, Description, CategoryID, UserID)
VALUES
('$LoggedUser[Username]\'s personal collage$NameStr', 'Personal collage for $LoggedUser[Username]. The first 5 albums will appear on his or her [url=https:\/\/".SSL_SITE_URL."\/user.php?id=$LoggedUser[ID]]profile[\/url].', '0', $LoggedUser[ID])");
$CollageID = $DB->inserted_id();
header('Location: collage.php?id='.$CollageID);
die();
default:
if(!empty($_GET['id'])) {
if (!empty($_GET['id'])) {
require(SERVER_ROOT.'/sections/collages/collage.php');
} else {
require(SERVER_ROOT.'/sections/collages/browse.php');

View File

@ -20,7 +20,8 @@
if (!empty($Error)) { ?>
<div class="save_message error"><?=$Error?></div>
<br />
<? } ?>
<?
} ?>
<form class="create_form" name="collage" action="collages.php" method="post">
<input type="hidden" name="action" value="new_handle" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
@ -28,8 +29,8 @@
<tr id="collagename">
<td class="label"><strong>Name</strong></td>
<td>
<input type="text" class="<?=$NoName?'hidden':''?>" name="name" size="60" id="namebox" value="<?=display_str($Name)?>" />
<span id="personal" class="<?=$NoName?'':'hidden'?>" style="font-style: oblique"><strong><?=$LoggedUser['Username']?>'s personal collage</strong></span>
<input type="text"<?=$NoName ? ' class="hidden"' : '' ?> name="name" size="60" id="namebox" value="<?=display_str($Name)?>" />
<span id="personal"<?=$NoName ? '' : ' class="hidden"' ?> style="font-style: oblique;"><strong><?=$LoggedUser['Username']?>'s personal collage</strong></span>
</td>
</tr>
<tr>
@ -39,26 +40,29 @@
<?
array_shift($CollageCats);
foreach($CollageCats as $CatID=>$CatName) { ?>
<option value="<?=$CatID+1?>"<?=(($CatID+1 == $Category) ? ' selected="selected"' : '')?>><?=$CatName?></option>
<? }
foreach ($CollageCats as $CatID=>$CatName) : ?>
<option value="<?=$CatID + 1 ?>"<?=(($CatID + 1 == $Category) ? ' selected="selected"' : '')?>><?=$CatName?></option>
<?
endforeach;
$DB->query("SELECT COUNT(ID) FROM collages WHERE UserID='$LoggedUser[ID]' AND CategoryID='0' AND Deleted='0'");
list($CollageCount) = $DB->next_record();
if(($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
if (($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
<option value="0"<?=(($Category === '0') ? ' selected="selected"' : '')?>>Personal</option>
<? } ?>
<?
} ?>
</select>
<br />
<ul>
<li><strong>Theme</strong> - A collage containing releases that all relate to a certain theme (e.g. "Searching for the Perfect Beat", "Concept Albums", "Funky Groove", etc.).</li>
<li><strong>Genre introduction</strong> - A subjective introduction to a genre composed by our own users.</li>
<li><strong>Discography</strong> - A collage containing all the releases of an artist. Useful for keeping track of side-projects.</li>
<li><strong>Discography</strong> - A collage containing all the releases of an artist, which can be useful for keeping track of side projects.</li>
<li><strong>Label</strong> - A collage containing all the releases of a particular record label.</li>
<li><strong>Staff picks</strong> - A listing of recommendations picked by the staff on special occasions.</li>
<li><strong>Charts</strong> - Contains all the releases that comprise a certain type of chart (e.g. Billboard Top 100, Pitchfork Top 100, What.cd Top 10, etc.).</li>
<li><strong>Charts</strong> - Contains all the releases that comprise a certain type of chart (e.g. Billboard Top 100, Pitchfork Top 100, What.CD Top 10, etc.).</li>
<?
if(($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
<li><strong>Personal</strong> - You can put whatever you want here. It's your own personal collage.</li>
if (($CollageCount < $LoggedUser['Permissions']['MaxCollages']) && check_perms('site_collages_personal')) { ?>
<li><strong>Personal</strong> - You can put whatever you want here. It is your own personal collage.</li>
<? } ?>
</ul>
</td>

View File

@ -35,11 +35,11 @@
}
}
if(!$Err) {
if (!$Err) {
$DB->query("SELECT ID,Deleted FROM collages WHERE Name='$P[name]'");
if($DB->record_count()) {
if ($DB->record_count()) {
list($ID, $Deleted) = $DB->next_record();
if($Deleted) {
if ($Deleted) {
$Err = "That collection already exists but needs to be recovered; please <a href=\"staffpm.php\">contact</a> the staff team!";
} else {
$Err = "That collection already exists: <a href=\"/collages.php?id=$ID\">$ID</a>.";
@ -47,13 +47,13 @@
}
}
if(!$Err) {
if(empty($CollageCats[$P['category']])) {
if (!$Err) {
if (empty($CollageCats[$P['category']])) {
$Err = 'Please select a category';
}
}
if($Err) {
if ($Err) {
//error($Err);
$Err = urlencode($Err);
$Name = urlencode($_POST['name']);
@ -65,7 +65,7 @@
}
$TagList = explode(',',$_POST['tags']);
foreach($TagList as $ID=>$Tag) {
foreach ($TagList as $ID=>$Tag) {
$TagList[$ID] = Misc::sanitize_tag($Tag);
}
$TagList = implode(' ',$TagList);

View File

@ -2,10 +2,11 @@
$OtherLink = '';
$Title = 'Artist comments made by '.($Self?'you':$Username);
$Header = 'Artist comments left by '.($Self?'you':Users::format_username($UserID, false, false, false)).'';
$Title = 'Artist comments made by '.($Self ? 'you' : $Username);
$Header = 'Artist comments left by '.($Self ? 'you' : Users::format_username($UserID, false, false, false)).'';
$Comments = $DB->query("SELECT
$Comments = $DB->query("
SELECT
SQL_CALC_FOUND_ROWS
ac.AuthorID,
a.ArtistID,
@ -15,16 +16,11 @@
ac.AddedTime,
ac.EditedTime,
ac.EditedUserID as EditorID
FROM artists_group as a
JOIN artist_comments as ac ON ac.ArtistID = a.ArtistID
WHERE ac.AuthorId = $UserID
GROUP BY ac.ID
ORDER BY ac.AddedTime DESC
LIMIT $Limit;
");
@ -53,9 +49,9 @@
</div>
<?
while(list($UserID, $ArtistID, $ArtistName, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
while (list($UserID, $ArtistID, $ArtistName, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
$permalink = "artist.php?id=$ArtistID&amp;postid=$PostID#post$PostID";
$postheader = " on " . "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a>";
$postheader = ' on ' . "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a>";
comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime);
@ -63,6 +59,5 @@
<div class="linkbox"><?= $Pages; ?></div>
</div>
<?
View::show_footer();
View::show_footer();

View File

@ -15,41 +15,41 @@
function comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime) {
global $Text,$HeavyInfo;
$UserInfo = Users::user_info($UserID);
$postheader = "by <strong>" . Users::format_username($UserID, true, true, true, true, false) . "</strong> "
$postheader = 'by <strong>' . Users::format_username($UserID, true, true, true, true, false) . '</strong> '
. time_diff($AddedTime) . $postheader;
?>
<table class='forum_post box vertical_margin<?=$noavatar ? ' noavatar' : ''?>' id="post<?=$PostID?>">
<table class="forum_post box vertical_margin<?=$noavatar ? ' noavatar' : '' ?>" id="post<?=$PostID?>">
<colgroup>
<? if(empty($UserInfo['DisableAvatars'])) { ?>
<? if (empty($UserInfo['DisableAvatars'])) { ?>
<col class="col_avatar" />
<? } ?>
<col class="col_post_body" />
</colgroup>
<tr class='colhead_dark'>
<td colspan="<?=empty($UserInfo['DisableAvatars']) ? 2 : 1?>">
<span style="float:left;"><a href='<?=$permalink ?>'>#<?=$PostID?></a>
<tr class="colhead_dark">
<td colspan="<?=empty($UserInfo['DisableAvatars']) ? 2 : 1 ?>">
<span style="float: left;"><a href="<?=$permalink ?>">#<?=$PostID?></a>
<?=$postheader ?>
</span>
</td>
</tr>
<tr>
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
<td class='avatar' valign="top">
<? if($UserInfo['Avatar']){ ?>
<img src='<?=$UserInfo['Avatar']?>' width='150' alt="<?=$UserInfo['Username']?>'s avatar" />
<? } else { ?>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
<td class="avatar" valign="top">
<? if ($UserInfo['Avatar']) { ?>
<img src="<?=$UserInfo['Avatar']?>" width="150" alt="<?=$UserInfo['Username']?>'s avatar" />
<? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
<? } ?>
<? } ?>
</td>
<? } ?>
<td class='body' valign="top">
<? } ?>
<td class="body" valign="top">
<?=$Text->full_format($Body) ?>
<? if($EditorID){ ?>
<? if ($EditorID) { ?>
<br /><br />
Last edited by
<?=Users::format_username($EditorID, false, false, false) ?> <?=time_diff($EditedTime)?>
<? } ?>
<? } ?>
</td>
</tr>
</table>

View File

@ -1,7 +1,7 @@
<?php
if(!empty($_REQUEST['action'])) {
if($_REQUEST['action'] == 'my_torrents') {
if (!empty($_REQUEST['action'])) {
if ($_REQUEST['action'] == 'my_torrents') {
$MyTorrents = true;
} elseif ($_REQUEST['action'] == 'torrents') {
$MyTorrents = false;
@ -14,19 +14,18 @@
$OtherLink = '<a href="comments.php?action=requests" class="brackets">Request comments</a> <a href="comments.php?action=artists" class="brackets">Artist comments</a><br/>';
if($MyTorrents) {
if ($MyTorrents) {
$Conditions = "WHERE t.UserID = $UserID AND tc.AuthorID != t.UserID AND tc.AddedTime > t.Time";
$Title = 'Comments left on your torrents';
$Header = 'Comments left on your uploads';
if($Self) {
if ($Self) {
$OtherLink .= '<a href="comments.php?action=torrents" class="brackets">Display comments you have made</a>';
}
}
else {
} else {
$Conditions = "WHERE tc.AuthorID = $UserID";
$Title = 'Comments made by '.($Self?'you':$Username);
$Header = 'Torrent comments left by '.($Self?'you':Users::format_username($UserID, false, false, false)).'';
if($Self) {
if ($Self) {
$OtherLink .= '<a href="comments.php?action=my_torrents" class="brackets">Display comments left on your uploads</a>';
}
}
@ -42,17 +41,12 @@
tc.AddedTime,
tc.EditedTime,
tc.EditedUserID as EditorID
FROM torrents as t
JOIN torrents_comments as tc ON tc.GroupID = t.GroupID
JOIN torrents_group as tg ON t.GroupID = tg.ID
$Conditions
GROUP BY tc.ID
ORDER BY tc.AddedTime DESC
LIMIT $Limit;
");
@ -81,10 +75,9 @@
<?=$Pages?>
</div>
<?
while(list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
while (list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
$permalink = "torrents.php?id=$GroupID&amp;postid=$PostID#post$PostID";
$postheader = " on " . Artists::display_artists($Artists[$GroupID]) . " <a href=\"torrents.php?id=$GroupID\">$Title</a>";
$postheader = ' on ' . Artists::display_artists($Artists[$GroupID]) . " <a href=\"torrents.php?id=$GroupID\">$Title</a>";
comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime);
@ -93,5 +86,5 @@
</div>
<?
View::show_footer();
View::show_footer();

View File

@ -46,7 +46,7 @@
<div class="header">
<h2>Donate</h2>
</div>
<div class="box pad" style="padding:10px 10px 10px 20px;">
<div class="box pad" style="padding: 10px 10px 10px 20px;">
<p>We accept donations to cover the costs associated with running the site and tracker. These costs come from the rental and purchase of the hardware the site runs on (servers, components, etc.), in addition to operating expenses (bandwidth, power, etc.).</p>
<p>Because we do not have any advertisements or sponsorships and this service is provided free of charge, we are entirely reliant upon user donations. If you are financially able, please consider making a donation to help us pay the bills!</p>
<p>We currently only accept one payment method: PayPal. Because of the fees they charge, there is a <strong>minimum donation amount of <?=PAYPAL_SYMBOL?> <?=PAYPAL_MINIMUM?></strong> (Please note, this is only a minimum amount and we greatly appreciate any extra you can afford.).</p>
@ -55,9 +55,9 @@
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="<?=PAYPAL_ADDRESS?>" />
<input type="hidden" name="return" value="http://<?=SITE_URL?>/donate.php?action=complete" />
<input type="hidden" name="cancel_return" value="http://<?=SITE_URL?>/donate.php?action=cancel" />
<input type="hidden" name="notify_url" value="http://<?=NONSSL_SITE_URL?>/donate.php?action=ipn" />
<input type="hidden" name="return" value="https://<?=SSL_SITE_URL?>/donate.php?action=complete" />
<input type="hidden" name="cancel_return" value="https://<?=SSL_SITE_URL?>/donate.php?action=cancel" />
<input type="hidden" name="notify_url" value="https://<?=SSL_SITE_URL?>/donate.php?action=ipn" />
<input type="hidden" name="item_name" value="Donation" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="custom" value="<?=$LoggedUser['ID']?>" />
@ -71,7 +71,7 @@
</div>
<h3>What you will receive for a 5&euro; or 0.5 BTC minimum donation</h3>
<div class="box pad" style="padding:10px 10px 10px 20px;">
<div class="box pad" style="padding: 10px 10px 10px 20px;">
<ul>
<?
if ($LoggedUser['Donor']) { ?>
@ -92,7 +92,7 @@
<p>Please be aware that by making a donation you aren't purchasing donor status or invites. You are helping us pay the bills and cover the costs of running the site. We are doing our best to give our love back to donors, but sometimes it might take more than 48 hours. Feel free to contact us by sending us a <a href="staffpm.php">Staff PM</a> regarding any matter. We will answer as quickly as possible.</p>
</div>
<h3>What you will <strong>not</strong> receive</h3>
<div class="box pad" style="padding:10px 10px 10px 20px;">
<div class="box pad" style="padding: 10px 10px 10px 20px;">
<ul>
<? if ($LoggedUser['Donor']) { ?>
<li>2 more invitations; these are one time only.</li>

View File

@ -47,7 +47,7 @@
<div class="header">
<h2>Donate</h2>
</div>
<div class="box pad" style="padding:10px 10px 10px 20px;">
<div class="box pad" style="padding: 10px 10px 10px 20px;">
<p>We accept donations to cover the costs associated with running the site and tracker. These costs come from the rental and purchase of the hardware the site runs on (servers, components, etc.), in addition to operating expenses (bandwidth, power, etc.).</p>
<p>Because we do not have any advertisements or sponsorships and this service is provided free of charge, we are entirely reliant upon user donations. If you are financially able, please consider making a donation to help us pay the bills!</p>
<p>We currently only accept one payment method: PayPal. Because of the fees they charge, there is a <strong>minimum donation amount of <?=PAYPAL_SYMBOL?> <?=PAYPAL_MINIMUM?></strong> (Please note, this is only a minimum amount and we greatly appreciate any extra you can afford.).</p>
@ -56,9 +56,9 @@
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="<?=PAYPAL_ADDRESS?>" />
<input type="hidden" name="return" value="http://<?=SITE_URL?>/donate.php?action=complete" />
<input type="hidden" name="cancel_return" value="http://<?=SITE_URL?>/donate.php?action=cancel" />
<input type="hidden" name="notify_url" value="http://<?=NONSSL_SITE_URL?>/donate.php?action=ipn" />
<input type="hidden" name="return" value="https://<?=SSL_SITE_URL?>/donate.php?action=complete" />
<input type="hidden" name="cancel_return" value="https://<?=SSL_SITE_URL?>/donate.php?action=cancel" />
<input type="hidden" name="notify_url" value="https://<?=SSL_SITE_URL?>/donate.php?action=ipn" />
<input type="hidden" name="item_name" value="Donation" />
<input type="hidden" name="amount" value="" />
<input type="hidden" name="custom" value="<?=$LoggedUser['ID']?>" />

View File

@ -63,7 +63,7 @@
Misc::send_pm($_POST['custom'], 0, 'Thank you for your donation', 'Your donation from '.$_POST['payer_email'].' of '.$_POST['mc_gross'].' '.PAYPAL_CURRENCY.' has been successfully processed. Unfortunately however this donation was less than the specified minimum donation of '.PAYPAL_MINIMUM.' '.PAYPAL_CURRENCY.' and while we are grateful, no special privileges have been awarded to you.');
} else {
//Failed pending donation
$Message = "User http://".NONSSL_SITE_URL."/user.php?id=".$_POST['custom']." had donation of ".$TotalDonated." ".PAYPAL_CURRENCY." at ".$DonationTime." UTC from ".$_POST['payer_email']." returned.";
$Message = "User https://".SSL_SITE_URL."/user.php?id=".$_POST['custom']." had donation of ".$TotalDonated." ".PAYPAL_CURRENCY." at ".$DonationTime." UTC from ".$_POST['payer_email']." returned.";
$DB->query('SELECT SUM(Amount), MIN(Time) FROM donations WHERE UserID=\''.$_POST['custom'].'\';');
list($TotalDonated,$DonationTime) = $DB->next_record();
if ($TotalDonated+$_POST['mc_gross'] == 0) {

View File

@ -22,7 +22,7 @@
$User = (int)$_GET['user'];
if(!$Enabled = $Cache->get_value('enabled_'.$User)){
if (!$Enabled = $Cache->get_value('enabled_'.$User)) {
require(SERVER_ROOT.'/classes/class_mysql.php');
$DB=NEW DB_MYSQL; //Load the database wrapper
$DB->query("SELECT Enabled FROM users_main WHERE ID='$User'");
@ -40,7 +40,7 @@
}
$Feed->open_feed();
switch($_GET['feed']) {
switch ($_GET['feed']) {
case 'feed_news':
include(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT;

View File

@ -12,7 +12,7 @@
// Check for lame SQL injection attempts
$ForumID = $_GET['forumid'];
if(!is_number($ForumID)) {
if (!is_number($ForumID)) {
error(0);
}
@ -28,11 +28,12 @@
// Caching anything beyond the first page of any given forum is just wasting ram
// users are more likely to search then to browse to page 2
if($Page==1) {
if ($Page == 1) {
list($Forum,,,$Stickies) = $Cache->get_value('forums_'.$ForumID);
}
if(!isset($Forum) || !is_array($Forum)) {
$DB->query("SELECT
if (!isset($Forum) || !is_array($Forum)) {
$DB->query("
SELECT
t.ID,
t.Title,
t.AuthorID,
@ -48,7 +49,7 @@
LIMIT $Limit"); // Can be cached until someone makes a new post
$Forum = $DB->to_array('ID',MYSQLI_ASSOC, false);
if($Page==1) {
if ($Page == 1) {
$DB->query("SELECT COUNT(ID) FROM forums_topics WHERE ForumID='$ForumID' AND IsSticky='1'");
list($Stickies) = $DB->next_record();
$Cache->cache_value('forums_'.$ForumID, array($Forum,'',0,$Stickies), 0);
@ -56,16 +57,22 @@
}
if(!isset($Forums[$ForumID])) { error(404); }
if (!isset($Forums[$ForumID])) {
error(404);
}
// Make sure they're allowed to look at the page
if (!check_perms('site_moderate_forums')) {
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] === 0) { error(403); }
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] === 0) {
error(403);
}
}
$ForumName = display_str($Forums[$ForumID]['Name']);
if($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) { error(403); }
if ($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRead'] > $LoggedUser['Class']) {
error(403);
}
// Start printing
View::show_header('Forums > '. $Forums[$ForumID]['Name']);
@ -73,10 +80,10 @@
<div class="thin">
<h2><a href="forums.php">Forums</a> &gt; <?=$ForumName?></h2>
<div class="linkbox">
<? if(check_forumperm($ForumID, 'Write') && check_forumperm($ForumID, 'Create')){ ?>
<? if (check_forumperm($ForumID, 'Write') && check_forumperm($ForumID, 'Create')) { ?>
<a href="forums.php?action=new&amp;forumid=<?=$ForumID?>" class="brackets">New thread</a>
<? } ?>
<a href="#" onclick="$('#searchforum').toggle(); this.innerHTML = (this.innerHTML == 'Search this forum'?'Hide search':'Search this forum'); return false;" class="brackets">Search this forum</a>
<a href="#" onclick="$('#searchforum').toggle(); this.innerHTML = (this.innerHTML == 'Search this forum' ? 'Hide search' : 'Search this forum'); return false;" class="brackets">Search this forum</a>
<div id="searchforum" class="hidden center">
<div style="display: inline-block;">
<h3>Search this forum:</h3>
@ -106,7 +113,7 @@
<td><input type="text" id="username" name="user" size="70" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center"><input type="submit" name="submit" value="Search" /></td>
<td colspan="2" style="text-align: center;"><input type="submit" name="submit" value="Search" /></td>
</tr>
</table>
</form>
@ -117,9 +124,9 @@
<?
/*
if(check_perms('users_mod')) {
if (check_perms('users_mod')) {
$DB->query("SELECT ForumID from subscribed_forums WHERE ForumID='$ForumID' AND SubscriberID='$LoggedUser[ID]'");
if($DB->record_count() == 0) { ?>
if ($DB->record_count() == 0) { ?>
<a href="forums.php?action=forum_subscribe&amp;perform=add&amp;forumid=<?=$ForumID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Subscribe to forum</a>
<? } else { ?>
<a href="forums.php?action=forum_subscribe&amp;perform=remove&amp;forumid=<?=$ForumID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Unsubscribe from forum</a>
@ -129,15 +136,15 @@
?>
</div>
<? if(check_perms('site_moderate_forums')) { ?>
<? if (check_perms('site_moderate_forums')) { ?>
<div class="linkbox">
<a href="forums.php?action=edit_rules&amp;forumid=<?=$ForumID?>" class="brackets">Change specific rules</a>
</div>
<? } ?>
<? if(!empty($Forums[$ForumID]['SpecificRules'])) { ?>
<? if (!empty($Forums[$ForumID]['SpecificRules'])) { ?>
<div class="linkbox">
<strong>Forum Specific Rules</strong>
<? foreach($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
<? foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
$Thread = get_thread_info($ThreadIDs);
?>
<br />
@ -147,16 +154,16 @@
<? } ?>
<div class="linkbox pager">
<?
$Pages=Format::get_pages($Page,$Forums[$ForumID]['NumTopics'],TOPICS_PER_PAGE,9);
$Pages = Format::get_pages($Page,$Forums[$ForumID]['NumTopics'],TOPICS_PER_PAGE,9);
echo $Pages;
?>
</div>
<table class="forum_index" width="100%">
<tr class="colhead">
<td style="width:2%;"></td>
<td style="width: 2%;"></td>
<td>Latest</td>
<td style="width:7%;">Replies</td>
<td style="width:14%;">Author</td>
<td style="width: 7%;">Replies</td>
<td style="width: 14%;">Author</td>
</tr>
<?
// Check that we have content to process
@ -170,13 +177,18 @@
<?
} else {
// forums_last_read_topics is a record of the last post a user read in a topic, and what page that was on
$DB->query('SELECT
$DB->query('
SELECT
l.TopicID,
l.PostID,
CEIL((SELECT COUNT(ID) FROM forums_posts WHERE forums_posts.TopicID = l.TopicID AND forums_posts.ID<=l.PostID)/'.$PerPage.') AS Page
CEIL(( SELECT COUNT(ID)
FROM forums_posts
WHERE forums_posts.TopicID = l.TopicID
AND forums_posts.ID<=l.PostID)/'.$PerPage.'
) AS Page
FROM forums_last_read_topics AS l
WHERE TopicID IN('.implode(', ', array_keys($Forum)).') AND
UserID=\''.$LoggedUser['ID'].'\'');
WHERE TopicID IN('.implode(', ', array_keys($Forum)).')
AND UserID=\''.$LoggedUser['ID'].'\'');
// Turns the result set into a multi-dimensional array, with
// forums_last_read_topics.TopicID as the key.
@ -186,8 +198,8 @@
//---------- Begin printing
$Row='a';
foreach($Forum as $Topic){
$Row = 'a';
foreach ($Forum as $Topic) {
list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
$Row = ($Row == 'a') ? 'b' : 'a';
// Build list of page links
@ -197,37 +209,41 @@
$PagesText = '';
$TopicPages = ceil($PostCount/$PerPage);
if($TopicPages > 1){
$PagesText=' (';
for($i = 1; $i <= $TopicPages; $i++){
if($TopicPages>4 && ($i > 2 && $i <= $TopicPages-2)) {
if(!$ShownEllipses) {
$PageLinks[]='-';
if ($TopicPages > 1) {
$PagesText = ' (';
for ($i = 1; $i <= $TopicPages; $i++) {
if ($TopicPages > 4 && ($i > 2 && $i <= $TopicPages - 2)) {
if (!$ShownEllipses) {
$PageLinks[] = '-';
$ShownEllipses = true;
}
continue;
}
$PageLinks[]='<a href="forums.php?action=viewthread&amp;threadid='.$TopicID.'&amp;page='.$i.'">'.$i.'</a>';
$PageLinks[] = '<a href="forums.php?action=viewthread&amp;threadid='.$TopicID.'&amp;page='.$i.'">'.$i.'</a>';
}
$PagesText.=implode(' ', $PageLinks);
$PagesText.=')';
}
// handle read/unread posts - the reason we can't cache the whole page
if((!$Locked || $Sticky) && ((empty($LastRead[$TopicID]) || $LastRead[$TopicID]['PostID']<$LastID) && strtotime($LastTime)>$LoggedUser['CatchupTime'])) {
if ((!$Locked || $Sticky) && ((empty($LastRead[$TopicID]) || $LastRead[$TopicID]['PostID'] < $LastID) && strtotime($LastTime) > $LoggedUser['CatchupTime'])) {
$Read = 'unread';
} else {
$Read = 'read';
}
if($Locked) { $Read .= "_locked"; }
if($Sticky) { $Read .= "_sticky"; }
if ($Locked) {
$Read .= '_locked';
}
if ($Sticky) {
$Read .= '_sticky';
}
?>
<tr class="row<?=$Row?>">
<td class="<?=$Read?>" title="<?=ucwords(str_replace('_',' ',$Read))?>"></td>
<td>
<span style="float:left;" class="last_topic">
<span style="float: left;" class="last_topic">
<?
$TopicLength=75-(2*count($PageLinks));
$TopicLength = 75 - (2 * count($PageLinks));
unset($PageLinks);
$Title = display_str($Title);
$DisplayTitle = $Title;
@ -238,16 +254,16 @@
</strong>
<?=$PagesText?>
</span>
<? if(!empty($LastRead[$TopicID])) { ?>
<? if (!empty($LastRead[$TopicID])) { ?>
<span style="float: left;" class="last_read" title="Jump to last read">
<a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>&amp;page=<?=$LastRead[$TopicID]['Page']?>#post<?=$LastRead[$TopicID]['PostID']?>"></a>
</span>
<? } ?>
<span style="float:right;" class="last_poster">
<span style="float: right;" class="last_poster">
by <?=Users::format_username($LastAuthorID, false, false, false)?> <?=time_diff($LastTime,1)?>
</span>
</td>
<td><?=number_format($PostCount-1)?></td>
<td><?=number_format($PostCount - 1)?></td>
<td><?=Users::format_username($AuthorID, false, false, false)?></td>
</tr>
<? }

View File

@ -2,7 +2,7 @@
enforce_login();
if(!empty($LoggedUser['DisableForums'])) {
if (!empty($LoggedUser['DisableForums'])) {
error(403);
}
@ -12,7 +12,7 @@
unset($ForumCats);
$ForumCats = $Cache->get_value('forums_categories');
if ($ForumCats === false) {
$DB->query("SELECT ID, Name FROM forums_categories");
$DB->query('SELECT ID, Name FROM forums_categories');
$ForumCats = array();
while (list($ID, $Name) = $DB->next_record()) {
$ForumCats[$ID] = $Name;
@ -21,8 +21,9 @@
}
//This variable contains all our lovely forum data
if(!$Forums = $Cache->get_value('forums_list')) {
$DB->query("SELECT
if (!$Forums = $Cache->get_value('forums_list')) {
$DB->query('
SELECT
f.ID,
f.CategoryID,
f.Name,
@ -45,11 +46,11 @@
LEFT JOIN forums_topics as t ON t.ID = f.LastPostTopicID
LEFT JOIN forums_specific_rules AS sr ON sr.ForumID = f.ID
GROUP BY f.ID
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort");
ORDER BY fc.Sort, fc.Name, f.CategoryID, f.Sort');
$Forums = $DB->to_array('ID', MYSQLI_ASSOC, false);
foreach($Forums as $ForumID => $Forum) {
if(count($Forum['SpecificRules'])) {
$DB->query("SELECT ThreadID FROM forums_specific_rules WHERE ForumID = ".$ForumID);
foreach ($Forums as $ForumID => $Forum) {
if (count($Forum['SpecificRules'])) {
$DB->query('SELECT ThreadID FROM forums_specific_rules WHERE ForumID = '.$ForumID);
$ThreadIDs = $DB->collect('ThreadID');
$Forums[$ForumID]['SpecificRules'] = $ThreadIDs;
}
@ -58,7 +59,7 @@
$Cache->cache_value('forums_list', $Forums, 0); //Inf cache.
}
if(!empty($_POST['action'])){
if (!empty($_POST['action'])) {
switch ($_POST['action']) {
case 'reply':
require(SERVER_ROOT.'/sections/forums/take_reply.php');
@ -85,7 +86,7 @@
default:
error(0);
}
} elseif(!empty($_GET['action'])) {
} elseif (!empty($_GET['action'])) {
switch ($_GET['action']) {
case 'viewforum':
// Page that lists all the topics in a forum

View File

@ -12,11 +12,17 @@
\*********************************************************************/
// Quick SQL injection check
if(!is_number($_POST['threadid'])) { error(404); }
if($_POST['title'] == ''){ error(0); }
if (!is_number($_POST['threadid'])) {
error(404);
}
if ($_POST['title'] == ''){
error(0);
}
// End injection check
// Make sure they are moderators
if(!check_perms('site_moderate_forums')) { error(403); }
if (!check_perms('site_moderate_forums')) {
error(403);
}
authorize();
// Variables for database input
@ -36,7 +42,8 @@
$DB->query("DELETE FROM forums_last_read_topics WHERE TopicID='$TopicID'");
}
$DB->query("SELECT
$DB->query("
SELECT
t.ForumID,
f.MinClassWrite,
COUNT(p.ID) AS Posts
@ -47,26 +54,32 @@
GROUP BY p.TopicID");
list($OldForumID, $MinClassWrite, $Posts) = $DB->next_record();
if($MinClassWrite > $LoggedUser['Class']) { error(403); }
if ($MinClassWrite > $LoggedUser['Class']) {
error(403);
}
// If we're moving
$Cache->delete_value('forums_'.$ForumID);
$Cache->delete_value('forums_'.$OldForumID);
// If we're deleting a thread
if(isset($_POST['delete'])) {
if(check_perms('site_admin_forums')) {
if (isset($_POST['delete'])) {
if (check_perms('site_admin_forums')) {
$DB->query("DELETE FROM forums_posts WHERE TopicID='$TopicID'");
$DB->query("DELETE FROM forums_topics WHERE ID='$TopicID'");
$DB->query("SELECT
$DB->query("
SELECT
t.ID,
t.LastPostID,
t.Title,
p.AuthorID,
um.Username,
p.AddedTime,
(SELECT COUNT(pp.ID) FROM forums_posts AS pp JOIN forums_topics AS tt ON pp.TopicID=tt.ID WHERE tt.ForumID='$ForumID'),
( SELECT COUNT(pp.ID)
FROM forums_posts AS pp
JOIN forums_topics AS tt ON pp.TopicID=tt.ID
WHERE tt.ForumID='$ForumID'),
t.IsLocked,
t.IsSticky
FROM forums_topics AS t
@ -74,10 +87,13 @@
LEFT JOIN users_main AS um ON um.ID=p.AuthorID
WHERE t.ForumID='$ForumID'
GROUP BY t.ID
ORDER BY t.LastPostID DESC LIMIT 1");
ORDER BY t.LastPostID DESC
LIMIT 1");
list($NewLastTopic, $NewLastPostID, $NewLastTitle, $NewLastAuthorID, $NewLastAuthorName, $NewLastAddedTime, $NumPosts, $NewLocked, $NewSticky) = $DB->next_record(MYSQLI_NUM, false);
$DB->query("UPDATE forums SET
$DB->query("
UPDATE forums
SET
NumTopics=NumTopics-1,
NumPosts=NumPosts-'$Posts',
LastPostTopicID='$NewLastTopic',
@ -91,15 +107,15 @@
$Cache->begin_transaction('forums_list');
$UpdateArray = array(
'NumPosts'=>$NumPosts,
'NumTopics'=>'-1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle,
'IsLocked'=>$NewLocked,
'IsSticky'=>$NewSticky
'NumPosts' => $NumPosts,
'NumTopics' => '-1',
'LastPostID' => $NewLastPostID,
'LastPostAuthorID' => $NewLastAuthorID,
'LastPostTopicID' => $NewLastTopic,
'LastPostTime' => $NewLastAddedTime,
'Title' => $NewLastTitle,
'IsLocked' => $NewLocked,
'IsSticky' => $NewSticky
);
$Cache->update_row($ForumID, $UpdateArray);
@ -115,15 +131,17 @@
$Cache->begin_transaction('thread_'.$TopicID.'_info');
$UpdateArray = array(
'IsSticky'=>$Sticky,
'IsLocked'=>$Locked,
'Title'=>Format::cut_string($RawTitle, 150, 1, 0),
'ForumID'=>$ForumID
'IsSticky' => $Sticky,
'IsLocked' => $Locked,
'Title' => Format::cut_string($RawTitle, 150, 1, 0),
'ForumID' => $ForumID
);
$Cache->update_row(false, $UpdateArray);
$Cache->commit_transaction(0);
$DB->query("UPDATE forums_topics SET
$DB->query("
UPDATE forums_topics
SET
IsSticky = '$Sticky',
IsLocked = '$Locked',
Title = '$Title',
@ -131,41 +149,48 @@
WHERE ID='$TopicID'");
if($ForumID!=$OldForumID) { // If we're moving a thread, change the forum stats
if ($ForumID != $OldForumID) { // If we're moving a thread, change the forum stats
$DB->query("SELECT MinClassRead, MinClassWrite, Name FROM forums WHERE ID='$ForumID'");
list($MinClassRead, $MinClassWrite, $ForumName) = $DB->next_record(MYSQLI_NUM, false);
$Cache->begin_transaction('thread_'.$TopicID.'_info');
$UpdateArray = array(
'ForumName'=>$ForumName,
'MinClassRead'=>$MinClassRead,
'MinClassWrite'=>$MinClassWrite
'ForumName' => $ForumName,
'MinClassRead' => $MinClassRead,
'MinClassWrite' => $MinClassWrite
);
$Cache->update_row(false, $UpdateArray);
$Cache->commit_transaction(3600*24*5);
$Cache->commit_transaction(3600 * 24 * 5);
$Cache->begin_transaction('forums_list');
// Forum we're moving from
$DB->query("SELECT
$DB->query("
SELECT
t.ID,
t.LastPostID,
t.Title,
p.AuthorID,
um.Username,
p.AddedTime,
(SELECT COUNT(pp.ID) FROM forums_posts AS pp JOIN forums_topics AS tt ON pp.TopicID=tt.ID WHERE tt.ForumID='$OldForumID'),
( SELECT COUNT(pp.ID)
FROM forums_posts AS pp
JOIN forums_topics AS tt ON pp.TopicID=tt.ID
WHERE tt.ForumID='$OldForumID'),
t.IsLocked,
t.IsSticky
FROM forums_topics AS t
JOIN forums_posts AS p ON p.ID=t.LastPostID
LEFT JOIN users_main AS um ON um.ID=p.AuthorID
WHERE t.ForumID='$OldForumID'
ORDER BY t.LastPostID DESC LIMIT 1");
ORDER BY t.LastPostID DESC
LIMIT 1");
list($NewLastTopic, $NewLastPostID, $NewLastTitle, $NewLastAuthorID, $NewLastAuthorName, $NewLastAddedTime, $NumPosts, $NewLocked, $NewSticky) = $DB->next_record(MYSQLI_NUM, false);
$DB->query("UPDATE forums SET
$DB->query("
UPDATE forums
SET
NumTopics=NumTopics-1,
NumPosts=NumPosts-'$Posts',
LastPostTopicID='$NewLastTopic',
@ -176,15 +201,15 @@
$UpdateArray = array(
'NumPosts'=>$NumPosts,
'NumTopics'=>'-1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle,
'IsLocked'=>$NewLocked,
'IsSticky'=>$NewSticky
'NumPosts' => $NumPosts,
'NumTopics' => '-1',
'LastPostID' => $NewLastPostID,
'LastPostAuthorID' => $NewLastAuthorID,
'LastPostTopicID' => $NewLastTopic,
'LastPostTime' => $NewLastAddedTime,
'Title' => $NewLastTitle,
'IsLocked' => $NewLocked,
'IsSticky' => $NewSticky
);
@ -192,22 +217,29 @@
// Forum we're moving to
$DB->query("SELECT
$DB->query("
SELECT
t.ID,
t.LastPostID,
t.Title,
p.AuthorID,
um.Username,
p.AddedTime,
(SELECT COUNT(pp.ID) FROM forums_posts AS pp JOIN forums_topics AS tt ON pp.TopicID=tt.ID WHERE tt.ForumID='$ForumID')
( SELECT COUNT(pp.ID)
FROM forums_posts AS pp
JOIN forums_topics AS tt ON pp.TopicID=tt.ID
WHERE tt.ForumID='$ForumID')
FROM forums_topics AS t
JOIN forums_posts AS p ON p.ID=t.LastPostID
LEFT JOIN users_main AS um ON um.ID=p.AuthorID
WHERE t.ForumID='$ForumID'
ORDER BY t.LastPostID DESC LIMIT 1");
ORDER BY t.LastPostID DESC
LIMIT 1");
list($NewLastTopic, $NewLastPostID, $NewLastTitle, $NewLastAuthorID, $NewLastAuthorName, $NewLastAddedTime, $NumPosts) = $DB->next_record(MYSQLI_NUM, false);
$DB->query("UPDATE forums SET
$DB->query("
UPDATE forums
SET
NumTopics=NumTopics+1,
NumPosts=NumPosts+'$Posts',
LastPostTopicID='$NewLastTopic',
@ -218,39 +250,38 @@
$UpdateArray = array(
'NumPosts'=>($NumPosts+$Posts),
'NumTopics'=>'+1',
'LastPostID'=>$NewLastPostID,
'LastPostAuthorID'=>$NewLastAuthorID,
'LastPostTopicID'=>$NewLastTopic,
'LastPostTime'=>$NewLastAddedTime,
'Title'=>$NewLastTitle
'NumPosts' => ($NumPosts + $Posts),
'NumTopics' => '+1',
'LastPostID' => $NewLastPostID,
'LastPostAuthorID' => $NewLastAuthorID,
'LastPostTopicID' => $NewLastTopic,
'LastPostTime' => $NewLastAddedTime,
'Title' => $NewLastTitle
);
$Cache->update_row($ForumID, $UpdateArray);
$Cache->commit_transaction(0);
} else { // Editing
$DB->query("SELECT LastPostTopicID FROM forums WHERE ID='$ForumID'");
list($LastTopicID) = $DB->next_record();
if($LastTopicID == $TopicID) {
if ($LastTopicID == $TopicID) {
$UpdateArray = array(
'Title'=>$RawTitle,
'IsLocked'=>$Locked,
'IsSticky'=>$Sticky
'Title' => $RawTitle,
'IsLocked' => $Locked,
'IsSticky' => $Sticky
);
$Cache->begin_transaction('forums_list');
$Cache->update_row($ForumID, $UpdateArray);
$Cache->commit_transaction(0);
}
}
if($Locked) {
$CatalogueID = floor($NumPosts/THREAD_CATALOGUE);
for($i=0;$i<=$CatalogueID;$i++) {
$Cache->expire_value('thread_'.$TopicID.'_catalogue_'.$i,3600*24*7);
if ($Locked) {
$CatalogueID = floor($NumPosts / THREAD_CATALOGUE);
for ($i = 0; $i <= $CatalogueID; $i++) {
$Cache->expire_value('thread_'.$TopicID.'_catalogue_'.$i, 3600 * 24 * 7); // 7 days
}
$Cache->expire_value('thread_'.$TopicID.'_info',3600*24*7);
$Cache->expire_value('thread_'.$TopicID.'_info', 3600 * 24 * 7); // 7 days
$DB->query('UPDATE forums_polls SET Closed=\'0\' WHERE TopicID=\''.$TopicID.'\'');
$Cache->delete_value('polls_'.$TopicID);

View File

@ -10,16 +10,18 @@
*/
$ForumID = $_GET['forumid'];
if(!is_number($ForumID)) {
if (!is_number($ForumID)) {
error(404);
}
$Forum = get_forum_info($ForumID);
if($Forum === false) {
if ($Forum === false) {
error(404);
}
if(!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) { error(403); }
if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) {
error(403);
}
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
?>
<div class="thin">
@ -42,16 +44,16 @@
</div>
</div>
<? } ?>
<table class="forum_post box vertical_margin" style="text-align:left;">
<table class="forum_post box vertical_margin" style="text-align: left;">
<colgroup>
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
<col class="col_avatar" />
<? } ?>
<col class="col_post_body" />
</colgroup>
<tr class="colhead_dark">
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
<span style="float:left;"><a href='#newthreadpreview'>#XXXXXX</a>
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1 ?>">
<span style="float: left;"><a href="#newthreadpreview">#XXXXXX</a>
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?></strong>
Just now
</span>
@ -64,11 +66,11 @@
</tr>
<tr>
<td class="avatar" valign="top">
<? if (!empty($LoggedUser['Avatar'])) { ?>
<? if (!empty($LoggedUser['Avatar'])) { ?>
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
<? } else { ?>
<? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
<? } ?>
<? } ?>
</td>
<td class="body" valign="top">
<div id="contentpreview" style="text-align: left;"></div>
@ -105,7 +107,9 @@
var AnswerCount = 1;
function AddAnswerField() {
if (AnswerCount >= 25) { return; }
if (AnswerCount >= 25) {
return;
}
var AnswerField = document.createElement("input");
AnswerField.type = "text";
AnswerField.id = "answer_"+AnswerCount;
@ -119,9 +123,13 @@ function AddAnswerField() {
}
function RemoveAnswerField() {
if (AnswerCount == 1) { return; }
if (AnswerCount == 1) {
return;
}
var x = $('#answer_block').raw();
for (i=0; i<2; i++) { x.removeChild(x.lastChild); }
for (i = 0; i < 2; i++) {
x.removeChild(x.lastChild);
}
AnswerCount--;
}
//]]>
@ -147,7 +155,7 @@ function RemoveAnswerField() {
<? } ?>
</table>
<div id="subscribediv" class="hidden">
<input id="subscribeboxpreview" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe'])?' checked="checked"':''?> />
<input id="subscribeboxpreview" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe']) ? ' checked="checked"' : '' ?> />
<label for="subscribebox">Subscribe to topic</label>
</div>
<div id="buttons" class="center">

View File

@ -8,13 +8,13 @@
list($Page,$Limit) = Format::page_limit(POSTS_PER_PAGE);
if($LoggedUser['CustomForums']) {
if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
$PermittedForums = implode("','", array_keys($LoggedUser['CustomForums'], 1));
}
if((isset($_GET['type']) && $_GET['type'] == 'body')) {
if ((isset($_GET['type']) && $_GET['type'] == 'body')) {
$Type = 'body';
} else {
$Type='title';
@ -22,20 +22,19 @@
}
// What are we looking for? Let's make sure it isn't dangerous.
if(isset($_GET['search'])) {
if (isset($_GET['search'])) {
$Search = trim($_GET['search']);
} else {
$Search = '';
}
// Searching for posts by a specific user
if(!empty($_GET['user'])) {
if (!empty($_GET['user'])) {
$User = trim($_GET['user']);
$DB->query("SELECT ID FROM users_main WHERE Username='".db_string($User)."'");
list($AuthorID) = $DB->next_record();
if($AuthorID === null) {
if ($AuthorID === null) {
$AuthorID = 0;
//this will cause the search to return 0 results.
//workaround in line 276 to display that the username was wrong.
@ -45,14 +44,14 @@
}
// Are we looking in individual forums?
if(isset($_GET['forums']) && is_array($_GET['forums'])) {
if (isset($_GET['forums']) && is_array($_GET['forums'])) {
$ForumArray = array();
foreach($_GET['forums'] as $Forum) {
if(is_number($Forum)) {
foreach ($_GET['forums'] as $Forum) {
if (is_number($Forum)) {
$ForumArray[]=$Forum;
}
}
if(count($ForumArray)>0) {
if (count($ForumArray) > 0) {
$SearchForums = implode(', ',$ForumArray);
}
}
@ -61,7 +60,10 @@
if (!empty($_GET['threadid']) && is_number($_GET['threadid'])) {
$ThreadID = $_GET['threadid'];
$Type = 'body';
$SQL = "SELECT Title FROM forums_topics AS t
$SQL = "
SELECT
Title
FROM forums_topics AS t
JOIN forums AS f ON f.ID=t.ForumID
WHERE t.ID=$ThreadID
AND ((f.MinClassRead <= '$LoggedUser[Class]'";
@ -102,9 +104,9 @@
<tr>
<td><strong>Search in:</strong></td>
<td>
<input type="radio" name="type" id="type_title" value="title" <? if($Type == 'title') { echo 'checked="checked" '; }?>/>
<input type="radio" name="type" id="type_title" value="title" <? if ($Type == 'title') { echo 'checked="checked" '; }?>/>
<label for="type_title">Titles</label>
<input type="radio" name="type" id="type_body" value="body" <? if($Type == 'body') { echo 'checked="checked" '; }?>/>
<input type="radio" name="type" id="type_body" value="body" <? if ($Type == 'body') { echo 'checked="checked" '; }?>/>
<label for="type_body">Post bodies</label>
</td>
</tr>
@ -119,7 +121,7 @@
$LastCategoryID = -1;
$Columns = 0;
foreach($Forums as $Forum) {
foreach ($Forums as $Forum) {
if (!check_forumperm($Forum['ID'])) {
continue;
}
@ -128,9 +130,9 @@
if ($Forum['CategoryID'] != $LastCategoryID) {
$LastCategoryID = $Forum['CategoryID'];
if($Open) {
if ($Columns%5) { ?>
<td colspan="<?=(5-($Columns%5))?>"></td>
if ($Open) {
if ($Columns % 5) { ?>
<td colspan="<?=(5 - ($Columns % 5))?>"></td>
<?
}
@ -145,17 +147,17 @@
<td colspan="5"><strong><?=$ForumCats[$Forum['CategoryID']]?></strong></td>
</tr>
<tr>
<? } elseif ($Columns%5 == 0) { ?>
<? } elseif ($Columns % 5 == 0) { ?>
</tr>
<tr>
<? } ?>
<td>
<input type="checkbox" name="forums[]" value="<?=$Forum['ID']?>" id="forum_<?=$Forum['ID']?>"<? if(isset($_GET['forums']) && in_array($Forum['ID'], $_GET['forums'])) { echo ' checked="checked"';} ?> />
<input type="checkbox" name="forums[]" value="<?=$Forum['ID']?>" id="forum_<?=$Forum['ID']?>"<? if (isset($_GET['forums']) && in_array($Forum['ID'], $_GET['forums'])) { echo ' checked="checked"';} ?> />
<label for="forum_<?=$Forum['ID']?>"><?=htmlspecialchars($Forum['Name'])?></label>
</td>
<? }
if ($Columns%5) { ?>
<td colspan="<?=(5-($Columns%5))?>"></td>
if ($Columns % 5) { ?>
<td colspan="<?=(5 - ($Columns % 5))?>"></td>
<? } ?>
</tr>
</table>
@ -183,11 +185,13 @@
// Break search string down into individual words
$Words = explode(' ', db_string($Search));
if($Type == 'body') {
if ($Type == 'body') {
$sql = "SELECT SQL_CALC_FOUND_ROWS
$sql = "
SELECT
SQL_CALC_FOUND_ROWS
t.ID,
".(!empty($ThreadID) ? "SUBSTRING_INDEX(p.Body, ' ', 40)":"t.Title").",
".(!empty($ThreadID) ? "SUBSTRING_INDEX(p.Body, ' ', 40)" : 't.Title').",
t.ForumID,
f.Name,
p.AddedTime,
@ -196,13 +200,12 @@
FROM forums_posts AS p
JOIN forums_topics AS t ON t.ID=p.TopicID
JOIN forums AS f ON f.ID=t.ForumID
WHERE
((f.MinClassRead<='$LoggedUser[Class]'";
if(!empty($RestrictedForums)) {
WHERE ((f.MinClassRead<='$LoggedUser[Class]'";
if (!empty($RestrictedForums)) {
$sql.=" AND f.ID NOT IN ('".$RestrictedForums."')";
}
$sql .= ')';
if(!empty($PermittedForums)) {
if (!empty($PermittedForums)) {
$sql.=' OR f.ID IN (\''.$PermittedForums.'\')';
}
$sql .= ') AND ';
@ -216,20 +219,22 @@
//$sql .= implode("', p.Body) AND LOCATE('", $Words);
//$sql .= "', p.Body) ";
if(isset($SearchForums)) {
if (isset($SearchForums)) {
$sql.=" AND f.ID IN ($SearchForums)";
}
if(isset($AuthorID)) {
if (isset($AuthorID)) {
$sql.=" AND p.AuthorID='$AuthorID' ";
}
if(!empty($ThreadID)) {
if (!empty($ThreadID)) {
$sql.=" AND t.ID='$ThreadID' ";
}
$sql .= "ORDER BY p.AddedTime DESC LIMIT $Limit";
} else {
$sql = "SELECT SQL_CALC_FOUND_ROWS
$sql = "
SELECT
SQL_CALC_FOUND_ROWS
t.ID,
t.Title,
t.ForumID,
@ -239,23 +244,22 @@
''
FROM forums_topics AS t
JOIN forums AS f ON f.ID=t.ForumID
WHERE
((f.MinClassRead<='$LoggedUser[Class]'";
if(!empty($RestrictedForums)) {
WHERE ((f.MinClassRead<='$LoggedUser[Class]'";
if (!empty($RestrictedForums)) {
$sql.=" AND f.ID NOT IN ('".$RestrictedForums."')";
}
$sql .= ')';
if(!empty($PermittedForums)) {
if (!empty($PermittedForums)) {
$sql.=' OR f.ID IN (\''.$PermittedForums.'\')';
}
$sql .= ') AND ';
$sql .= "t.Title LIKE '%";
$sql .= implode("%' AND t.Title LIKE '%", $Words);
$sql .= "%' ";
if(isset($SearchForums)) {
if (isset($SearchForums)) {
$sql.=" AND f.ID IN ($SearchForums)";
}
if(isset($AuthorID)) {
if (isset($AuthorID)) {
$sql.=" AND t.AuthorID='$AuthorID' ";
}
$sql .= "ORDER BY t.LastPostTime DESC LIMIT $Limit";
@ -277,12 +281,12 @@
<td><?=(!empty($ThreadID))?'Post Begins':'Topic'?></td>
<td>Time</td>
</tr>
<? if($DB->record_count() == 0) { ?>
<tr><td colspan="3">Nothing found<?=(isset($AuthorID) && $AuthorID == 0) ? ' (unknown username)' : ''?>!</td></tr>
<? if ($DB->record_count() == 0) { ?>
<tr><td colspan="3">Nothing found<?=(isset($AuthorID) && $AuthorID == 0) ? ' (unknown username)' : '' ?>!</td></tr>
<? }
$Row = 'a'; // For the pretty colours
while(list($ID, $Title, $ForumID, $ForumName, $LastTime, $PostID, $Body) = $DB->next_record()) {
while (list($ID, $Title, $ForumID, $ForumName, $LastTime, $PostID, $Body) = $DB->next_record()) {
$Row = ($Row == 'a') ? 'b' : 'a';
// Print results
?>
@ -291,13 +295,13 @@
<a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$ForumName?></a>
</td>
<td>
<? if(empty($ThreadID)) { ?>
<? if (empty($ThreadID)) { ?>
<a href="forums.php?action=viewthread&amp;threadid=<?=$ID?>"><?=Format::cut_string($Title, 80); ?></a>
<? } else { ?>
<?=Format::cut_string($Title, 80); ?>
<? }
if ($Type == 'body') { ?>
<a href="#" onclick="$('#post_<?=$PostID?>_text').toggle(); return false;">(show)</a> <span style="float: right;" class="last_read" title="Jump to post"><a href="forums.php?action=viewthread&amp;threadid=<?=$ID?><? if(!empty($PostID)) { echo '&amp;postid='.$PostID.'#post'.$PostID; } ?>"></a></span>
<a href="#" onclick="$('#post_<?=$PostID?>_text').toggle(); return false;">(show)</a> <span style="float: right;" class="last_read" title="Jump to post"><a href="forums.php?action=viewthread&amp;threadid=<?=$ID?><? if (!empty($PostID)) { echo '&amp;postid='.$PostID.'#post'.$PostID; } ?>"></a></span>
<? } ?>
</td>
<td>
@ -305,7 +309,7 @@
</td>
</tr>
<?
if($Type == 'body') { ?>
if ($Type == 'body') { ?>
<tr class="row<?=$Row?> hidden" id="post_<?=$PostID?>_text">
<td colspan="3"><?=$Text->full_format($Body)?></td>
</tr>

View File

@ -29,7 +29,7 @@
error(0);
}
//If you're not sending anything, go back
// If you're not sending anything, go back
if (empty($_POST['body']) || empty($_POST['title'])) {
header('Location: '.$_SERVER['HTTP_REFERER']);
die();
@ -38,7 +38,7 @@
$Body = $_POST['body'];
if ($LoggedUser['DisablePosting']) {
error('Your posting rights have been removed');
error('Your posting privileges have been removed');
}
$Title = Format::cut_string(trim($_POST['title']), 150, 1, 0);
@ -46,27 +46,33 @@
$ForumID = $_POST['forum'];
if (!isset($Forums[$ForumID])) { error(404); }
if (!isset($Forums[$ForumID])) {
error(404);
}
if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) {
error(403);
}
$DB->query("INSERT INTO forums_topics
$DB->query("
INSERT INTO forums_topics
(Title, AuthorID, ForumID, LastPostTime, LastPostAuthorID)
Values
('".db_string($Title)."', '".$LoggedUser['ID']."', '$ForumID', '".sqltime()."', '".$LoggedUser['ID']."')");
$TopicID = $DB->inserted_id();
$DB->query("INSERT INTO forums_posts
$DB->query("
INSERT INTO forums_posts
(TopicID, AuthorID, AddedTime, Body)
VALUES
('$TopicID', '".$LoggedUser['ID']."', '".sqltime()."', '".db_string($Body)."')");
$PostID = $DB->inserted_id();
$DB->query("UPDATE forums SET
$DB->query("
UPDATE forums
SET
NumPosts = NumPosts+1,
NumTopics = NumTopics+1,
LastPostID = '$PostID',
@ -75,7 +81,9 @@
LastPostTime = '".sqltime()."'
WHERE ID = '$ForumID'");
$DB->query("UPDATE forums_topics SET
$DB->query("
UPDATE forums_topics
SET
NumPosts = NumPosts+1,
LastPostID = '$PostID',
LastPostAuthorID = '".$LoggedUser['ID']."',
@ -100,7 +108,7 @@
$Cache->delete_value('subscriptions_user_'.$SubscriberID);
}
}
*/
*/
if (empty($_POST['question']) || empty($_POST['answers']) || !check_perms('forums_polls_create')) {
$NoPoll = 1;
@ -127,7 +135,7 @@
$Cache->cache_value('polls_'.$TopicID, array($Question,$Answers,$Votes,'0000-00-00 00:00:00','0'), 0);
if ($ForumID == STAFF_FORUM) {
send_irc("PRIVMSG ".ADMIN_CHAN." :!mod Poll created by ".$LoggedUser['Username'].": '".$Question."' https://".SSL_SITE_URL."/forums.php?action=viewthread&threadid=".$TopicID);
send_irc("PRIVMSG ".ADMIN_CHAN." :!mod Poll created by ".$LoggedUser['Username'].': "'.$Question.'" https://'.SSL_SITE_URL.'/forums.php?action=viewthread&threadid='.$TopicID);
}
}
@ -141,8 +149,8 @@
}
if ($Stickies > 0) {
$Part1 = array_slice($Forum,0,$Stickies,true); //Stickies
$Part3 = array_slice($Forum,$Stickies,TOPICS_PER_PAGE-$Stickies-1,true); //Rest of page
$Part1 = array_slice($Forum, 0, $Stickies, true); //Stickies
$Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); //Rest of page
} else {
$Part1 = array();
$Part3 = $Forum;
@ -158,44 +166,44 @@
'LastPostTime' => sqltime(),
'LastPostAuthorID' => $LoggedUser['ID'],
'NoPoll' => $NoPoll
)); //Bumped
)); // Bumped
$Forum = $Part1 + $Part2 + $Part3;
$Cache->cache_value('forums_'.$ForumID, array($Forum,'',0,$Stickies), 0);
$Cache->cache_value('forums_'.$ForumID, array($Forum, '', 0, $Stickies), 0);
//Update the forum root
// Update the forum root
$Cache->begin_transaction('forums_list');
$Cache->update_row($ForumID, array(
'NumPosts'=>'+1',
'NumTopics'=>'+1',
'LastPostID'=>$PostID,
'LastPostAuthorID'=>$LoggedUser['ID'],
'LastPostTopicID'=>$TopicID,
'LastPostTime'=>sqltime(),
'Title'=>$Title,
'IsLocked'=>0,
'IsSticky'=>0
'NumPosts' => '+1',
'NumTopics' => '+1',
'LastPostID' => $PostID,
'LastPostAuthorID' => $LoggedUser['ID'],
'LastPostTopicID' => $TopicID,
'LastPostTime' => sqltime(),
'Title' => $Title,
'IsLocked' => 0,
'IsSticky' => 0
));
$Cache->commit_transaction(0);
} else {
//If there's no cache, we have no data, and if there's no data
// If there's no cache, we have no data, and if there's no data
$Cache->delete_value('forums_list');
}
$Cache->begin_transaction('thread_'.$TopicID.'_catalogue_0');
$Post = array(
'ID'=>$PostID,
'AuthorID'=>$LoggedUser['ID'],
'AddedTime'=>sqltime(),
'Body'=>$Body,
'EditedUserID'=>0,
'EditedTime'=>'0000-00-00 00:00:00',
'ID' => $PostID,
'AuthorID' => $LoggedUser['ID'],
'AddedTime' => sqltime(),
'Body' => $Body,
'EditedUserID' => 0,
'EditedTime' => '0000-00-00 00:00:00'
);
$Cache->insert('', $Post);
$Cache->commit_transaction(0);
$Cache->begin_transaction('thread_'.$TopicID.'_info');
$Cache->update_row(false, array('Posts'=>'+1', 'LastPostAuthorID'=>$LoggedUser['ID']));
$Cache->update_row(false, array('Posts' => '+1', 'LastPostAuthorID' => $LoggedUser['ID']));
$Cache->commit_transaction(0);
header('Location: forums.php?action=viewthread&threadid='.$TopicID);

View File

@ -1,6 +1,10 @@
<?
authorize();
$FriendID = db_string($_GET['friendid']);
$DB->query("INSERT IGNORE INTO friends (UserID, FriendID) VALUES ('$LoggedUser[ID]', '$FriendID')");
$DB->query("
INSERT IGNORE INTO friends
(UserID, FriendID)
VALUES ('$LoggedUser[ID]', '$FriendID')");
header('Location: friends.php');
?>

View File

@ -1,4 +1,9 @@
<?
$DB->query("UPDATE friends SET Comment='$P[comment]' WHERE UserID='$LoggedUser[ID]' AND FriendID='$P[friendid]'");
$DB->query("
UPDATE friends
SET Comment='$P[comment]'
WHERE UserID='$LoggedUser[ID]'
AND FriendID='$P[friendid]'");
header('Location: friends.php');
?>

View File

@ -1,4 +1,4 @@
<?
<?
/************************************************************************
//------------// Main friends page //----------------------------------//
This page lists a user's friends.
@ -22,7 +22,8 @@
list($Page,$Limit) = Format::page_limit(FRIENDS_PER_PAGE);
// Main query
$DB->query("SELECT
$DB->query("
SELECT
SQL_CALC_FOUND_ROWS
f.FriendID,
f.Comment,
@ -72,7 +73,7 @@
<table class="friends_table vertical_margin">
<tr class="colhead">
<td colspan="3">
<span style="float:left;"><?=Users::format_username($FriendID, true, true, true, true)?>
<span style="float: left;"><?=Users::format_username($FriendID, true, true, true, true)?>
<? if (check_paranoia('ratio', $Paranoia, $Class, $FriendID)) { ?>
&nbsp;Ratio: <strong><?=Format::get_ratio_html($Uploaded, $Downloaded)?></strong>
<? }
@ -84,7 +85,7 @@
<? } ?>
</span>
<? if (check_paranoia('lastseen', $Paranoia, $Class, $FriendID)) { ?>
<span style="float:right;"><?=time_diff($LastAccess)?></span>
<span style="float: right;"><?=time_diff($LastAccess)?></span>
<? } ?>
</td>
</tr>

View File

@ -1,16 +1,16 @@
<?
$P = db_array($_POST);
enforce_login();
if(!empty($_REQUEST['friendid']) && !is_number($_REQUEST['friendid'])) {
if (!empty($_REQUEST['friendid']) && !is_number($_REQUEST['friendid'])) {
error(404);
}
if(!empty($_REQUEST['action'])) {
switch($_REQUEST['action']) {
if (!empty($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'add':
include(SERVER_ROOT.'/sections/friends/add.php');
break;
case 'Defriend':
case 'Remove friend':
authorize();
include(SERVER_ROOT.'/sections/friends/remove.php');
break;

View File

@ -1,4 +1,8 @@
<?
$DB->query("DELETE FROM friends WHERE UserID='$LoggedUser[ID]' AND FriendID='$P[friendid]'");
$DB->query("
DELETE FROM friends
WHERE UserID='$LoggedUser[ID]'
AND FriendID='$P[friendid]'");
header('Location: friends.php');
?>

View File

@ -33,8 +33,8 @@
}
}
if(isset($_GET['c']) && strlen($Data) < 262144) {
$Cache->cache_value('image_cache_'.md5($URL), array($Data,$Type), 3600*24*7);
if (isset($_GET['c']) && strlen($Data) < 262144) {
$Cache->cache_value('image_cache_'.md5($URL), array($Data,$Type), 3600 * 24 * 7);
}
}
@ -63,13 +63,13 @@
$UserInfo['Avatar'] = '';
$Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000);
$DB->query("UPDATE users_info SET Avatar='', AdminComment=CONCAT('".sqltime()." - Avatar reset automatically (Size: ".number_format((strlen($Data))/1024)."kb, Height: ".$Height."px). Used to be $DBURL\n\n', AdminComment) WHERE UserID='$UserID'");
$DB->query("UPDATE users_info SET Avatar='', AdminComment=CONCAT('".sqltime()." - Avatar reset automatically (Size: ".number_format((strlen($Data)) / 1024)." kB, Height: ".$Height."px). Used to be $DBURL\n\n', AdminComment) WHERE UserID='$UserID'");
// Send PM
send_pm($UserID,0,"Your avatar has been automatically reset","The following avatar rules have been in effect for months now:
[b]Avatars must not exceed 256kB or be vertically longer than 400px. [/b]
[b]Avatars must not exceed 256 kB or be vertically longer than 400px. [/b]
Your avatar at $DBURL has been found to exceed these rules. As such, it has been automatically reset. You are welcome to reinstate your avatar once it has been resized down to an acceptable size.");

View File

@ -39,14 +39,16 @@
<div class="box">
<div class="head colhead_dark"><strong><a href="staffblog.php">Latest staff blog posts</a></strong></div>
<?
if(($Blog = $Cache->get_value('staff_blog')) === false) {
$DB->query("SELECT
if (($Blog = $Cache->get_value('staff_blog')) === false) {
$DB->query("
SELECT
b.ID,
um.Username,
b.Title,
b.Body,
b.Time
FROM staff_blog AS b LEFT JOIN users_main AS um ON b.UserID=um.ID
FROM staff_blog AS b
LEFT JOIN users_main AS um ON b.UserID=um.ID
ORDER BY Time DESC");
$Blog = $DB->to_array(false, MYSQLI_NUM);
$Cache->cache_value('staff_blog', $Blog, 1209600);
@ -63,12 +65,12 @@
?>
<ul class="stats nobullet">
<?
if(count($Blog) < 5) {
if (count($Blog) < 5) {
$Limit = count($Blog);
} else {
$Limit = 5;
}
for($i = 0; $i < $Limit; $i++) {
for ($i = 0; $i < $Limit; $i++) {
list($BlogID, $Author, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i];
$BlogTime = strtotime($BlogTime);
?>
@ -86,7 +88,7 @@
<div class="box">
<div class="head colhead_dark"><strong><a href="blog.php">Latest blog posts</a></strong></div>
<?
if(($Blog = $Cache->get_value('blog')) === false) {
if (($Blog = $Cache->get_value('blog')) === false) {
$DB->query("SELECT
b.ID,
um.Username,
@ -103,12 +105,12 @@
?>
<ul class="stats nobullet">
<?
if(count($Blog) < 5) {
if (count($Blog) < 5) {
$Limit = count($Blog);
} else {
$Limit = 5;
}
for($i = 0; $i < $Limit; $i++) {
for ($i = 0; $i < $Limit; $i++) {
list($BlogID, $Author, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i];
?>
<li>
@ -122,13 +124,12 @@
<div class="box">
<div class="head colhead_dark"><strong>Stats</strong></div>
<ul class="stats nobullet">
<? if (USER_LIMIT>0) { ?>
<? if (USER_LIMIT > 0) { ?>
<li>Maximum users: <?=number_format(USER_LIMIT) ?></li>
<?
}
if(($UserCount = $Cache->get_value('stats_user_count')) === false){
if (($UserCount = $Cache->get_value('stats_user_count')) === false) {
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
list($UserCount) = $DB->next_record();
$Cache->cache_value('stats_user_count', $UserCount, 0); //inf cache
@ -139,45 +140,53 @@
<?
if (($UserStats = $Cache->get_value('stats_users')) === false) {
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600*24)."'");
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600 * 24)."'");
list($UserStats['Day']) = $DB->next_record();
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600*24*7)."'");
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600 * 24 * 7)."'");
list($UserStats['Week']) = $DB->next_record();
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600*24*30)."'");
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1' AND LastAccess>'".time_minus(3600 * 24 * 30)."'");
list($UserStats['Month']) = $DB->next_record();
$Cache->cache_value('stats_users',$UserStats,0);
}
?>
<li>Users active today: <?=number_format($UserStats['Day'])?> (<?=number_format($UserStats['Day']/$UserCount*100,2)?>%)</li>
<li>Users active this week: <?=number_format($UserStats['Week'])?> (<?=number_format($UserStats['Week']/$UserCount*100,2)?>%)</li>
<li>Users active this month: <?=number_format($UserStats['Month'])?> (<?=number_format($UserStats['Month']/$UserCount*100,2)?>%)</li>
<li>Users active today: <?=number_format($UserStats['Day'])?> (<?=number_format($UserStats['Day'] / $UserCount * 100,2)?>%)</li>
<li>Users active this week: <?=number_format($UserStats['Week'])?> (<?=number_format($UserStats['Week'] / $UserCount * 100,2)?>%)</li>
<li>Users active this month: <?=number_format($UserStats['Month'])?> (<?=number_format($UserStats['Month'] / $UserCount * 100,2)?>%)</li>
<?
if(($TorrentCount = $Cache->get_value('stats_torrent_count')) === false) {
if (($TorrentCount = $Cache->get_value('stats_torrent_count')) === false) {
$DB->query("SELECT COUNT(ID) FROM torrents");
list($TorrentCount) = $DB->next_record();
$Cache->cache_value('stats_torrent_count', $TorrentCount, 0); //inf cache
}
if(($AlbumCount = $Cache->get_value('stats_album_count')) === false) {
if (($AlbumCount = $Cache->get_value('stats_album_count')) === false) {
$DB->query("SELECT COUNT(ID) FROM torrents_group WHERE CategoryID='1'");
list($AlbumCount) = $DB->next_record();
$Cache->cache_value('stats_album_count', $AlbumCount, 0); //inf cache
}
if(($ArtistCount = $Cache->get_value('stats_artist_count')) === false) {
if (($ArtistCount = $Cache->get_value('stats_artist_count')) === false) {
$DB->query("SELECT COUNT(ArtistID) FROM artists_group");
list($ArtistCount) = $DB->next_record();
$Cache->cache_value('stats_artist_count', $ArtistCount, 0); //inf cache
}
if (($PerfectCount = $Cache->get_value('stats_perfect_count')) === false) {
$DB->query("SELECT COUNT(ID) FROM torrents WHERE ((LogScore = 100 AND Format = 'FLAC') OR (Media = 'Vinyl' AND Format = 'FLAC') OR (Media = 'WEB' AND Format = 'FLAC') OR (Media = 'DVD' AND Format = 'FLAC') OR (Media = 'Soundboard' AND Format = 'FLAC'))");
$DB->query("
SELECT COUNT(ID)
FROM torrents
WHERE ((LogScore = 100 AND Format = 'FLAC')
OR (Media = 'Vinyl' AND Format = 'FLAC')
OR (Media = 'WEB' AND Format = 'FLAC')
OR (Media = 'DVD' AND Format = 'FLAC')
OR (Media = 'Soundboard' AND Format = 'FLAC')
)");
list($PerfectCount) = $DB->next_record();
$Cache->cache_value('stats_perfect_count', $PerfectCount, 0);
$Cache->cache_value('stats_perfect_count', $PerfectCount, 0); //inf cache
}
?>
<li>Torrents: <?=number_format($TorrentCount)?></li>
@ -198,7 +207,7 @@
}
?>
<li>Requests: <?=number_format($RequestCount)?> (<?=number_format($FilledCount/$RequestCount*100, 2)?>% filled)</li>
<li>Requests: <?=number_format($RequestCount)?> (<?=number_format($FilledCount / $RequestCount * 100, 2)?>% filled)</li>
<?
if ($SnatchStats = $Cache->get_value('stats_snatches')) {
@ -207,10 +216,10 @@
<?
}
if(($PeerStats = $Cache->get_value('stats_peers')) === false) {
if (($PeerStats = $Cache->get_value('stats_peers')) === false) {
//Cache lock!
$PeerStatsLocked = $Cache->get_value('stats_peers_lock');
if(!$PeerStatsLocked) {
if (!$PeerStatsLocked) {
$Cache->cache_value('stats_peers_lock', 1, 30);
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid) FROM xbt_files_users WHERE active=1 GROUP BY Type");
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
@ -224,7 +233,7 @@
list($LeecherCount,$SeederCount) = $PeerStats;
}
if(!$PeerStatsLocked) {
if (!$PeerStatsLocked) {
$Ratio = Format::get_ratio_html($SeederCount, $LeecherCount);
$PeerCount = number_format($SeederCount + $LeecherCount);
$SeederCount = number_format($SeederCount);
@ -236,17 +245,17 @@
<li>Peers: <?=$PeerCount?></li>
<li>Seeders: <?=$SeederCount?></li>
<li>Leechers: <?=$LeecherCount?></li>
<li>Seeder/Leecher ratio: <?=$Ratio?></li>
<li>Seeder/leecher ratio: <?=$Ratio?></li>
</ul>
</div>
<?
if(($TopicID = $Cache->get_value('polls_featured')) === false) {
if (($TopicID = $Cache->get_value('polls_featured')) === false) {
$DB->query("SELECT TopicID FROM forums_polls ORDER BY Featured DESC LIMIT 1");
list($TopicID) = $DB->next_record();
$Cache->cache_value('polls_featured',$TopicID,0);
}
if($TopicID) {
if(($Poll = $Cache->get_value('polls_'.$TopicID)) === false) {
if ($TopicID) {
if (($Poll = $Cache->get_value('polls_'.$TopicID)) === false) {
$DB->query("SELECT Question, Answers, Featured, Closed FROM forums_polls WHERE TopicID='".$TopicID."'");
list($Question, $Answers, $Featured, $Closed) = $DB->next_record(MYSQLI_NUM, array(1));
$Answers = unserialize($Answers);
@ -292,16 +301,16 @@
<ul class="poll nobullet">
<? foreach ($Answers as $i => $Answer) {
if ($TotalVotes > 0) {
$Ratio = $Votes[$i]/$MaxVotes;
$Percent = $Votes[$i]/$TotalVotes;
$Ratio = $Votes[$i] / $MaxVotes;
$Percent = $Votes[$i] / $TotalVotes;
} else {
$Ratio=0;
$Percent=0;
$Ratio = 0;
$Percent = 0;
}
?> <li><?=display_str($Answers[$i])?> (<?=number_format($Percent*100,2)?>%)</li>
?> <li><?=display_str($Answers[$i])?> (<?=number_format($Percent * 100,2)?>%)</li>
<li class="graph">
<span class="left_poll"></span>
<span class="center_poll" style="width:<?=round($Ratio*140)?>px;"></span>
<span class="center_poll" style="width: <?=round($Ratio * 140)?>px;"></span>
<span class="right_poll"></span>
<br />
</li>
@ -319,7 +328,7 @@
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
<? } ?>
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br /><br />
<input type="button" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" />
<input type="button" onclick="ajax.post('index.php','poll',function(response) {$('#poll_container').raw().innerHTML = response});" value="Vote" />
</form>
</div>
<? } ?>
@ -338,7 +347,8 @@
$Recommend_artists = $Cache->get_value('recommend_artists');
if (!is_array($Recommend) || !is_array($Recommend_artists)) {
$DB->query("SELECT
$DB->query("
SELECT
tr.GroupID,
tr.UserID,
u.Username,
@ -347,8 +357,8 @@
FROM torrents_recommended AS tr
JOIN torrents_group AS tg ON tg.ID=tr.GroupID
LEFT JOIN users_main AS u ON u.ID=tr.UserID
ORDER BY tr.Time DESC LIMIT 10
");
ORDER BY tr.Time DESC
LIMIT 10");
$Recommend = $DB->to_array();
$Cache->cache_value('recommend',$Recommend,1209600);
@ -367,7 +377,7 @@
<table class="torrent_table hidden" id="vanityhouse">
<?
foreach($Recommend as $Recommendations) {
foreach ($Recommend as $Recommendations) {
list($GroupID, $UserID, $Username, $GroupName, $TagList) = $Recommendations;
$TagsStr = '';
if ($TagList) {
@ -406,7 +416,7 @@
<div id="news<?=$NewsID?>" class="box">
<div class="head">
<strong><?=$Text->full_format($Title)?></strong> <?=time_diff($NewsTime);?>
<? if(check_perms('admin_manage_news')) {?>
<? if (check_perms('admin_manage_news')) { ?>
- <a href="tools.php?action=editnews&amp;id=<?=$NewsID?>" class="brackets">Edit</a>
<? } ?>
</div>
@ -432,8 +442,9 @@ function contest() {
global $DB, $Cache, $LoggedUser;
list($Contest, $TotalPoints) = $Cache->get_value('contest');
if(!$Contest) {
$DB->query("SELECT
if (!$Contest) {
$DB->query("
SELECT
UserID,
SUM(Points),
Username
@ -455,7 +466,7 @@ function contest() {
<div class="box box_contest">
<div class="head colhead_dark"><strong>Quality time scoreboard</strong></div>
<div class="pad">
<ol style="padding-left:5px;">
<ol style="padding-left: 5px;">
<?
foreach ($Contest as $User) {
list($UserID, $Points, $Username) = $User;

View File

@ -74,7 +74,7 @@
} else {
// Either his key has expired, or he hasn't requested a pass change at all
if (strtotime($Expires)<time() && $UserID) {
if (strtotime($Expires) < time() && $UserID) {
// If his key has expired, clear all the reset information
$DB->query("UPDATE
users_info

View File

@ -15,7 +15,7 @@
$ID = $_GET['id'];
switch ($Short) {
case "user" :
case 'user' :
$DB->query("SELECT Username FROM users_main WHERE ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
@ -23,19 +23,19 @@
list($Username) = $DB->next_record();
break;
case "request_update" :
case 'request_update' :
$NoReason = true;
$DB->query("SELECT Title, Description, TorrentID, CategoryID, Year FROM requests WHERE ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
}
list($Name, $Desc, $Filled, $CategoryID, $Year) = $DB->next_record();
if ($Filled || ($CategoryID != 0 && ($Categories[$CategoryID-1] != "Music" || $Year != 0))) {
if ($Filled || ($CategoryID != 0 && ($Categories[$CategoryID-1] != 'Music' || $Year != 0))) {
error(403);
}
break;
case "request" :
case 'request' :
$DB->query("SELECT Title, Description, TorrentID FROM requests WHERE ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
@ -43,7 +43,7 @@
list($Name, $Desc, $Filled) = $DB->next_record();
break;
case "collage" :
case 'collage' :
$DB->query("SELECT Name, Description FROM collages WHERE ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
@ -51,7 +51,7 @@
list($Name, $Desc) = $DB->next_record();
break;
case "thread" :
case 'thread' :
$DB->query("SELECT ft.Title, ft.ForumID, um.Username FROM forums_topics AS ft JOIN users_main AS um ON um.ID=ft.AuthorID WHERE ft.ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
@ -66,15 +66,15 @@
}
break;
case "post" :
$DB->query("SELECT fp.Body, fp.TopicID, um.Username FROM forums_posts AS fp JOIN users_main AS um ON um.ID=fp.AuthorID WHERE fp.ID=".$ID);
case 'post' :
$DB->query('SELECT fp.Body, fp.TopicID, um.Username FROM forums_posts AS fp JOIN users_main AS um ON um.ID=fp.AuthorID WHERE fp.ID='.$ID);
if ($DB->record_count() < 1) {
error(404);
}
list($Body, $TopicID, $Username) = $DB->next_record();
$DB->query("SELECT ForumID FROM forums_topics WHERE ID = ".$TopicID);
$DB->query('SELECT ForumID FROM forums_topics WHERE ID = '.$TopicID);
list($ForumID) = $DB->next_record();
$DB->query("SELECT MinClassRead FROM forums WHERE ID = ".$ForumID);
$DB->query('SELECT MinClassRead FROM forums WHERE ID = '.$ForumID);
list($MinClassRead) = $DB->next_record();
if (!empty($LoggedUser['DisableForums']) ||
($MinClassRead > $LoggedUser['EffectiveClass'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) ||
@ -83,17 +83,17 @@
}
break;
case "requests_comment" :
case "torrents_comment" :
case "artist_comment":
case "collages_comment" :
case 'requests_comment' :
case 'torrents_comment' :
case 'artist_comment':
case 'collages_comment' :
$Table = $Short.'s';
if ($Short == "collages_comment") {
$Column = "UserID";
if ($Short == 'collages_comment') {
$Column = 'UserID';
} else {
$Column = "AuthorID";
$Column = 'AuthorID';
}
$DB->query("SELECT ".$Short.".Body, um.Username FROM ".$Table." AS ".$Short." JOIN users_main AS um ON um.ID=".$Short.".".$Column." WHERE ".$Short.".ID=".$ID);
$DB->query('SELECT '.$Short.".Body, um.Username FROM ".$Table." AS ".$Short." JOIN users_main AS um ON um.ID=".$Short.".".$Column." WHERE ".$Short.".ID=".$ID);
if ($DB->record_count() < 1) {
error(404);
}
@ -126,12 +126,12 @@
switch ($Short) {
case "user" :
case 'user' :
?>
<p>You are reporting the user <strong><?=display_str($Username)?></strong></p>
<?
break;
case "request_update" :
case 'request_update' :
?>
<p>You are reporting the request:</p>
<table>
@ -163,13 +163,13 @@
</td>
</tr>
<tr>
<td class="label">Release Type</td>
<td class="label">Release type</td>
<td>
<select id="releasetype" name="releasetype">
<option value='0'>---</option>
<option value="0">---</option>
<?
foreach ($ReleaseTypes as $Key => $Val) {
?> <option value='<?=$Key?>' <?=(!empty($ReleaseType) ? ($Key == $ReleaseType ?" selected='selected'" : "") : '') ?>><?=$Val?></option>
?> <option value="<?=$Key?>"<?=(!empty($ReleaseType) ? ($Key == $ReleaseType ? ' selected="selected"' : '') : '') ?>><?=$Val?></option>
<?
}
?>
@ -190,7 +190,7 @@
</div>
<?
break;
case "request" :
case 'request' :
?>
<p>You are reporting the request:</p>
<table>
@ -207,7 +207,7 @@
</table>
<?
break;
case "collage" :
case 'collage' :
?>
<p>You are reporting the collage:</p>
<table>
@ -222,7 +222,7 @@
</table>
<?
break;
case "thread" :
case 'thread' :
?>
<p>You are reporting the thread:</p>
<table>
@ -237,7 +237,7 @@
</table>
<?
break;
case "post" :
case 'post' :
?>
<p>You are reporting the post:</p>
<table>
@ -252,10 +252,10 @@
</table>
<?
break;
case "requests_comment" :
case "torrents_comment" :
case "artist_comment":
case "collages_comment" :
case 'requests_comment' :
case 'torrents_comment' :
case 'artist_comment':
case 'collages_comment' :
?>
<p>You are reporting the <?=$Types[$Short]['title']?>:</p>
<table>

View File

@ -32,7 +32,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h2.2]2.2[/url]. Your torrent was reported because it was a duplicate of another torrent.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h2.2]2.2[/url]. Your torrent was reported because it was a duplicate of another torrent.'
)
),
'banned' => array(
@ -48,7 +48,7 @@
'upload' => '0',
'warn' => '4',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h1.2]1.2[/url]. You have uploaded material that is currently forbidden. Items on the Do Not Upload list (at the top of the [url=http://'.NONSSL_SITE_URL.'/upload.php]upload page[/url]) and in the [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h1.2]Specifically Banned[/url] portion of the uploading rules cannot be uploaded to the site. Do not upload them unless your torrent meets a condition specified in the comments of the DNU list.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h1.2]1.2[/url]. You have uploaded material that is currently forbidden. Items on the Do Not Upload list (at the top of the [url=https://'.SSL_SITE_URL.'/upload.php]upload page[/url]) and in the [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h1.2]Specifically Banned[/url] portion of the uploading rules cannot be uploaded to the site. Do not upload them unless your torrent meets a condition specified in the comments of the DNU list.
Your torrent was reported because it contained material from the DNU list or from the Specifically Banned section of the rules.'
)
),
@ -106,7 +106,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h2.2]2.2[/url]. Your torrent was reported because it was trumped by another torrent.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h2.2]2.2[/url]. Your torrent was reported because it was trumped by another torrent.'
)
),
'private_trump' => array(
@ -146,7 +146,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.16]2.3.16[/url]. Properly tag your music files. Certain meta tags (e.g., ID3, Vorbis) are required on all music uploads. Make sure to use the appropriate tag format for your files (e.g., no ID3 tags for FLAC - see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.8]2.2.10.8[/url]). ID3v2 tags for files are highly recommended over ID3v1. ID3 are recommended for AC3 torrents but are not mandatory because the format does not natively support file metadata tagging (for AC3, the file names become the vehicle for correctly labeling media files). Torrents uploaded with both good ID3v1 tags and blank ID3v2 tags (a dual set of tags) are trumpable by torrents with either just good ID3v1 tags or good ID3v2 tags (a single set of tags). If you upload an album missing one or more of the required tags, then another user may add the tags, re-upload, and report your torrent for deletion.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.16]2.3.16[/url]. Properly tag your music files. Certain meta tags (e.g., ID3, Vorbis) are required on all music uploads. Make sure to use the appropriate tag format for your files (e.g., no ID3 tags for FLAC - see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.8]2.2.10.8[/url]). ID3v2 tags for files are highly recommended over ID3v1. ID3 are recommended for AC3 torrents but are not mandatory because the format does not natively support file metadata tagging (for AC3, the file names become the vehicle for correctly labeling media files). Torrents uploaded with both good ID3v1 tags and blank ID3v2 tags (a dual set of tags) are trumpable by torrents with either just good ID3v1 tags or good ID3v2 tags (a single set of tags). If you upload an album missing one or more of the required tags, then another user may add the tags, re-upload, and report your torrent for deletion.
Your torrent was reported because it was trumped by another torrent with improved metadata tags.'
)
),
@ -166,7 +166,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.5.5]2.5.5[/url]. Vinyl rips may be trumped by better-sounding rips of the same bit depth, regardless of lineage information (see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.9]2.3.9[/url]).
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.5.5]2.5.5[/url]. Vinyl rips may be trumped by better-sounding rips of the same bit depth, regardless of lineage information (see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.9]2.3.9[/url]).
Your torrent was reported as it was trumped by a better-sounding vinyl rip.'
)
),
@ -185,8 +185,8 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.2]2.3.2[/url]. Name your directories with meaningful titles, such as "Artist - Album (Year) - Format." The minimum acceptable is "Album" although it is preferable to include more information. If the directory name does not include this minimum then another user can rename the directory, re-upload, and report your torrent for deletion. In addition, torrent folders that are named using the scene convention will be trumpable if the Scene label is absent from the torrent.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.3]2.3.3[/url]. Avoid creating unnecessary nested folders (such as an extra folder for the actual album) inside your properly named directory. A torrent with unnecessary nested folders is trumpable by a torrent with such folders removed. For single disc albums, all audio files must be included in the main torrent folder. For multi-disc albums, the main torrent folder may include one sub-folder that holds the audio file contents for each disc in the box set, i.e., the main torrent folder is "Adele - 19 (2008) - FLAC" while appropriate sub-folders may include "19 (Disc 1of2)" or "19" and "Live From The Hotel Cafe (Disc 2of2)" or "Acoustic Set Live From The Hotel Cafe, Los Angeles." Additional folders are unnecessary because they do nothing to improve the organization of the torrent. If you are uncertain about what to do for other cases, PM a staff member for guidance.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.2]2.3.2[/url]. Name your directories with meaningful titles, such as "Artist - Album (Year) - Format." The minimum acceptable is "Album" although it is preferable to include more information. If the directory name does not include this minimum then another user can rename the directory, re-upload, and report your torrent for deletion. In addition, torrent folders that are named using the scene convention will be trumpable if the Scene label is absent from the torrent.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.3]2.3.3[/url]. Avoid creating unnecessary nested folders (such as an extra folder for the actual album) inside your properly named directory. A torrent with unnecessary nested folders is trumpable by a torrent with such folders removed. For single disc albums, all audio files must be included in the main torrent folder. For multi-disc albums, the main torrent folder may include one sub-folder that holds the audio file contents for each disc in the box set, i.e., the main torrent folder is "Adele - 19 (2008) - FLAC" while appropriate sub-folders may include "19 (Disc 1of2)" or "19" and "Live From The Hotel Cafe (Disc 2of2)" or "Acoustic Set Live From The Hotel Cafe, Los Angeles." Additional folders are unnecessary because they do nothing to improve the organization of the torrent. If you are uncertain about what to do for other cases, PM a staff member for guidance.
Your torrent was reported because it was trumped by another torrent with an improved folder name and directory structure.'
)
),
@ -205,7 +205,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.11]2.3.11[/url]. File names must accurately reflect the song titles. You may not have file names like 01track.mp3, 02track.mp3, etc. Torrents containing files that are named with incorrect song titles can be trumped by properly labeled torrents. Also, torrents that are sourced from the scene but do not have the Scene label must comply with site naming rules (no release group names in the file names, no advertisements in the file names, etc.). If all the letters in the track titles are capitalized, the torrent is trumpable. If you upload an album with improper file names, then another user may fix the file names, re-upload, and report yours for deletion.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.11]2.3.11[/url]. File names must accurately reflect the song titles. You may not have file names like 01track.mp3, 02track.mp3, etc. Torrents containing files that are named with incorrect song titles can be trumped by properly labeled torrents. Also, torrents that are sourced from the scene but do not have the Scene label must comply with site naming rules (no release group names in the file names, no advertisements in the file names, etc.). If all the letters in the track titles are capitalized, the torrent is trumpable. If you upload an album with improper file names, then another user may fix the file names, re-upload, and report yours for deletion.
Your torrent was reported because it was trumped by another torrent with improved file names.'
)
),
@ -225,8 +225,8 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.19]2.1.19[/url]. All music torrents must represent a complete release, and may not be missing tracks (or discs in the case of a multi-disc release).
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.19.2]2.1.19.2[/url]. A single track (e.g., one MP3 file) cannot be uploaded on its own unless it is an officially released single. If a specific track can only be found on an album, the entire album must be uploaded in the torrent.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.19]2.1.19[/url]. All music torrents must represent a complete release, and may not be missing tracks (or discs in the case of a multi-disc release).
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.19.2]2.1.19.2[/url]. A single track (e.g., one MP3 file) cannot be uploaded on its own unless it is an officially released single. If a specific track can only be found on an album, the entire album must be uploaded in the torrent.
Your torrent was reported because it was missing tracks.'
)
),
@ -245,8 +245,8 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.19]2.1.19[/url]. All music torrents must represent a complete release, and may not be missing tracks (or discs in the case of a multi-disc release).
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.19.1]2.1.19.1[/url]. If an album is released as a multi-disc set (or box set) of CDs or vinyl discs, then it must be uploaded as a single torrent. Preferably, each individual CD rip in a multi-disc set should be organized in its own folder (see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.12]2.3.12[/url]).
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.19]2.1.19[/url]. All music torrents must represent a complete release, and may not be missing tracks (or discs in the case of a multi-disc release).
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.19.1]2.1.19.1[/url]. If an album is released as a multi-disc set (or box set) of CDs or vinyl discs, then it must be uploaded as a single torrent. Preferably, each individual CD rip in a multi-disc set should be organized in its own folder (see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.12]2.3.12[/url]).
Your torrent was reported because it was missing discs.'
)
),
@ -266,7 +266,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.19.3]2.1.19.3[/url]. Bonus discs may be uploaded separately in accordance with [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h2.4]2.4[/url]. Please note that individual bonus tracks cannot be uploaded without the rest of the album. Bonus tracks are not bonus discs. Enhanced audio CDs with data or video tracks must be uploaded without the non-audio tracks. If you want to share the videos or data, you may host the files off-site with a file sharing service and include the link to that service in your torrent description.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.19.3]2.1.19.3[/url]. Bonus discs may be uploaded separately in accordance with [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h2.4]2.4[/url]. Please note that individual bonus tracks cannot be uploaded without the rest of the album. Bonus tracks are not bonus discs. Enhanced audio CDs with data or video tracks must be uploaded without the non-audio tracks. If you want to share the videos or data, you may host the files off-site with a file sharing service and include the link to that service in your torrent description.
Your torrent was reported because it contained only bonus tracks without the full album.'
)
),
@ -286,7 +286,7 @@
'upload' => '0',
'warn' => '2',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.2]2.1.2[/url]. No transcodes or re-encodes of lossy releases are acceptable here.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.2]2.1.2[/url]. No transcodes or re-encodes of lossy releases are acceptable here.
Your torrent was reported because it contained transcoded audio files.'
)
),
@ -304,8 +304,8 @@
'upload' => '0',
'warn' => '2',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.3]2.1.3[/url]. Music releases must have an average bitrate of at least 192 kbps regardless of the format. Exceptions: The following VBR encodes may go under the 192 kbps limit: LAME V2 (VBR), V1 (VBR), V0 (VBR), APS (VBR), APX (VBR), MP3 192 (VBR), and AAC ~192 (VBR) to AAC ~256 (VBR) releases.
Your torrent was reported because it contained one of more audio files that did not meet the minimum bitrate requirement.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.3]2.1.3[/url]. Music releases must have an average bitrate of at least 192 kbps regardless of the format. Exceptions: The following VBR encodes may go under the 192 kbps limit: LAME V2 (VBR), V1 (VBR), V0 (VBR), APS (VBR), APX (VBR), MP3 192 (VBR), and AAC ~192 (VBR) to AAC ~256 (VBR) releases.
Your torrent was reported because it contained one or more audio files that did not meet the minimum bitrate requirement.'
)
),
'mutt' => array(
@ -322,7 +322,7 @@
'upload' => '0',
'warn' => '2',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.6]2.1.6[/url]. All music torrents must be encoded with a single encoder using the same settings.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.6]2.1.6[/url]. All music torrents must be encoded with a single encoder using the same settings.
Your torrent was reported because it contained one or more audio files that were encoded by different audio encoders or with different encoder settings.'
)
),
@ -342,8 +342,8 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.5]2.1.5[/url]. Albums must not be ripped or uploaded as a single track.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.5.1]2.1.5.1[/url]. If the tracks on the original CD were separate, you must rip them to separate files. Any unsplit FLAC rips lacking a cue sheet will be deleted outright. Any unsplit FLAC rip that includes a cue sheet will be trumpable by a properly split FLAC torrent. CDs with single tracks can be uploaded without prior splitting.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.5]2.1.5[/url]. Albums must not be ripped or uploaded as a single track.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.5.1]2.1.5.1[/url]. If the tracks on the original CD were separate, you must rip them to separate files. Any unsplit FLAC rips lacking a cue sheet will be deleted outright. Any unsplit FLAC rip that includes a cue sheet will be trumpable by a properly split FLAC torrent. CDs with single tracks can be uploaded without prior splitting.
Your torrent was reported because it contained a single-track rip instead of a rip consisting of separate audio files.'
)
),
@ -362,9 +362,9 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.16]2.3.16[/url]. Properly tag your music files.
The Uploading Rules require that all uploads be properly tagged. Your torrent has been marked as having poor tags. It is now listed on [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the required tags and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Tag Trump" and indicate in the report comments that you have fixed the tags. Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having bad tags and is now eligible for trumping through the [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] listing.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.16]2.3.16[/url]. Properly tag your music files.
The Uploading Rules require that all uploads be properly tagged. Your torrent has been marked as having poor tags. It is now listed on [url=https://'.SSL_SITE_URL.'/better.php]Better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the required tags and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Tag Trump" and indicate in the report comments that you have fixed the tags. Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having bad tags and is now eligible for trumping through the [url=https://'.SSL_SITE_URL.'/better.php]Better.php[/url] listing.'
)
),
'folders_bad' => array(
@ -380,9 +380,9 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.2]2.3.2[/url]. Name your directories with meaningful titles, such as "Artist - Album (Year) - Format."
The Uploading Rules require that all uploads contain torrent directories with meaningful names. Your torrent has been marked as having a poorly named torrent directory. It is now listed on [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the folder/directory name(s) and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Folder Trump" and indicate in the report comments that you have fixed the directory name(s). Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having a bad folder name (or directory structure) and is now eligible for trumping through the [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] listing.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.2]2.3.2[/url]. Name your directories with meaningful titles, such as "Artist - Album (Year) - Format."
The Uploading Rules require that all uploads contain torrent directories with meaningful names. Your torrent has been marked as having a poorly named torrent directory. It is now listed on [url=https://'.SSL_SITE_URL.'/better.php]Better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the folder/directory name(s) and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Folder Trump" and indicate in the report comments that you have fixed the directory name(s). Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having a bad folder name (or directory structure) and is now eligible for trumping through the [url=https://'.SSL_SITE_URL.'/better.php]Better.php[/url] listing.'
)
),
'wrong_format' => array(
@ -398,7 +398,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.4]2.1.4[/url]. Bitrates must accurately reflect encoder presets or the average bitrate of the audio files. You are responsible for supplying correct format and bitrate information on the upload page.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.4]2.1.4[/url]. Bitrates must accurately reflect encoder presets or the average bitrate of the audio files. You are responsible for supplying correct format and bitrate information on the upload page.
Your torrent has now been labeled using the appropriate format and bitrate.'
)
),
@ -432,7 +432,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.1]2.1.1[/url]. The only formats allowed for music are:
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.1]2.1.1[/url]. The only formats allowed for music are:
Lossy: MP3, AAC, AC3, DTS
Lossless: FLAC
Your torrent was reported because it contained a disallowed format.'
@ -454,7 +454,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.4]2.1.4[/url]. Bitrates must accurately reflect encoder presets or the average bitrate of the audio files. You are responsible for supplying correct format and bitrate information on the upload page.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.4]2.1.4[/url]. Bitrates must accurately reflect encoder presets or the average bitrate of the audio files. You are responsible for supplying correct format and bitrate information on the upload page.
Your torrent was reported because the bitrates of one or more audio files had been misrepresented.'
)
),
@ -472,7 +472,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.11]2.1.11[/url]. Music ripped from the radio (Satellite or FM), television, the web, or podcasts are not allowed.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.11]2.1.11[/url]. Music ripped from the radio (Satellite or FM), television, the web, or podcasts are not allowed.
The only allowable media formats are CD, DVD, Vinyl, Soundboard, SACD, DAT, Cassette, WEB, and Blu-ray.'
)
),
@ -490,7 +490,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.20]2.1.20[/url]. User made discographies may not be uploaded. Multi-album torrents are not allowed on the site under any circumstances. That means no discographies, Pitchfork compilations, etc. If releases (e.g., CD singles) were never released as a bundled set, do not upload them together. Live Soundboard material should be uploaded as one torrent per night, per show, or per venue. Including more than one show in a torrent results in a multi-album torrent.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.20]2.1.20[/url]. User made discographies may not be uploaded. Multi-album torrents are not allowed on the site under any circumstances. That means no discographies, Pitchfork compilations, etc. If releases (e.g., CD singles) were never released as a bundled set, do not upload them together. Live Soundboard material should be uploaded as one torrent per night, per show, or per venue. Including more than one show in a torrent results in a multi-album torrent.
Your torrent was reported because it consisted of a discography.'
)
),
@ -508,8 +508,8 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.16]2.1.16[/url]. User-made compilations are not allowed.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.16.1]2.1.16.1[/url]. These are defined as compilations made by the uploader or anyone else who does not officially represent the artist or the label. Compilations must be reasonably official. User-made and unofficial multichannel mixes are also not allowed.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.16]2.1.16[/url]. User-made compilations are not allowed.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.16.1]2.1.16.1[/url]. These are defined as compilations made by the uploader or anyone else who does not officially represent the artist or the label. Compilations must be reasonably official. User-made and unofficial multichannel mixes are also not allowed.
Your torrent was reported because it was a user compilation.'
)
),
@ -526,7 +526,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.9]2.3.9[/url]. All lossless analog rips should include clear information about source lineage. All lossless SACD digital layer analog rips and vinyl rips must include clear information about recording equipment used (see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#h2.8]2.8[/url]). If you used a USB turntable for a vinyl rip, clearly indicate this in your lineage information. Also include all intermediate steps up to lossless encoding, such as the program used for mastering, sound card used, etc. Lossless analog rips missing rip information can be trumped by better documented lossless analog rips of equal or better quality. In order to trump a lossless analog rip without a lineage, this lineage must be included as a .txt or .log file within the new torrent.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.9]2.3.9[/url]. All lossless analog rips should include clear information about source lineage. All lossless SACD digital layer analog rips and vinyl rips must include clear information about recording equipment used (see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#h2.8]2.8[/url]). If you used a USB turntable for a vinyl rip, clearly indicate this in your lineage information. Also include all intermediate steps up to lossless encoding, such as the program used for mastering, sound card used, etc. Lossless analog rips missing rip information can be trumped by better documented lossless analog rips of equal or better quality. In order to trump a lossless analog rip without a lineage, this lineage must be included as a .txt or .log file within the new torrent.
Your torrent is now eligible for trumping by a better-sounding rip with complete lineage information.'
)
),
@ -544,8 +544,8 @@
'upload' => '0',
'warn' => '4',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9]2.2.10.9[/url]. No log editing is permitted.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9.1]2.2.10.9.1[/url]. Forging log data is a serious misrepresentation of quality, and will result in a warning and the loss of your uploading privileges when the edited log is found. We recommend that you do not open the rip log file for any reason. However, if you must open the rip log, do not edit anything in the file for any reason. If you discover that one of your software settings is incorrect in the ripping software preferences, you must rip the CD again with the proper settings. Do not consolidate logs under any circumstances. If you must re-rip specific tracks or an entire disc and the rip results happen to have the new log appended to the original, leave them as is. Do not remove any part of either log, and never copy/paste parts of a new log over an old log.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9]2.2.10.9[/url]. No log editing is permitted.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9.1]2.2.10.9.1[/url]. Forging log data is a serious misrepresentation of quality, and will result in a warning and the loss of your uploading privileges when the edited log is found. We recommend that you do not open the rip log file for any reason. However, if you must open the rip log, do not edit anything in the file for any reason. If you discover that one of your software settings is incorrect in the ripping software preferences, you must rip the CD again with the proper settings. Do not consolidate logs under any circumstances. If you must re-rip specific tracks or an entire disc and the rip results happen to have the new log appended to the original, leave them as is. Do not remove any part of either log, and never copy/paste parts of a new log over an old log.
Your torrent was reported because it contained an edited log (either edited by you or someone else). For questions about your uploading privileges, you must PM the staff member who handled this log case.'
)
),
@ -563,7 +563,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.12]2.1.12[/url]. No unofficial audience recordings may be uploaded. These include but are not limited to AUD (Audience), IEM (In Ear Monitor), ALD (Assistive Listening Device), Mini-Disc, and Matrix-sourced recordings (see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.6.3]2.6.3[/url]).
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.12]2.1.12[/url]. No unofficial audience recordings may be uploaded. These include but are not limited to AUD (Audience), IEM (In Ear Monitor), ALD (Assistive Listening Device), Mini-Disc, and Matrix-sourced recordings (see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.6.3]2.6.3[/url]).
Your torrent was reported because it was sourced from an audience recording.'
)
),
@ -580,10 +580,10 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.11]2.3.11[/url]. File names must accurately reflect the song titles. You may not have file names like 01track.mp3, 02track.mp3, etc. Torrents containing files that are named with incorrect song titles can be trumped by properly labeled torrents. Also, torrents that are sourced from the scene but do not have the Scene label must comply with site naming rules (no release group names in the file names, no advertisements in the file names, etc.). If all the letters in the track titles are capitalized, the torrent is trumpable.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.13]2.3.13[/url]. Track numbers are required in file names (e.g., "01 - TrackName.mp3"). If a torrent without track numbers in the file names is uploaded, then a torrent with the track numbers in the file names can take its place. When formatted properly, file names will sort in order by track number or playing order. Also see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.3.14]2.3.14[/url].
The Uploading Rules require that all uploads contain audio tracks with accurate file names. Your torrent has been marked as having incorrect or incomplete file names. It is now listed on [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the file names and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Bad File Names Trump" and indicate in the report comments that you have fixed the file names. Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having bad file names and is now eligible for trumping through the [url=http://'.NONSSL_SITE_URL.'/better.php]Better.php[/url] listing.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.11]2.3.11[/url]. File names must accurately reflect the song titles. You may not have file names like 01track.mp3, 02track.mp3, etc. Torrents containing files that are named with incorrect song titles can be trumped by properly labeled torrents. Also, torrents that are sourced from the scene but do not have the Scene label must comply with site naming rules (no release group names in the file names, no advertisements in the file names, etc.). If all the letters in the track titles are capitalized, the torrent is trumpable.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.13]2.3.13[/url]. Track numbers are required in file names (e.g., "01 - TrackName.mp3"). If a torrent without track numbers in the file names is uploaded, then a torrent with the track numbers in the file names can take its place. When formatted properly, file names will sort in order by track number or playing order. Also see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.3.14]2.3.14[/url].
The Uploading Rules require that all uploads contain audio tracks with accurate file names. Your torrent has been marked as having incorrect or incomplete file names. It is now listed on [url=https://'.SSL_SITE_URL.'/better.php]better.php[/url] and is eligible for trumping. You are of course free to fix this torrent yourself. Add or fix the file names and upload the replacement torrent to the site. Then, report (RP) the older torrent using the category "Bad File Names Trump" and indicate in the report comments that you have fixed the file names. Be sure to provide a link (PL) to the new replacement torrent.
Your torrent has been labeled as having bad file names and is now eligible for trumping through the [url=https://'.SSL_SITE_URL.'/better.php]better.php[/url] listing.'
)
),
'cassette' => array(
@ -591,7 +591,7 @@
'reason' => '17',
'title' => 'Unapproved Cassette',
'report_messages' => array(
"If the album was never released other than on cassette, please include a source."
'If the album was never released other than on cassette, please include a source.'
),
'report_fields' => array(
'link' => '0'
@ -600,10 +600,10 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.10.1]2.10.1[/url]. Cassettes are allowed under strict conditions.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.10.1.1]2.10.1.1[/url]. Releases available only on cassette may be uploaded under special strict conditions (see [url=http://'.NONSSL_SITE_URL.'/wiki.php?action=article&amp;id=593]this wiki[/url] for information on cassette ripping). Cassette-sourced uploads must be approved by staff first (see [url=http://'.NONSSL_SITE_URL.'/wiki.php?action=article&amp;id=681]this wiki[/url] for details on the approval process). This also applies to soundboard releases where a tape generation can be found in the lineage (either the tape is not in the first generation or there are multiple tape generations). See [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.6.6]2.6.6[/url] for more information.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.10.1.2]2.10.1.2[/url]. You must contact a moderator privately for approval before uploading. Include proof in the form of discography information from a reputable source as well as the spectrals for 2 songs in your message.
Your torrent was reported because it contains an unapproved cassette rip.'
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.10.1]2.10.1[/url]. Cassettes are allowed under strict conditions.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.10.1.1]2.10.1.1[/url]. Releases available only on cassette may be uploaded under special strict conditions (see [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&amp;id=593]this wiki[/url] for information on cassette ripping).
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.10.1.2]2.10.1.2[/url]. Rips must be made from official cassette sources. Bootlegs are often from unofficial sources and may be deleted if they do not meet high quality audio standards (see rule [rule]2.10.8[/rule]).
When uploading new cassette-sourced torrents, be sure to include in the release description evidence of its uniqueness in the form of discography information from a reputable source as well as pictures of the cassette you ripped.'
)
),
'skips' => array(
@ -611,8 +611,8 @@
'reason' => '13',
'title' => 'Skips / Encode Errors',
'report_messages' => array(
"Please tell us which track(s) we should check.",
"Telling us where precisely in the song the skip/encode error can be heard will help us deal with your torrent."
'Please tell us which track(s) we should check.',
'Telling us where precisely in the song the skip/encode error can be heard will help us deal with your torrent.'
),
'report_fields' => array(
'track' => '2'
@ -621,7 +621,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.8]2.1.8[/url]. Music not sourced from vinyl must not contain pops, clicks, or skips. They will be deleted for rip/encode errors if reported.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.8]2.1.8[/url]. Music not sourced from vinyl must not contain pops, clicks, or skips. They will be deleted for rip/encode errors if reported.
Your torrent was reported because one or more tracks contain encoding errors.'
)
),
@ -639,10 +639,10 @@
'upload' => '0',
'warn' => '0',
'delete' => '0',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.3]2.2.10.3[/url]. A FLAC upload with an EAC or XLD rip log that scores 100% on the log checker replaces one with a lower score... . Note: A FLAC upload with a log that scores 95% for not defeating the audio cache may be rescored to 100% following the procedure outlined in [url=http://'.NONSSL_SITE_URL.'/wiki.php?action=article&amp;id=219]this wiki[/url].
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.5]2.2.10.5[/url]. XLD and EAC logs in languages other than English require a manual log checker score adjustment by staff.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.6.2]2.2.10.6.2[/url]. If you created a CD range rip that has matching CRCs for test and copy, and where every track has an AccurateRip score of 2 or more, then you may submit your torrent for manual score adjustment.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9.2]2.2.10.9.2[/url]. If you find that an appended log has not been scored properly, please report the torrent and use the log rescore option.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.3]2.2.10.3[/url]. A FLAC upload with an EAC or XLD rip log that scores 100% on the log checker replaces one with a lower score... . Note: A FLAC upload with a log that scores 95% for not defeating the audio cache may be rescored to 100% following the procedure outlined in [url=https://'.SSL_SITE_URL.'/wiki.php?action=article&amp;id=219]this wiki[/url].
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.5]2.2.10.5[/url]. XLD and EAC logs in languages other than English require a manual log checker score adjustment by staff.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.6.2]2.2.10.6.2[/url]. If you created a CD range rip that has matching CRCs for test and copy, and where every track has an AccurateRip score of 2 or more, then you may submit your torrent for manual score adjustment.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.2.10.9.2]2.2.10.9.2[/url]. If you find that an appended log has not been scored properly, please report the torrent and use the log rescore option.
Your torrent has now been properly scored by the staff.'
)
)
@ -662,7 +662,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.2]4.1.2[/url]. All applications must come with a crack, keygen, or other method of ensuring that downloaders can install them easily. App torrents with keygens, cracks, or patches that do not work or torrents missing clear installation instructions will be deleted if reported. No exceptions.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.2]4.1.2[/url]. All applications must come with a crack, keygen, or other method of ensuring that downloaders can install them easily. App torrents with keygens, cracks, or patches that do not work or torrents missing clear installation instructions will be deleted if reported. No exceptions.
Your torrent was reported because it was missing an installation method.'
)
),
@ -680,8 +680,8 @@
'upload' => '0',
'warn' => '4',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r1.2.5]1.2.5[/url]. Games of any kind. No games of any kind for PC, Mac, Linux, mobile devices, or any other platform are allowed.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.7]4.1.7[/url]. Games of any kind are prohibited (see [url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r1.2.5]1.2.5[/url]).
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r1.2.5]1.2.5[/url]. Games of any kind. No games of any kind for PC, Mac, Linux, mobile devices, or any other platform are allowed.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.7]4.1.7[/url]. Games of any kind are prohibited (see [url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r1.2.5]1.2.5[/url]).
Your torrent was reported because it contained a game disc rip.'
)
),
@ -699,7 +699,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.3]4.1.3[/url]. App releases must not be freely available tools. Application releases cannot be freely downloaded anywhere from any official source. Nor may you upload open source applications where the source code is available for free.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.3]4.1.3[/url]. App releases must not be freely available tools. Application releases cannot be freely downloaded anywhere from any official source. Nor may you upload open source applications where the source code is available for free.
Your torrent was reported because it contained a freely available application.'
)
),
@ -717,7 +717,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.4]4.1.4[/url]. Release descriptions for applications must contain good information about the application. You should either have a small description of the program (either taken from its web site or from an NFO file) or a link to the information -- but ideally both. Torrents missing this information will be deleted when reported.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.4]4.1.4[/url]. Release descriptions for applications must contain good information about the application. You should either have a small description of the program (either taken from its web site or from an NFO file) or a link to the information -- but ideally both. Torrents missing this information will be deleted when reported.
Your torrent was reported because it lacked adequate release information.'
)
),
@ -735,8 +735,8 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.18]2.1.18[/url]. Sound Sample Packs must be uploaded as applications.
[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.9]4.1.9[/url]. Sound sample packs, template collections, and font collections are allowed if they are official releases, not freely available, and unarchived. Sound sample packs, template collections, and font collections must be official compilations and they must not be uploaded as an archive. The files contained inside the torrent must not be archived so that users can see what the pack contains. That means if sound sample packs are in WAV format, they must be uploaded as WAV. If the font collection, template collection, or sound sample pack was originally released as an archive, you must unpack the files before uploading them in a torrent. None of the contents in these packs and collections may be freely available.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.18]2.1.18[/url]. Sound Sample Packs must be uploaded as applications.
[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.9]4.1.9[/url]. Sound sample packs, template collections, and font collections are allowed if they are official releases, not freely available, and unarchived. Sound sample packs, template collections, and font collections must be official compilations and they must not be uploaded as an archive. The files contained inside the torrent must not be archived so that users can see what the pack contains. That means if sound sample packs are in WAV format, they must be uploaded as WAV. If the font collection, template collection, or sound sample pack was originally released as an archive, you must unpack the files before uploading them in a torrent. None of the contents in these packs and collections may be freely available.
Your torrent was reported because it was an archived collection.'
)
),
@ -754,7 +754,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.11]4.1.11[/url]. Collections of cracks, keygens or serials are not allowed. The crack, keygen, or serial for an application must be in a torrent with its corresponding application. It cannot be uploaded separately from the application.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.11]4.1.11[/url]. Collections of cracks, keygens or serials are not allowed. The crack, keygen, or serial for an application must be in a torrent with its corresponding application. It cannot be uploaded separately from the application.
Your torrent was reported because it contained a collection of serials, keygens, or cracks.'
)
),
@ -772,7 +772,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.12]4.1.12[/url]. Torrents containing hacking or cracking tools are prohibited.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.12]4.1.12[/url]. Torrents containing hacking or cracking tools are prohibited.
Your torrent was reported because it contained a hacking tool.'
)
),
@ -790,7 +790,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.14]4.1.14[/url]. All applications must be complete.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.14]4.1.14[/url]. All applications must be complete.
The torrent was determined to be infected with a virus or trojan. In the future, please scan all potential uploads with an antivirus program such as AVG, Avast, or MS Security Essentials.
Your torrent was reported because it contained a virus or trojan.'
)
@ -809,7 +809,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r4.1.14]4.1.14[/url]. All applications must be complete.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r4.1.14]4.1.14[/url]. All applications must be complete.
This program was determined to be not fully functional.
Your torrent was reported because it contained a program that did not work or no longer works.'
)
@ -829,7 +829,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r6.5]6.5[/url]. Collections/packs of ebooks are prohibited, even if each title is somehow related to other ebook titles in some way. All ebooks must be uploaded individually and cannot be archived (users must be able to see the ebook format in the torrent).
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r6.5]6.5[/url]. Collections/packs of ebooks are prohibited, even if each title is somehow related to other ebook titles in some way. All ebooks must be uploaded individually and cannot be archived (users must be able to see the ebook format in the torrent).
Your torrent was reported because it contained a collection or pack of ebooks.'
)
)
@ -850,7 +850,7 @@
'upload' => '0',
'warn' => '0',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r2.1.8]2.1.8[/url]. Music not sourced from vinyl must not contain pops, clicks, or skips. They will be deleted for rip/encode errors if reported.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r2.1.8]2.1.8[/url]. Music not sourced from vinyl must not contain pops, clicks, or skips. They will be deleted for rip/encode errors if reported.
Your torrent was reported because one or more audiobook tracks contain encoding errors.'
)
)
@ -870,7 +870,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r7.3]7.3[/url]. Tutorials on how to use musical instruments, vocal training, producing music, or otherwise learning the theory and practice of music are the only allowed topics. No material outside of these topics is allowed. For example, instruction videos about Kung Fu training, dance lessons, beer brewing, or photography are not permitted here. What is considered allowable under these topics is ultimately at the discretion of the staff.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r7.3]7.3[/url]. Tutorials on how to use musical instruments, vocal training, producing music, or otherwise learning the theory and practice of music are the only allowed topics. No material outside of these topics is allowed. For example, instruction videos about Kung Fu training, dance lessons, beer brewing, or photography are not permitted here. What is considered allowable under these topics is ultimately at the discretion of the staff.
Your torrent was reported because it contained a video that has no relevance to the allowed music-related topics on the site.'
)
)
@ -890,7 +890,7 @@
'upload' => '0',
'warn' => '1',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r3.3]3.3[/url]. No radio talk shows or podcasts are allowed. What.CD is primarily a music site, and those recordings do not belong in any torrent category.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r3.3]3.3[/url]. No radio talk shows or podcasts are allowed. What.CD is primarily a music site, and those recordings do not belong in any torrent category.
Your torrent was reported because it contained audio files sourced from a talk show or podcast.'
)
)
@ -910,7 +910,7 @@
'upload' => '0',
'warn' => '',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r5.2.3]5.2.3[/url]. Collections may not span more than one comic title. You may not include multiple, different comic titles in a single collection, e.g., "The Amazing Spider-Man #1" and "The Incredible Hulk #1."
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r5.2.3]5.2.3[/url]. Collections may not span more than one comic title. You may not include multiple, different comic titles in a single collection, e.g., "The Amazing Spider-Man #1" and "The Incredible Hulk #1."
Your torrent was reported because it contained comics from multiple unrelated series.'
)
),
@ -928,7 +928,7 @@
'upload' => '0',
'warn' => '',
'delete' => '1',
'pm' => '[url=http://'.NONSSL_SITE_URL.'/rules.php?p=upload#r5.2.6]5.2.6[/url]. Torrents spanning multiple volumes are too large and must be uploaded as separate volumes.
'pm' => '[url=https://'.SSL_SITE_URL.'/rules.php?p=upload#r5.2.6]5.2.6[/url]. Torrents spanning multiple volumes are too large and must be uploaded as separate volumes.
Your torrent was reported because it contained multiple comic volumes.'
)
)

View File

@ -22,11 +22,11 @@
$TorrentCache = get_group_info($GroupID, true, $RevisionID);
$GroupDetails = $TorrentCache[0];
$TorrentList = $TorrentCache[1];
//Resolve the torrentlist to the one specific torrent being reported
// Resolve the torrentlist to the one specific torrent being reported
foreach ($TorrentList as &$Torrent) {
//Remove unneeded entries
if ($Torrent["ID"] != $TorrentID)
unset($TorrentList[$Torrent["ID"]]);
// Remove unneeded entries
if ($Torrent['ID'] != $TorrentID)
unset($TorrentList[$Torrent['ID']]);
}
// Group details
list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear,
@ -47,9 +47,9 @@
$Title = $AltName;
}
if ($GroupYear > 0) {
$DisplayName.=' [' . $GroupYear . ']';
$AltName.=' [' . $GroupYear . ']';
$Title.= ' [' . $GroupYear . ']';
$DisplayName.= " [$GroupYear]";
$AltName.= " [$GroupYear]";
$Title.= " [$GroupYear]";
}
if ($GroupVanityHouse) {
$DisplayName.=' [Vanity House]';
@ -68,12 +68,11 @@
<div class="header">
<h2>Report a torrent</h2>
</div>
<div class="header">
<h3><?=$DisplayName?></h3>
</div>
<div class="thin">
<table class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : ''?>" id="torrent_details">
<table class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : '' ?>" id="torrent_details">
<tr class="colhead_dark">
<td width="80%"><strong>Reported torrent</strong></td>
<td><strong>Size</strong></td>
@ -102,7 +101,7 @@
<td class="label">Reason:</td>
<td>
<select id="type" name="type" onchange="ChangeReportType()">
<?
<?
if (!empty($Types[$CategoryID])) {
$TypeList = $Types['master'] + $Types[$CategoryID];
$Priorities = array();
@ -116,7 +115,7 @@
foreach ($TypeList as $Type => $Data) {
?>
<option value="<?= $Type ?>"><?= $Data['title'] ?></option>
<? } ?>
<? } ?>
</select>
</td>
</tr>
@ -141,7 +140,6 @@
<script type="text/javascript">ChangeReportType();</script>
</div>
</div>
<input type="submit" value="Submit report" />
</form>

View File

@ -13,24 +13,24 @@
authorize();
if(!is_number($_POST['torrentid'])) {
if (!is_number($_POST['torrentid'])) {
error(404);
} else {
$TorrentID = $_POST['torrentid'];
}
if(!is_number($_POST['categoryid'])) {
if (!is_number($_POST['categoryid'])) {
error(404);
} else {
$CategoryID = $_POST['categoryid'];
}
if(!isset($_POST['type'])) {
if (!isset($_POST['type'])) {
error(404);
} else if (array_key_exists($_POST['type'], $Types[$CategoryID])) {
$Type = $_POST['type'];
$ReportType = $Types[$CategoryID][$Type];
} else if(array_key_exists($_POST['type'],$Types['master'])) {
} else if (array_key_exists($_POST['type'],$Types['master'])) {
$Type = $_POST['type'];
$ReportType = $Types['master'][$Type];
} else {
@ -39,78 +39,78 @@
}
foreach($ReportType['report_fields'] as $Field => $Value) {
if($Value == '1') {
if(empty($_POST[$Field])) {
foreach ($ReportType['report_fields'] as $Field => $Value) {
if ($Value == '1') {
if (empty($_POST[$Field])) {
$Err = "You are missing a required field (".$Field.") for a ".$ReportType['title']." report.";
}
}
}
if(!empty($_POST['sitelink'])) {
if(preg_match_all('/((https?:\/\/)?([a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*\.)?'.NONSSL_SITE_URL.'\/torrents.php\?(id=[0-9]+\&)?torrentid=([0-9]+))/is', $_POST['sitelink'], $Matches)) {
if (!empty($_POST['sitelink'])) {
if (preg_match_all('/((https?:\/\/)?([a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*\.)?'.SSL_SITE_URL.'\/torrents.php\?(id=[0-9]+\&)?torrentid=([0-9]+))/is', $_POST['sitelink'], $Matches)) {
$ExtraIDs = implode(' ', $Matches[6]);
if(in_array($TorrentID, $Matches[6])) {
if (in_array($TorrentID, $Matches[6])) {
$Err = "The extra permalinks you gave included the link to the torrent you're reporting!";
}
} else {
$Err = "Permalink was incorrect, should look like http://".NONSSL_SITE_URL."/torrents.php?torrentid=12345";
$Err = "The permalink was incorrect. It should look like https://".SSL_SITE_URL."/torrents.php?torrentid=12345";
}
} else {
$ExtraIDs = "";
$ExtraIDs = '';
}
if(!empty($_POST['link'])) {
if (!empty($_POST['link'])) {
//resource_type://domain:port/filepathname?query_string#anchor
// http:// www .foo.com /bar
if(preg_match_all('/(https?:\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(:[0-9]{2,5})?(\/(\S)+)?/is', $_POST['link'], $Matches)) {
if (preg_match_all('/(https?:\/\/)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(:[0-9]{2,5})?(\/(\S)+)?/is', $_POST['link'], $Matches)) {
$Links = implode(' ', $Matches[0]);
} else {
$Err = "The extra links you provided weren't links...";
}
} else {
$Links = "";
$Links = '';
}
if(!empty($_POST['image'])) {
if(preg_match("/^(".IMAGE_REGEX.")( ".IMAGE_REGEX.")*$/is", trim($_POST['image']), $Matches)) {
if (!empty($_POST['image'])) {
if (preg_match("/^(".IMAGE_REGEX.")( ".IMAGE_REGEX.")*$/is", trim($_POST['image']), $Matches)) {
$Images = $Matches[0];
} else {
$Err = "The extra image links you provided weren't links to images...";
}
} else {
$Images = "";
$Images = '';
}
if(!empty($_POST['track'])) {
if(preg_match('/([0-9]+( [0-9]+)*)|All/is', $_POST['track'], $Matches)) {
if (!empty($_POST['track'])) {
if (preg_match('/([0-9]+( [0-9]+)*)|All/is', $_POST['track'], $Matches)) {
$Tracks = $Matches[0];
} else {
$Err = "Tracks should be given in a space separated list of numbers (no other characters)";
$Err = 'Tracks should be given in a space separated list of numbers (no other characters)';
}
} else {
$Tracks = "";
$Tracks = '';
}
if(!empty($_POST['extra'])) {
if (!empty($_POST['extra'])) {
$Extra = db_string($_POST['extra']);
} else {
$Err = "As useful as blank reports are, could you be a tiny bit more helpful? (Leave a comment)";
$Err = 'As useful as blank reports are, could you be a tiny bit more helpful? (Leave a comment)';
}
$DB->query("SELECT ID FROM torrents WHERE ID=".$TorrentID);
if($DB->record_count() < 1) {
if ($DB->record_count() < 1) {
$Err = "A torrent with that ID doesn't exist!";
}
if(!empty($Err)) {
if (!empty($Err)) {
error($Err);
include(SERVER_ROOT.'/sections/reportsv2/report.php');
die();
}
$DB->query("SELECT ID FROM reportsv2 WHERE TorrentID=".$TorrentID." AND ReporterID=".db_string($LoggedUser['ID'])." AND ReportedTime > '".time_minus(3)."'");
if($DB->record_count() > 0) {
if ($DB->record_count() > 0) {
header('Location: torrents.php?torrentid='.$TorrentID);
die();
}

View File

@ -215,7 +215,7 @@
Tools::warn_user($UploaderID, $WarnLength, $Reason);
} else {
//This is a bitch for people that don't warn but do other things, it makes me sad.
$AdminComment = "";
$AdminComment = '';
if($Upload) {
//They removed upload
$AdminComment .= "Upload privileges removed by ".$LoggedUser['Username'];
@ -237,9 +237,9 @@
//PM
if($Escaped['uploader_pm'] || $Warning > 0 || isset($Escaped['delete']) || $SendPM) {
if(isset($Escaped['delete'])) {
$PM = "[url=http://".NONSSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."]Your above torrent[/url] was reported and has been deleted.\n\n";
$PM = '[url=https://'.SSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."]Your above torrent[/url] was reported and has been deleted.\n\n";
} else {
$PM = "[url=http://".NONSSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."]Your above torrent[/url] was reported but not deleted.\n\n";
$PM = '[url=https://'.SSL_SITE_URL."/torrents.php?torrentid=".$TorrentID."]Your above torrent[/url] was reported but not deleted.\n\n";
}
$Preset = $ResolveType['resolve_options']['pm'];
@ -249,7 +249,7 @@
}
if($Warning > 0) {
$PM .= "\nThis has resulted in a [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&amp;id=218]".$Warning." week warning.[/url]\n";
$PM .= "\nThis has resulted in a [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;id=218]".$Warning." week warning.[/url]\n";
}
if($Upload) {

View File

@ -7,26 +7,26 @@
*/
$NewRequest = ($_GET['action'] == "new" ? true : false);
$NewRequest = ($_GET['action'] == 'new' ? true : false);
if(!$NewRequest) {
if (!$NewRequest) {
$RequestID = $_GET['id'];
if(!is_number($RequestID)) {
if (!is_number($RequestID)) {
error(404);
}
}
if($NewRequest && ($LoggedUser['BytesUploaded'] < 250*1024*1024 || !check_perms('site_submit_requests'))) {
if ($NewRequest && ($LoggedUser['BytesUploaded'] < 250 * 1024 * 1024 || !check_perms('site_submit_requests'))) {
error('You do not have enough uploaded to make a request.');
}
if(!$NewRequest) {
if(empty($ReturnEdit)) {
if (!$NewRequest) {
if (empty($ReturnEdit)) {
$Request = Requests::get_requests(array($RequestID));
$Request = $Request['matches'][$RequestID];
if(empty($Request)) {
if (empty($Request)) {
error(404);
}
@ -35,11 +35,11 @@
$VoteArray = get_votes_array($RequestID);
$VoteCount = count($VoteArray['Voters']);
$NeedCue = (strpos($LogCue, "Cue") !== false);
$NeedLog = (strpos($LogCue, "Log") !== false);
if($NeedLog) {
if(strpos($LogCue, "%")) {
preg_match("/\d+/", $LogCue, $Matches);
$NeedCue = (strpos($LogCue, 'Cue') !== false);
$NeedLog = (strpos($LogCue, 'Log') !== false);
if ($NeedLog) {
if (strpos($LogCue, '%')) {
preg_match('/\d+/', $LogCue, $Matches);
$MinLogScore = (int) $Matches[0];
}
}
@ -47,29 +47,29 @@
$IsFilled = !empty($TorrentID);
$CategoryName = $Categories[$CategoryID - 1];
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0)));
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == 'Music' && $Year == 0)));
$CanEdit = ((!$IsFilled && $LoggedUser['ID'] == $RequestorID && $VoteCount < 2) || $ProjectCanEdit || check_perms('site_moderate_requests'));
if(!$CanEdit) {
if (!$CanEdit) {
error(403);
}
if($CategoryName == "Music") {
if ($CategoryName == 'Music') {
$ArtistForm = get_request_artists($RequestID);
$BitrateArray = array();
if($BitrateList == "Any") {
if ($BitrateList == 'Any') {
$BitrateArray = array_keys($Bitrates);
} else {
$BitrateArray = array_keys(array_intersect($Bitrates,explode('|', $BitrateList)));
}
$FormatArray = array();
if($FormatList == "Any") {
if ($FormatList == 'Any') {
$FormatArray = array_keys($Formats);
} else {
foreach ($Formats as $Key => $Val) {
if(strpos($FormatList, $Val) !== false) {
if (strpos($FormatList, $Val) !== false) {
$FormatArray[] = $Key;
}
}
@ -77,12 +77,12 @@
$MediaArray = array();
if($MediaList == "Any") {
if ($MediaList == 'Any') {
$MediaArray = array_keys($Media);
} else {
$MediaTemp = explode('|', $MediaList);
foreach ($Media as $Key => $Val) {
if(in_array($Val, $MediaTemp)) {
if (in_array($Val, $MediaTemp)) {
$MediaArray[] = $Key;
}
}
@ -93,7 +93,7 @@
}
}
if($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
if ($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
$DB->query("SELECT Name FROM artists_group WHERE artistid = ".$_GET['artistid']." LIMIT 1");
list($ArtistName) = $DB->next_record();
$ArtistForm = array(
@ -101,7 +101,7 @@
2 => array(),
3 => array()
);
} elseif($NewRequest && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
} elseif ($NewRequest && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
$ArtistForm = Artists::get_artist($_GET['groupid']);
$DB->query("SELECT tg.Name,
tg.Year,
@ -113,7 +113,7 @@
JOIN torrents_tags AS tt ON tt.GroupID=tg.ID
JOIN tags AS t ON t.ID=tt.TagID
WHERE tg.ID = ".$_GET['groupid']);
if(list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
if (list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
$GroupID = trim($_REQUEST['groupid']);
}
}
@ -128,7 +128,7 @@
<div class="box pad">
<form action="" method="post" id="request_form" onsubmit="Calculate();">
<div>
<? if(!$NewRequest) { ?>
<? if (!$NewRequest) { ?>
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
<? } ?>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
@ -139,7 +139,7 @@
<tr>
<td colspan="2" class="center">Please make sure your request follows <a href="rules.php?p=requests">the request rules!</a></td>
</tr>
<? if($NewRequest || $CanEdit) { ?>
<? if ($NewRequest || $CanEdit) { ?>
<tr>
<td class="label">
Type
@ -158,7 +158,7 @@
<p id="vawarning" class="hidden">Please use the multiple artists feature rather than adding "Various Artists" as an artist; read <a href="wiki.php?action=article&amp;id=369">this</a> for more information.</p>
<?
if(!empty($ArtistForm)) {
if (!empty($ArtistForm)) {
$First = true;
foreach($ArtistForm as $Importance => $ArtistNames) {
foreach($ArtistNames as $Artist) {
@ -173,7 +173,7 @@
<option value="3"<?=($Importance == '3' ? ' selected="selected"' : '')?>>Remixer</option>
<option value="3"<?=($Importance == '7' ? ' selected="selected"' : '')?>>Producer</option>
</select>
<?if($First) { ?><a href="#" onclick="AddArtistField();return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField();return false;" class="brackets">&minus;</a> <? } $First = false;?>
<? if ($First) { ?><a href="#" onclick="AddArtistField();return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField();return false;" class="brackets">&minus;</a><? } $First = false; ?>
<br />
<? }
}
@ -193,7 +193,6 @@
?>
</td>
</tr>
<tr>
<td class="label">Title</td>
<td>
@ -225,7 +224,7 @@
<input type="text" name="year" size="5" value="<?=(!empty($Year) ? display_str($Year) : '')?>" />
</td>
</tr>
<? if($NewRequest || $CanEdit) { ?>
<? if ($NewRequest || $CanEdit) { ?>
<tr id="image_tr">
<td class="label">Image</td>
<td>
@ -238,7 +237,7 @@
<td>
<?
$GenreTags = $Cache->get_value('genre_tags');
if(!$GenreTags) {
if (!$GenreTags) {
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
$GenreTags = $DB->collect('Name');
$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
@ -246,7 +245,7 @@
?>
<select id="genre_tags" name="genre_tags" onchange="add_tag();return false;" >
<option>---</option>
<? foreach(Misc::display_array($GenreTags) as $Genre){ ?>
<? foreach (Misc::display_array($GenreTags) as $Genre){ ?>
<option value="<?=$Genre ?>"><?=$Genre ?></option>
<? } ?>
</select>
@ -257,12 +256,12 @@
There is a list of official tags to the left of the text box. Please use these tags instead of "unofficial" tags (e.g. use the official "<strong class="important_text_alt">drum.and.bass</strong>" tag, instead of an unofficial "<strong class="important_text">dnb</strong>" tag.).
</td>
</tr>
<? if($NewRequest || $CanEdit) { ?>
<? if ($NewRequest || $CanEdit) { ?>
<tr id="releasetypes_tr">
<td class="label">Release type</td>
<td>
<select id="releasetype" name="releasetype">
<option value='0'>---</option>
<option value="0">---</option>
<?
foreach ($ReleaseTypes as $Key => $Val) {
//echo '<h1>'.$ReleaseType.'</h1>'; die();
@ -279,10 +278,12 @@
<input type="checkbox" name="all_formats" id="toggle_formats" onchange="Toggle('formats', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($FormatArray) && (count($FormatArray) == count($Formats)) ? ' checked="checked"' : '')?> /><label for="toggle_formats"> All</label>
<span style="float: right;"><strong>NB: You cannot require a log or cue unless FLAC is an allowed format</strong></span>
<? foreach ($Formats as $Key => $Val) {
if($Key % 8 == 0) echo "<br />";?>
<input type="checkbox" name="formats[]" value="<?=$Key?>" onchange="ToggleLogCue(); if(!this.checked) { $('#toggle_formats').raw().checked = false; }" id="format_<?=$Key?>"
if ($Key % 8 == 0) {
echo '<br />';
} ?>
<input type="checkbox" name="formats[]" value="<?=$Key?>" onchange="ToggleLogCue(); if (!this.checked) { $('#toggle_formats').raw().checked = false; }" id="format_<?=$Key?>"
<?=(!empty($FormatArray) && in_array($Key, $FormatArray) ? ' checked="checked"' : '')?> /><label for="format_<?=$Key?>"> <?=$Val?></label>
<? }?>
<? } ?>
</td>
</tr>
<tr id="bitrates_tr">
@ -290,11 +291,13 @@
<td>
<input type="checkbox" name="all_bitrates" id="toggle_bitrates" onchange="Toggle('bitrates', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($BitrateArray) && (count($BitrateArray) == count($Bitrates)) ? ' checked="checked"' : '')?> /><label for="toggle_bitrates"> All</label>
<? foreach ($Bitrates as $Key => $Val) {
if($Key % 8 == 0) echo "<br />";?>
if ($Key % 8 == 0) {
echo '<br />';
} ?>
<input type="checkbox" name="bitrates[]" value="<?=$Key?>" id="bitrate_<?=$Key?>"
<?=(!empty($BitrateArray) && in_array($Key, $BitrateArray) ? ' checked="checked" ' : '')?>
onchange="if(!this.checked) { $('#toggle_bitrates').raw().checked = false; }" /><label for="bitrate_<?=$Key?>"> <?=$Val?></label>
<? }?>
onchange="if (!this.checked) { $('#toggle_bitrates').raw().checked = false; }" /><label for="bitrate_<?=$Key?>"> <?=$Val?></label>
<? } ?>
</td>
</tr>
<tr id="media_tr">
@ -302,11 +305,13 @@
<td>
<input type="checkbox" name="all_media" id="toggle_media" onchange="Toggle('media', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($MediaArray) && (count($MediaArray) == count($Media)) ? ' checked="checked"' : '')?> /><label for="toggle_media"> All</label>
<? foreach ($Media as $Key => $Val) {
if($Key % 8 == 0) echo "<br />";?>
if ($Key % 8 == 0) {
echo '<br />';
} ?>
<input type="checkbox" name="media[]" value="<?=$Key?>" id="media_<?=$Key?>"
<?=(!empty($MediaArray) && in_array($Key, $MediaArray) ? ' checked="checked" ' : '')?>
onchange="if(!this.checked) { $('#toggle_media').raw().checked = false; }" /><label for="media_<?=$Key?>"> <?=$Val?></label>
<? }?>
onchange="if (!this.checked) { $('#toggle_media').raw().checked = false; }" /><label for="media_<?=$Key?>"> <?=$Val?></label>
<? } ?>
</td>
</tr>
<tr id="logcue_tr" class="hidden">
@ -326,11 +331,11 @@
<textarea name="description" cols="70" rows="7"><?=(!empty($Description) ? $Description : '')?></textarea> <br />
</td>
</tr>
<? if(check_perms('site_moderate_requests')) { ?>
<? if (check_perms('site_moderate_requests')) { ?>
<tr>
<td class="label">Torrent group</td>
<td>
https://what.cd/torrents.php?id=<input type="text" name="groupid" value="<?=$GroupID?>" size="15" /><br />
https://<?=SSL_SITE_URL?>/torrents.php?id=<input type="text" name="groupid" value="<?=$GroupID?>" size="15" /><br />
If this request matches a torrent group <span style="font-weight: bold;">already existing</span> on the site, please indicate that here.
</td>
</tr>
@ -339,7 +344,7 @@
<tr>
<td class="label">Torrent group</td>
<td>
<a href="torrents.php?id=<?=$GroupID?>">https://what.cd/torrents.php?id=<?=$GroupID?></a><br />
<a href="torrents.php?id=<?=$GroupID?>">https://<?=SSL_SITE_URL?>/torrents.php?id=<?=$GroupID?></a><br />
This request <?=($NewRequest?'will be':'is')?> associated with the above torrent group.
<? if (!$NewRequest) { ?>
If this is incorrect, please <a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>">report this request</a> so that staff can fix it.
@ -348,7 +353,7 @@
</td>
</tr>
<? }
if($NewRequest) { ?>
if ($NewRequest) { ?>
<tr id="voting">
<td class="label">Bounty (MB)</td>
<td>

View File

@ -4,7 +4,7 @@
* This is the page that displays the request to the end user after being created.
*/
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT;
@ -237,7 +237,7 @@
<table class="layout">
<? $VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
$ViewerVote = false;
for($i = 0; $i < $VoteMax; $i++) {
for ($i = 0; $i < $VoteMax; $i++) {
$User = array_shift($RequestVotes['Voters']);
$Boldify = false;
if ($User['UserID'] == $LoggedUser['ID']) {

View File

@ -5,29 +5,29 @@
authorize();
if($_POST['action'] != "takenew" && $_POST['action'] != "takeedit") {
if ($_POST['action'] != 'takenew' && $_POST['action'] != 'takeedit') {
error(0);
}
$NewRequest = ($_POST['action'] == "takenew");
$NewRequest = ($_POST['action'] == 'takenew');
if(!$NewRequest) {
if (!$NewRequest) {
$ReturnEdit = true;
}
if($NewRequest) {
if(!check_perms('site_submit_requests') || $LoggedUser['BytesUploaded'] < 250*1024*1024){
if ($NewRequest) {
if (!check_perms('site_submit_requests') || $LoggedUser['BytesUploaded'] < 250 * 1024 * 1024) {
error(403);
}
} else {
$RequestID = $_POST['requestid'];
if(!is_number($RequestID)) {
if (!is_number($RequestID)) {
error(0);
}
$Request = Requests::get_requests(array($RequestID));
$Request = $Request['matches'][$RequestID];
if(empty($Request)) {
if (empty($Request)) {
error(404);
}
@ -40,132 +40,132 @@
$CategoryName = $Categories[$CategoryID - 1];
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0)));
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID == 0) || ($CategoryName == 'Music' && $Year == 0)));
$CanEdit = ((!$IsFilled && $LoggedUser['ID'] == $RequestorID && $VoteCount < 2) || $ProjectCanEdit || check_perms('site_moderate_requests'));
if(!$CanEdit) {
if (!$CanEdit) {
error(403);
}
}
// Validate
if(empty($_POST['type'])) {
if (empty($_POST['type'])) {
error(0);
}
$CategoryName = $_POST['type'];
$CategoryID = (array_search($CategoryName, $Categories) + 1);
if(empty($CategoryID)) {
if (empty($CategoryID)) {
error(0);
}
if(empty($_POST['title'])) {
$Err = "You forgot to enter the title!";
if (empty($_POST['title'])) {
$Err = 'You forgot to enter the title!';
} else {
$Title = trim($_POST['title']);
}
if(empty($_POST['tags'])) {
$Err = "You forgot to enter any tags!";
if (empty($_POST['tags'])) {
$Err = 'You forgot to enter any tags!';
} else {
$Tags = trim($_POST['tags']);
}
if($NewRequest) {
if(empty($_POST['amount'])) {
$Err = "You forgot to enter any bounty!";
if ($NewRequest) {
if (empty($_POST['amount'])) {
$Err = 'You forgot to enter any bounty!';
} else {
$Bounty = trim($_POST['amount']);
if(!is_number($Bounty)) {
$Err = "Your entered bounty is not a number";
} elseif($Bounty < 100*1024*1024) {
$Err = "Minumum bounty is 100MB";
if (!is_number($Bounty)) {
$Err = 'Your entered bounty is not a number';
} elseif ($Bounty < 100 * 1024 * 1024) {
$Err = 'Minumum bounty is 100 MB.';
}
$Bytes = $Bounty; //From MB to B
}
}
if(empty($_POST['image'])) {
$Image = "";
if (empty($_POST['image'])) {
$Image = '';
} else {
ImageTools::blacklisted($_POST['image']);
if(preg_match("/".IMAGE_REGEX."/", trim($_POST['image'])) > 0) {
if (preg_match('/'.IMAGE_REGEX.'/', trim($_POST['image'])) > 0) {
$Image = trim($_POST['image']);
} else {
$Err = display_str($_POST['image'])." does not appear to be a valid link to an image.";
$Err = display_str($_POST['image']).' does not appear to be a valid link to an image.';
}
}
if(empty($_POST['description'])) {
$Err = "You forgot to enter any description!";
if (empty($_POST['description'])) {
$Err = 'You forgot to enter a description.';
} else {
$Description = trim($_POST['description']);
}
if($CategoryName == "Music") {
if(empty($_POST['artists'])) {
$Err = "You didn't enter any artists";
if ($CategoryName == "Music") {
if (empty($_POST['artists'])) {
$Err = 'You did not enter any artists.';
} else {
$Artists = $_POST['artists'];
$Importance = $_POST['importance'];
}
if(!is_number($_POST['releasetype']) || !array_key_exists($_POST['releasetype'], $ReleaseTypes)) {
$Err = "Please pick a release type";
if (!is_number($_POST['releasetype']) || !array_key_exists($_POST['releasetype'], $ReleaseTypes)) {
$Err = 'Please pick a release type';
}
$ReleaseType = $_POST['releasetype'];
if(empty($_POST['all_formats']) && count($_POST['formats']) != count($Formats)) {
if (empty($_POST['all_formats']) && count($_POST['formats']) != count($Formats)) {
$FormatArray = $_POST['formats'];
if(count($FormatArray) < 1) {
$Err = "You must require at least one format";
if (count($FormatArray) < 1) {
$Err = 'You must require at least one format';
}
} else {
$AllFormats = true;
}
if(empty($_POST['all_bitrates']) && count($_POST['bitrates']) != count($Bitrates)) {
if (empty($_POST['all_bitrates']) && count($_POST['bitrates']) != count($Bitrates)) {
$BitrateArray = $_POST['bitrates'];
if(count($BitrateArray) < 1) {
$Err = "You must require at least one bitrate";
if (count($BitrateArray) < 1) {
$Err = 'You must require at least one bitrate';
}
} else {
$AllBitrates = true;
}
if(empty($_POST['all_media']) && count($_POST['media']) != count($Media)) {
if (empty($_POST['all_media']) && count($_POST['media']) != count($Media)) {
$MediaArray = $_POST['media'];
if(count($MediaArray) < 1) {
$Err = "You must require at least one type of media";
if (count($MediaArray) < 1) {
$Err = 'You must require at least one medium.';
}
} else {
$AllMedia = true;
}
//$Bitrates[1] = FLAC
if(!empty($FormatArray) && in_array(1, $FormatArray)) {
if (!empty($FormatArray) && in_array(1, $FormatArray)) {
$NeedLog = empty($_POST['needlog']) ? false : true;
if($NeedLog) {
if($_POST['minlogscore']) {
if ($NeedLog) {
if ($_POST['minlogscore']) {
$MinLogScore = trim($_POST['minlogscore']);
} else {
$MinLogScore = 0;
}
if(!is_number($MinLogScore)) {
$Err = "You've entered a minimum log score that isn't a number";
if (!is_number($MinLogScore)) {
$Err = 'You have entered a minimum log score that is not a number.';
}
}
$NeedCue = empty($_POST['needcue']) ? false : true;
//FLAC was picked, require either Lossless or 24 bit Lossless
if(!$AllBitrates && !in_array(8, $BitrateArray) && !in_array(9, $BitrateArray)) {
$Err = "You selected FLAC as a format but no possible bitrate to fill it (Lossless or 24 bit Lossless)";
if (!$AllBitrates && !in_array(8, $BitrateArray) && !in_array(9, $BitrateArray)) {
$Err = 'You selected FLAC as a format but no possible bitrate to fill it (Lossless or 24bit Lossless)';
}
if (($NeedCue || $NeedLog)) {
if (!(empty($_POST['all_media']) && $MediaArray[0] == 0)) {
$Err = "Only CD is allowed as media for FLAC Log/Cue Requests.";
$Err = 'Only CD is allowed as media for FLAC + log/cue requests.';
}
}
} else {
@ -177,47 +177,47 @@
// GroupID
if (!empty($_POST['groupid'])) {
$GroupID = trim($_POST['groupid']);
$URLRegex = '/^https?:\/\/(www\.|ssl\.)?'.NONSSL_SITE_URL.'\/torrents\.php\?(page=[0-9]+&)?id=([0-9]+)/i';
$URLRegex = '/^https?:\/\/(www\.|ssl\.)?'.SSL_SITE_URL.'\/torrents\.php\?(page=[0-9]+&)?id=([0-9]+)/i';
if (preg_match($URLRegex, $GroupID, $Matches)) {
$GroupID = $Matches[3];
}
if (is_number($GroupID)) {
$DB->query("SELECT 1 FROM torrents_group WHERE ID = '$GroupID' AND CategoryID = 1");
if ($DB->record_count() == 0) {
$Err = "Torrent Group, if entered, must correspond to a music group on the site.";
$Err = 'The torrent group, if entered, must correspond to a music torrent group on the site.';
}
} else {
$Err = "Torrent Group, if entered, must correspond to a music group on the site.";
$Err = 'The torrent group, if entered, must correspond to a music torrent group on the site.';
}
} elseif ($_POST['groupid'] == '0') {
$GroupID = 0;
}
//Not required
if(!empty($_POST['editioninfo'])) {
if (!empty($_POST['editioninfo'])) {
$EditionInfo = trim($_POST['editioninfo']);
} else {
$EditionInfo = "";
$EditionInfo = '';
}
if(!empty($_POST['cataloguenumber'])) {
if (!empty($_POST['cataloguenumber'])) {
$CatalogueNumber = trim($_POST['cataloguenumber']);
} else {
$CatalogueNumber = "";
$CatalogueNumber = '';
}
if(!empty($_POST['recordlabel'])) {
if (!empty($_POST['recordlabel'])) {
$RecordLabel = trim($_POST['recordlabel']);
} else {
$RecordLabel = "";
$RecordLabel = '';
}
}
if($CategoryName == "Music" || $CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
if(empty($_POST['year'])) {
$Err = "You forgot to enter the year!";
if ($CategoryName == 'Music' || $CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
if (empty($_POST['year'])) {
$Err = 'You forgot to enter the year!';
} else {
$Year = trim($_POST['year']);
if(!is_number($Year)) {
$Err = "Your entered year is not a number";
if (!is_number($Year)) {
$Err = 'Your entered year is not a number.';
}
}
}
@ -226,12 +226,12 @@
if (!empty($_POST['oclc'])) {
$OCLC = trim($_POST['oclc']);
} else {
$OCLC = "";
$OCLC = '';
}
//For refilling on error
if($CategoryName == "Music") {
if ($CategoryName == 'Music') {
$MainArtistCount = 0;
$ArtistNames = array();
$ArtistForm = array(
@ -239,105 +239,105 @@
2 => array(),
3 => array()
);
for($i = 0, $il = count($Artists); $i < $il; $i++) {
if(trim($Artists[$i]) != "") {
if(!in_array($Artists[$i], $ArtistNames)) {
for ($i = 0, $il = count($Artists); $i < $il; $i++) {
if (trim($Artists[$i]) != '') {
if (!in_array($Artists[$i], $ArtistNames)) {
$ArtistForm[$Importance[$i]][] = array('name' => trim($Artists[$i]));
if(in_array($Importance[$i], array(1,4,5,6))) {
if (in_array($Importance[$i], array(1,4,5,6))) {
$MainArtistCount++;
}
$ArtistNames[] = trim($Artists[$i]);
}
}
}
if($MainArtistCount < 1) {
$Err = "Please enter at least one main artist, conductor, composer, or DJ";
if ($MainArtistCount < 1) {
$Err = 'Please enter at least one main artist, conductor, composer, or DJ.';
}
if(!isset($ArtistNames[0])) {
if (!isset($ArtistNames[0])) {
unset($ArtistForm);
}
}
if(!empty($Err)) {
if (!empty($Err)) {
error($Err);
$Div = $_POST['unit'] == 'mb' ? 1024*1024 : 1024*1024*1024;
$Div = $_POST['unit'] == 'mb' ? 1024 * 1024 : 1024 * 1024 * 1024;
$Bounty /= $Div;
include(SERVER_ROOT.'/sections/requests/new_edit.php');
die();
}
//Databasify the input
if($CategoryName == "Music") {
if(empty($AllBitrates)) {
foreach($BitrateArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Bitrates)) {
if ($CategoryName == 'Music') {
if (empty($AllBitrates)) {
foreach ($BitrateArray as $Index => $MasterIndex) {
if (array_key_exists($Index, $Bitrates)) {
$BitrateArray[$Index] = $Bitrates[$MasterIndex];
} else {
//Hax
error(0);
}
}
$BitrateList = implode("|", $BitrateArray);
$BitrateList = implode('|', $BitrateArray);
} else {
$BitrateList = "Any";
$BitrateList = 'Any';
}
if(empty($AllFormats)) {
foreach($FormatArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Formats)) {
if (empty($AllFormats)) {
foreach ($FormatArray as $Index => $MasterIndex) {
if (array_key_exists($Index, $Formats)) {
$FormatArray[$Index] = $Formats[$MasterIndex];
} else {
//Hax
error(0);
}
}
$FormatList = implode("|", $FormatArray);
$FormatList = implode('|', $FormatArray);
} else {
$FormatList = "Any";
$FormatList = 'Any';
}
if(empty($AllMedia)) {
foreach($MediaArray as $Index => $MasterIndex) {
if(array_key_exists($Index, $Media)) {
if (empty($AllMedia)) {
foreach ($MediaArray as $Index => $MasterIndex) {
if (array_key_exists($Index, $Media)) {
$MediaArray[$Index] = $Media[$MasterIndex];
} else {
//Hax
error(0);
}
}
$MediaList = implode("|", $MediaArray);
$MediaList = implode('|', $MediaArray);
} else {
$MediaList = "Any";
$MediaList = 'Any';
}
$LogCue = "";
if($NeedLog) {
$LogCue .= "Log";
if($MinLogScore > 0) {
if($MinLogScore >= 100) {
$LogCue .= " (100%)";
$LogCue = '';
if ($NeedLog) {
$LogCue .= 'Log';
if ($MinLogScore > 0) {
if ($MinLogScore >= 100) {
$LogCue .= ' (100%)';
} else {
$LogCue .= " (>= ".$MinLogScore."%)";
$LogCue .= ' (>= '.$MinLogScore.'%)';
}
}
}
if($NeedCue) {
if($LogCue != "") {
$LogCue .= " + Cue";
if ($NeedCue) {
if ($LogCue != '') {
$LogCue .= ' + Cue';
} else {
$LogCue = "Cue";
$LogCue = 'Cue';
}
}
}
//Query time!
if($CategoryName == "Music") {
if($NewRequest) {
$DB->query("INSERT INTO requests (
if ($CategoryName == 'Music') {
if ($NewRequest) {
$DB->query('INSERT INTO requests (
UserID, TimeAdded, LastVote, CategoryID, Title, Year, Image, Description, RecordLabel,
CatalogueNumber, ReleaseType, BitrateList, FormatList, MediaList, LogCue, Visible, GroupID, OCLC)
VALUES
(".$LoggedUser['ID'].", '".sqltime()."', '".sqltime()."', ".$CategoryID.", '".db_string($Title)."', ".$Year.", '".db_string($Image)."', '".db_string($Description)."','".db_string($RecordLabel)."',
('.$LoggedUser['ID'].", '".sqltime()."', '".sqltime()."', ".$CategoryID.", '".db_string($Title)."', ".$Year.", '".db_string($Image)."', '".db_string($Description)."','".db_string($RecordLabel)."',
'".db_string($CatalogueNumber)."', ".$ReleaseType.", '".$BitrateList."','".$FormatList."', '".$MediaList."', '".$LogCue."', '1', '$GroupID', '".db_string($OCLC)."')");
$RequestID = $DB->inserted_id();
@ -363,7 +363,7 @@
//I almost didn't think of this, we need to be able to delete artists / tags
$DB->query("SELECT ArtistID FROM requests_artists WHERE RequestID = ".$RequestID);
$RequestArtists = $DB->to_array();
foreach($RequestArtists as $RequestArtist) {
foreach ($RequestArtists as $RequestArtist) {
$Cache->delete_value('artists_requests_'.$RequestArtist);
}
$DB->query("DELETE FROM requests_artists WHERE RequestID = ".$RequestID);
@ -383,8 +383,8 @@
*/
foreach($ArtistForm as $Importance => $Artists) {
foreach($Artists as $Num => $Artist) {
foreach ($ArtistForm as $Importance => $Artists) {
foreach ($Artists as $Num => $Artist) {
//1. See if each artist given already exists and if it does, grab the ID.
$DB->query("
SELECT
@ -395,16 +395,16 @@
FROM artists_alias AS aa
WHERE aa.Name = '".db_string($Artist['name'])."'");
while(list($ArtistID, $AliasID, $AliasName, $Redirect) = $DB->next_record(MYSQLI_NUM, false)) {
if(!strcasecmp($Artist['name'], $AliasName)) {
if($Redirect) {
while (list($ArtistID, $AliasID, $AliasName, $Redirect) = $DB->next_record(MYSQLI_NUM, false)) {
if (!strcasecmp($Artist['name'], $AliasName)) {
if ($Redirect) {
$AliasID = $Redirect;
}
$ArtistForm[$Importance][$Num] = array('id' => $ArtistID, 'aliasid' => $AliasID, 'name' => $AliasName);
break;
}
}
if(!$ArtistID) {
if (!$ArtistID) {
//2. For each artist that didn't exist, create an artist.
$DB->query("INSERT INTO artists_group (Name) VALUES ('".db_string($Artist['name'])."')");
$ArtistID = $DB->inserted_id();
@ -421,8 +421,8 @@
//3. Create a row in the requests_artists table for each artist, based on the ID.
foreach($ArtistForm as $Importance => $Artists) {
foreach($Artists as $Num => $Artist) {
foreach ($ArtistForm as $Importance => $Artists) {
foreach ($Artists as $Num => $Artist) {
$DB->query("INSERT IGNORE INTO requests_artists (RequestID, ArtistID, AliasID, Importance) VALUES (".$RequestID.", ".$Artist['id'].", ".$Artist['aliasid'].", '".$Importance."')");
$Cache->increment('stats_album_count');
$Cache->delete_value('artists_requests_'.$Artist['id']);
@ -433,11 +433,11 @@
} else {
//Not a music request anymore, delete music only fields.
if(!$NewRequest) {
if (!$NewRequest) {
$DB->query("SELECT ArtistID FROM requests_artists WHERE RequestID = ".$RequestID);
$OldArtists = $DB->collect('ArtistID');
foreach($OldArtists as $ArtistID) {
if(empty($ArtistID)) { continue; }
foreach ($OldArtists as $ArtistID) {
if (empty($ArtistID)) { continue; }
//Get a count of how many groups or requests use the artist ID
$DB->query("SELECT COUNT(ag.ArtistID)
FROM artists_group as ag
@ -451,7 +451,7 @@
WHERE ta.ArtistID IS NOT NULL
AND ag.ArtistID = '$ArtistID'");
list($GroupCount) = $DB->next_record();
if(($ReqCount + $GroupCount) == 0) {
if (($ReqCount + $GroupCount) == 0) {
//The only group to use this artist
Artists::delete_artist($ArtistID);
} else {
@ -462,9 +462,9 @@
$DB->query("DELETE FROM requests_artists WHERE RequestID = ".$RequestID);
}
if($CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
if ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
//These types require a year field.
if($NewRequest) {
if ($NewRequest) {
$DB->query("INSERT INTO requests (
UserID, TimeAdded, LastVote, CategoryID, Title, Year, Image, Description, Visible, OCLC)
VALUES
@ -483,7 +483,7 @@
WHERE ID = ".$RequestID);
}
} else {
if($NewRequest) {
if ($NewRequest) {
$DB->query("INSERT INTO requests (
UserID, TimeAdded, LastVote, CategoryID, Title, Image, Description, Visible, OCLC)
VALUES
@ -504,12 +504,12 @@
}
//Tags
if(!$NewRequest) {
if (!$NewRequest) {
$DB->query("DELETE FROM requests_tags WHERE RequestID = ".$RequestID);
}
$Tags = array_unique(explode(',', $Tags));
foreach($Tags as $Index => $Tag) {
foreach ($Tags as $Index => $Tag) {
$Tag = Misc::sanitize_tag($Tag);
$Tag = Misc::get_alias_tag($Tag);
$Tags[$Index] = $Tag; //For announce
@ -527,7 +527,7 @@
(".$TagID.", ".$RequestID.")");
}
if($NewRequest) {
if ($NewRequest) {
//Remove the bounty and create the vote
$DB->query("INSERT INTO requests_votes
(RequestID, UserID, Bounty)
@ -539,7 +539,7 @@
if($CategoryName == "Music") {
if ($CategoryName == "Music") {
$Announce = "'".$Title."' - ".Artists::display_artists($ArtistForm, false, false)." https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID." - ".implode(" ", $Tags);
} else {
$Announce = "'".$Title."' - https://".SSL_SITE_URL."/requests.php?action=view&id=".$RequestID." - ".implode(" ", $Tags);

View File

@ -618,7 +618,7 @@ function next_hour() {
AND ul.UserID IS NULL
GROUP BY um.ID");
while (list($Username, $Email) = $DB->next_record()) {
$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at http://".NONSSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at https://".SSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
Misc::send_email($Email, 'Your '.SITE_NAME.' account is about to be disabled', $Body);
}
$DB->query("SELECT um.ID

View File

@ -10,8 +10,8 @@
*****************************************************************/
if (isset($argv[1])) {
if ($argv[1] == "cli_sandbox") {
include("misc/cli_sandbox.php");
if ($argv[1] == 'cli_sandbox') {
include('misc/cli_sandbox.php');
die();
}

View File

@ -5,7 +5,7 @@
View::show_header('Tag Aliases');
$orderby = ($_GET['order']) == "badtags" ? "BadTag" : "AliasTag";
$orderby = ($_GET['order']) == 'badtags' ? 'BadTag' : 'AliasTag';
if (check_perms('users_mod')) {
if (isset($_POST['newalias'])) {
@ -56,7 +56,7 @@
</td>
<? if (check_perms('users_mod')) { ?>
<td>
<input type="submit" value="Add Alias" />
<input type="submit" value="Add alias" />
</td>
<? } ?>
</form>

View File

@ -0,0 +1,265 @@
<?
View::show_header('Batch Tag Editor','validate');
if (!check_perms('users_mod')) {
error(403);
}
// validation functions
$Val->SetFields('tag',true,'string','Enter a single tag to search for.',array('maxlength'=>'200','minlength'=>'2'));
$Val->SetFields('replace',true,'string','Enter a single replacement tag.',array('maxlength'=>'200','minlength'=>'2'));
echo $Val->GenerateJS('tagform');
// some constants to make programmers' lives easier
define('MODE_RENAME',0);
define('MODE_MERGE',1);
?>
<div class="thin">
<h3>Merge/Rename Tags</h3>
<form action="tools.php" method="get" name="tagform" id="tagform" onsubmit="return formVal();">
<input type="hidden" name="action" value="edit_tags" />
<table>
<tr>
<td class="label">
Tag:
</td>
<td>
<input type="text" name="tag" id="tag" />
</td>
<td class="label">
Rename to/merge with tag:
</td>
<td>
<input type="text" name="replace" id="replace" />
</td>
<td class="label">
<input type="checkbox" name="list" id="list" checked="checked" /> <label for="list">List affected rows</label>
</td>
</tr>
<tr>
<td class="center" colspan="5">
<input type="submit" value="Rename/Merge Tags" />
</td>
</tr>
</table>
</form>
<br />
<?
if (isset($_GET['tag']) || isset($_GET['replace'])) {
// validate input
$Err = $Val->ValidateForm($_GET);
if ($Err) {
echo ' <div class="box pad center">
<strong>Error:</strong> '.$Err.'
</div>';
} else {
$Tag = Misc::sanitize_tag($_GET['tag']);
$Replacement = Misc::sanitize_tag($_GET['replace']);
// trying to merge tag with itself would create big problems
if ($Tag == $Replacement) {
echo " <div class=\"box pad center\">
<strong>Error:</strong> Cannot merge tag $Tag with itself (doh).
</div>
</div>";
View::show_footer();
exit;
}
// 1) make sure tag exists
$DB->query("SELECT ID
FROM tags
WHERE Name = '".$Tag."'
LIMIT 1;");
if ($DB->record_count() == 0) {
echo " <div class=\"box pad center\">
<strong>Error:</strong> No such tag found: $Tag
</div>
</div>";
View::show_footer();
exit;
}
list($TagID) = $DB->next_record();
// 2) check if replacement exists
$DB->query("SELECT ID
FROM tags
WHERE Name = '".$Replacement."'
LIMIT 1;");
if ($DB->record_count() == 0 ) {
$Mode = MODE_RENAME;
} else {
$Mode = MODE_MERGE;
}
list($ReplacementID) = $DB->next_record();
if ($_GET['list']) {
$AffectedTorrents = array();
// 3) get a list of affected torrents
$DB->query("SELECT
tg.ID,
ag.ArtistID,
ag.Name,
tg.Name
FROM torrents_group AS tg
LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID
JOIN torrents_tags AS t ON t.GroupID=tg.ID
WHERE t.TagID=$TagID;");
while (list($TorrentID,$ArtistID,$ArtistName,$TorrentName) = $DB->next_record()) {
$Row = ($ArtistName ? "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a> - " : '');
$Row.= "<a href='torrents.php?id=$TorrentID'>".display_str($TorrentName)."</a>";
$AffectedTorrents[] = $Row;
}
// 4) get a list of affected requests
$DB->query("SELECT
ra.RequestID,
ag.ArtistID,
ag.Name,
r.Title
FROM requests AS r
LEFT JOIN requests_artists AS ra ON r.ID=ra.RequestID
LEFT JOIN artists_group AS ag ON ag.ArtistID=ra.ArtistID
JOIN requests_tags AS t ON t.RequestID=r.ID
WHERE t.TagID=$TagID;");
while (list($RequestID,$ArtistID,$ArtistName,$RequestName) = $DB->next_record()) {
$Row = ($ArtistName ? "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a> - " : '');
$Row.= "<a href='requests.php?action=viewrequest&id=$RequestID'>".display_str($RequestName)."</a>";
$AffectedRequests[] = $Row;
}
}
$TotalAffected = 0;
if ($Mode == MODE_RENAME) {
// EASY! just rename the tag
// 5) rename the tag
$DB->query("UPDATE tags
SET Name = '".$Replacement."'
WHERE ID = $TagID
LIMIT 1;");
$TotalAffected = $DB->affected_rows();
} else {
// HARD! merge two tags together and update usage
// 5) remove dupe tags from torrents
// (torrents that have both "old tag" and "replacement tag" set)
$DB->query("SELECT GroupID FROM torrents_tags WHERE TagID=$ReplacementID;");
if ($DB->record_count() > 0 ) {
$Query = "DELETE
FROM torrents_tags
WHERE TagID=$TagID
AND GroupID IN (";
while (list($GroupID) = $DB->next_record()) {
$Query.= $GroupID.',';
}
$Query = substr($Query,0,-1).");";
$DB->query($Query);
$TotalAffected = $DB->affected_rows();
}
// 6) replace old tag in torrents
$DB->query("UPDATE torrents_tags
SET TagID=$ReplacementID
WHERE TagID=$TagID;");
$UsageChange = $DB->affected_rows();
// 7) remove dupe tags from artists
$DB->query("SELECT ArtistID FROM artists_tags WHERE TagID=$ReplacementID;");
if ($DB->record_count() > 0 ) {
$Query = "DELETE
FROM artists_tags
WHERE TagID=$TagID
AND ArtistID IN (";
while (list($ArtistID) = $DB->next_record()) {
$Query.= $ArtistID.',';
}
$Query = substr($Query,0,-1).");";
$DB->query($Query);
$TotalAffected += $DB->affected_rows();
}
// 8) replace old tag in artists
$DB->query("UPDATE artists_tags
SET TagID=$ReplacementID
WHERE TagID=$TagID;");
$UsageChange += $DB->affected_rows();
// 9) remove dupe tags from requests
$DB->query("SELECT RequestID FROM requests_tags WHERE TagID=$ReplacementID;");
if ($DB->record_count() > 0) {
$Query = "DELETE
FROM requests_tags
WHERE TagID=$TagID
AND RequestID IN (";
while (list($RequestID) = $DB->next_record()) {
$Query.= $RequestID.',';
}
$Query = substr($Query,0,-1).");";
$DB->query($Query);
$TotalAffected += $DB->affected_rows();
}
// 10) replace old tag in requests
$DB->query("UPDATE requests_tags
SET TagID=$ReplacementID
WHERE TagID=$TagID;");
$UsageChange += $DB->affected_rows();
$TotalAffected += $UsageChange;
// 11) finally, remove old tag completely
$DB->query("DELETE
FROM tags
WHERE ID=$TagID
LIMIT 1");
// 12) update usage count for replacement tag
$DB->query("UPDATE tags
SET Uses=Uses+$UsageChange
WHERE ID=$ReplacementID
LIMIT 1");
} // if ($Mode == MODE_MERGE)
echo '<div class="box pad center"><strong>Success!</strong> Affected entries: '.number_format($TotalAffected).'</div>';
if ($_GET['list']) {
?>
<br>
<table>
<tr class="colhead">
<td>
Affected torrent groups
</td>
</tr>
<?
if (count($AffectedTorrents)) {
foreach ($AffectedTorrents as $Row) {
echo "<tr><td>$Row</td></tr>";
}
}
?>
<tr class="colhead">
<td>
Affected requests
</td>
</tr>
<?
if (count($AffectedRequests)) {
foreach ($AffectedRequests as $Row) {
echo "<tr><td>$Row</td></tr>";
}
}
?>
</table>
<?
}
} // if (!$Err)
} // if ( isset($_GET['tag']) || isset($_GET['replace']) )
echo '</div>';
View::show_footer();
?>

View File

@ -69,8 +69,10 @@
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Misc</td></tr>
<? if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=edit_tags">Batch tag editor</a></td></tr>
<? }
if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=manipulate_tree">Manipulate tree</a></td></tr>
<? }
if (check_perms('admin_update_geoip')) { ?>

View File

@ -1,5 +1,5 @@
<?
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
$Where = array();
@ -445,19 +445,47 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
}
// append extra info to torrent title
$ExtraInfo='';
$AddExtra='';
if ($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
if ($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
$ExtraInfo = '';
$AddExtra = '';
if ($Format) {
$ExtraInfo.=$Format;
$AddExtra=' / ';
}
if ($Encoding) {
$ExtraInfo.=$AddExtra.$Encoding;
$AddExtra=' / ';
}
// "FLAC / Lossless / Log (100%) / Cue / CD";
if ($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
if ($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
if ($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
if ($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
if ($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
if ($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
if ($IsSnatched) { if ($GroupCategoryID == 1) { $ExtraInfo .= ' / '; } $ExtraInfo.= Format::torrent_label('Snatched!'); }
if ($ExtraInfo!='') {
if ($HasLog) {
$ExtraInfo.=$AddExtra.'Log ('.$LogScore.'%)';
$AddExtra = ' / ';
}
if ($HasCue) {
$ExtraInfo.=$AddExtra.'Cue';
$AddExtra = ' / ';
}
if ($Media) {
$ExtraInfo.=$AddExtra.$Media;
$AddExtra = ' / ';
}
if ($Scene) {
$ExtraInfo.=$AddExtra.'Scene';
$AddExtra = ' / ';
}
if ($Year > 0) {
$ExtraInfo.=$AddExtra.$Year;
$AddExtra = ' ';
}
if ($RemasterTitle) {
$ExtraInfo.=$AddExtra.$RemasterTitle;
}
if ($IsSnatched) {
if ($GroupCategoryID == 1) {
$ExtraInfo .= ' / ';
}
$ExtraInfo.= Format::torrent_label('Snatched!');
}
if ($ExtraInfo != '') {
$ExtraInfo = "- [$ExtraInfo]";
}
@ -473,7 +501,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
// print row
?>
<tr class="torrent row<?=$Highlight . ($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '')?>">
<td style="padding:8px;text-align:center;"><strong><?=$Rank?></strong></td>
<td style="padding: 8px; text-align: center;"><strong><?=$Rank?></strong></td>
<td class="center cats_col"><div title="<?=$TorrentTags->title()?>" class="<?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div></td>
<td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?>
@ -485,7 +513,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
<span><a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a></span>
<strong><?=$DisplayName?></strong> <?=$ExtraInfo?><?if($Reported){?> - <strong class="torrent_label tl_reported" title="Reported">Reported</strong><?}?>
<strong><?=$DisplayName?></strong> <?=$ExtraInfo?><? if ($Reported) { ?> - <strong class="torrent_label tl_reported" title="Reported">Reported</strong><? } ?>
<span class="bookmark" style="float: right;">
<?
if ($IsBookmarked) {
@ -496,7 +524,6 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
<? } ?>
</span>
<div class="tags"><?=$TorrentTags->format()?></div>
</div>
</td>
<td style="text-align: right;" class="nobr"><?=Format::get_size($Size)?></td>

View File

@ -186,7 +186,7 @@
$DisplayName = $DisplayName. " [$GroupYear]";
}
if ($GroupVanityHouse) {
$DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]';
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
}
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();

View File

@ -23,7 +23,7 @@
define('EXPLAIN_HACK',false);
if (EXPLAIN_HACK){
if (EXPLAIN_HACK) {
$SCFR = '';
} else {
$SCFR = 'SQL_CALC_FOUND_ROWS';
@ -31,7 +31,7 @@
// Function to build a SQL WHERE to search for a string
// Offers exact searching, fulltext searching, and negative searching
function build_search($SearchStr,$Field,$Exact=false,$SQLWhere='',$FullText=0,&$FilterString='') {
function build_search($SearchStr, $Field, $Exact=false, $SQLWhere='', $FullText=0, &$FilterString='') {
if ($SQLWhere != '') {
$AddWhere = false;
} else {
@ -645,7 +645,7 @@ function header_link($SortKey,$DefaultWay = 'DESC') {
}
}
// List of pages
// List of pages
$Pages = Format::get_pages($Page,$TorrentCount,TORRENTS_PER_PAGE);
// Gets tacked onto torrent download URLs

View File

@ -305,7 +305,48 @@ function header_link($SortKey,$DefaultWay="desc") {
// Tag list
if (!empty($SearchWords['taglist'])) {
global $Cache, $DB;
//Get tag aliases.
$TagAliases = $Cache->get_value('tag_aliases_search');
if (!$TagAliases) {
$DB->query("SELECT ID,BadTag,AliasTag FROM tag_aliases ORDER BY BadTag");
$TagAliases = $DB->to_array();
//Unify tag aliases to be in_this_format as tags not in.this.format
array_walk_recursive($TagAliases, create_function('&$val', '$val = preg_replace("/\./","_", $val);'));
//Clean up the array for smaller cache size
foreach ($TagAliases as &$TagAlias) {
foreach (array_keys($TagAlias) as $Key) {
if (is_numeric($Key)) {
unset($TagAlias[$Key]);
}
}
}
$Cache->cache_value('tag_aliases_search', $TagAliases, 3600 * 24 * 7); // cache for 7 days
}
//Get tags
$Tags = $SearchWords['taglist'];
//Replace bad tags with tag aliases
//In other news oh God I'm going to hell for all this preg_replace, but they're kept in two separate formats
for ($i = 0; $i < sizeof($Tags['include']) ; $i++) {
foreach ($TagAliases as $TagAlias) {
if ($Tags['include'][$i] === $TagAlias['BadTag']) {
$Tags['include'][$i] = $TagAlias['AliasTag'];
break;
}
}
}
for ($i = 0; $i < sizeof($Tags['exclude']) ; $i++) {
foreach ($TagAliases as $TagAlias) {
if (preg_replace('/^!/', '', $Tags['exclude'][$i]) === $TagAlias['BadTag']) {
$Tags['exclude'][$i] = '!'.$TagAlias['AliasTag'];
break;
}
}
}
//Only keep unique entries after unifying tag standard
$Tags['include'] = array_unique($Tags['include']);
$Tags['exclude'] = array_unique($Tags['exclude']);
$TagListString = implode(", ", array_merge($Tags['include'], $Tags['exclude']));
if (!$EnableNegation && !empty($Tags['exclude'])) {
$Tags['include'] = array_merge($Tags['include'], $Tags['exclude']);
unset($Tags['exclude']);
@ -389,7 +430,7 @@ function header_link($SortKey,$DefaultWay="desc") {
}
}
if (isset($_GET['haslog']) && $_GET['haslog']!=='') {
if (isset($_GET['haslog']) && $_GET['haslog'] !== '') {
if ($_GET['haslog'] == 100) {
$SphQL->where('logscore', 100);
$SphQLTor->where('logscore', 100);
@ -712,7 +753,7 @@ function header_link($SortKey,$DefaultWay="desc") {
<tr id="tagfilter">
<td class="label">Tags (comma-separated):</td>
<td colspan="3" class="ft_taglist">
<input type="text" size="40" id="tags" name="taglist" class="inputtext smaller" title="Use !tag to exclude tag" value="<?=str_replace('_','.',Format::form('taglist', true))?>" />&nbsp;
<input type="text" size="40" id="tags" name="taglist" class="inputtext smaller" title="Use !tag to exclude tag" value="<?=str_replace('_','.',display_str($TagListString)) /* Use aliased tags, not actual query string. */ ?>" />&nbsp;
<input type="radio" name="tags_type" id="tags_type0" value="0"<?Format::selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>&nbsp;&nbsp;
<input type="radio" name="tags_type" id="tags_type1" value="1"<?Format::selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
</td>
@ -933,14 +974,14 @@ function header_link($SortKey,$DefaultWay="desc") {
}
$SnatchedGroupClass = $GroupInfo['Flags']['IsSnatched'] ? ' snatched_group' : '';
if ($GroupResults && (count($Torrents)>1 || isset($GroupedCategories[$CategoryID-1]))) {
if ($GroupResults && (count($Torrents) > 1 || isset($GroupedCategories[$CategoryID - 1]))) {
// These torrents are in a group
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
if ($GroupYear > 0) {
$DisplayName .= " [$GroupYear]";
}
if ($GroupVanityHouse) {
$DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]';
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
}
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
?>
@ -1040,7 +1081,7 @@ function header_link($SortKey,$DefaultWay="desc") {
<? } ?>
| <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" title="Report">RP</a> ]
</span>
&raquo; <a href="torrents.php?id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Data)?><?if($Reported){?> / <strong class="torrent_label tl_reported" title="Reported">Reported</strong><?}?></a>
&raquo; <a href="torrents.php?id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Data)?><? if ($Reported) { ?> / <strong class="torrent_label tl_reported" title="Reported">Reported</strong><? } ?></a>
</td>
<td><?=$Data['FileCount']?></td>
<td class="nobr"><?=time_diff($Data['Time'], 1)?></td>

View File

@ -7,7 +7,7 @@ function compare($X, $Y) {
define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default
define('MAX_COLLAGES', 5); // How many normal collages should be shown by default
// Bookmarks::has_bookmarked()
// Bookmarks::has_bookmarked()
include(SERVER_ROOT.'/classes/class_text.php');
$Text = NEW TEXT;

View File

@ -201,7 +201,7 @@ function get_reports($TorrentID){
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes) {
function filelist($Str) {
return "</td><td>" . Format::get_size($Str[1]) . "</td></tr>";
return '</td><td>' . Format::get_size($Str[1]) . '</td></tr>';
}
$LastRemasterYear = '-';
@ -265,10 +265,10 @@ function filelist($Str) {
//There was a type but it wasn't an option!
$ReportType = $Types['master']['other'];
}
$ReportInfo .= "<tr><td>" . (check_perms('admin_reports') ? "<a href='user.php?id=$ReporterID'>$ReporterName</a> <a href='reportsv2.php?view=report&amp;id=$ReportID'>reported it</a> " : "Someone reported it ") . time_diff($ReportedTime, 2, true, true) . " for the reason '" . $ReportType['title'] . "':";
$ReportInfo .= "<blockquote>" . $Text->full_format($ReportReason) . "</blockquote></td></tr>";
$ReportInfo .= '<tr><td>' . (check_perms('admin_reports') ? "<a href=\"user.php?id=$ReporterID\">$ReporterName</a> <a href=\"reportsv2.php?view=report&amp;id=$ReportID\">reported it</a> " : 'Someone reported it ') . time_diff($ReportedTime, 2, true, true) . ' for the reason "' . $ReportType['title'] . '":';
$ReportInfo .= '<blockquote>' . $Text->full_format($ReportReason) . '</blockquote></td></tr>';
}
$ReportInfo .= "</table>";
$ReportInfo .= '</table>';
}
$CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear)));
@ -276,12 +276,15 @@ function filelist($Str) {
$RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&amp;torrentid=' . $TorrentID . '" class="brackets">Regenerate</a>' : '';
$FileTable = '
<table class="filelist_table">
<tr class="colhead_dark"><td>
<div class="filelist_title" style="float: left;">File Name' . $RegenLink . '</div>
<tr class="colhead_dark">
<td>
<div class="filelist_title" style="float: left;">File name' . $RegenLink . '</div>
<div class="filelist_path" style="float: right;">' . ($FilePath ? "/$FilePath/" : '') . '</div>
</td><td>
</td>
<td>
<strong>Size</strong>
</td></tr>';
</td>
</tr>';
if (substr($FileList, -3) == '}}}') { // Old style
$FileListSplit = explode('|||', $FileList);
foreach ($FileListSplit as $File) {
@ -393,7 +396,7 @@ function filelist($Str) {
<tr class="releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition group_torrent">
<td colspan="5" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?= $GroupID ?>, <?= $EditionID ?>, this, event)" title="Collapse this edition. Hold &quot;Ctrl&quot; while clicking to collapse all editions in this torrent group.">&minus;</a> <?= Torrents::edition_string($Torrent, $TorrentDetails) ?></strong></td>
</tr>
<?
<?
}
$LastRemasterTitle = $RemasterTitle;
$LastRemasterYear = $RemasterYear;
@ -401,21 +404,19 @@ function filelist($Str) {
$LastRemasterCatalogueNumber = $RemasterCatalogueNumber;
$LastMedia = $Media;
?>
<tr class="torrent_row releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition_<?= $EditionID ?> group_torrent<?= $IsSnatched ? ' snatched_torrent' : '' ?>" style="font-weight: normal;" id="torrent<?= $TorrentID ?>">
<td>
<span>[ <a href="torrents.php?action=download&amp;id=<?= $TorrentID ?>&amp;authkey=<?= $LoggedUser['AuthKey'] ?>&amp;torrent_pass=<?= $LoggedUser['torrent_pass'] ?>" title="Download"><?= $HasFile ? 'DL' : 'Missing' ?></a>
<? if (Torrents::can_use_token($Torrent)) { ?>
<? if (Torrents::can_use_token($Torrent)) { ?>
| <a href="torrents.php?action=download&amp;id=<?= $TorrentID ?>&amp;authkey=<?= $LoggedUser['AuthKey'] ?>&amp;torrent_pass=<?= $LoggedUser['torrent_pass'] ?>&amp;usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
<? } ?>
<? } ?>
| <a href="reportsv2.php?action=report&amp;id=<?= $TorrentID ?>" title="Report">RP</a>
<? if ($CanEdit) { ?>
<? if ($CanEdit) { ?>
| <a href="torrents.php?action=edit&amp;id=<?= $TorrentID ?>" title="Edit">ED</a>
<? } ?>
<? if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
<? }
if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
| <a href="torrents.php?action=delete&amp;torrentid=<?= $TorrentID ?>" title="Remove">RM</a>
<? } ?>
<? } ?>
| <a href="torrents.php?torrentid=<?= $TorrentID ?>" title="Permalink">PL</a>
]</span>
&raquo; <a href="#" onclick="$('#torrent_<?= $TorrentID ?>').toggle(); return false;"><?= $ExtraInfo; ?></a>
@ -425,53 +426,50 @@ function filelist($Str) {
<td><?= number_format($Seeders) ?></td>
<td><?= number_format($Leechers) ?></td>
</tr>
<tr class="releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition_<?= $EditionID ?> torrentdetails pad <? if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<? } ?>" id="torrent_<?= $TorrentID; ?>">
<tr class="releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition_<?= $EditionID ?> torrentdetails pad<? if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?> hidden<? } ?>" id="torrent_<?= $TorrentID; ?>">
<td colspan="5">
<blockquote>
Uploaded by <?= Users::format_username($UserID, false, false, false) ?> <?= time_diff($TorrentTime); ?>
<? if ($Seeders == 0) { ?>
<? if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?>
<? if ($Seeders == 0) {
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?>
<br /><strong>Last active: <?= time_diff($LastActive); ?></strong>
<? } else { ?>
<? } else { ?>
<br />Last active: <?= time_diff($LastActive); ?>
<? } ?>
<? if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
<? }
if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
<br /><a href="torrents.php?action=reseed&amp;torrentid=<?= $TorrentID ?>&amp;groupid=<?= $GroupID ?>" class="brackets">Request re-seed</a>
<? } ?>
<? } ?>
<? }
} ?>
</blockquote>
<? if (check_perms('site_moderate_requests')) { ?>
<? if (check_perms('site_moderate_requests')) { ?>
<div class="linkbox">
<a href="torrents.php?action=masspm&amp;id=<?= $GroupID ?>&amp;torrentid=<?= $TorrentID ?>" class="brackets">Mass PM snatchers</a>
</div>
<? } ?>
<? } ?>
<div class="linkbox">
<a href="#" class="brackets" onclick="show_peers('<?= $TorrentID ?>', 0);return false;">View peer list</a>
<? if (check_perms('site_view_torrent_snatchlist')) { ?>
<? if (check_perms('site_view_torrent_snatchlist')) { ?>
<a href="#" class="brackets" onclick="show_downloads('<?= $TorrentID ?>', 0);return false;" title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
<a href="#" class="brackets" onclick="show_snatches('<?= $TorrentID ?>', 0);return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
<? } ?>
<? } ?>
<a href="#" class="brackets" onclick="show_files('<?= $TorrentID ?>');return false;">View file list</a>
<? if ($Reported) { ?>
<? if ($Reported) { ?>
<a href="#" class="brackets" onclick="show_reported('<?= $TorrentID ?>');return false;">View report information</a>
<? } ?>
<? } ?>
</div>
<div id="peers_<?= $TorrentID ?>" class="hidden"></div>
<div id="downloads_<?= $TorrentID ?>" class="hidden"></div>
<div id="snatches_<?= $TorrentID ?>" class="hidden"></div>
<div id="files_<?= $TorrentID ?>" class="hidden"><?= $FileTable ?></div>
<? if ($Reported) { ?>
<? if ($Reported) { ?>
<div id="reported_<?= $TorrentID ?>" class="hidden"><?= $ReportInfo ?></div>
<? } ?>
<?
<? }
if (!empty($Description)) {
echo '<blockquote>' . $Text->full_format($Description) . '</blockquote>';
}
?>
</td>
</tr>
<?
<?
}
}

View File

@ -58,7 +58,7 @@
}
$DB->query("SELECT ID FROM torrents WHERE GroupID='$GroupID'");
while(list($TorrentID) = $DB->next_record()) {
while (list($TorrentID) = $DB->next_record()) {
$Cache->delete_value('torrent_download_'.$TorrentID);
}
Torrents::update_hash($GroupID);

View File

@ -2,13 +2,19 @@
$GroupID = $_GET['groupid'];
$TorrentID = $_GET['torrentid'];
if(!is_number($GroupID) || !is_number($TorrentID)) { error(0); }
if (!is_number($GroupID) || !is_number($TorrentID)) {
error(0);
}
$DB->query("SELECT last_action, LastReseedRequest, UserID, Time FROM torrents WHERE ID='$TorrentID'");
list($LastActive, $LastReseedRequest, $UploaderID, $UploadedTime) = $DB->next_record();
if(time()-strtotime($LastReseedRequest)<864000) { error("There was already a re-seed request for this torrent within the past 10 days."); }
if ($LastActive == '0000-00-00 00:00:00' || time() - strtotime($LastActive) < 345678) { error(403); }
if (time() - strtotime($LastReseedRequest) < 864000) {
error('There was already a re-seed request for this torrent within the past 10 days.');
}
if ($LastActive == '0000-00-00 00:00:00' || time() - strtotime($LastActive) < 345678) {
error(403);
}
$DB->query("UPDATE torrents SET LastReseedRequest=NOW() WHERE ID='$TorrentID'");
@ -27,14 +33,16 @@
$UserID = $User['uid'];
$DB->query("SELECT UserID FROM top_snatchers WHERE UserID='$UserID'");
if($DB->record_count()>0) { continue; }
if ($DB->record_count() > 0) {
continue;
}
$UserInfo = Users::user_info($UserID);
$Username = $UserInfo['Username'];
$TimeStamp = $User['tstamp'];
$Request = "Hi $Username,
The user [url=http://".SITE_URL."/user.php?id=$LoggedUser[ID]]$LoggedUser[Username][/url] has requested a re-seed for the torrent [url=http://".SITE_URL."/torrents.php?id=$GroupID&torrentid=$TorrentID]".$Name."[/url], which you snatched on ".date('M d Y', $TimeStamp).". The torrent is now un-seeded, and we need your help to resurrect it!
The user [url=https://".SSL_SITE_URL."/user.php?id=$LoggedUser[ID]]$LoggedUser[Username][/url] has requested a re-seed for the torrent [url=https://".SSL_SITE_URL."/torrents.php?id=$GroupID&torrentid=$TorrentID]".$Name."[/url], which you snatched on ".date('M d Y', $TimeStamp).". The torrent is now un-seeded, and we need your help to resurrect it!
The exact process for re-seeding a torrent is slightly different for each client, but the concept is the same. The idea is to download the .torrent file and open it in your client, and point your client to the location where the data files are, then initiate a hash check.
@ -49,7 +57,7 @@
$Request = "Hi $Username,
The user [url=http://".SITE_URL."/user.php?id=$LoggedUser[ID]]$LoggedUser[Username][/url] has requested a re-seed for the torrent [url=http://".SITE_URL."/torrents.php?id=$GroupID&torrentid=$TorrentID]".$Name."[/url], which you uploaded on ".date('M d Y', strtotime($UploadedTime)).". The torrent is now un-seeded, and we need your help to resurrect it!
The user [url=https://".SSL_SITE_URL."/user.php?id=$LoggedUser[ID]]$LoggedUser[Username][/url] has requested a re-seed for the torrent [url=https://".SSL_SITE_URL."/torrents.php?id=$GroupID&torrentid=$TorrentID]".$Name."[/url], which you uploaded on ".date('M d Y', strtotime($UploadedTime)).". The torrent is now un-seeded, and we need your help to resurrect it!
The exact process for re-seeding a torrent is slightly different for each client, but the concept is the same. The idea is to download the .torrent file and open it in your client, and point your client to the location where the data files are, then initiate a hash check.

View File

@ -8,19 +8,25 @@
// The "order by x" links on columns headers
function header_link($SortKey,$DefaultWay="DESC") {
global $Order,$Way;
if($SortKey==$Order) {
if($Way=="DESC") { $NewWay="ASC"; }
else { $NewWay="DESC"; }
} else { $NewWay=$DefaultWay; }
if ($SortKey == $Order) {
if ($Way == 'DESC') {
$NewWay = 'ASC';
} else {
$NewWay = 'DESC';
}
} else {
$NewWay = $DefaultWay;
}
return "torrents.php?way=".$NewWay."&amp;order=".$SortKey."&amp;".Format::get_url(array('way','order'));
}
$UserID = $_GET['userid'];
if(!is_number($UserID)) { error(0); }
if (!is_number($UserID)) {
error(0);
}
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
if (!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
$Page = $_GET['page'];
$Limit = ($Page-1)*TORRENTS_PER_PAGE.', '.TORRENTS_PER_PAGE;
} else {
@ -28,53 +34,53 @@ function header_link($SortKey,$DefaultWay="DESC") {
$Limit = TORRENTS_PER_PAGE;
}
if(!empty($_GET['order']) && in_array($_GET['order'], $Orders)) {
if (!empty($_GET['order']) && in_array($_GET['order'], $Orders)) {
$Order = $_GET['order'];
} else {
$Order = 'Time';
}
if(!empty($_GET['way']) && array_key_exists($_GET['way'], $Ways)) {
if (!empty($_GET['way']) && array_key_exists($_GET['way'], $Ways)) {
$Way = $_GET['way'];
} else {
$Way = 'DESC';
}
$SearchWhere = array();
if(!empty($_GET['format'])) {
if(in_array($_GET['format'], $Formats)) {
if (!empty($_GET['format'])) {
if (in_array($_GET['format'], $Formats)) {
$SearchWhere[]="t.Format='".db_string($_GET['format'])."'";
} elseif($_GET['format'] == 'perfectflac') {
} elseif ($_GET['format'] == 'perfectflac') {
$_GET['filter'] = 'perfectflac';
}
}
if(!empty($_GET['bitrate']) && in_array($_GET['bitrate'], $Bitrates)) {
if (!empty($_GET['bitrate']) && in_array($_GET['bitrate'], $Bitrates)) {
$SearchWhere[]="t.Encoding='".db_string($_GET['bitrate'])."'";
}
if(!empty($_GET['media']) && in_array($_GET['media'], $Media)) {
if (!empty($_GET['media']) && in_array($_GET['media'], $Media)) {
$SearchWhere[]="t.Media='".db_string($_GET['media'])."'";
}
if(!empty($_GET['releasetype']) && array_key_exists($_GET['releasetype'], $ReleaseTypes)) {
if (!empty($_GET['releasetype']) && array_key_exists($_GET['releasetype'], $ReleaseTypes)) {
$SearchWhere[]="tg.ReleaseType='".db_string($_GET['releasetype'])."'";
}
if(isset($_GET['scene']) && in_array($_GET['scene'], array('1','0'))) {
if (isset($_GET['scene']) && in_array($_GET['scene'], array('1','0'))) {
$SearchWhere[]="t.Scene='".db_string($_GET['scene'])."'";
}
if(isset($_GET['vanityhouse']) && in_array($_GET['vanityhouse'], array('1','0'))) {
if (isset($_GET['vanityhouse']) && in_array($_GET['vanityhouse'], array('1','0'))) {
$SearchWhere[]="tg.VanityHouse='".db_string($_GET['vanityhouse'])."'";
}
if(isset($_GET['cue']) && in_array($_GET['cue'], array('1','0'))) {
if (isset($_GET['cue']) && in_array($_GET['cue'], array('1','0'))) {
$SearchWhere[]="t.HasCue='".db_string($_GET['cue'])."'";
}
if(isset($_GET['log']) && in_array($_GET['log'], array('1','0', '100', '-1'))) {
if($_GET['log'] == '100') {
if (isset($_GET['log']) && in_array($_GET['log'], array('1','0', '100', '-1'))) {
if ($_GET['log'] == '100') {
$SearchWhere[]="t.HasLog = '1'";
$SearchWhere[]="t.LogScore = '100'";
} elseif ($_GET['log'] == '-1') {
@ -85,10 +91,10 @@ function header_link($SortKey,$DefaultWay="DESC") {
}
}
if(!empty($_GET['categories'])) {
if (!empty($_GET['categories'])) {
$Cats = array();
foreach(array_keys($_GET['categories']) as $Cat) {
if(!is_number($Cat)) {
foreach (array_keys($_GET['categories']) as $Cat) {
if (!is_number($Cat)) {
error(0);
}
$Cats[]="tg.CategoryID='".db_string($Cat)."'";
@ -96,26 +102,30 @@ function header_link($SortKey,$DefaultWay="DESC") {
$SearchWhere[]='('.implode(' OR ', $Cats).')';
}
if(!isset($_GET['tags_type'])) {
if (!isset($_GET['tags_type'])) {
$_GET['tags_type'] = '1';
}
if(!empty($_GET['tags'])) {
if (!empty($_GET['tags'])) {
$Tags = explode(',',$_GET['tags']);
$TagList = array();
foreach($Tags as $Tag) {
foreach ($Tags as $Tag) {
$Tag = trim(str_replace('.','_',$Tag));
if(empty($Tag)) { continue; }
if($Tag[0] == '!') {
if (empty($Tag)) {
continue;
}
if ($Tag[0] == '!') {
$Tag = ltrim(substr($Tag,1));
if(empty($Tag)) { continue; }
if (empty($Tag)) {
continue;
}
$TagList[]="CONCAT(' ',tg.TagList,' ') NOT LIKE '% ".db_string($Tag)." %'";
} else {
$TagList[]="CONCAT(' ',tg.TagList,' ') LIKE '% ".db_string($Tag)." %'";
}
}
if(!empty($TagList)) {
if(isset($_GET['tags_type']) && $_GET['tags_type'] != 1) {
if (!empty($TagList)) {
if (isset($_GET['tags_type']) && $_GET['tags_type'] != 1) {
$_GET['tags_type'] = '0';
$SearchWhere[]='('.implode(' OR ', $TagList).')';
} else {
@ -126,7 +136,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
}
$SearchWhere = implode(' AND ', $SearchWhere);
if(!empty($SearchWhere)) {
if (!empty($SearchWhere)) {
$SearchWhere = ' AND '.$SearchWhere;
}
@ -134,16 +144,20 @@ function header_link($SortKey,$DefaultWay="DESC") {
$Perms = Permissions::get_permissions($User['PermissionID']);
$UserClass = $Perms['Class'];
switch($_GET['type']) {
switch ($_GET['type']) {
case 'snatched':
if(!check_paranoia('snatched', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if (!check_paranoia('snatched', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$Time = 'xs.tstamp';
$UserField = 'xs.uid';
$ExtraWhere = '';
$From = "xbt_snatched AS xs JOIN torrents AS t ON t.ID=xs.fid";
break;
case 'seeding':
if(!check_paranoia('seeding', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if (!check_paranoia('seeding', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$Time = '(xfu.mtime - xfu.timespent)';
$UserField = 'xfu.uid';
$ExtraWhere = 'AND xfu.active=1 AND xfu.Remaining=0';
@ -156,21 +170,27 @@ function header_link($SortKey,$DefaultWay="DESC") {
$From = "torrents AS t";
break;
case 'leeching':
if(!check_paranoia('leeching', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if (!check_paranoia('leeching', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$Time = '(xfu.mtime - xfu.timespent)';
$UserField = 'xfu.uid';
$ExtraWhere = 'AND xfu.active=1 AND xfu.Remaining>0';
$From = "xbt_files_users AS xfu JOIN torrents AS t ON t.ID=xfu.fid";
break;
case 'uploaded':
if ((empty($_GET['filter']) || $_GET['filter'] != 'perfectflac') && !check_paranoia('uploads', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if ((empty($_GET['filter']) || $_GET['filter'] != 'perfectflac') && !check_paranoia('uploads', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$Time = 'unix_timestamp(t.Time)';
$UserField = 't.UserID';
$ExtraWhere = '';
$From = "torrents AS t";
break;
case 'downloaded':
if(!check_perms('site_view_torrent_snatchlist')) { error(403); }
if (!check_perms('site_view_torrent_snatchlist')) {
error(403);
}
$Time = 'unix_timestamp(ud.Time)';
$UserField = 'ud.UserID';
$ExtraWhere = '';
@ -180,37 +200,47 @@ function header_link($SortKey,$DefaultWay="DESC") {
error(404);
}
if(!empty($_GET['filter'])) {
if($_GET['filter'] == "perfectflac") {
if (!check_paranoia('perfectflacs', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
if (!empty($_GET['filter'])) {
if ($_GET['filter'] == 'perfectflac') {
if (!check_paranoia('perfectflacs', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$ExtraWhere .= " AND t.Format = 'FLAC'";
if(empty($_GET['media'])) {
if (empty($_GET['media'])) {
$ExtraWhere .= " AND (
t.LogScore = 100 OR
t.Media IN ('Vinyl','WEB','DVD','Soundboard','Casette','SACD','Blu-ray','DAT')
)";
} elseif(strtoupper($_GET['media']) == 'CD' && empty($_GET['log'])) {
} elseif (strtoupper($_GET['media']) == 'CD' && empty($_GET['log'])) {
$ExtraWhere .= " AND t.LogScore = 100";
}
} elseif($_GET['filter'] == "uniquegroup") {
if (!check_paranoia('uniquegroups', $User['Paranoia'], $UserClass, $UserID)) { error(403); }
$GroupBy = "tg.ID";
} elseif ($_GET['filter'] == 'uniquegroup') {
if (!check_paranoia('uniquegroups', $User['Paranoia'], $UserClass, $UserID)) {
error(403);
}
$GroupBy = 'tg.ID';
}
}
if(empty($GroupBy)) {
$GroupBy = "t.ID";
if (empty($GroupBy)) {
$GroupBy = 't.ID';
}
if((empty($_GET['search']) || trim($_GET['search']) == '') && $Order!='Name') {
$SQL = "SELECT SQL_CALC_FOUND_ROWS t.GroupID, t.ID AS TorrentID, $Time AS Time, tg.CategoryID
if ((empty($_GET['search']) || trim($_GET['search']) == '') && $Order!='Name') {
$SQL = "
SELECT
SQL_CALC_FOUND_ROWS t.GroupID,
t.ID AS TorrentID,
$Time AS Time,
tg.CategoryID
FROM $From
JOIN torrents_group AS tg ON tg.ID=t.GroupID
WHERE $UserField='$UserID' $ExtraWhere $SearchWhere
GROUP BY ".$GroupBy."
ORDER BY $Order $Way LIMIT $Limit";
} else {
$DB->query("CREATE TEMPORARY TABLE temp_sections_torrents_user (
$DB->query("
CREATE TEMPORARY TABLE temp_sections_torrents_user (
GroupID int(10) unsigned not null,
TorrentID int(10) unsigned not null,
Time int(12) unsigned not null,
@ -221,7 +251,9 @@ function header_link($SortKey,$DefaultWay="DESC") {
Name mediumtext,
Size bigint(12) unsigned,
PRIMARY KEY (TorrentID)) CHARSET=utf8");
$DB->query("INSERT IGNORE INTO temp_sections_torrents_user SELECT
$DB->query("
INSERT IGNORE INTO temp_sections_torrents_user
SELECT
t.GroupID,
t.ID AS TorrentID,
$Time AS Time,
@ -238,14 +270,14 @@ function header_link($SortKey,$DefaultWay="DESC") {
WHERE $UserField='$UserID' $ExtraWhere $SearchWhere
GROUP BY TorrentID, Time");
if(!empty($_GET['search']) && trim($_GET['search']) != '') {
if (!empty($_GET['search']) && trim($_GET['search']) != '') {
$Words = array_unique(explode(' ', db_string($_GET['search'])));
}
$SQL = "SELECT SQL_CALC_FOUND_ROWS
GroupID, TorrentID, Time, CategoryID
FROM temp_sections_torrents_user";
if(!empty($Words)) {
if (!empty($Words)) {
$SQL .= "
WHERE Name LIKE '%".implode("%' AND Name LIKE '%", $Words)."%'";
}
@ -291,27 +323,27 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="nobr" colspan="3">
<select id="bitrate" name="bitrate" class="ft_bitrate">
<option value="">Bitrate</option>
<? foreach($Bitrates as $BitrateName) { ?>
<option value="<?=display_str($BitrateName); ?>" <?Format::selected('bitrate', $BitrateName)?>><?=display_str($BitrateName); ?></option>
<? foreach ($Bitrates as $BitrateName) { ?>
<option value="<?=display_str($BitrateName); ?>"<?Format::selected('bitrate', $BitrateName)?>><?=display_str($BitrateName); ?></option>
<? } ?> </select>
<select name="format" class="ft_format">
<option value="">Format</option>
<? foreach($Formats as $FormatName) { ?>
<option value="<?=display_str($FormatName); ?>" <?Format::selected('format', $FormatName)?>><?=display_str($FormatName); ?></option>
<? foreach ($Formats as $FormatName) { ?>
<option value="<?=display_str($FormatName); ?>"<?Format::selected('format', $FormatName)?>><?=display_str($FormatName); ?></option>
<? } ?>
<option value="perfectflac" <?Format::selected('filter', 'perfectflac')?>>Perfect FLACs</option>
<option value="perfectflac"<?Format::selected('filter', 'perfectflac')?>>Perfect FLACs</option>
</select>
<select name="media" class="ft_media">
<option value="">Media</option>
<? foreach($Media as $MediaName) { ?>
<option value="<?=display_str($MediaName); ?>" <?Format::selected('media',$MediaName)?>><?=display_str($MediaName); ?></option>
<? foreach ($Media as $MediaName) { ?>
<option value="<?=display_str($MediaName); ?>"<?Format::selected('media',$MediaName)?>><?=display_str($MediaName); ?></option>
<? } ?>
</select>
<select name="releasetype" class="ft_releasetype">
<option value="">Release type</option>
<? foreach($ReleaseTypes as $ID=>$Type) { ?>
<option value="<?=display_str($ID); ?>" <?Format::selected('releasetype',$ID)?>><?=display_str($Type); ?></option>
<? foreach ($ReleaseTypes as $ID=>$Type) { ?>
<option value="<?=display_str($ID); ?>"<?Format::selected('releasetype',$ID)?>><?=display_str($Type); ?></option>
<? } ?>
</select>
</td>
@ -320,26 +352,26 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="label"><strong>Misc:</strong></td>
<td class="nobr" colspan="3">
<select name="log" class="ft_haslog">
<option value="">Has Log</option>
<option value="1" <?Format::selected('log','1')?>>Yes</option>
<option value="0" <?Format::selected('log','0')?>>No</option>
<option value="100" <?Format::selected('log','100')?>>100% only</option>
<option value="-1" <?Format::selected('log','-1')?>>&lt;100%/Unscored</option>
<option value="">Has log</option>
<option value="1"<?Format::selected('log','1')?>>Yes</option>
<option value="0"<?Format::selected('log','0')?>>No</option>
<option value="100"<?Format::selected('log','100')?>>100% only</option>
<option value="-1"<?Format::selected('log','-1')?>>&lt;100%/unscored</option>
</select>
<select name="cue" class="ft_hascue">
<option value="">Has Cue</option>
<option value="1" <?Format::selected('cue',1)?>>Yes</option>
<option value="0" <?Format::selected('cue',0)?>>No</option>
<option value="">Has cue</option>
<option value="1"<?Format::selected('cue',1)?>>Yes</option>
<option value="0"<?Format::selected('cue',0)?>>No</option>
</select>
<select name="scene" class="ft_scene">
<option value="">Scene</option>
<option value="1" <?Format::selected('scene',1)?>>Yes</option>
<option value="0" <?Format::selected('scene',0)?>>No</option>
<option value="1"<?Format::selected('scene',1)?>>Yes</option>
<option value="0"<?Format::selected('scene',0)?>>No</option>
</select>
<select name="vanityhouse" class="ft_vanityhouse">
<option value="">Vanity House</option>
<option value="1" <?Format::selected('vanityhouse',1)?>>Yes</option>
<option value="0" <?Format::selected('vanityhouse',0)?>>No</option>
<option value="1"<?Format::selected('vanityhouse',1)?>>Yes</option>
<option value="0"<?Format::selected('vanityhouse',0)?>>No</option>
</select>
</td>
</tr>
@ -347,8 +379,8 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="label"><strong>Tags:</strong></td>
<td>
<input type="text" name="tags" size="60" title="Use !tag to exclude tag" value="<?Format::form('tags')?>" />&nbsp;
<input type="radio" name="tags_type" id="tags_type0" value="0" <?Format::selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>&nbsp;&nbsp;
<input type="radio" name="tags_type" id="tags_type1" value="1" <?Format::selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
<input type="radio" name="tags_type" id="tags_type0" value="0"<?Format::selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>&nbsp;&nbsp;
<input type="radio" name="tags_type" id="tags_type1" value="1"<?Format::selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
</td>
</tr>
@ -356,14 +388,14 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="label"><strong>Order by</strong></td>
<td>
<select name="order" class="ft_order_by">
<? foreach($Orders as $OrderText) { ?>
<option value="<?=$OrderText?>" <?Format::selected('order', $OrderText)?>><?=$OrderText?></option>
<? }?>
<? foreach ($Orders as $OrderText) { ?>
<option value="<?=$OrderText?>"<?Format::selected('order', $OrderText)?>><?=$OrderText?></option>
<? } ?>
</select>&nbsp;
<select name="way" class="ft_order_way">
<? foreach($Ways as $WayKey=>$WayText) { ?>
<option value="<?=$WayKey?>" <?Format::selected('way', $WayKey)?>><?=$WayText?></option>
<? }?>
<? foreach ($Ways as $WayKey=>$WayText) { ?>
<option value="<?=$WayKey?>"<?Format::selected('way', $WayKey)?>><?=$WayText?></option>
<? } ?>
</select>
</td>
</tr>
@ -371,11 +403,11 @@ function header_link($SortKey,$DefaultWay="DESC") {
<table class="layout cat_list">
<?
$x=0;
$x = 0;
reset($Categories);
foreach($Categories as $CatKey => $CatName) {
if($x%7==0) {
if($x > 0) {
foreach ($Categories as $CatKey => $CatName) {
if ($x % 7 == 0) {
if ($x > 0) {
?>
</tr>
<? } ?>
@ -385,8 +417,8 @@ function header_link($SortKey,$DefaultWay="DESC") {
$x++;
?>
<td>
<input type="checkbox" name="categories[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1"<? if(isset($_GET['categories'][$CatKey+1])) { ?> checked="checked"<? } ?> />
<label for="cat_<?=($CatKey+1)?>"><?=$CatName?></label>
<input type="checkbox" name="categories[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1"<? if (isset($_GET['categories'][$CatKey + 1])) { ?> checked="checked"<? } ?> />
<label for="cat_<?=($CatKey + 1)?>"><?=$CatName?></label>
</td>
<?
}
@ -398,7 +430,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
</div>
</form>
</div>
<? if(count($GroupIDs) == 0) { ?>
<? if (count($GroupIDs) == 0) { ?>
<div class="center">
Nothing found!
</div>
@ -422,7 +454,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
</tr>
<?
$Results = $Results['matches'];
foreach($TorrentsInfo as $TorrentID => $Info) {
foreach ($TorrentsInfo as $TorrentID => $Info) {
list($GroupID, , $Time) = array_values($Info);
extract(Torrents::array_group($Results[$GroupID]));
@ -435,17 +467,21 @@ function header_link($SortKey,$DefaultWay="DESC") {
unset($ExtendedArtists[2]);
unset($ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists);
} elseif(!empty($Artists)) {
} elseif (!empty($Artists)) {
$DisplayName = Artists::display_artists(array(1=>$Artists));
} else {
$DisplayName='';
$DisplayName = '';
}
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&amp;torrentid='.$TorrentID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
if($GroupVanityHouse) { $DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]'; }
if ($GroupYear > 0) {
$DisplayName.=" [$GroupYear]";
}
if ($GroupVanityHouse) {
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
}
$ExtraInfo = Torrents::torrent_info($Torrent);
if($ExtraInfo) {
if ($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
}
?>
@ -471,7 +507,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="nobr"><?=time_diff($Time,1)?></td>
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
<td><?=number_format($Torrent['Snatched'])?></td>
<td<?=($Torrent['Seeders']==0)?' class="r00"':''?>><?=number_format($Torrent['Seeders'])?></td>
<td<?=($Torrent['Seeders'] == 0) ? ' class="r00"' : ''?>><?=number_format($Torrent['Seeders'])?></td>
<td><?=number_format($Torrent['Leechers'])?></td>
</tr>
<? } ?>

View File

@ -156,7 +156,7 @@ function checked($Checked) {
</td>
</tr>
<tr>
<td class="label"><strong>Sort/Hide release types</strong></td>
<td class="label"><strong>Sort/hide release types</strong></td>
<td>
<noscript>Please enable JavaScript to use these options.</noscript>
<a href="#" id="toggle_sortable" class="brackets">Expand</a>

View File

@ -26,7 +26,7 @@
$Email = $_POST['email'];
$Username = $LoggedUser['Username'];
$SiteName = SITE_NAME;
$SiteURL = NONSSL_SITE_URL;
$SiteURL = SSL_SITE_URL;
$InviteExpires = time_plus(60*60*24*3); // 3 days
//MultiInvite
@ -61,7 +61,7 @@
To confirm your invite, click on the following link:
http://$SiteURL/register.php?invite=$InviteKey
https://$SiteURL/register.php?invite=$InviteKey
After you register, you will be able to use your account. Please take note that if you do not use this invite in the next 3 days, it will expire. We urge you to read the RULES and the wiki immediately after you join.

View File

@ -12,12 +12,14 @@
$UserID = $_GET['userid'];
if (!is_number($UserID)) { error(404); }
if (!is_number($UserID)) {
error(404);
}
$DB->query("SELECT ui.JoinDate, p.Level AS Class FROM users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID JOIN permissions AS p ON p.ID=um.PermissionID WHERE um.ID = $UserID");
list($Joined, $Class) = $DB->next_record();
if(!check_perms('users_view_email', $Class)) {
if (!check_perms('users_view_email', $Class)) {
error(403);
}
@ -84,7 +86,7 @@
?>
</tr>
<?
foreach($History as $Key => $Values){
foreach ($History as $Key => $Values){
if (isset($History[$Key+1])) {
$Values['Time'] = $History[$Key+1]['Time'];
} else {
@ -104,7 +106,7 @@
<td />
<td><?=time_diff($Time)?></td>
<td><?=display_str($IP)?></td>
<? $UserURL = "http://".NONSSL_SITE_URL."/user.php?id=$UserID2";
<? $UserURL = "https://".SSL_SITE_URL."/user.php?id=$UserID2";
$DB->query("SELECT Enabled FROM users_main WHERE ID = ".$UserID2);
list($Enabled)=$DB->next_record();
$DB->set_query_id($ueQuery);

View File

@ -3,9 +3,9 @@
var LIMIT = 10;
var artistId, artistName;
var artistTags;
$(document).ready(function() {
$(document).ready(function() {
initArtistCloud();
});
});
function initArtistCloud() {
$("#currentArtist").text();
@ -22,7 +22,7 @@ function loadArtists() {
var first = true;
var ratio;
$.each(data, function(key, val) {
if(first) {
if (first) {
ratio = val['score'] / 300;
first = false;
}
@ -39,18 +39,16 @@ function loadArtists() {
function addArtist(id, name, score) {
var item = $('<li><a style="color:#007DC6;" data-weight="' + score + '">' + name + '</a></li>');
$(item).click(function(e) {
e.preventDefault();
reinit(id, name);
});
artistTags.append(item);
}
function addArtistMain(name) {
var item = $('<li><a style="color:#007DC6;" data-weight="350">' + name + '</a></li>');
var item = $('<li><a style="color: #007DC6;" data-weight="350">' + name + '</a></li>');
$("#currentArtist").attr('href', 'artist.php?id=' + artistId);
$("#currentArtist").text(artistName);
@ -73,38 +71,34 @@ function reinit(id, name) {
}
function createCloud() {
if(!$('#similarArtistsCanvas').tagcanvas({
if (!$('#similarArtistsCanvas').tagcanvas({
// textFont: 'Impact,"Arial Black",sans-serif',
wheelZoom: false,
freezeActive: true,
weightSize:0.15,
interval:20,
weightSize: 0.15,
interval: 20,
textFont: null,
textColour: null,
textHeight: 25,
outlineColour:'#f96',
outlineThickness:4,
maxSpeed:0.04,
minBrightness:0.1,
depth:0.92,
pulsateTo:0.2,
pulsateTime:0.75,
initial:[0.1,-0.1],
decel:0.98,
reverse:true,
shadow:'#ccf',
shadowBlur:3,
outlineColour: '#f96',
outlineThickness: 4,
maxSpeed: 0.04,
minBrightness: 0.1,
depth: 0.92,
pulsateTo: 0.2,
pulsateTime: 0.75,
initial: [0.1,-0.1],
decel: 0.98,
reverse: true,
shadow: '#ccf',
shadowBlur: 3,
weight : true,
weightFrom:'data-weight'
weightFrom: 'data-weight'
},'artistTags')) {
// something went wrong, hide the canvas container
$('#flip_view_2').hide();
}
}
} ) ( jQuery );

View File

@ -24,56 +24,47 @@ var isMobile = {
}
};
if(isMobile.Android()) {
if(!hasCookie(ANDROID_COOKIE_NAME)) {
if (isMobile.Android()) {
if (!hasCookie(ANDROID_COOKIE_NAME)) {
setCookie(ANDROID_COOKIE_NAME, true, 365);
var result=confirm("An Android App is available for What.CD, would you like to download it?");
if (result==true) {
var result = confirm("An Android App is available for What.CD, would you like to download it?");
if (result == true) {
window.location = ANDROID_APP_URL;
}
}
}
else if(isMobile.NotAndroid()) {
if(!hasCookie(OTHER_COOKIE_NAME)) {
} else if (isMobile.NotAndroid()) {
if (!hasCookie(OTHER_COOKIE_NAME)) {
setCookie(OTHER_COOKIE_NAME, true, 365);
var result=confirm("A mobile version of What.CD is available, would you like to use it?");
if (result==true) {
var result = confirm("A mobile version of What.CD is available, would you like to use it?");
if (result == true) {
window.location = MOBILE_SITE_URL;
}
}
}
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
function setCookie(c_name,value,exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
function getCookie(c_name) {
var i,x,y,ARRcookies=document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
x = ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y = ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x = x.replace(/^\s+|\s+$/g,"");
if (x == c_name) {
return unescape(y);
}
}
}
function hasCookie(c_name)
{
var checked=getCookie(c_name);
if (checked != null)
{
function hasCookie(c_name) {
var checked=getCookie(c_name);
if (checked != null) {
return true;
}
return false;

View File

@ -1,7 +1,11 @@
function toggleChecks(formElem,masterElem) {
if (masterElem.checked) { checked=true; } else { checked=false; }
for(s=0; s<$('#'+formElem).raw().elements.length; s++) {
if ($('#'+formElem).raw().elements[s].type=="checkbox") {
if (masterElem.checked) {
checked = true;
} else {
checked = false;
}
for (s = 0; s < $('#'+formElem).raw().elements.length; s++) {
if ($('#'+formElem).raw().elements[s].type == "checkbox") {
$('#'+formElem).raw().elements[s].checked=checked;
}
}
@ -10,15 +14,15 @@ 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.
* 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') {
if (typeof(image) == 'string') {
$('#lightbox').show().listen('click',lightbox.unbox).raw().innerHTML =
'<p size="7" style="color:gray;font-size:50px">Loading...<p>';
'<p size="7" style="color: gray; font-size: 50px;">Loading...<p>';
$('#curtain').show().listen('click',lightbox.unbox);
var src = image;
image = new Image();
@ -40,20 +44,20 @@ var lightbox = {
},
box: function (image) {
var hasA = false;
if(image.parentNode != null && image.parentNode.tagName.toUpperCase() == 'A') {
if (image.parentNode != null && image.parentNode.tagName.toUpperCase() == 'A') {
hasA = true;
}
if(!hasA) {
if (!hasA) {
$('#lightbox').show().listen('click',lightbox.unbox).raw().innerHTML = '<img src="' + image.src + '" />';
$('#curtain').show().listen('click',lightbox.unbox);
}
},
box_async: function (image) {
var hasA = false;
if(image.parentNode != null && image.parentNode.tagName.toUpperCase() == 'A') {
if (image.parentNode != null && image.parentNode.tagName.toUpperCase() == 'A') {
hasA = true;
}
if(!hasA) {
if (!hasA) {
$('#lightbox').raw().innerHTML = '<img src="' + image.src + '" />';
}
},
@ -106,9 +110,9 @@ function add_selection() {
var listitem = document.createElement("li");
listitem.id = 'list' + selected.value;
listitem.innerHTML = ' <input type="hidden" name="list[]" value="'+selected.value+'" /> ' +
' <span style="float:left;">'+selected.innerHTML+'</span>' +
' <a href="#" onclick="remove_selection(\''+selected.value+'\');return false;" style="float:right;" class="brackets">X</a>' +
' <br style="clear:all;" />';
' <span style="float: left;">'+selected.innerHTML+'</span>' +
' <a href="#" onclick="remove_selection(\''+selected.value+'\');return false;" style="float: right;" class="brackets">X</a>' +
' <br style="clear: all;" />';
$('#list').raw().appendChild(listitem);
$('#opt' + selected.value).raw().disabled = true;
}

View File

@ -1,9 +1,9 @@
function ChangeCategory(catid) {
if(catid == 1) {
if (catid == 1) {
$('#split_releasetype').show();
$('#split_artist').show();
$('#split_year').show();
} else if(catid == 4 || catid == 6) {
} else if (catid == 4 || catid == 6) {
$('#split_releasetype').hide();
$('#split_year').show();
$('#split_artist').hide();
@ -16,15 +16,15 @@ function ChangeCategory(catid) {
function ArtistManager() {
var GroupID = window.location.search.match(/[?&]id=(\d+)/);
if(typeof GroupID == 'undefined') {
if (typeof GroupID == 'undefined') {
return;
} else {
GroupID = GroupID[1];
}
var ArtistList;
if(!(ArtistList = $('#artist_list').raw())) {
if (!(ArtistList = $('#artist_list').raw())) {
return false;
} else if($('#artistmanager').raw()) {
} else if ($('#artistmanager').raw()) {
$('#artistmanager').toggle();
$('#artist_list').toggle();
} else {
@ -58,7 +58,7 @@ function ArtistManager() {
importance = 7;
break;
}
if(elArtistList.children[i].children[0].tagName.toUpperCase() == 'A') {
if (elArtistList.children[i].children[0].tagName.toUpperCase() == 'A') {
var ArtistID = elArtistList.children[i].children[0].href.match(/[?&]id=(\d+)/)[1];
var elBox = document.createElement('input');
elBox.type = 'checkbox';
@ -67,7 +67,7 @@ function ArtistManager() {
elBox.value = importance+';'+ArtistID;
elBox.onclick = function(e) { SelectArtist(e,this); };
elArtistList.children[i].insertBefore(elBox, elArtistList.children[i].children[0]);
if(importance == 1 || importance == 4 || importance == 6) {
if (importance == 1 || importance == 4 || importance == 6) {
MainArtistCount++;
}
}
@ -161,11 +161,11 @@ function ArtistManager() {
}
function SelectArtist(e,obj) {
if(window.event) {
if (window.event) {
e = window.event;
}
EndBox = Number(obj.id.substr(17));
if(!e.shiftKey || typeof StartBox == 'undefined') {
if (!e.shiftKey || typeof StartBox == 'undefined') {
StartBox = Number(obj.id.substr(17));
}
Dir = (EndBox > StartBox ? 1 : -1);
@ -181,19 +181,19 @@ function ArtistManagerSubmit() {
var Selection = new Array();
var MainSelectionCount = 0;
for(var i = 0, boxes = $('[name="artistmanager_box"]'); boxes.raw(i); i++) {
if(boxes.raw(i).checked) {
if (boxes.raw(i).checked) {
Selection.push(boxes.raw(i).value);
if(boxes.raw(i).value.substr(0,1) == '1') {
if (boxes.raw(i).value.substr(0,1) == '1') {
MainSelectionCount++;
}
}
}
if(Selection.length == 0 || ($('#manager_action').raw().value == 'delete' && !confirm('Are you sure you want to delete '+Selection.length+' artists from this group?'))) {
if (Selection.length == 0 || ($('#manager_action').raw().value == 'delete' && !confirm('Are you sure you want to delete '+Selection.length+' artists from this group?'))) {
return;
}
$('#artists_selection').raw().value = Selection.join(',');
if((($('#artists_importance').raw().value != 1 && $('#artists_importance').raw().value != 4 && $('#artists_importance').raw().value != 6) || $('#manager_action').raw().value == 'delete') && MainSelectionCount == MainArtistCount) {
if(!$('.error_message').raw()) {
if ((($('#artists_importance').raw().value != 1 && $('#artists_importance').raw().value != 4 && $('#artists_importance').raw().value != 6) || $('#manager_action').raw().value == 'delete') && MainSelectionCount == MainArtistCount) {
if (!$('.error_message').raw()) {
error_message('All groups need to have at least one main artist, composer, or DJ.');
}
$('.error_message').raw().scrollIntoView();
@ -209,16 +209,16 @@ function ArtistManagerDelete() {
}
function Vote(amount, requestid) {
if(typeof amount == 'undefined') {
if (typeof amount == 'undefined') {
amount = parseInt($('#amount').raw().value);
}
if(amount == 0) {
if (amount == 0) {
amount = 20 * 1024 * 1024;
}
var index;
var votecount;
if(!requestid) {
if (!requestid) {
requestid = $('#requestid').raw().value;
votecount = $('#votecount').raw();
index = false;
@ -229,7 +229,7 @@ function Vote(amount, requestid) {
}
ajax.get('requests.php?action=takevote&id=' + requestid + '&auth=' + authkey + '&amount=' + amount, function (response) {
if(response == 'bankrupt') {
if (response == 'bankrupt') {
error_message("You do not have sufficient upload credit to add " + get_size(amount) + " to this request");
return;
} else if (response == 'dupesuccess') {
@ -238,7 +238,7 @@ function Vote(amount, requestid) {
votecount.innerHTML = (parseInt(votecount.innerHTML)) + 1;
}
if($('#total_bounty').results() > 0) {
if ($('#total_bounty').results() > 0) {
totalBounty = parseInt($('#total_bounty').raw().value);
totalBounty += (amount * (1 - $('#request_tax').raw().value));
$('#total_bounty').raw().value = totalBounty;