mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-12 18:36:29 +00:00
Empty commit
This commit is contained in:
parent
b139eca03b
commit
b1db2e6185
@ -14,7 +14,7 @@
|
||||
$LoginCookie = $Enc->decrypt($_COOKIE['session']);
|
||||
}
|
||||
if (isset($LoginCookie)) {
|
||||
list($SessionID, $UserID) = explode("|~|",$Enc->decrypt($LoginCookie));
|
||||
list($SessionID, $UserID) = explode("|~|", $Enc->decrypt($LoginCookie));
|
||||
|
||||
if (!$UserID || !$SessionID) {
|
||||
die('Not logged in!');
|
||||
@ -49,8 +49,8 @@ function is_number($Str) {
|
||||
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","&",$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", '&', $Str);
|
||||
|
||||
$Replace = array(
|
||||
"'",'"',"<",">",
|
||||
@ -62,7 +62,7 @@ function display_str($Str) {
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$Str = str_replace($Replace,$With,$Str);
|
||||
$Str = str_replace($Replace, $With, $Str);
|
||||
}
|
||||
return $Str;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public static function get_artists($GroupIDs) {
|
||||
ORDER BY ta.GroupID ASC,
|
||||
ta.Importance ASC,
|
||||
aa.Name ASC;");
|
||||
while (list($GroupID,$ArtistID,$ArtistName,$ArtistImportance,$AliasID) = $DB->next_record(MYSQLI_BOTH, false)) {
|
||||
while (list($GroupID, $ArtistID, $ArtistName, $ArtistImportance, $AliasID) = $DB->next_record(MYSQLI_BOTH, false)) {
|
||||
$Results[$GroupID][$ArtistImportance][] = array('id' => $ArtistID, 'name' => $ArtistName, 'aliasid' => $AliasID);
|
||||
$New[$GroupID][$ArtistImportance][] = array('id' => $ArtistID, 'name' => $ArtistName, 'aliasid' => $AliasID);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ function set_up() {
|
||||
continue;
|
||||
}
|
||||
$this->Artists[$ArtistID] = new ARTIST($ArtistID, $Name);
|
||||
$this->Similar[$ArtistID] = array('ID'=>$ArtistID,'Score'=>$Score);
|
||||
$this->Similar[$ArtistID] = array('ID' => $ArtistID, 'Score' => $Score);
|
||||
$this->TotalScore += $Score;
|
||||
$ArtistIDs[] = $ArtistID;
|
||||
}
|
||||
@ -86,8 +86,8 @@ function set_up() {
|
||||
JOIN artists_similar AS s2 ON s1.SimilarID=s2.SimilarID AND s1.ArtistID!=s2.ArtistID
|
||||
JOIN artists_similar_scores AS ass ON ass.SimilarID=s1.SimilarID
|
||||
JOIN artists_group AS a ON a.ArtistID=s2.ArtistID
|
||||
WHERE s1.ArtistID IN(".implode(',',$ArtistIDs).')
|
||||
AND s2.ArtistID IN('.implode(',',$ArtistIDs).')');
|
||||
WHERE s1.ArtistID IN(".implode(',', $ArtistIDs).')
|
||||
AND s2.ArtistID IN('.implode(',', $ArtistIDs).')');
|
||||
|
||||
// Build into array
|
||||
while (list($Artist1ID, $Artist2ID) = $DB->next_record()) {
|
||||
|
@ -30,7 +30,7 @@ public function lines($Thickness, $Solid = 1, $Blank = 0) {
|
||||
}
|
||||
|
||||
public function title($Title, $Color = '', $Size = '') {
|
||||
$this->URL .= '&chtt='.str_replace(array(' ',"\n"), array('+','|'), $Title);
|
||||
$this->URL .= '&chtt='.str_replace(array(' ', "\n"), array('+', '|'), $Title);
|
||||
if (!empty($Color)) {
|
||||
$this->URL .= '&chts='.$Color;
|
||||
}
|
||||
|
@ -51,4 +51,32 @@ public static function decrease_subscriptions($CollageID) {
|
||||
WHERE ID = '$CollageID'");
|
||||
}
|
||||
|
||||
public static function create_personal_collage() {
|
||||
global $DB, $LoggedUser;
|
||||
|
||||
$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']) {
|
||||
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=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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
/*
|
||||
interface COOKIE_INTERFACE {
|
||||
public function get($Key);
|
||||
public function set($Key,$Value,$Seconds,$LimitAccess);
|
||||
public function set($Key, $Value, $Seconds, $LimitAccess);
|
||||
public function del($Key);
|
||||
|
||||
public function flush();
|
||||
@ -31,12 +31,12 @@ public function get($Key) {
|
||||
}
|
||||
|
||||
//Pass the 4th optional param as false to allow JS access to the cookie
|
||||
public function set($Key,$Value,$Seconds = 86400,$LimitAccess = SELF::LIMIT_ACCESS) {
|
||||
setcookie(SELF::PREFIX.$Key,$Value,time()+$Seconds,'/',SITE_URL,$_SERVER['SERVER_PORT'] === '443',$LimitAccess,false);
|
||||
public function set($Key, $Value, $Seconds = 86400, $LimitAccess = SELF::LIMIT_ACCESS) {
|
||||
setcookie(SELF::PREFIX.$Key, $Value, time() + $Seconds, '/', SITE_URL, $_SERVER['SERVER_PORT'] === '443', $LimitAccess, false);
|
||||
}
|
||||
|
||||
public function del($Key) {
|
||||
setcookie(SELF::PREFIX.$Key,'',time()-24*3600); //3600 vs 1 second to account for potential clock desyncs
|
||||
setcookie(SELF::PREFIX.$Key, '', time() - 24 * 3600); //3600 vs 1 second to account for potential clock desyncs
|
||||
}
|
||||
|
||||
public function flush() {
|
||||
|
@ -12,20 +12,20 @@
|
||||
}
|
||||
|
||||
class CRYPT {
|
||||
public function encrypt($Str,$Key=ENCKEY) {
|
||||
public function encrypt($Str, $Key = ENCKEY) {
|
||||
srand();
|
||||
$Str=str_pad($Str, 32-strlen($Str));
|
||||
$IVSize=mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
||||
$IV=mcrypt_create_iv($IVSize, MCRYPT_RAND);
|
||||
$CryptStr=mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $Key, $Str, MCRYPT_MODE_CBC, $IV);
|
||||
$Str = str_pad($Str, 32 - strlen($Str));
|
||||
$IVSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
||||
$IV = mcrypt_create_iv($IVSize, MCRYPT_RAND);
|
||||
$CryptStr = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $Key, $Str, MCRYPT_MODE_CBC, $IV);
|
||||
return base64_encode($IV.$CryptStr);
|
||||
}
|
||||
|
||||
public function decrypt($CryptStr,$Key=ENCKEY) {
|
||||
if ($CryptStr!='') {
|
||||
$IV=substr(base64_decode($CryptStr),0,16);
|
||||
$CryptStr=substr(base64_decode($CryptStr),16);
|
||||
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $Key, $CryptStr, MCRYPT_MODE_CBC,$IV));
|
||||
public function decrypt($CryptStr, $Key = ENCKEY) {
|
||||
if ($CryptStr != '') {
|
||||
$IV = substr(base64_decode($CryptStr), 0, 16);
|
||||
$CryptStr = substr(base64_decode($CryptStr), 16);
|
||||
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $Key, $CryptStr, MCRYPT_MODE_CBC, $IV));
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ public static function human_format($Number) {
|
||||
* @return Number of bytes it represents, e.g. (123.45 * 1024)
|
||||
*/
|
||||
public static function get_bytes($Size) {
|
||||
list($Value,$Unit) = sscanf($Size, "%f%s");
|
||||
list($Value, $Unit) = sscanf($Size, "%f%s");
|
||||
$Unit = ltrim($Unit);
|
||||
if (empty($Unit)) {
|
||||
return $Value ? round($Value) : 0;
|
||||
@ -487,7 +487,7 @@ public static function make_utf8($Str) {
|
||||
$Encoding = 'UTF-8';
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = mb_detect_encoding($Str,'UTF-8, ISO-8859-1');
|
||||
$Encoding = mb_detect_encoding($Str, 'UTF-8, ISO-8859-1');
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = 'ISO-8859-1';
|
||||
@ -495,7 +495,7 @@ public static function make_utf8($Str) {
|
||||
if ($Encoding == 'UTF-8') {
|
||||
return $Str;
|
||||
} else {
|
||||
return @mb_convert_encoding($Str,'UTF-8',$Encoding);
|
||||
return @mb_convert_encoding($Str, 'UTF-8', $Encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ function ellipse($x, $y, $Width, $Height, $Color) {
|
||||
}
|
||||
|
||||
function text($x, $y, $Color, $Text) {
|
||||
return imagettftext ($this->Image, $this->FontSize,$this->TextAngle, $x, $y, $Color, $this->Font, $Text);
|
||||
return imagettftext ($this->Image, $this->FontSize, $this->TextAngle, $x, $y, $Color, $this->Font, $Text);
|
||||
}
|
||||
|
||||
function make_png($FileName = NULL) {
|
||||
|
@ -76,7 +76,7 @@ public function disconnect() {
|
||||
|
||||
public function get_channel() {
|
||||
preg_match('/.+ PRIVMSG ([^:]+) :.+/', $this->Data, $Channel);
|
||||
if (preg_match('/#.+/',$Channel[1])) {
|
||||
if (preg_match('/#.+/', $Channel[1])) {
|
||||
return $Channel[1];
|
||||
} else {
|
||||
return false;
|
||||
@ -100,7 +100,7 @@ protected function get_irc_host() {
|
||||
|
||||
protected function get_word($Select=1) {
|
||||
preg_match('/:.+ PRIVMSG [^:]+ :(.+)/', $this->Data, $Word);
|
||||
$Word = split(' ',$Word[1]);
|
||||
$Word = split(' ', $Word[1]);
|
||||
return trim($Word[$Select]);
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ protected function whois($Nick) {
|
||||
/*
|
||||
This function uses blacklisted_ip, which is no longer in RC2.
|
||||
You can probably find it in old RC1 code kicking aronud if you need it.
|
||||
protected function ip_check($IP,$Gline=false,$Channel=BOT_REPORT_CHAN) {
|
||||
protected function ip_check($IP, $Gline = false, $Channel = BOT_REPORT_CHAN) {
|
||||
global $Cache, $DB;
|
||||
if (blacklisted_ip($IP)) {
|
||||
$this->send_to($Channel, 'TOR IP Detected: '.$IP);
|
||||
@ -148,7 +148,7 @@ protected function ip_check($IP,$Gline=false,$Channel=BOT_REPORT_CHAN) {
|
||||
}*/
|
||||
|
||||
protected function listen() {
|
||||
global $Cache,$DB;
|
||||
global $Cache, $DB;
|
||||
$Cache->InternalCache = false;
|
||||
stream_set_timeout($this->Socket, 10000000000);
|
||||
while ($this->State == 1) {
|
||||
@ -163,7 +163,7 @@ protected function listen() {
|
||||
}
|
||||
|
||||
if ($this->Whois !== false) {
|
||||
$Exp = explode(' ',$this->Data);
|
||||
$Exp = explode(' ', $this->Data);
|
||||
if ($Exp[1] == '307') {
|
||||
$this->Identified[$this->Whois] = 1;
|
||||
$this->send_to($this->LastChan, "$this->Whois correctly identified as a real person!");
|
||||
@ -185,7 +185,7 @@ protected function listen() {
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match("/:([^!]+)![^\s]* PART #what.cd-disabled/", $this->Data, $Nick)) {
|
||||
if (preg_match("/:([^!]+)![^\s]* PART ".BOT_DISABLED_CHAN.'/', $this->Data, $Nick)) {
|
||||
if (isset($this->DisabledUsers[$Nick[1]])) {
|
||||
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[1] . "'");
|
||||
$Cache->increment_value('num_disablees', -1);
|
||||
@ -193,7 +193,7 @@ protected function listen() {
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match("/:([^!]+)![^\s]* KICK #what.cd-disabled.* /", $this->Data, $Nick)) {
|
||||
if (preg_match("/:([^!]+)![^\s]* KICK ".BOT_DISABLED_CHAN.'.* /', $this->Data, $Nick)) {
|
||||
$Nick = explode(" ", $Nick[0]);
|
||||
if (isset($this->DisabledUsers[$Nick[3]])) {
|
||||
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[3] . "'");
|
||||
@ -210,11 +210,11 @@ protected function listen() {
|
||||
$this->send_raw('PONG :'.$Ping[1]);
|
||||
}
|
||||
|
||||
if (preg_match('/.*PRIVMSG #.*/',$this->Data)) {
|
||||
if (preg_match('/.*PRIVMSG #.*/', $this->Data)) {
|
||||
$this->channel_events();
|
||||
}
|
||||
|
||||
if (preg_match("/.* PRIVMSG ".BOT_NICK." .*/",$this->Data)) {
|
||||
if (preg_match("/.* PRIVMSG ".BOT_NICK." .*/", $this->Data)) {
|
||||
$this->query_events();
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ public static function create_thread($ForumID, $AuthorID, $Title, $PostBody) {
|
||||
WHERE ID = '$TopicID'");
|
||||
|
||||
// Bump this topic to head of the cache
|
||||
list($Forum,,,$Stickies) = $Cache->get_value('forums_'.$ForumID);
|
||||
list($Forum,,, $Stickies) = $Cache->get_value('forums_'.$ForumID);
|
||||
if (!empty($Forum)) {
|
||||
if (count($Forum) == TOPICS_PER_PAGE && $Stickies < TOPICS_PER_PAGE) {
|
||||
array_pop($Forum);
|
||||
@ -407,7 +407,7 @@ public static function get_alias_tag($BadTag) {
|
||||
* @param string $Message the message to write.
|
||||
*/
|
||||
public static function write_log($Message) {
|
||||
global $DB,$Time;
|
||||
global $DB, $Time;
|
||||
$DB->query("
|
||||
INSERT INTO log (Message, Time)
|
||||
VALUES ('" . db_string($Message) . "', '" . sqltime() . "')");
|
||||
@ -423,7 +423,7 @@ public static function write_log($Message) {
|
||||
public static function sanitize_tag($Str) {
|
||||
$Str = strtolower($Str);
|
||||
$Str = preg_replace('/[^a-z0-9.]/', '', $Str);
|
||||
$Str = preg_replace('/(^[.,]*)|([.,]*$)/','',$Str);
|
||||
$Str = preg_replace('/(^[.,]*)|([.,]*$)/', '', $Str);
|
||||
$Str = htmlspecialchars($Str);
|
||||
$Str = db_string(trim($Str));
|
||||
return $Str;
|
||||
|
@ -248,7 +248,7 @@ function query($Query, $AutoHandle = 1) {
|
||||
|
||||
function query_unb($Query) {
|
||||
$this->connect();
|
||||
mysqli_real_query($this->LinkID,$Query);
|
||||
mysqli_real_query($this->LinkID, $Query);
|
||||
}
|
||||
|
||||
function inserted_id() {
|
||||
@ -257,9 +257,9 @@ function inserted_id() {
|
||||
}
|
||||
}
|
||||
|
||||
function next_record($Type=MYSQLI_BOTH, $Escape = true) { // $Escape can be true, false, or an array of keys to not escape
|
||||
function next_record($Type = MYSQLI_BOTH, $Escape = true) { // $Escape can be true, false, or an array of keys to not escape
|
||||
if ($this->LinkID) {
|
||||
$this->Record = mysqli_fetch_array($this->QueryID,$Type);
|
||||
$this->Record = mysqli_fetch_array($this->QueryID, $Type);
|
||||
$this->Row++;
|
||||
if (!is_array($this->Record)) {
|
||||
$this->QueryID = false;
|
||||
@ -302,7 +302,7 @@ function escape_str($Str) {
|
||||
trigger_error('Attempted to escape array.');
|
||||
return '';
|
||||
}
|
||||
return mysqli_real_escape_string($this->LinkID,$Str);
|
||||
return mysqli_real_escape_string($this->LinkID, $Str);
|
||||
}
|
||||
|
||||
// Creates an array from a result set
|
||||
@ -310,7 +310,7 @@ function escape_str($Str) {
|
||||
// Otherwise, use an integer
|
||||
function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) {
|
||||
$Return = array();
|
||||
while ($Row = mysqli_fetch_array($this->QueryID,$Type)) {
|
||||
while ($Row = mysqli_fetch_array($this->QueryID, $Type)) {
|
||||
if ($Escape !== false) {
|
||||
$Row = Misc::display_array($Row, $Escape);
|
||||
}
|
||||
|
@ -6,13 +6,14 @@ class Permissions {
|
||||
* @param string PermissionName
|
||||
* @param string $MinClass Return false if the user's class level is below this.
|
||||
*/
|
||||
public static function check_perms($PermissionName,$MinClass = 0) {
|
||||
public static function check_perms($PermissionName, $MinClass = 0) {
|
||||
global $LoggedUser;
|
||||
return (
|
||||
isset($LoggedUser['Permissions'][$PermissionName])
|
||||
&& $LoggedUser['Permissions'][$PermissionName]
|
||||
&& ($LoggedUser['Class']>=$MinClass
|
||||
|| $LoggedUser['EffectiveClass']>=$MinClass)) ? true : false;
|
||||
&& ($LoggedUser['Class'] >= $MinClass
|
||||
|| $LoggedUser['EffectiveClass'] >= $MinClass)
|
||||
) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?
|
||||
//Useful: http://www.robtex.com/cnet/
|
||||
$AllowedProxies = array(
|
||||
//Opera Turbo (may include opera owned IPs that aren't used for Turbo, but shouldn't run much risk of exploitation)
|
||||
//Opera Turbo (may include Opera-owned IP addresses that aren't used for Turbo, but shouldn't run much risk of exploitation)
|
||||
'64.255.180.*', //Norway
|
||||
'64.255.164.*', //Norway
|
||||
'80.239.242.*', //Poland
|
||||
@ -15,16 +15,16 @@
|
||||
|
||||
function proxyCheck($IP) {
|
||||
global $AllowedProxies;
|
||||
for ($i=0,$il=count($AllowedProxies);$i<$il;++$i) {
|
||||
for ($i = 0, $il = count($AllowedProxies); $i < $il; ++$i) {
|
||||
//based on the wildcard principle it should never be shorter
|
||||
if (strlen($IP) < strlen($AllowedProxies[$i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//since we're matching bit for bit iterating from the start
|
||||
for ($j=0,$jl=strlen($IP);$j<$jl;++$j) {
|
||||
for ($j = 0, $jl = strlen($IP); $j < $jl; ++$j) {
|
||||
//completed iteration and no inequality
|
||||
if ($j == $jl-1 && $IP[$j] === $AllowedProxies[$i][$j]) {
|
||||
if ($j == $jl - 1 && $IP[$j] === $AllowedProxies[$i][$j]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Example :
|
||||
// $TPL = new TEMPLATE;
|
||||
// $TPL->open('inv.tpl');
|
||||
// $TPL->set('ADDRESS1',$TPL->str_align(57,$UADDRESS1,'l',' '));
|
||||
// $TPL->set('ADDRESS1', $TPL->str_align(57, $UADDRESS1, 'l', ' '));
|
||||
// $TPL->get();
|
||||
|
||||
class TEMPLATE {
|
||||
|
@ -132,7 +132,7 @@ public function full_format ($Str, $OutputTOC = true, $Min = 3) {
|
||||
$Str = preg_replace('/'.$URLPrefix.'\s+/i', '$1', $Str);
|
||||
$Str = preg_replace('/(?<!'.$URLPrefix.')http(s)?:\/\//i', '$1[inlineurl]http$2://', $Str);
|
||||
// For anonym.to and archive.org links, remove any [inlineurl] in the middle of the link
|
||||
$callback = create_function('$matches', 'return str_replace("[inlineurl]","",$matches[0]);');
|
||||
$callback = create_function('$matches', 'return str_replace("[inlineurl]", "", $matches[0]);');
|
||||
$Str = preg_replace_callback('/(?<=\[inlineurl\]|'.$URLPrefix.')(\S*\[inlineurl\]\S*)/m', $callback, $Str);
|
||||
|
||||
if ($this->TOC) {
|
||||
@ -647,11 +647,11 @@ private function to_html ($Array) {
|
||||
$Group = $Groups['matches'][$Matches[2]];
|
||||
$Str .= Artists::display_artists($Group['ExtendedArtists']).'<a href="torrents.php?id='.$Matches[2].'">'.$Group['Name'].'</a>';
|
||||
} else {
|
||||
$Str .= '[torrent]'.str_replace('[inlineurl]','',$Block['Val']).'[/torrent]';
|
||||
$Str .= '[torrent]'.str_replace('[inlineurl]', '', $Block['Val']).'[/torrent]';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$Str .= '[torrent]'.str_replace('[inlineurl]','',$Block['Val']).'[/torrent]';
|
||||
$Str .= '[torrent]'.str_replace('[inlineurl]', '', $Block['Val']).'[/torrent]';
|
||||
}
|
||||
break;
|
||||
case 'wiki':
|
||||
|
@ -169,8 +169,8 @@ public static function disable_users($UserIDs, $AdminComment, $BanReason = 1) {
|
||||
i.BanDate='".sqltime()."',
|
||||
i.BanReason='$BanReason',
|
||||
i.RatioWatchDownload=".($BanReason == 2 ? 'm.Downloaded' : "'0'")."
|
||||
WHERE m.ID IN(".implode(',',$UserIDs).") ");
|
||||
$Cache->decrement('stats_user_count',$DB->affected_rows());
|
||||
WHERE m.ID IN(".implode(',', $UserIDs).') ');
|
||||
$Cache->decrement('stats_user_count', $DB->affected_rows());
|
||||
foreach ($UserIDs as $UserID) {
|
||||
$Cache->delete_value('enabled_'.$UserID);
|
||||
$Cache->delete_value('user_info_'.$UserID);
|
||||
@ -197,7 +197,7 @@ public static function disable_users($UserIDs, $AdminComment, $BanReason = 1) {
|
||||
$DB->query("
|
||||
SELECT torrent_pass
|
||||
FROM users_main
|
||||
WHERE ID in (".implode(', ',$UserIDs).')');
|
||||
WHERE ID in (".implode(', ', $UserIDs).')');
|
||||
$PassKeys = $DB->collect('torrent_pass');
|
||||
$Concat = '';
|
||||
foreach ($PassKeys as $PassKey) {
|
||||
|
@ -277,7 +277,7 @@ function file_list() {
|
||||
$FileSize = $File->Val['length'];
|
||||
$TotalSize += $FileSize;
|
||||
|
||||
$FileName = ltrim(implode('/',$File->Val[$PathKey]->Val), '/');
|
||||
$FileName = ltrim(implode('/', $File->Val[$PathKey]->Val), '/');
|
||||
$FileSizes[] = $FileSize;
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ function file_list() {
|
||||
$FileSize = substr($File->Val['length'], 7);
|
||||
$TotalSize += $FileSize;
|
||||
|
||||
$FileName = ltrim(implode('/',$File->Val[$PathKey]->Val), '/');
|
||||
$FileName = ltrim(implode('/', $File->Val[$PathKey]->Val), '/');
|
||||
$FileSizes[] = $FileSize;
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public static function torrent_properties(&$Torrent, &$Flags) {
|
||||
* @param boolean $Hidden Currently does fuck all. TODO: Fix that.
|
||||
*/
|
||||
public static function write_group_log($GroupID, $TorrentID, $UserID, $Message, $Hidden) {
|
||||
global $DB,$Time;
|
||||
global $DB, $Time;
|
||||
$DB->query("
|
||||
INSERT INTO group_log
|
||||
(GroupID, TorrentID, UserID, Info, Time, Hidden)
|
||||
@ -371,7 +371,7 @@ public static function delete_group($GroupID) {
|
||||
$DB->query("
|
||||
UPDATE collages
|
||||
SET NumTorrents=NumTorrents-1
|
||||
WHERE ID IN (".implode(', ',$CollageIDs).')');
|
||||
WHERE ID IN (".implode(', ', $CollageIDs).')');
|
||||
$DB->query("
|
||||
DELETE FROM collages_torrents
|
||||
WHERE GroupID='$GroupID'");
|
||||
@ -659,7 +659,7 @@ public static function torrent_info($Data, $ShowMedia = false, $ShowEdition = fa
|
||||
$EditionInfo = array();
|
||||
if (!empty($Data['RemasterYear'])) { $EditionInfo[] = $Data['RemasterYear']; }
|
||||
if (!empty($Data['RemasterTitle'])) { $EditionInfo[] = $Data['RemasterTitle']; }
|
||||
if (count($EditionInfo)) { $Info[] = implode(' ',$EditionInfo); }
|
||||
if (count($EditionInfo)) { $Info[] = implode(' ', $EditionInfo); }
|
||||
}
|
||||
if ($Data['IsSnatched']) { $Info[] = Format::torrent_label('Snatched!'); }
|
||||
if ($Data['FreeTorrent'] == '1') { $Info[] = Format::torrent_label('Freeleech!'); }
|
||||
|
@ -184,13 +184,13 @@ public static function user_heavy_info($UserID) {
|
||||
foreach ($PermIDs AS $PermID) {
|
||||
$Perms = Permissions::get_permissions($PermID);
|
||||
if (!empty($Perms['PermittedForums'])) {
|
||||
$PermittedForums = array_merge($PermittedForums, array_map('trim', explode(',',$Perms['PermittedForums'])));
|
||||
$PermittedForums = array_merge($PermittedForums, array_map('trim', explode(',', $Perms['PermittedForums'])));
|
||||
}
|
||||
}
|
||||
$Perms = Permissions::get_permissions($HeavyInfo['PermissionID']);
|
||||
unset($HeavyInfo['PermissionID']);
|
||||
if (!empty($Perms['PermittedForums'])) {
|
||||
$PermittedForums = array_merge($PermittedForums, array_map('trim', explode(',',$Perms['PermittedForums'])));
|
||||
$PermittedForums = array_merge($PermittedForums, array_map('trim', explode(',', $Perms['PermittedForums'])));
|
||||
}
|
||||
|
||||
if (!empty($PermittedForums) || !empty($RestrictedForums)) {
|
||||
|
@ -35,8 +35,8 @@ function display_str($Str) {
|
||||
}
|
||||
if ($Str != '' && !is_number($Str)) {
|
||||
$Str = Format::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","&",$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", '&', $Str);
|
||||
|
||||
$Replace = array(
|
||||
"'",'"',"<",">",
|
||||
|
@ -6,9 +6,9 @@
|
||||
//-----------------------------------*/
|
||||
|
||||
class VALIDATE {
|
||||
var $Fields=array();
|
||||
var $Fields = array();
|
||||
|
||||
function SetFields($FieldName,$Required,$FieldType,$ErrorMessage,$Options=array()) {
|
||||
function SetFields($FieldName, $Required, $FieldType, $ErrorMessage, $Options = array()) {
|
||||
$this->Fields[$FieldName]['Type'] = strtolower($FieldType);
|
||||
$this->Fields[$FieldName]['Required'] = $Required;
|
||||
$this->Fields[$FieldName]['ErrorMessage'] = $ErrorMessage;
|
||||
@ -153,7 +153,7 @@ function ValidateForm($ValidateArray) {
|
||||
}
|
||||
|
||||
} elseif ($Field['Type'] == 'compare') {
|
||||
if ($ValidateArray[$Field['CompareField']]!=$ValidateVar) {
|
||||
if ($ValidateArray[$Field['CompareField']] != $ValidateVar) {
|
||||
return $Field['ErrorMessage'];
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,4 @@ User-agent: *
|
||||
Allow: /index.php
|
||||
Allow: /login.php
|
||||
Allow: /register.php
|
||||
#<skip>
|
||||
Allow: /what-network/
|
||||
Allow: /gazelle/
|
||||
Sitemap: https://what.cd/sitemap.xml
|
||||
#</skip>
|
||||
Disallow: /
|
||||
|
@ -268,7 +268,10 @@
|
||||
|
||||
} elseif (!empty($_GET['artistname'])) {
|
||||
$NameSearch = str_replace('\\', '\\\\', trim($_GET['artistname']));
|
||||
$DB->query("SELECT ArtistID, Name FROM artists_alias WHERE Name LIKE '" . db_string($NameSearch) . "'");
|
||||
$DB->query("
|
||||
SELECT ArtistID, Name
|
||||
FROM artists_alias
|
||||
WHERE Name LIKE '" . db_string($NameSearch) . "'");
|
||||
if ($DB->record_count() == 0) {
|
||||
if (isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) {
|
||||
header('Location: torrents.php?action=advanced&artistname=' . urlencode($_GET['artistname']));
|
||||
|
@ -1,14 +1,19 @@
|
||||
<?php
|
||||
|
||||
if (check_perms('admin_reports') && !empty($_GET['remove']) && is_number($_GET['remove'])) {
|
||||
$DB->query("DELETE FROM torrents_bad_folders WHERE TorrentID = ".$_GET['remove']);
|
||||
$DB->query("SELECT GroupID FROM torrents WHERE ID = ".$_GET['remove']);
|
||||
$DB->query("
|
||||
DELETE FROM torrents_bad_folders
|
||||
WHERE TorrentID = ".$_GET['remove']);
|
||||
$DB->query("
|
||||
SELECT GroupID
|
||||
FROM torrents
|
||||
WHERE ID = ".$_GET['remove']);
|
||||
list($GroupID) = $DB->next_record();
|
||||
$Cache->delete_value('torrents_details_'.$GroupID);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_GET['filter']) && $_GET['filter'] == "all") {
|
||||
if (!empty($_GET['filter']) && $_GET['filter'] == 'all') {
|
||||
$Join = '';
|
||||
$All = true;
|
||||
} else {
|
||||
@ -61,17 +66,17 @@
|
||||
} else {
|
||||
$DisplayName = '';
|
||||
}
|
||||
$DisplayName.='<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if ($GroupYear > 0) {
|
||||
$DisplayName.=" [$GroupYear]";
|
||||
$DisplayName .= " [$GroupYear]";
|
||||
}
|
||||
if ($ReleaseType > 0) {
|
||||
$DisplayName.=' ['.$ReleaseTypes[$ReleaseType].']';
|
||||
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
|
||||
}
|
||||
|
||||
$ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
|
||||
if ($ExtraInfo) {
|
||||
$DisplayName.=' - '.$ExtraInfo;
|
||||
$DisplayName .= ' - '.$ExtraInfo;
|
||||
}
|
||||
?>
|
||||
<tr class="torrent torrent_row<?=$Torrents[$TorrentID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
|
||||
|
@ -1,18 +1,19 @@
|
||||
<?
|
||||
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
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE t.Format='FLAC'
|
||||
GROUP BY x.fid
|
||||
HAVING COUNT(x.uid) = 1
|
||||
ORDER BY t.LogScore DESC, t.Time ASC
|
||||
LIMIT 30");
|
||||
$DB->query("
|
||||
SELECT
|
||||
t.ID AS TorrentID,
|
||||
t.GroupID AS GroupID
|
||||
FROM xbt_files_users AS x
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE t.Format='FLAC'
|
||||
GROUP BY x.fid
|
||||
HAVING COUNT(x.uid) = 1
|
||||
ORDER BY t.LogScore DESC, t.Time ASC
|
||||
LIMIT 30");
|
||||
|
||||
$GroupIDs = $DB->to_array('GroupID');
|
||||
$Cache->cache_value('better_single_groupids', $GroupIDs, 30*60);
|
||||
$Cache->cache_value('better_single_groupids', $GroupIDs, 30 * 60);
|
||||
}
|
||||
|
||||
$Results = Torrents::get_groups(array_keys($GroupIDs));
|
||||
@ -42,17 +43,17 @@
|
||||
}
|
||||
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
|
||||
|
||||
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'&torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if ($GroupYear > 0) {
|
||||
$DisplayName.=" [$GroupYear]";
|
||||
$DisplayName .= " [$GroupYear]";
|
||||
}
|
||||
if ($ReleaseType > 0) {
|
||||
$DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]";
|
||||
$DisplayName .= " [".$ReleaseTypes[$ReleaseType]."]";
|
||||
}
|
||||
|
||||
$ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
|
||||
if ($ExtraInfo) {
|
||||
$DisplayName.=' - '.$ExtraInfo;
|
||||
$DisplayName .= ' - '.$ExtraInfo;
|
||||
}
|
||||
?>
|
||||
<tr class="torrent torrent_row<?=$Torrents[$FlacID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
|
||||
|
@ -19,7 +19,8 @@
|
||||
}
|
||||
|
||||
// Get list of FLAC snatches
|
||||
$DB->query("SELECT t.GroupID, x.fid
|
||||
$DB->query("
|
||||
SELECT t.GroupID, x.fid
|
||||
FROM ".($SeedingOnly ? 'xbt_files_users' : 'xbt_snatched')." AS x
|
||||
JOIN torrents AS t ON t.ID=x.fid
|
||||
JOIN torrents_group AS tg ON tg.ID = t.GroupID
|
||||
@ -27,7 +28,8 @@
|
||||
AND ((t.LogScore = '100' AND t.Media = 'CD')
|
||||
OR t.Media != 'CD')
|
||||
AND tg.CategoryID = 1
|
||||
AND x.uid='$UserID'" . ($SeedingOnly ? ' AND x.active = 1 AND x.remaining = 0' : ''));
|
||||
AND x.uid='$UserID'" .
|
||||
($SeedingOnly ? ' AND x.active = 1 AND x.remaining = 0' : ''));
|
||||
|
||||
$SnatchedTorrentIDs = array_fill_keys($DB->collect('fid'), true);
|
||||
$SnatchedGroupIDs = array_unique($DB->collect('GroupID'));
|
||||
@ -41,19 +43,26 @@
|
||||
}
|
||||
// Create hash table
|
||||
|
||||
$DB->query("CREATE TEMPORARY TABLE temp_sections_better_snatch
|
||||
SELECT t.GroupID,
|
||||
GROUP_CONCAT(t.Encoding SEPARATOR ' ') AS EncodingList,
|
||||
CRC32(CONCAT_WS(' ', Media, Remasteryear, Remastertitle,
|
||||
Remasterrecordlabel, Remastercataloguenumber)) AS RemIdent
|
||||
$DB->query("
|
||||
CREATE TEMPORARY TABLE temp_sections_better_snatch
|
||||
SELECT
|
||||
t.GroupID,
|
||||
GROUP_CONCAT(t.Encoding SEPARATOR ' ') AS EncodingList,
|
||||
CRC32(CONCAT_WS(
|
||||
' ', Media, Remasteryear, Remastertitle,
|
||||
Remasterrecordlabel, Remastercataloguenumber)
|
||||
) AS RemIdent
|
||||
FROM torrents AS t
|
||||
WHERE t.GroupID IN(".implode(',',$SnatchedGroupIDs).") AND t.Format IN ('FLAC', 'MP3')
|
||||
WHERE t.GroupID IN(".implode(',', $SnatchedGroupIDs).")
|
||||
AND t.Format IN ('FLAC', 'MP3')
|
||||
GROUP BY t.GroupID, RemIdent");
|
||||
|
||||
//$DB->query('SELECT * FROM t');
|
||||
|
||||
$DB->query("SELECT GroupID FROM temp_sections_better_snatch
|
||||
WHERE EncodingList NOT LIKE '%V0 (VBR)%'
|
||||
$DB->query("
|
||||
SELECT GroupID
|
||||
FROM temp_sections_better_snatch
|
||||
WHERE EncodingList NOT LIKE '%V0 (VBR)%'
|
||||
OR EncodingList NOT LIKE '%V2 (VBR)%'
|
||||
OR EncodingList NOT LIKE '%320%'");
|
||||
|
||||
@ -218,9 +227,9 @@
|
||||
<div class="torrent_info"><?=$ExtraInfo?></div>
|
||||
<div class="tags"><?=$TorrentTags->format()?></div>
|
||||
</td>
|
||||
<td><strong <?=isset($Edition['Formats']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><?=isset($Edition['Formats']['V2 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['V0 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['320']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
@ -1,8 +1,13 @@
|
||||
<?php
|
||||
|
||||
if (check_perms('admin_reports') && !empty($_GET['remove']) && is_number($_GET['remove'])) {
|
||||
$DB->query("DELETE FROM torrents_bad_tags WHERE TorrentID = ".$_GET['remove']);
|
||||
$DB->query("SELECT GroupID FROM torrents WHERE ID = ".$_GET['remove']);
|
||||
$DB->query("
|
||||
DELETE FROM torrents_bad_tags
|
||||
WHERE TorrentID = ".$_GET['remove']);
|
||||
$DB->query("
|
||||
SELECT GroupID
|
||||
FROM torrents
|
||||
WHERE ID = ".$_GET['remove']);
|
||||
list($GroupID) = $DB->next_record();
|
||||
$Cache->delete_value('torrents_details_'.$GroupID);
|
||||
}
|
||||
@ -62,17 +67,17 @@
|
||||
} else {
|
||||
$DisplayName = '';
|
||||
}
|
||||
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&torrentid='.$TorrentID.'#torrent'.$TorrentID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'&torrentid='.$TorrentID.'#torrent'.$TorrentID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
if ($GroupYear > 0) {
|
||||
$DisplayName.=" [$GroupYear]";
|
||||
$DisplayName .= " [$GroupYear]";
|
||||
}
|
||||
if ($ReleaseType > 0) {
|
||||
$DisplayName.=' ['.$ReleaseTypes[$ReleaseType].']';
|
||||
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
|
||||
}
|
||||
|
||||
$ExtraInfo = Torrents::torrent_info($Torrents[$TorrentID]);
|
||||
if ($ExtraInfo) {
|
||||
$DisplayName.=' - '.$ExtraInfo;
|
||||
$DisplayName .= ' - '.$ExtraInfo;
|
||||
}
|
||||
?>
|
||||
<tr class="torrent torrent_row<?=$Torrents[$TorrentID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
|
||||
|
@ -178,9 +178,9 @@
|
||||
<div class="torrent_info"><?=$ExtraInfo?></div>
|
||||
<div class="tags"><?=$TorrentTags->format()?></div>
|
||||
</td>
|
||||
<td><strong <?=isset($Edition['Formats']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><?=isset($Edition['Formats']['V2 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['V0 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['320']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
@ -324,9 +324,9 @@ function transcode_parse_groups($Groups) {
|
||||
<div class="torrent_info"><?=$Edition['EditionName']?></div>
|
||||
<div class="tags"><?=$TorrentTags->format('better.php?action=transcode&tags=')?></div>
|
||||
</td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
<td><strong <?=(isset($Edition['MP3s']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO')?></strong></td>
|
||||
<td><?=(isset($Edition['MP3s']['V2 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>')?></td>
|
||||
<td><?=(isset($Edition['MP3s']['V0 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>')?></td>
|
||||
<td><?=(isset($Edition['MP3s']['320']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>')?></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
@ -13,15 +13,15 @@
|
||||
$EncodingKeys = array_fill_keys($Encodings, true);
|
||||
|
||||
// Get list of FLAC uploads
|
||||
$DB->query("SELECT t.GroupID, t.ID
|
||||
$DB->query("
|
||||
SELECT t.GroupID, t.ID
|
||||
FROM torrents AS t
|
||||
JOIN torrents_group AS tg ON tg.ID = t.GroupID
|
||||
WHERE
|
||||
t.Format='FLAC'
|
||||
AND ((t.LogScore = '100' AND t.Media = 'CD')
|
||||
OR t.Media != 'CD')
|
||||
AND tg.CategoryID = 1
|
||||
AND t.UserID='$UserID'");
|
||||
JOIN torrents_group AS tg ON tg.ID = t.GroupID
|
||||
WHERE t.Format='FLAC'
|
||||
AND ((t.LogScore = '100' AND t.Media = 'CD')
|
||||
OR t.Media != 'CD')
|
||||
AND tg.CategoryID = 1
|
||||
AND t.UserID = '$UserID'");
|
||||
|
||||
$UploadedTorrentIDs = array_fill_keys($DB->collect('ID'), true);
|
||||
$UploadedGroupIDs = $DB->collect('GroupID');
|
||||
@ -31,17 +31,24 @@
|
||||
}
|
||||
|
||||
// Create hash table
|
||||
$DB->query("CREATE TEMPORARY TABLE temp_sections_better_upload
|
||||
SELECT t.GroupID,
|
||||
GROUP_CONCAT(t.Encoding SEPARATOR ' ') AS EncodingList,
|
||||
CRC32(CONCAT_WS(' ', Media, Remasteryear, Remastertitle,
|
||||
Remasterrecordlabel, Remastercataloguenumber)) AS RemIdent
|
||||
$DB->query("
|
||||
CREATE TEMPORARY TABLE temp_sections_better_upload
|
||||
SELECT
|
||||
t.GroupID,
|
||||
GROUP_CONCAT(t.Encoding SEPARATOR ' ') AS EncodingList,
|
||||
CRC32(CONCAT_WS(
|
||||
' ', Media, Remasteryear, Remastertitle,
|
||||
Remasterrecordlabel, Remastercataloguenumber)
|
||||
) AS RemIdent
|
||||
FROM torrents AS t
|
||||
WHERE t.GroupID IN(".implode(',',$UploadedGroupIDs).") AND t.Format IN ('FLAC', 'MP3')
|
||||
WHERE t.GroupID IN(".implode(',', $UploadedGroupIDs).")
|
||||
AND t.Format IN ('FLAC', 'MP3')
|
||||
GROUP BY t.GroupID, RemIdent");
|
||||
|
||||
$DB->query("SELECT GroupID FROM temp_sections_better_upload
|
||||
WHERE EncodingList NOT LIKE '%V0 (VBR)%'
|
||||
$DB->query("
|
||||
SELECT GroupID
|
||||
FROM temp_sections_better_upload
|
||||
WHERE EncodingList NOT LIKE '%V0 (VBR)%'
|
||||
OR EncodingList NOT LIKE '%V2 (VBR)%'
|
||||
OR EncodingList NOT LIKE '%320%'");
|
||||
|
||||
@ -197,9 +204,9 @@
|
||||
<div class="torrent_info"><?=$ExtraInfo?></div>
|
||||
<div class="tags"><?=$TorrentTags->format()?></div>
|
||||
</td>
|
||||
<td><strong <?=isset($Edition['Formats']['V2 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['V0 (VBR)']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><strong <?=isset($Edition['Formats']['320']) ? 'class="important_text_alt">YES' : 'class="important_text">NO'?></strong></td>
|
||||
<td><?=isset($Edition['Formats']['V2 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['V0 (VBR)']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
<td><?=isset($Edition['Formats']['320']) ? '<strong class="important_text_alt">YES</strong>' : '<strong class="important_text">NO</strong>'?></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
|
@ -103,31 +103,10 @@
|
||||
case 'create_personal':
|
||||
if (!check_perms('site_collages_personal')) {
|
||||
error(403);
|
||||
} else {
|
||||
Collages::create_personal_collage();
|
||||
}
|
||||
|
||||
$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']) {
|
||||
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=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();
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!empty($_GET['id'])) {
|
||||
|
@ -580,7 +580,7 @@
|
||||
$EditSummary[] = "IRC status changed";
|
||||
$HeavyUpdates['DisableIRC'] = $DisableIRC;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
|
||||
Misc::send_pm($UserID, 0, 'Your IRC privileges have been disabled', "Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in ".BOT_DISABLED_CHAN.'.');
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,7 +589,7 @@
|
||||
$EditSummary[] = "request status changed";
|
||||
$HeavyUpdates['DisableRequests'] = $DisableRequests;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled.");
|
||||
Misc::send_pm($UserID, 0, 'Your request privileges have been disabled', "Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".SSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in ".BOT_DISABLED_CHAN.'.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ function Quote(post, user, link) {
|
||||
if ($('#quickpost').raw().value !== '') {
|
||||
$('#quickpost').raw().value = $('#quickpost').raw().value + "\n\n";
|
||||
}
|
||||
$('#quickpost').raw().value = $('#quickpost').raw().value + "[quote="+username + (link == true ? "|" + post : "") + "]" +
|
||||
$('#quickpost').raw().value = $('#quickpost').raw().value + "[quote=" + username + (link == true ? "|" + post : "") + "]" +
|
||||
//response.replace(/(img|aud)(\]|=)/ig,'url$2').replace(/\[url\=(https?:\/\/[^\s\[\]<>"\'()]+?)\]\[url\](.+?)\[\/url\]\[\/url\]/gi, "[url]$1[/url]")
|
||||
html_entity_decode(response)
|
||||
+ "[/quote]";
|
||||
@ -41,9 +41,9 @@ function Edit_Form(post,key) {
|
||||
$('#reply_box').ghide();
|
||||
if (location.href.match(/torrents\.php/) ||
|
||||
location.href.match(/artist\.php/)) {
|
||||
boxWidth="50";
|
||||
boxWidth = "50";
|
||||
} else {
|
||||
boxWidth="80";
|
||||
boxWidth = "80";
|
||||
}
|
||||
postuserid = $('#post' + postid + ' strong a').raw().getAttribute('href').split('=')[1]
|
||||
/* jQuery isnt enabled on comments, artist comments, or basically anywhere but thread.php
|
||||
@ -52,13 +52,13 @@ function Edit_Form(post,key) {
|
||||
postuserid = jQuery('#post' + postid + ' strong a').attr('href').split('=')[1];
|
||||
*/
|
||||
if (postuserid != userid) {
|
||||
pmbox = '<span id="pmbox'+postid+'">PM user on edit? <input type="checkbox" name="pm" value="1" /></span>';
|
||||
pmbox = '<span id="pmbox' + postid + '"><label>PM user on edit? <input type="checkbox" name="pm" value="1" /></label></span>';
|
||||
} else {
|
||||
pmbox = '';
|
||||
};
|
||||
$('#bar' + postid).raw().cancel = $('#content' + postid).raw().innerHTML;
|
||||
$('#bar' + postid).raw().oldbar = $('#bar' + postid).raw().innerHTML;
|
||||
$('#content' + postid).raw().innerHTML = "<div id=\"preview" + postid + "\"></div><form id=\"form" + postid + "\" method=\"post\" action=\"\">"+pmbox+"<input type=\"hidden\" name=\"auth\" value=\"" + authkey + "\" /><input type=\"hidden\" name=\"key\" value=\"" + key + "\" /><input type=\"hidden\" name=\"post\" value=\"" + postid + "\" /><textarea id=\"editbox" + postid + "\" onkeyup=\"resize('editbox" + postid + "');\" name=\"body\" cols=\""+boxWidth+"\" rows=\"10\"></textarea></form>";
|
||||
$('#content' + postid).raw().innerHTML = "<div id=\"preview" + postid + "\"></div><form id=\"form" + postid + "\" method=\"post\" action=\"\">" + pmbox + "<input type=\"hidden\" name=\"auth\" value=\"" + authkey + "\" /><input type=\"hidden\" name=\"key\" value=\"" + key + "\" /><input type=\"hidden\" name=\"post\" value=\"" + postid + "\" /><textarea id=\"editbox" + postid + "\" onkeyup=\"resize('editbox" + postid + "');\" name=\"body\" cols=\"" + boxWidth + "\" rows=\"10\"></textarea></form>";
|
||||
$('#bar' + postid).raw().innerHTML = '<input type="button" value="Preview" onclick="Preview_Edit(' + postid + ');" /><input type="button" value="Post" onclick="Save_Edit(' + postid + ')" /><input type="button" value="Cancel" onclick="Cancel_Edit(' + postid + ');" />';
|
||||
}
|
||||
/* If it's the initial edit, fetch the post content to be edited.
|
||||
@ -161,7 +161,7 @@ function Quick_Preview() {
|
||||
var quickreplybuttons;
|
||||
$('#post_preview').raw().value = "Make changes";
|
||||
$('#post_preview').raw().preview = true;
|
||||
ajax.post("ajax.php?action=preview","quickpostform", function(response) {
|
||||
ajax.post("ajax.php?action=preview", "quickpostform", function(response) {
|
||||
$('#quickreplypreview').gshow();
|
||||
$('#contentpreview').raw().innerHTML = response;
|
||||
$('#quickreplytext').ghide();
|
||||
@ -180,7 +180,7 @@ function Newthread_Preview(mode) {
|
||||
$('#newthreadpreviewbutton').gtoggle();
|
||||
$('#newthreadeditbutton').gtoggle();
|
||||
if (mode) { // Preview
|
||||
ajax.post("ajax.php?action=preview","newthreadform", function(response) {
|
||||
ajax.post("ajax.php?action=preview", "newthreadform", function(response) {
|
||||
$('#contentpreview').raw().innerHTML = response;
|
||||
});
|
||||
$('#newthreadtitle').raw().innerHTML = $('#title').raw().value;
|
||||
|
@ -27,7 +27,7 @@ var isMobile = {
|
||||
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?");
|
||||
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;
|
||||
}
|
||||
@ -35,7 +35,7 @@ if (isMobile.Android()) {
|
||||
} 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?");
|
||||
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;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Mono What.cd Stylesheet
|
||||
Mono What.CD Stylesheet
|
||||
|
||||
Author: Callum Jefferies (callumj)
|
||||
Contact: callum.jefferies@gmail.com
|
||||
@ -16,7 +16,7 @@ All icons Copyright (c) Callum Jefferies 2011
|
||||
body {
|
||||
padding: 120px 20px 60px 20px;
|
||||
background: #eee !important;
|
||||
font: 9pt/14pt 'Lucida Grande',Helvetica,Arial,sans-serif;
|
||||
font: 9pt/14pt 'Lucida Grande', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
@ -38,7 +38,7 @@ a:hover {
|
||||
}
|
||||
|
||||
h1,h2,h3 {
|
||||
font-family: Helvetica,Arial,sans-serif;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
color: #444 !important;
|
||||
}
|
||||
|
@ -2043,7 +2043,7 @@ tr.torrent .bookmark > a:after {
|
||||
}
|
||||
|
||||
.group_image img {
|
||||
background: url(https://what.cd/static/common/noartwork/music.png) no-repeat top left;
|
||||
background: url(static/common/noartwork/music.png) no-repeat top left;
|
||||
background-size: 90px;
|
||||
color: transparent;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user