Empty commit

This commit is contained in:
Git 2013-05-01 08:00:16 +00:00
parent b055e9c6f1
commit 1ad3d86466
75 changed files with 619 additions and 552 deletions

View File

@ -162,7 +162,6 @@ public static function proxy_url($Url) {
* @return string * @return string
*/ */
public static function process($Url, $Thumb = false) { public static function process($Url, $Thumb = false) {
global $LoggedUser;
if (empty($Url)) { if (empty($Url)) {
return ''; return '';
} }
@ -182,20 +181,11 @@ public static function process($Url, $Thumb = false) {
} }
} }
if (isset($LoggedUser['Permissions'])) {
/*
* We only want to apply the proxy and store the processed URL if the
* permissions were loaded before. This is necessary because self::process
* is used in Users::user_info which is called in script_start.php before
* the permissions are loaded, causing the own avatar to always load without
* proxy later on.
*/
if (check_perms('site_proxy_images')) { if (check_perms('site_proxy_images')) {
$ProcessedUrl = self::proxy_url($ProcessedUrl); $ProcessedUrl = self::proxy_url($ProcessedUrl);
} }
self::store($Url . ($Thumb ? '_thumb' : ''), $ProcessedUrl); self::store($Url . ($Thumb ? '_thumb' : ''), $ProcessedUrl);
}
return $ProcessedUrl; return $ProcessedUrl;
} }

View File

@ -209,7 +209,7 @@ private function build_options() {
foreach ($this->Options as $Option => $Value) { foreach ($this->Options as $Option => $Value) {
$Options[] = "$Option = $Value"; $Options[] = "$Option = $Value";
} }
return implode(", ", $Options); return implode(', ', $Options);
} }
/** /**
@ -221,7 +221,7 @@ private function build_query() {
} }
$this->QueryString = "SELECT $this->Select\nFROM $this->Indexes"; $this->QueryString = "SELECT $this->Select\nFROM $this->Indexes";
if (!empty($this->Expressions)) { if (!empty($this->Expressions)) {
$this->Filters['expr'] = "MATCH('".implode(" ", $this->Expressions)."')"; $this->Filters['expr'] = "MATCH('".implode(' ', $this->Expressions)."')";
} }
if (!empty($this->Filters)) { if (!empty($this->Filters)) {
$this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters); $this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters);

View File

@ -466,7 +466,8 @@ public static function update_hash($GroupID) {
*/ */
public static function regenerate_filelist($TorrentID) { public static function regenerate_filelist($TorrentID) {
global $DB, $Cache; global $DB, $Cache;
$DB->query("SELECT tg.ID, $DB->query("
SELECT tg.ID,
tf.File tf.File
FROM torrents_files AS tf FROM torrents_files AS tf
JOIN torrents AS t ON t.ID=tf.TorrentID JOIN torrents AS t ON t.ID=tf.TorrentID

View File

@ -103,8 +103,6 @@ public static function user_info($UserID) {
$Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000); $Cache->cache_value('user_info_'.$UserID, $UserInfo, 2592000);
} }
// Image proxy
$UserInfo['Avatar'] = ImageTools::process($UserInfo['Avatar']);
return $UserInfo; return $UserInfo;
} }
@ -542,6 +540,7 @@ public static function get_bookmarks ($UserID)
*/ */
public static function show_avatar($Avatar, $Username, $Setting, $Size=150, $ReturnHTML = True) { public static function show_avatar($Avatar, $Username, $Setting, $Size=150, $ReturnHTML = True) {
global $LoggedUser; global $LoggedUser;
$Avatar = ImageTools::process($Avatar);
// case 1 is avatars disabled // case 1 is avatars disabled
switch ($Setting) { switch ($Setting) {
case 0: case 0:

View File

@ -233,25 +233,25 @@
switch ($CurrentOrder) { switch ($CurrentOrder) {
case 'votes' : case 'votes' :
$OrderBy = "Votes"; $OrderBy = 'Votes';
break; break;
case 'bounty' : case 'bounty' :
$OrderBy = "Bounty"; $OrderBy = 'Bounty';
break; break;
case 'created' : case 'created' :
$OrderBy = "TimeAdded"; $OrderBy = 'TimeAdded';
break; break;
case 'lastvote' : case 'lastvote' :
$OrderBy = "LastVote"; $OrderBy = 'LastVote';
break; break;
case 'filled' : case 'filled' :
$OrderBy = "TimeFilled"; $OrderBy = 'TimeFilled';
break; break;
case 'year' : case 'year' :
$OrderBy = "Year"; $OrderBy = 'Year';
break; break;
default : default :
$OrderBy = "TimeAdded"; $OrderBy = 'TimeAdded';
break; break;
} }
//print($Way); print($OrderBy); die(); //print($Way); print($OrderBy); die();

View File

@ -5,7 +5,9 @@
// Number of users per page // Number of users per page
define('BOOKMARKS_PER_PAGE', '20'); define('BOOKMARKS_PER_PAGE', '20');
if (empty($_REQUEST['action'])) { $_REQUEST['action'] = 'view'; } if (empty($_REQUEST['action'])) {
$_REQUEST['action'] = 'view';
}
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'add': case 'add':
require(SERVER_ROOT.'/sections/bookmarks/add.php'); require(SERVER_ROOT.'/sections/bookmarks/add.php');
@ -31,7 +33,9 @@
break; break;
case 'edit': case 'edit':
if (empty($_REQUEST['type'])) { $_REQUEST['type'] = false; } if (empty($_REQUEST['type'])) {
$_REQUEST['type'] = false;
}
switch ($_REQUEST['type']) { switch ($_REQUEST['type']) {
case 'torrents': case 'torrents':
require(SERVER_ROOT.'/sections/bookmarks/edit_torrents.php'); require(SERVER_ROOT.'/sections/bookmarks/edit_torrents.php');
@ -42,7 +46,9 @@
case 'view': case 'view':
if (empty($_REQUEST['type'])) { $_REQUEST['type'] = 'torrents'; } if (empty($_REQUEST['type'])) {
$_REQUEST['type'] = 'torrents';
}
switch ($_REQUEST['type']) { switch ($_REQUEST['type']) {
case 'torrents': case 'torrents':
require(SERVER_ROOT.'/sections/bookmarks/torrents.php'); require(SERVER_ROOT.'/sections/bookmarks/torrents.php');

View File

@ -8,16 +8,18 @@
require(SERVER_ROOT.'/sections/comments/post.php'); // Post formatting function. require(SERVER_ROOT.'/sections/comments/post.php'); // Post formatting function.
$action = ''; $action = '';
if(!empty($_REQUEST['action'])) if (!empty($_REQUEST['action'])) {
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
}
/** /**
* Getting a userid if applicable * Getting a userid if applicable
*/ */
if (isset($_GET['id'])) { if (isset($_GET['id'])) {
$UserID = $_GET['id']; $UserID = $_GET['id'];
if(!is_number($UserID)) if (!is_number($UserID)) {
error(404); error(404);
}
$UserInfo = Users::user_info($UserID); $UserInfo = Users::user_info($UserID);

View File

@ -21,26 +21,22 @@ function comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorI
?> ?>
<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> <colgroup>
<? if (empty($UserInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<col class="col_avatar" /> <col class="col_avatar" />
<? } ?> <? } ?>
<col class="col_post_body" /> <col class="col_post_body" />
</colgroup> </colgroup>
<tr class="colhead_dark"> <tr class="colhead_dark">
<td colspan="<?=empty($UserInfo['DisableAvatars']) ? 2 : 1 ?>"> <td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
<span style="float: left;"><a href="<?=$permalink ?>">#<?=$PostID?></a> <span style="float: left;"><a href="<?=$permalink ?>">#<?=$PostID?></a>
<?=$postheader ?> <?=$postheader ?>
</span> </span>
</td> </td>
</tr> </tr>
<tr> <tr>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<td class="avatar" valign="top"> <td class="avatar" valign="top">
<? if ($UserInfo['Avatar']) { ?> <?=Users::show_avatar($UserInfo['Avatar'], $UserInfo['Username'], $HeavyInfo['DisableAvatars'])?>
<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>
<? } ?> <? } ?>
<td class="body" valign="top"> <td class="body" valign="top">

View File

@ -6,7 +6,7 @@
include(SERVER_ROOT.'/sections/donate/donate.php'); include(SERVER_ROOT.'/sections/donate/donate.php');
} else { } else {
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'ipn': // Paypal hits this page when a donation is received case 'ipn': // PayPal hits this page when a donation is received
include(SERVER_ROOT.'/sections/donate/ipn.php'); include(SERVER_ROOT.'/sections/donate/ipn.php');
break; break;

View File

@ -46,13 +46,13 @@
<? } ?> <? } ?>
<table class="forum_post box vertical_margin" style="text-align: left;"> <table class="forum_post box vertical_margin" style="text-align: left;">
<colgroup> <colgroup>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<col class="col_avatar" /> <col class="col_avatar" />
<? } ?> <? } ?>
<col class="col_post_body" /> <col class="col_post_body" />
</colgroup> </colgroup>
<tr class="colhead_dark"> <tr class="colhead_dark">
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1 ?>"> <td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
<span style="float: left;"><a href="#newthreadpreview">#XXXXXX</a> <span style="float: left;"><a href="#newthreadpreview">#XXXXXX</a>
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?></strong> by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?></strong>
Just now Just now
@ -65,13 +65,11 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<? if (Users::has_avatars_enabled()) { ?>
<td class="avatar" valign="top"> <td class="avatar" valign="top">
<? if (!empty($LoggedUser['Avatar'])) { ?> <?=Users::show_avatar($LoggedUser['Avatar'], $LoggedUser['Username'], $HeavyInfo['DisableAvatars'])?>
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
<? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
<? } ?>
</td> </td>
<? } ?>
<td class="body" valign="top"> <td class="body" valign="top">
<div id="contentpreview" style="text-align: left;"></div> <div id="contentpreview" style="text-align: left;"></div>
</td> </td>

View File

@ -72,7 +72,7 @@
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<table class="friends_table vertical_margin"> <table class="friends_table vertical_margin">
<tr class="colhead"> <tr class="colhead">
<td colspan="3"> <td colspan="<?=Users::has_avatars_enabled() ? 3 : 2?>">
<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)) { ?> <? if (check_paranoia('ratio', $Paranoia, $Class, $FriendID)) { ?>
&nbsp;Ratio: <strong><?=Format::get_ratio_html($Uploaded, $Downloaded)?></strong> &nbsp;Ratio: <strong><?=Format::get_ratio_html($Uploaded, $Downloaded)?></strong>
@ -90,20 +90,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="50px" valign="top"> <? if (Users::has_avatars_enabled()) { ?>
<? <td class="col_avatar avatar" valign="top">
if (empty($HeavyInfo['DisableAvatars'])) { <?=Users::show_avatar($Avatar, $Username, $HeavyInfo['DisableAvatars'])?>
if (!empty($Avatar)) { ?>
<img src="<?=ImageTools::process($Avatar)?>" alt="<?=$Username?>'s avatar" width="50px" />
<? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" />
<? }
} ?>
</td> </td>
<? }?>
<td valign="top"> <td valign="top">
<input type="hidden" name="friendid" value="<?=$FriendID?>" /> <input type="hidden" name="friendid" value="<?=$FriendID?>" />
<textarea name="comment" rows="4" cols="80"><?=$Comment?></textarea> <textarea name="comment" rows="4" cols="65"><?=$Comment?></textarea>
</td> </td>
<td class="left" valign="top"> <td class="left" valign="top">
<input type="submit" name="action" value="Update" /><br /> <input type="submit" name="action" value="Update" /><br />

View File

@ -1,9 +1,10 @@
<? <?
enforce_login(); enforce_login();
$StaffIDs = $Cache->get_value("staff_ids"); $StaffIDs = $Cache->get_value('staff_ids');
if (!is_array($StaffIDs)) { if (!is_array($StaffIDs)) {
$DB->query("SELECT m.ID, m.Username $DB->query("
SELECT m.ID, m.Username
FROM users_main AS m FROM users_main AS m
JOIN permissions AS p ON p.ID=m.PermissionID JOIN permissions AS p ON p.ID=m.PermissionID
WHERE p.DisplayStaff='1'"); WHERE p.DisplayStaff='1'");
@ -11,10 +12,12 @@
$StaffIDs[$StaffID] = $StaffName; $StaffIDs[$StaffID] = $StaffName;
} }
uasort($StaffIDs, 'strcasecmp'); uasort($StaffIDs, 'strcasecmp');
$Cache->cache_value("staff_ids", $StaffIDs); $Cache->cache_value('staff_ids', $StaffIDs);
} }
if(!isset($_REQUEST['action'])) { $_REQUEST['action'] = ''; } if (!isset($_REQUEST['action'])) {
$_REQUEST['action'] = '';
}
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'takecompose': case 'takecompose':
require('takecompose.php'); require('takecompose.php');

View File

@ -2,7 +2,9 @@
authorize(); authorize();
if(empty($_POST['toid'])) { error(404); } if (empty($_POST['toid'])) {
error(404);
}
if (!empty($LoggedUser['DisablePM']) && !isset($StaffIDs[$_POST['toid']])) { if (!empty($LoggedUser['DisablePM']) && !isset($StaffIDs[$_POST['toid']])) {
error(403); error(403);
@ -15,7 +17,7 @@
$ToID = explode(',', $_POST['toid']); $ToID = explode(',', $_POST['toid']);
foreach ($ToID as $TID) { foreach ($ToID as $TID) {
if (!is_number($TID)) { if (!is_number($TID)) {
$Err = "A recipient does not exist."; $Err = 'A recipient does not exist.';
} }
} }
$DB->query("SELECT UserID FROM pm_conversations_users WHERE UserID='$LoggedUser[ID]' AND ConvID='$ConvID'"); $DB->query("SELECT UserID FROM pm_conversations_users WHERE UserID='$LoggedUser[ID]' AND ConvID='$ConvID'");
@ -25,7 +27,7 @@
} else { } else {
$ConvID = ''; $ConvID = '';
if (!is_number($_POST['toid'])) { if (!is_number($_POST['toid'])) {
$Err = "This recipient does not exist."; $Err = 'This recipient does not exist.';
} else { } else {
$ToID = $_POST['toid']; $ToID = $_POST['toid'];
} }

View File

@ -1,7 +1,7 @@
<? <?
authorize(); authorize();
if(empty($_POST['id']) || !is_number($_POST['id']) || empty($_POST['type']) || ($_POST['type'] != "request_update" && empty($_POST['reason']))) { if (empty($_POST['id']) || !is_number($_POST['id']) || empty($_POST['type']) || ($_POST['type'] != 'request_update' && empty($_POST['reason']))) {
error(404); error(404);
} }

View File

@ -304,25 +304,25 @@
switch ($CurrentOrder) { switch ($CurrentOrder) {
case 'votes' : case 'votes' :
$OrderBy = "Votes"; $OrderBy = 'Votes';
break; break;
case 'bounty' : case 'bounty' :
$OrderBy = "Bounty"; $OrderBy = 'Bounty';
break; break;
case 'created' : case 'created' :
$OrderBy = "TimeAdded"; $OrderBy = 'TimeAdded';
break; break;
case 'lastvote' : case 'lastvote' :
$OrderBy = "LastVote"; $OrderBy = 'LastVote';
break; break;
case 'filled' : case 'filled' :
$OrderBy = "TimeFilled"; $OrderBy = 'TimeFilled';
break; break;
case 'year' : case 'year' :
$OrderBy = "Year"; $OrderBy = 'Year';
break; break;
default : default :
$OrderBy = "TimeAdded"; $OrderBy = 'TimeAdded';
break; break;
} }
//print($Way); print($OrderBy); die(); //print($Way); print($OrderBy); die();

View File

@ -1,8 +1,9 @@
<? <?
enforce_login(); enforce_login();
if(!isset($_REQUEST['action'])) if (!isset($_REQUEST['action'])) {
$_REQUEST['action'] = ''; $_REQUEST['action'] = '';
}
// Get user level // Get user level
$DB->query(" $DB->query("

View File

@ -1,5 +1,7 @@
<? <?
if(!check_perms('admin_login_watch')) { error(403); } if (!check_perms('admin_login_watch')) {
error(403);
}
if (isset($_POST['submit']) && isset($_POST['id']) && $_POST['submit'] == 'Unban' && is_number($_POST['id'])) { if (isset($_POST['submit']) && isset($_POST['id']) && $_POST['submit'] == 'Unban' && is_number($_POST['id'])) {
authorize(); authorize();
@ -8,7 +10,8 @@
View::show_header('Login Watch'); View::show_header('Login Watch');
$DB->query('SELECT $DB->query('
SELECT
l.ID, l.ID,
l.IP, l.IP,
l.UserID, l.UserID,
@ -31,7 +34,9 @@
<td>Bans</td> <td>Bans</td>
<td>Remaining</td> <td>Remaining</td>
<td>Submit</td> <td>Submit</td>
<? if(check_perms('admin_manage_ipbans')) { ?> <td>Submit</td><? } ?> <? if (check_perms('admin_manage_ipbans')) { ?>
<td>Submit</td>
<? } ?>
</tr> </tr>
<? <?
$Row = 'b'; $Row = 'b';

View File

@ -31,7 +31,8 @@
if ($Details == 'all' || $Details == 'ut') { if ($Details == 'all' || $Details == 'ut') {
if (!$TopUsedTags = $Cache->get_value('topusedtag_'.$Limit)) { if (!$TopUsedTags = $Cache->get_value('topusedtag_'.$Limit)) {
$DB->query("SELECT $DB->query("
SELECT
t.ID, t.ID,
t.Name, t.Name,
COUNT(tt.GroupID) AS Uses, COUNT(tt.GroupID) AS Uses,
@ -51,7 +52,8 @@
if ($Details == 'all' || $Details == 'ur') { if ($Details == 'all' || $Details == 'ur') {
if (!$TopRequestTags = $Cache->get_value('toprequesttag_'.$Limit)) { if (!$TopRequestTags = $Cache->get_value('toprequesttag_'.$Limit)) {
$DB->query("SELECT $DB->query("
SELECT
t.ID, t.ID,
t.Name, t.Name,
COUNT(r.RequestID) AS Uses, COUNT(r.RequestID) AS Uses,
@ -70,7 +72,8 @@
if ($Details == 'all' || $Details == 'v') { if ($Details == 'all' || $Details == 'v') {
if (!$TopVotedTags = $Cache->get_value('topvotedtag_'.$Limit)) { if (!$TopVotedTags = $Cache->get_value('topvotedtag_'.$Limit)) {
$DB->query("SELECT $DB->query("
SELECT
t.ID, t.ID,
t.Name, t.Name,
COUNT(tt.GroupID) AS Uses, COUNT(tt.GroupID) AS Uses,

View File

@ -28,7 +28,8 @@
$Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10; $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
$Limit = in_array($Limit, array(10,100,250)) ? $Limit : 10; $Limit = in_array($Limit, array(10,100,250)) ? $Limit : 10;
$BaseQuery = "SELECT $BaseQuery = "
SELECT
u.ID, u.ID,
ui.JoinDate, ui.JoinDate,
u.Uploaded, u.Uploaded,

View File

@ -33,7 +33,6 @@
} }
$DB->query("INSERT INTO torrents_tags $DB->query("INSERT INTO torrents_tags
(TagID, GroupID, PositiveVotes, UserID) VALUES (TagID, GroupID, PositiveVotes, UserID) VALUES
('$TagID', '$GroupID', '3', '$UserID') ('$TagID', '$GroupID', '3', '$UserID')

View File

@ -14,7 +14,9 @@
************************************************************************/ ************************************************************************/
$GroupID = $_GET['groupid']; $GroupID = $_GET['groupid'];
if(!is_number($GroupID) || !$GroupID) { error(0); } if (!is_number($GroupID) || !$GroupID) {
error(0);
}
// Get the artist name and the body of the last revision // Get the artist name and the body of the last revision
$DB->query("SELECT $DB->query("SELECT
@ -32,10 +34,14 @@
FROM torrents_group AS tg FROM torrents_group AS tg
LEFT JOIN wiki_torrents AS wt ON wt.RevisionID=tg.RevisionID LEFT JOIN wiki_torrents AS wt ON wt.RevisionID=tg.RevisionID
WHERE tg.ID='$GroupID'"); WHERE tg.ID='$GroupID'");
if($DB->record_count() == 0) { error(404); } if ($DB->record_count() == 0) {
error(404);
}
list($Name, $Image, $Body, $WikiImage, $WikiBody, $Year, $RecordLabel, $CatalogueNumber, $ReleaseType, $CategoryID, $VanityHouse) = $DB->next_record(); list($Name, $Image, $Body, $WikiImage, $WikiBody, $Year, $RecordLabel, $CatalogueNumber, $ReleaseType, $CategoryID, $VanityHouse) = $DB->next_record();
if(!$Body) { $Body = $WikiBody; $Image = $WikiImage; } if (!$Body) {
$Body = $WikiBody; $Image = $WikiImage;
}
View::show_header('Edit torrent group'); View::show_header('Edit torrent group');

View File

@ -5,7 +5,9 @@
* torrent. * torrent.
****************************************************************/ ****************************************************************/
if(!check_perms('torrents_edit')) { error(403); } if (!check_perms('torrents_edit')) {
error(403);
}
$OldGroupID = $_POST['oldgroupid']; $OldGroupID = $_POST['oldgroupid'];
$GroupID = $_POST['groupid']; $GroupID = $_POST['groupid'];

View File

@ -11,11 +11,10 @@
************************************************************************/ ************************************************************************/
$GroupID = $_GET['groupid']; $GroupID = $_GET['groupid'];
if(!is_number($GroupID) || !$GroupID) { error(0); } if (!is_number($GroupID) || !$GroupID) {
error(0);
}
include(SERVER_ROOT.'/classes/class_wiki.php'); // Wiki class include(SERVER_ROOT.'/classes/class_wiki.php'); // Wiki class
$Wiki = new WIKI('wiki_torrents', $GroupID, "/torrents.php?id=$GroupID"); $Wiki = new WIKI('wiki_torrents', $GroupID, "/torrents.php?id=$GroupID");
@ -24,7 +23,9 @@
$DB->query("SELECT Name FROM torrents_group WHERE ID='$GroupID'"); $DB->query("SELECT Name FROM torrents_group WHERE ID='$GroupID'");
list($Name) = $DB->next_record(); list($Name) = $DB->next_record();
if(!$Name) { error(404); } if (!$Name) {
error(404);
}
View::show_header("Revision history for $Name"); // Set title View::show_header("Revision history for $Name"); // Set title

View File

@ -35,10 +35,12 @@
$DB->query("DELETE FROM torrents_artists WHERE GroupID = '$GroupID' AND ArtistID = '$ArtistID' AND Importance = '$Importance'"); $DB->query("DELETE FROM torrents_artists WHERE GroupID = '$GroupID' AND ArtistID = '$ArtistID' AND Importance = '$Importance'");
$Cache->delete_value('artist_groups_'.$ArtistID); $Cache->delete_value('artist_groups_'.$ArtistID);
} }
$DB->query("SELECT ArtistID $DB->query("
SELECT ArtistID
FROM requests_artists FROM requests_artists
WHERE ArtistID IN (".$ArtistsString.") WHERE ArtistID IN (".$ArtistsString.")
UNION SELECT ArtistID UNION
SELECT ArtistID
FROM torrents_artists FROM torrents_artists
WHERE ArtistID IN (".$ArtistsString.")"); WHERE ArtistID IN (".$ArtistsString.")");
$Items = $DB->collect('ArtistID'); $Items = $DB->collect('ArtistID');

View File

@ -1,9 +1,12 @@
<? <?
if(!isset($_GET['id']) || !is_number($_GET['id']) || !isset($_GET['torrentid']) || !is_number($_GET['torrentid'])) { error(0); } if (!isset($_GET['id']) || !is_number($_GET['id']) || !isset($_GET['torrentid']) || !is_number($_GET['torrentid'])) {
error(0);
}
$GroupID = $_GET['id']; $GroupID = $_GET['id'];
$TorrentID = $_GET['torrentid']; $TorrentID = $_GET['torrentid'];
$DB->query("SELECT $DB->query("
SELECT
t.Media, t.Media,
t.Format, t.Format,
t.Encoding AS Bitrate, t.Encoding AS Bitrate,
@ -30,7 +33,9 @@
list($Properties) = $DB->to_array(false,MYSQLI_BOTH); list($Properties) = $DB->to_array(false,MYSQLI_BOTH);
if(!$Properties) { error(404); } if (!$Properties) {
error(404);
}
View::show_header('Edit torrent', 'upload'); View::show_header('Edit torrent', 'upload');

View File

@ -1,12 +1,18 @@
<? <?
if(!check_perms('torrents_edit')) { error(403); } if (!check_perms('torrents_edit')) {
error(403);
}
$GroupID = $_POST['groupid']; $GroupID = $_POST['groupid'];
$OldGroupID = $GroupID; $OldGroupID = $GroupID;
$NewGroupID = db_string($_POST['targetgroupid']); $NewGroupID = db_string($_POST['targetgroupid']);
if(!$GroupID || !is_number($GroupID)) { error(404); } if (!$GroupID || !is_number($GroupID)) {
if(!$NewGroupID || !is_number($NewGroupID)) { error(404); } error(404);
}
if (!$NewGroupID || !is_number($NewGroupID)) {
error(404);
}
if ($NewGroupID == $GroupID) { if ($NewGroupID == $GroupID) {
error('Old group ID is the same as new group ID!'); error('Old group ID is the same as new group ID!');
} }

View File

@ -1,5 +1,7 @@
<? <?
if(!isset($_GET['torrentid']) || !is_number($_GET['torrentid'])) { error(404); } if (!isset($_GET['torrentid']) || !is_number($_GET['torrentid'])) {
error(404);
}
$TorrentID = $_GET['torrentid']; $TorrentID = $_GET['torrentid'];
if (!empty($_GET['page']) && is_number($_GET['page'])) { if (!empty($_GET['page']) && is_number($_GET['page'])) {
@ -10,7 +12,8 @@
$Limit = 100; $Limit = 100;
} }
$Result = $DB->query("SELECT SQL_CALC_FOUND_ROWS $Result = $DB->query("
SELECT SQL_CALC_FOUND_ROWS
xu.uid, xu.uid,
t.Size, t.Size,
xu.active, xu.active,
@ -49,8 +52,8 @@
?> ?>
<tr> <tr>
<td><?=Users::format_username($PeerUserID, false, false, false)?></td> <td><?=Users::format_username($PeerUserID, false, false, false)?></td>
<td><?= ($Active) ? '<span style="color:green">Yes</span>' : '<span style="color:red">No</span>' ?></td> <td><?= ($Active) ? '<span style="color: green;">Yes</span>' : '<span style="color: red;">No</span>' ?></td>
<td><?= ($Connectable) ? '<span style="color:green">Yes</span>' : '<span style="color:red">No</span>' ?></td> <td><?= ($Connectable) ? '<span style="color: green;">Yes</span>' : '<span style="color: red;">No</span>' ?></td>
<td><?=Format::get_size($Uploaded) ?></td> <td><?=Format::get_size($Uploaded) ?></td>
<td><?=number_format(($Size - $Remaining) / $Size * 100, 2)?></td> <td><?=number_format(($Size - $Remaining) / $Size * 100, 2)?></td>
<td><?=display_str($UserAgent)?></td> <td><?=display_str($UserAgent)?></td>

View File

@ -5,13 +5,17 @@
$OldGroupID = $GroupID; $OldGroupID = $GroupID;
$NewName = $_POST['name']; $NewName = $_POST['name'];
if(!$GroupID || !is_number($GroupID)) { error(404); } if (!$GroupID || !is_number($GroupID)) {
error(404);
if(empty($NewName)) {
error("Albums can't have no name");
} }
if(!check_perms('torrents_edit')) { error(403); } if (empty($NewName)) {
error('Albums must have a name');
}
if (!check_perms('torrents_edit')) {
error(403);
}
$DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID); $DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID);
list($OldName) = $DB->next_record(MYSQLI_NUM, false); list($OldName) = $DB->next_record(MYSQLI_NUM, false);

View File

@ -1,5 +1,7 @@
<? <?
if(!isset($_GET['torrentid']) || !is_number($_GET['torrentid']) || !check_perms('site_view_torrent_snatchlist')) { error(404); } if (!isset($_GET['torrentid']) || !is_number($_GET['torrentid']) || !check_perms('site_view_torrent_snatchlist')) {
error(404);
}
$TorrentID = $_GET['torrentid']; $TorrentID = $_GET['torrentid'];
if (!empty($_GET['page']) && is_number($_GET['page'])) { if (!empty($_GET['page']) && is_number($_GET['page'])) {
@ -10,7 +12,8 @@
$Limit = 100; $Limit = 100;
} }
$Result = $DB->query("SELECT SQL_CALC_FOUND_ROWS $Result = $DB->query("
SELECT SQL_CALC_FOUND_ROWS
xs.uid, xs.uid,
xs.tstamp xs.tstamp
FROM xbt_snatched AS xs FROM xbt_snatched AS xs

View File

@ -2,7 +2,9 @@
authorize(); authorize();
$TorrentID = $_POST['torrentid']; $TorrentID = $_POST['torrentid'];
if(!$TorrentID || !is_number($TorrentID)) { error(404); } if (!$TorrentID || !is_number($TorrentID)) {
error(404);
}
$DB->query("SELECT $DB->query("SELECT
t.UserID, t.UserID,

View File

@ -11,7 +11,9 @@
} }
// End injection check // End injection check
if(!check_perms('site_edit_wiki')) { error(403); } if (!check_perms('site_edit_wiki')) {
error(403);
}
// Variables for database input // Variables for database input
$UserID = $LoggedUser['ID']; $UserID = $LoggedUser['ID'];
@ -25,7 +27,9 @@
if (!empty($_GET['action']) && $_GET['action'] == 'revert') { // if we're reverting to a previous revision if (!empty($_GET['action']) && $_GET['action'] == 'revert') { // if we're reverting to a previous revision
$RevisionID=$_GET['revisionid']; $RevisionID=$_GET['revisionid'];
if(!is_number($RevisionID)) { error(0); } if (!is_number($RevisionID)) {
error(0);
}
// to cite from merge: "Everything is legit, let's just confim they're not retarded" // to cite from merge: "Everything is legit, let's just confim they're not retarded"
if (empty($_GET['confirm'])) { if (empty($_GET['confirm'])) {
@ -90,7 +94,9 @@
else { // revert else { // revert
$DB->query("SELECT PageID,Body,Image FROM wiki_torrents WHERE RevisionID='$RevisionID'"); $DB->query("SELECT PageID,Body,Image FROM wiki_torrents WHERE RevisionID='$RevisionID'");
list($PossibleGroupID, $Body, $Image) = $DB->next_record(); list($PossibleGroupID, $Body, $Image) = $DB->next_record();
if($PossibleGroupID != $GroupID) { error(404); } if ($PossibleGroupID != $GroupID) {
error(404);
}
$DB->query("INSERT INTO wiki_torrents (PageID, Body, Image, UserID, Summary, Time) $DB->query("INSERT INTO wiki_torrents (PageID, Body, Image, UserID, Summary, Time)
SELECT '$GroupID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."' SELECT '$GroupID', Body, Image, '$UserID', 'Reverted to revision $RevisionID', '".sqltime()."'
@ -105,7 +111,7 @@
// Update torrents table (technically, we don't need the RevisionID column, but we can use it for a join which is nice and fast) // Update torrents table (technically, we don't need the RevisionID column, but we can use it for a join which is nice and fast)
$DB->query("UPDATE torrents_group SET $DB->query("UPDATE torrents_group SET
RevisionID='$RevisionID', RevisionID='$RevisionID',
".((isset($VanityHouse)) ? "VanityHouse='$VanityHouse'," : "")." ".((isset($VanityHouse)) ? "VanityHouse='$VanityHouse'," : '')."
WikiBody='$Body', WikiBody='$Body',
WikiImage='$Image' WikiImage='$Image'
WHERE ID='$GroupID'"); WHERE ID='$GroupID'");
@ -150,7 +156,7 @@
$DB->query("SELECT ID FROM torrents WHERE GroupID = ".$GroupID); $DB->query("SELECT ID FROM torrents WHERE GroupID = ".$GroupID);
if ($DB->record_count()) { if ($DB->record_count()) {
$TorrentIDs = implode(",", $DB->collect('ID')); $TorrentIDs = implode(',', $DB->collect('ID'));
$DB->query("SELECT DISTINCT uid FROM xbt_snatched WHERE fid IN (".$TorrentIDs.")"); $DB->query("SELECT DISTINCT uid FROM xbt_snatched WHERE fid IN (".$TorrentIDs.")");
$Snatchers = $DB->collect('uid'); $Snatchers = $DB->collect('uid');
foreach ($Snatchers as $UserID) { foreach ($Snatchers as $UserID) {

View File

@ -6,7 +6,9 @@
authorize(); authorize();
if(!check_perms('torrents_edit')) { error(403); } if (!check_perms('torrents_edit')) {
error(403);
}
$OldGroupID = $_POST['oldgroupid']; $OldGroupID = $_POST['oldgroupid'];
$TorrentID = $_POST['torrentid']; $TorrentID = $_POST['torrentid'];

View File

@ -1,5 +1,7 @@
<?php <?php
if (!check_perms('users_warn')) { error(404);} if (!check_perms('users_warn')) {
error(404);
}
Misc::assert_isset_request($_POST, array('groupid', 'postid', 'userid', 'key')); Misc::assert_isset_request($_POST, array('groupid', 'postid', 'userid', 'key'));
$GroupID = (int) $_POST['groupid']; $GroupID = (int) $_POST['groupid'];
@ -43,19 +45,19 @@
<option value="1">1 week</option> <option value="1">1 week</option>
<option value="2">2 weeks</option> <option value="2">2 weeks</option>
<option value="4">4 weeks</option> <option value="4">4 weeks</option>
<? if(check_perms("users_mod")) { ?> <? if (check_perms('users_mod')) { ?>
<option value="8">8 weeks</option> <option value="8">8 weeks</option>
<? } ?> <? } ?>
</select></td> </select></td>
</tr> </tr>
<tr> <tr>
<td class="label">Private Message:</td> <td class="label">Private message:</td>
<td> <td>
<textarea id="message" style="width: 95%;" tabindex="1" onkeyup="resize('message');" name="privatemessage" cols="90" rows="4"></textarea> <textarea id="message" style="width: 95%;" tabindex="1" onkeyup="resize('message');" name="privatemessage" cols="90" rows="4"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label">Edit Post:</td> <td class="label">Edit post:</td>
<td> <td>
<textarea id="body" style="width: 95%;" tabindex="1" onkeyup="resize('body');" name="body" cols="90" rows="8"><?=$PostBody?></textarea> <textarea id="body" style="width: 95%;" tabindex="1" onkeyup="resize('body');" name="body" cols="90" rows="8"><?=$PostBody?></textarea>
<br /> <br />

View File

@ -14,14 +14,26 @@
$Octets[2] > 255 || $Octets[2] > 255 ||
$Octets[3] < 0 || $Octets[3] < 0 ||
$Octets[3] > 255 || $Octets[3] > 255 ||
/*
* Per RFC 1918, the following CIDR blocks should never be found on the public Internet.
* 10.0.0.0/8
* 172.16.0.0/12
* 192.168.0.0/16
*
* Per RFC 3330, the block 127.0.0.0/8 should never appear on any network.
*
*/
$Octets[0] == 127 || $Octets[0] == 127 ||
$Octets[0] == 192 $Octets[0] == 10 ||
($Octets[0] == 172 && ((16 <= $Octets[1]) && ($Octets[1] <= 31))) ||
($Octets[0] == 192 && $Octets[1] == 168)
) { ) {
die('Invalid IP'); die('Invalid IPv4 address');
} }
// Valid port numbers are defined in RFC 1700
if (empty($_GET['port']) || !is_number($_GET['port']) || $_GET['port'] < 1 || $_GET['port'] > 65535) { if (empty($_GET['port']) || !is_number($_GET['port']) || $_GET['port'] < 1 || $_GET['port'] > 65535) {
die('Invalid Port'); die('Invalid port');
} }
// Error suppression, ugh. // Error suppression, ugh.

View File

@ -1,12 +1,12 @@
<?php <?php
ini_set('display_errors', '1');authorize(); ini_set('display_errors', '1');
authorize();
$UserID = db_string($_GET['userid']); $UserID = db_string($_GET['userid']);
if ($_GET['perform'] == 'add') { if ($_GET['perform'] == 'add') {
$DB->query("INSERT IGNORE INTO subscribed_users (UserID, SubscriberID) VALUES ('$UserID', '$LoggedUser[ID]')"); $DB->query("INSERT IGNORE INTO subscribed_users (UserID, SubscriberID) VALUES ('$UserID', '$LoggedUser[ID]')");
} } elseif ($_GET['perform'] == 'remove') {
elseif($_GET['perform'] == 'remove') {
$DB->query("DELETE FROM subscribed_users WHERE UserID = '$UserID' AND SubscriberID = '$LoggedUser[ID]'"); $DB->query("DELETE FROM subscribed_users WHERE UserID = '$UserID' AND SubscriberID = '$LoggedUser[ID]'");
} }
header('Location: user.php?id=' . $UserID); header('Location: user.php?id=' . $UserID);

View File

@ -94,7 +94,8 @@
$DB->query("SELECT $DB->query("
SELECT
m.Username, m.Username,
m.IP, m.IP,
m.Email, m.Email,
@ -157,7 +158,7 @@
// If we're deleting the user, we can ignore all the other crap // If we're deleting the user, we can ignore all the other crap
if ($_POST['UserStatus'] == "delete" && check_perms('users_delete_users')) { if ($_POST['UserStatus'] == 'delete' && check_perms('users_delete_users')) {
Misc::write_log("User account ".$UserID." (".$Cur['Username'].") was deleted by ".$LoggedUser['Username']); Misc::write_log("User account ".$UserID." (".$Cur['Username'].") was deleted by ".$LoggedUser['Username']);
$DB->query("DELETE FROM users_main WHERE id=".$UserID); $DB->query("DELETE FROM users_main WHERE id=".$UserID);
$DB->query("DELETE FROM users_info WHERE UserID=".$UserID); $DB->query("DELETE FROM users_info WHERE UserID=".$UserID);
@ -722,11 +723,11 @@
function translateUserStatus($status) { function translateUserStatus($status) {
switch ($status) { switch ($status) {
case 0: case 0:
return "Unconfirmed"; return 'Unconfirmed';
case 1: case 1:
return "Enabled"; return 'Enabled';
case 2: case 2:
return "Disabled"; return 'Disabled';
default: default:
return $status; return $status;
} }
@ -735,9 +736,9 @@ function translateUserStatus($status) {
function translateLeechStatus($status) { function translateLeechStatus($status) {
switch ($status) { switch ($status) {
case 0: case 0:
return "Disabled"; return 'Disabled';
case 1: case 1:
return "Enabled"; return 'Enabled';
default: default:
return $status; return $status;
} }

View File

@ -209,6 +209,7 @@ function check_paranoia_here($Setting) {
<div class="sidebar"> <div class="sidebar">
<? <?
if ($Avatar && Users::has_avatars_enabled()) { if ($Avatar && Users::has_avatars_enabled()) {
// TODO: use Users::show_avatar; why display_str in line 301??
if (check_perms('site_proxy_images') && !empty($Avatar)) { if (check_perms('site_proxy_images') && !empty($Avatar)) {
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;avatar='.$UserID.'&amp;i='.urlencode($Avatar); $Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;avatar='.$UserID.'&amp;i='.urlencode($Avatar);
} }

View File

@ -11,9 +11,18 @@
************************************************************************/ ************************************************************************/
$UserID = $_GET['userid']; $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"); $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(); list($Joined, $Class) = $DB->next_record();
if (!check_perms('users_view_email', $Class)) { if (!check_perms('users_view_email', $Class)) {

View File

@ -12,12 +12,21 @@
define('IPS_PER_PAGE', 25); define('IPS_PER_PAGE', 25);
if(!check_perms('users_mod')) { error(403); } if (!check_perms('users_mod')) {
error(403);
}
$UserID = $_GET['userid']; $UserID = $_GET['userid'];
if (!is_number($UserID)) { error(404); } if (!is_number($UserID)) {
error(404);
}
$DB->query("SELECT um.Username, p.Level AS Class FROM users_main AS um LEFT JOIN permissions AS p ON p.ID=um.PermissionID WHERE um.ID = ".$UserID); $DB->query("
SELECT um.Username,
p.Level AS Class
FROM users_main AS um
LEFT JOIN permissions AS p ON p.ID=um.PermissionID
WHERE um.ID = ".$UserID);
list($Username, $Class) = $DB->next_record(); list($Username, $Class) = $DB->next_record();
if (!check_perms('users_view_ips', $Class)) { if (!check_perms('users_view_ips', $Class)) {
@ -68,7 +77,7 @@ function ShowIPs(rowname) {
<a href="http://whatismyipaddress.com/ip/<?=display_str($IP)?>" class="brackets" title="Search WIMIA.com">WI</a> <a href="http://whatismyipaddress.com/ip/<?=display_str($IP)?>" class="brackets" title="Search WIMIA.com">WI</a>
</td> </td>
<td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td> <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td>
<td><?=date("Y-m-d g:i:s", $Time)?></td> <td><?=date('Y-m-d g:i:s', $Time)?></td>
</tr> </tr>
<? <?
} }

View File

@ -251,15 +251,15 @@
<? <?
while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) { while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) {
?> ?>
<table class="forum_post vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : '' ?>" id="post<?=$PostID ?>"> <table class="forum_post vertical_margin<?=!Users::has_avatars_enabled() ? ' noavatar' : '' ?>" id="post<?=$PostID ?>">
<colgroup> <colgroup>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<col class="col_avatar" /> <col class="col_avatar" />
<? } ?> <? } ?>
<col class="col_post_body" /> <col class="col_post_body" />
</colgroup> </colgroup>
<tr class="colhead_dark"> <tr class="colhead_dark">
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1 ?>"> <td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
<span style="float: left;"> <span style="float: left;">
<?=time_diff($AddedTime) ?> <?=time_diff($AddedTime) ?>
in <a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a> in <a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>&amp;postid=<?=$PostID?>#post<?=$PostID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a>
@ -294,21 +294,11 @@
if (!$ShowGrouped) { if (!$ShowGrouped) {
?> ?>
<tr> <tr>
<? <? if (Users::has_avatars_enabled()) { ?>
if (empty($HeavyInfo['DisableAvatars'])) {
?>
<td class="avatar" valign="top"> <td class="avatar" valign="top">
<? <?=Users::show_avatar($Avatar, $Username, $HeavyInfo['DisableAvatars'])?>
if ($Avatar) {
?>
<img src="<?=ImageTools::process($Avatar)?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
<?
}
?>
</td> </td>
<? <? } ?>
}
?>
<td class="body" valign="top"> <td class="body" valign="top">
<div id="content<?=$PostID?>"> <div id="content<?=$PostID?>">
<?=$Text->full_format($Body)?> <?=$Text->full_format($Body)?>

View File

@ -14,7 +14,9 @@
$ShowAll = !empty($_GET['showall']); $ShowAll = !empty($_GET['showall']);
if (!$ShowAll) { if (!$ShowAll) {
$sql = "SELECT c.ID, $sql = "
SELECT
c.ID,
c.Name, c.Name,
c.NumTorrents, c.NumTorrents,
s.LastVisit s.LastVisit
@ -25,7 +27,9 @@
AND ct.AddedOn>s.LastVisit AND ct.AddedOn>s.LastVisit
GROUP BY c.ID"; GROUP BY c.ID";
} else { } else {
$sql = "SELECT c.ID, $sql = "
SELECT
c.ID,
c.Name, c.Name,
c.NumTorrents, c.NumTorrents,
s.LastVisit s.LastVisit
@ -70,8 +74,8 @@
<? <?
} else { } else {
$HideGroup = ''; $HideGroup = '';
$ActionTitle="Hide"; $ActionTitle = 'Hide';
$ActionURL="hide"; $ActionURL = 'hide';
$ShowGroups = 0; $ShowGroups = 0;
foreach ($CollageSubs as $Collage) { foreach ($CollageSubs as $Collage) {
@ -239,8 +243,8 @@
$TorrentTable.=ob_get_clean(); $TorrentTable.=ob_get_clean();
} ?> } ?>
<!-- I hate that proton is making me do it like this --> <!-- I hate that proton is making me do it like this -->
<!--<div class="head colhead_dark" style="margin-top: 8px">--> <!--<div class="head colhead_dark" style="margin-top: 8px;">-->
<table style="margin-top: 8px" class="subscribed_collages_table"> <table style="margin-top: 8px;" class="subscribed_collages_table">
<tr class="colhead_dark"> <tr class="colhead_dark">
<td> <td>
<span style="float: left;"> <span style="float: left;">

View File

@ -139,15 +139,15 @@
<? <?
while (list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()) { while (list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()) {
?> ?>
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : '' ?>"> <table class="forum_post box vertical_margin<?=!Users::has_avatars_enabled() ? ' noavatar' : '' ?>">
<colgroup> <colgroup>
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<col class="col_avatar" /> <col class="col_avatar" />
<? } ?> <? } ?>
<col class="col_post_body" /> <col class="col_post_body" />
</colgroup> </colgroup>
<tr class="colhead_dark"> <tr class="colhead_dark">
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1 ?>"> <td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
<span style="float:left;"> <span style="float:left;">
<a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$ForumName?></a> &gt; <a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$ForumName?></a> &gt;
<a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a> <a href="forums.php?action=viewthread&amp;threadid=<?=$TopicID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a>
@ -166,13 +166,9 @@
</td> </td>
</tr> </tr>
<tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>"> <tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>">
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (Users::has_avatars_enabled()) { ?>
<td class="avatar" valign="top"> <td class="avatar" valign="top">
<? if ($AuthorAvatar) { ?> <?=Users::show_avatar($AuthorAvatar, $AuthorName, $HeavyInfo['DisableAvatars'])?>
<img src="<?=ImageTools::process($AuthorAvatar)?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
<? } else { ?>
<img src="<?=STATIC_SERVER.'common/avatars/default.png'?>" width="150" style="max-height: 400px;" alt="Default avatar" />
<? } ?>
</td> </td>
<? } ?> <? } ?>
<td class="body" valign="top"> <td class="body" valign="top">