Empty commit

This commit is contained in:
Git 2013-02-10 08:00:29 +00:00
parent 98bc98ed16
commit 35473bd15d
15 changed files with 350 additions and 359 deletions

View File

@ -584,7 +584,7 @@ private function to_html ($Array) {
$Str.='<em>'.$this->to_html($Block['Val'])."</em>"; $Str.='<em>'.$this->to_html($Block['Val'])."</em>";
break; break;
case 's': case 's':
$Str.='<span style="text-decoration: line-through">'.$this->to_html($Block['Val']).'</span>'; $Str.='<span style="text-decoration: line-through;">'.$this->to_html($Block['Val']).'</span>';
break; break;
case 'important': case 'important':
$Str.='<strong class="important_text">'.$this->to_html($Block['Val']).'</strong>'; $Str.='<strong class="important_text">'.$this->to_html($Block['Val']).'</strong>';

View File

@ -542,7 +542,7 @@ function to_html($Array) {
$Str.='[img]'.$Block['Val'].'[/img]'; $Str.='[img]'.$Block['Val'].'[/img]';
} else { } else {
if(check_perms('site_proxy_images')) { if(check_perms('site_proxy_images')) {
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />'; $Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="https://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
} else { } else {
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />'; $Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
} }

View File

@ -48,7 +48,11 @@ public static function geoip($IP) {
if (isset($IPs[$IP])) { if (isset($IPs[$IP])) {
return $IPs[$IP]; return $IPs[$IP];
} }
if (is_number($IP)) {
$Long = $IP;
} else {
$Long = Tools::ip_to_unsigned($IP); $Long = Tools::ip_to_unsigned($IP);
}
if(!$Long || $Long == 2130706433) { // No need to check cc for 127.0.0.1 if(!$Long || $Long == 2130706433) { // No need to check cc for 127.0.0.1
return false; return false;
} }
@ -126,7 +130,7 @@ public static function lookup_ip($IP) {
*/ */
public static function display_ip($IP) { public static function display_ip($IP) {
$Line = display_str($IP).' ('.Tools::get_country_code_by_ajax($IP).') '; $Line = display_str($IP).' ('.Tools::get_country_code_by_ajax($IP).') ';
$Line .= '[<a href="user.php?action=search&amp;ip_history=on&amp;ip='.display_str($IP).'&amp;matchtype=strict" title="Search">S</a>]'; $Line .= '<a href="user.php?action=search&amp;ip_history=on&amp;ip='.display_str($IP).'&amp;matchtype=strict" title="Search" class="brackets">S</a>';
return $Line; return $Line;
} }

View File

@ -834,7 +834,6 @@ function compare($X, $Y){
$Cache->cache_value('similar_positions_'.$ArtistID, $SimilarData, 3600*24); $Cache->cache_value('similar_positions_'.$ArtistID, $SimilarData, 3600*24);
} }
?> ?>
<div id="similar_artist_map" class="box"> <div id="similar_artist_map" class="box">
<div id="flipper_head" class="head"> <div id="flipper_head" class="head">
<a href="#">&uarr;</a>&nbsp; <a href="#">&uarr;</a>&nbsp;
@ -855,19 +854,17 @@ function compare($X, $Y){
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">//<![CDATA[
//<![CDATA[
var cloudLoaded = false; var cloudLoaded = false;
function flipView() { function flipView() {
var state = document.getElementById('flip_view_1').style.display == 'block'; var state = document.getElementById('flip_view_1').style.display == 'block';
if(state) { if(state) {
document.getElementById('flip_view_1').style.display='none'; document.getElementById('flip_view_1').style.display='none';
document.getElementById('flip_view_2').style.display='block'; document.getElementById('flip_view_2').style.display='block';
document.getElementById('flipper_title').innerHTML = 'Similar Artist Cloud'; document.getElementById('flipper_title').innerHTML = 'Similar artist cloud';
document.getElementById('flip_to').innerHTML = ' [Switch to Map]'; document.getElementById('flip_to').innerHTML = 'Switch to map';
if(!cloudLoaded) { if(!cloudLoaded) {
require("static/functions/jquery.js", function () { require("static/functions/jquery.js", function () {
@ -878,15 +875,12 @@ function flipView() {
}); });
cloudLoaded = true; cloudLoaded = true;
} }
} }
else { else {
document.getElementById('flip_view_1').style.display='block'; document.getElementById('flip_view_1').style.display='block';
document.getElementById('flip_view_2').style.display='none'; document.getElementById('flip_view_2').style.display='none';
document.getElementById('flipper_title').innerHTML = 'Similar Artist Map'; document.getElementById('flipper_title').innerHTML = 'Similar artist map';
document.getElementById('flip_to').innerHTML = ' [Switch to Cloud]'; document.getElementById('flip_to').innerHTML = 'Switch to cloud';
} }
} }

View File

@ -290,8 +290,8 @@ function compare($X, $Y){
<a href="bookmarks.php?type=requests" class="brackets">Requests</a> <a href="bookmarks.php?type=requests" class="brackets">Requests</a>
<? if (count($TorrentList) > 0) { ?> <? if (count($TorrentList) > 0) { ?>
<br /><br /> <br /><br />
<a href="bookmarks.php?action=remove_snatched&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets" onclick="return confirm('Are you sure you want to remove the bookmarks for all items you\'ve snatched?');">Remove Snatched</a> <a href="bookmarks.php?action=remove_snatched&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets" onclick="return confirm('Are you sure you want to remove the bookmarks for all items you\'ve snatched?');">Remove snatched</a>
<a href="bookmarks.php?action=edit&amp;type=torrents" class="brackets">Manage Torrents</a> <a href="bookmarks.php?action=edit&amp;type=torrents" class="brackets">Manage torrents</a>
<? } ?> <? } ?>
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@
$Conditions = "WHERE t.UserID = $UserID AND tc.AuthorID != t.UserID AND tc.AddedTime > t.Time"; $Conditions = "WHERE t.UserID = $UserID AND tc.AuthorID != t.UserID AND tc.AddedTime > t.Time";
$Title = 'Comments left on your torrents'; $Title = 'Comments left on your torrents';
$Header = 'Comments left on your uploads'; $Header = 'Comments left on your uploads';
if($Self) $OtherLink = '<a href="comments.php?action=torrents">Display comments you\'ve made</a>'; if($Self) $OtherLink = '<a href="comments.php?action=torrents" class="brackets">Display comments you have made</a>';
} }
else { else {
$Conditions = "WHERE tc.AuthorID = $UserID"; $Conditions = "WHERE tc.AuthorID = $UserID";

View File

@ -55,6 +55,7 @@
} }
} }
if(!isset($Forums[$ForumID])) { error(404); } if(!isset($Forums[$ForumID])) { error(404); }
// Make sure they're allowed to look at the page // Make sure they're allowed to look at the page
if (!check_perms('site_moderate_forums')) { if (!check_perms('site_moderate_forums')) {

View File

@ -36,8 +36,6 @@
$ThreadID = $_GET['threadid']; $ThreadID = $_GET['threadid'];
} }
if (isset($LoggedUser['PostsPerPage'])) { if (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage']; $PerPage = $LoggedUser['PostsPerPage'];
} else { } else {
@ -165,7 +163,7 @@
<div class="center"> <div class="center">
<a href="reports.php?action=report&amp;type=thread&amp;id=<?=$ThreadID?>" class="brackets">Report Thread</a> <a href="reports.php?action=report&amp;type=thread&amp;id=<?=$ThreadID?>" class="brackets">Report Thread</a>
<a href="#" onclick="Subscribe(<?=$ThreadID?>);return false;" id="subscribelink<?=$ThreadID?>" class="brackets"><?=(in_array($ThreadID, $UserSubscriptions) ? 'Unsubscribe' : 'Subscribe')?></a> <a href="#" onclick="Subscribe(<?=$ThreadID?>);return false;" id="subscribelink<?=$ThreadID?>" class="brackets"><?=(in_array($ThreadID, $UserSubscriptions) ? 'Unsubscribe' : 'Subscribe')?></a>
<a href="#" class="brackets" onclick="$('#searchthread').toggle(); this.innerHTML = (this.innerHTML == 'Search this Thread'?'Hide Search':'Search this Thread'); return false;">Search this Thread</a> <a href="#" onclick="$('#searchthread').toggle(); this.innerHTML = (this.innerHTML == 'Search this Thread'?'Hide Search':'Search this Thread'); return false;" class="brackets">Search this Thread</a>
</div> </div>
<div id="searchthread" class="hidden center"> <div id="searchthread" class="hidden center">
<div style="display: inline-block;"> <div style="display: inline-block;">

View File

@ -172,7 +172,10 @@
// Function to log a user's login attempt // Function to log a user's login attempt
function log_attempt($UserID) { function log_attempt($UserID) {
global $DB, $Cache, $AttemptID, $Attempts, $Bans, $BannedUntil, $Time; global $DB, $Cache, $AttemptID, $Attempts, $Bans, $BannedUntil, $Time, $UserID;
$IPStr = $_SERVER['REMOTE_ADDR'];
$IPA = substr($IPStr, 0, strcspn($IPStr, '.'));
$IP = Tools::ip_to_unsigned($IPStr);
if($AttemptID) { // User has attempted to log in recently if($AttemptID) { // User has attempted to log in recently
$Attempts++; $Attempts++;
if ($Attempts>5) { // Only 6 allowed login attempts, ban user's IP if ($Attempts>5) { // Only 6 allowed login attempts, ban user's IP
@ -185,7 +188,6 @@ function log_attempt($UserID) {
WHERE ID='".db_string($AttemptID)."'"); WHERE ID='".db_string($AttemptID)."'");
if ($Bans>9) { // Automated bruteforce prevention if ($Bans>9) { // Automated bruteforce prevention
$IP = Tools::ip_to_unsigned($_SERVER['REMOTE_ADDR']);
$DB->query("SELECT Reason FROM ip_bans WHERE ".$IP." BETWEEN FromIP AND ToIP"); $DB->query("SELECT Reason FROM ip_bans WHERE ".$IP." BETWEEN FromIP AND ToIP");
if($DB->record_count() > 0) { if($DB->record_count() > 0) {
//Ban exists already, only add new entry if not for same reason //Ban exists already, only add new entry if not for same reason
@ -200,8 +202,7 @@ function log_attempt($UserID) {
$DB->query("INSERT IGNORE INTO ip_bans $DB->query("INSERT IGNORE INTO ip_bans
(FromIP, ToIP, Reason) VALUES (FromIP, ToIP, Reason) VALUES
('$IP','$IP', 'Automated ban per >60 failed login attempts')"); ('$IP','$IP', 'Automated ban per >60 failed login attempts')");
$A = substr($_SERVER['REMOTE_ADDR'], 0, strcspn($_SERVER['REMOTE_ADDR'], '.')); $Cache->delete_value('ip_bans_'.$IPA);
$Cache->delete_value('ip_bans_'.$A);
} }
} }
} else { } else {
@ -216,12 +217,16 @@ function log_attempt($UserID) {
$Attempts=1; $Attempts=1;
$DB->query("INSERT INTO login_attempts $DB->query("INSERT INTO login_attempts
(UserID,IP,LastAttempt,Attempts) VALUES (UserID,IP,LastAttempt,Attempts) VALUES
('".db_string($UserID)."','".db_string($_SERVER['REMOTE_ADDR'])."','".sqltime()."',1)"); ('".db_string($UserID)."','".db_string($IPStr)."','".sqltime()."',1)");
} }
} // end log_attempt function } // end log_attempt function
// If user has submitted form // If user has submitted form
if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) { if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
if (strtotime($BannedUntil) > time()) {
header("Location: login.php");
die();
}
$Err=$Validate->ValidateForm($_POST); $Err=$Validate->ValidateForm($_POST);
if(!$Err) { if(!$Err) {

View File

@ -95,13 +95,13 @@
<a href="requests.php?action=delete&amp;id=<?=$RequestID?>" class="brackets">Delete</a> <a href="requests.php?action=delete&amp;id=<?=$RequestID?>" class="brackets">Delete</a>
<? } ?> <? } ?>
<? if(has_bookmarked('request', $RequestID)) { ?> <? if(has_bookmarked('request', $RequestID)) { ?>
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Unbookmark('request', <?=$RequestID?>,'[Bookmark]');return false;" class="brackets">Remove bookmark</a> <a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Unbookmark('request', <?=$RequestID?>,'Bookmark');return false;" class="brackets">Remove bookmark</a>
<? } else { ?> <? } else { ?>
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>,'[Remove bookmark]');return false;" class="brackets">Bookmark</a> <a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
<? } ?> <? } ?>
<a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>" class="brackets">Report request</a> <a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>" class="brackets">Report request</a>
<? if(!$IsFilled) { ?> <? if(!$IsFilled) { ?>
<a href="upload.php?requestid=<?=$RequestID?><?=($GroupID?"&groupid=$GroupID":'')?>" class="brackets">Upload request</a> <a href="upload.php?requestid=<?=$RequestID?><?= ($GroupID ? "&amp;groupid=$GroupID" : '') ?>" class="brackets">Upload request</a>
<? } <? }
if(!$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0))) { ?> if(!$IsFilled && (($CategoryID == 0) || ($CategoryName == "Music" && $Year == 0))) { ?>
<a href="reports.php?action=report&amp;type=request_update&amp;id=<?=$RequestID?>" class="brackets">Request update</a> <a href="reports.php?action=report&amp;type=request_update&amp;id=<?=$RequestID?>" class="brackets">Request update</a>

View File

@ -404,7 +404,7 @@
</table> </table>
<table class="layout"> <table class="layout">
<tr id="release_list"> <tr id="release_list">
<td class="label">Release Types</td> <td class="label">Release types</td>
<td> <td>
<input type="checkbox" id="toggle_releases" onchange="Toggle('releases', 0)" <?=(!$Submitted || !empty($ReleaseArray) && count($ReleaseArray) == count($ReleaseTypes) ? ' checked="checked"' : '')?>/> <label for="toggle_releases">All</label> <input type="checkbox" id="toggle_releases" onchange="Toggle('releases', 0)" <?=(!$Submitted || !empty($ReleaseArray) && count($ReleaseArray) == count($ReleaseTypes) ? ' checked="checked"' : '')?>/> <label for="toggle_releases">All</label>
<? $i = 0; <? $i = 0;
@ -495,7 +495,7 @@
<table id="request_table" class="request_table border" cellpadding="6" cellspacing="1" border="0" width="100%"> <table id="request_table" class="request_table border" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr class="colhead_dark"> <tr class="colhead_dark">
<td style="width: 38%;" class="nobr"> <td style="width: 38%;" class="nobr">
<strong>Request Name</strong> / <a href="?order=year&amp;sort=<?=(($CurrentOrder == 'year') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Year</strong></a> <strong>Request name</strong> / <a href="?order=year&amp;sort=<?=(($CurrentOrder == 'year') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Year</strong></a>
</td> </td>
<td class="nobr"> <td class="nobr">
<a href="?order=votes&amp;sort=<?=(($CurrentOrder == 'votes') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Votes</strong></a> <a href="?order=votes&amp;sort=<?=(($CurrentOrder == 'votes') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Votes</strong></a>
@ -516,7 +516,7 @@
<a href="?order=created&amp;sort=<?=(($CurrentOrder == 'created') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Created</strong></a> <a href="?order=created&amp;sort=<?=(($CurrentOrder == 'created') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Created</strong></a>
</td> </td>
<td class="nobr"> <td class="nobr">
<a href="?order=lastvote&amp;sort=<?=(($CurrentOrder == 'lastvote') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Last Vote</strong></a> <a href="?order=lastvote&amp;sort=<?=(($CurrentOrder == 'lastvote') ? $NewSort : 'desc')?>&amp;<?=$CurrentURL ?>"><strong>Last vote</strong></a>
</td> </td>
</tr> </tr>
<? if($NumResults == 0) { ?> <? if($NumResults == 0) { ?>

View File

@ -536,7 +536,6 @@ h3{margin:10px 0}
font-weight: bold; font-weight: bold;
} }
tr.torrent .bookmark > a:before { content: ""; } tr.torrent .bookmark > a:before { content: ""; }
tr.torrent .bookmark > a:after { content: ""; } tr.torrent .bookmark > a:after { content: ""; }
@ -544,12 +543,6 @@ tr.torrent .bookmark > a:after { content:""; }
margin-left: 20px; margin-left: 20px;
} }
.linkbox .brackets:before { .linkbox .brackets:before, .linkbox .brackets:after {
content: "[ ";
color: #757575;
}
.linkbox .brackets:after {
content: " ]";
color: #757575; color: #757575;
} }

View File

@ -466,12 +466,6 @@ h3{margin:10px 0}
.cats_comedy{width:30px; height:30px; background:url(https://what.cd/static/styles/minimal/images/icons/comedy.png) top left no-repeat} .cats_comedy{width:30px; height:30px; background:url(https://what.cd/static/styles/minimal/images/icons/comedy.png) top left no-repeat}
.cats_comics{width:30px; height:30px; background:url(https://what.cd/static/styles/minimal/images/icons/comics.png) top left no-repeat} .cats_comics{width:30px; height:30px; background:url(https://what.cd/static/styles/minimal/images/icons/comics.png) top left no-repeat}
.linkbox .brackets:before { .linkbox .brackets:before, .linkbox .brackets:after {
content: "[ ";
color: #757575;
}
.linkbox .brackets:after {
content: " ]";
color: #757575; color: #757575;
} }

View File

@ -489,6 +489,8 @@ table tr td.edition_info {
position:absolute; position:absolute;
top:0; top:0;
left:734px; left:734px;
right:0;
width: 300px;
} }
#artist #content .linkbox:first-of-type a { #artist #content .linkbox:first-of-type a {
margin-right:5px; margin-right:5px;