Empty commit

This commit is contained in:
Git 2013-06-18 08:00:48 +00:00
parent b139eca03b
commit b1db2e6185
38 changed files with 214 additions and 181 deletions

View File

@ -50,7 +50,7 @@ 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 = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str);
$Replace = array(
"'",'"',"<",">",

View File

@ -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();
}
}

View File

@ -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] . "'");

View File

@ -12,7 +12,8 @@ public static function check_perms($PermissionName,$MinClass = 0) {
isset($LoggedUser['Permissions'][$PermissionName])
&& $LoggedUser['Permissions'][$PermissionName]
&& ($LoggedUser['Class'] >= $MinClass
|| $LoggedUser['EffectiveClass']>=$MinClass)) ? true : false;
|| $LoggedUser['EffectiveClass'] >= $MinClass)
) ? true : false;
}
/**

View File

@ -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

View File

@ -169,7 +169,7 @@ 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).") ");
WHERE m.ID IN(".implode(',', $UserIDs).') ');
$Cache->decrement('stats_user_count', $DB->affected_rows());
foreach ($UserIDs as $UserID) {
$Cache->delete_value('enabled_'.$UserID);

View File

@ -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","&amp;",$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(
"'",'"',"<",">",

View File

@ -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: /

View File

@ -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']));

View File

@ -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 {

View File

@ -1,6 +1,7 @@
<?
if (($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
$DB->query("SELECT
$DB->query("
SELECT
t.ID AS TorrentID,
t.GroupID AS GroupID
FROM xbt_files_users AS x

View File

@ -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,18 +43,25 @@
}
// Create hash table
$DB->query("CREATE TEMPORARY TABLE temp_sections_better_snatch
SELECT t.GroupID,
$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
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
$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>
<?
}

View File

@ -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);
}

View File

@ -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>
<?
}

View File

@ -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>
<?
}

View File

@ -13,11 +13,11 @@
$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'
WHERE t.Format='FLAC'
AND ((t.LogScore = '100' AND t.Media = 'CD')
OR t.Media != 'CD')
AND tg.CategoryID = 1
@ -31,16 +31,23 @@
}
// Create hash table
$DB->query("CREATE TEMPORARY TABLE temp_sections_better_upload
SELECT t.GroupID,
$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
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
$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>
<?
}

View File

@ -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'])) {

View File

@ -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&amp;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&amp;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&amp;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&amp;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.'.');
}
}

View File

@ -52,7 +52,7 @@ 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 = '';
};

View File

@ -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;
}

View File

@ -1,5 +1,5 @@
/*
Mono What.cd Stylesheet
Mono What.CD Stylesheet
Author: Callum Jefferies (callumj)
Contact: callum.jefferies@gmail.com

View File

@ -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;
}