Empty commit

This commit is contained in:
Git 2013-04-13 08:00:19 +00:00
parent 69c8524bff
commit e78e066207
40 changed files with 976 additions and 767 deletions

View File

@ -83,7 +83,7 @@ public static function all_bookmarks($Type, $UserID = false) {
$UserID = $LoggedUser['ID'];
}
$CacheKey = 'bookmarks_' . $Type . '_' . $UserID;
if (($Bookmarks = $Cache->get_value($CacheKey)) === FALSE) {
if (($Bookmarks = $Cache->get_value($CacheKey)) === false) {
list ($Table, $Col) = self::bookmark_schema($Type);
$DB->query("SELECT $Col FROM $Table WHERE UserID = '$UserID'");
$Bookmarks = $DB->collect($Col);

View File

@ -91,7 +91,7 @@ public function get_cpu_time() {
return false;
}
public function log_var($Var, $VarName = FALSE) {
public function log_var($Var, $VarName = false) {
$BackTrace = debug_backtrace();
$ID = uniqid();
if (!$VarName) {
@ -314,7 +314,7 @@ public function perf_table($Perf=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_perf').toggle();return false;">(View)</a> Performance stats:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_perf').toggle();return false;" class="brackets">View</a> Performance stats:</strong></td>
</tr>
</table>
<table id="debug_perf" class="debug_table hidden" width="100%">
@ -339,7 +339,7 @@ public function include_table($Includes=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_include').toggle();return false;">(View)</a> <?=number_format(count($Includes))?> Includes:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_include').toggle();return false;" class="brackets">View</a> <?=number_format(count($Includes))?> Includes:</strong></td>
</tr>
</table>
<table id="debug_include" class="debug_table hidden" width="100%">
@ -363,7 +363,7 @@ public function class_table($Classes=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_classes').toggle();return false;">(View)</a> Classes:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_classes').toggle();return false;" class="brackets">View</a> Classes:</strong></td>
</tr>
</table>
<table id="debug_classes" class="debug_table hidden" width="100%">
@ -380,7 +380,7 @@ public function extension_table() {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_extensions').toggle();return false;">(View)</a> Extensions:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_extensions').toggle();return false;" class="brackets">View</a> Extensions:</strong></td>
</tr>
</table>
<table id="debug_extensions" class="debug_table hidden" width="100%">
@ -403,7 +403,7 @@ public function flag_table($Flags=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_flags').toggle();return false;">(View)</a> Flags:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_flags').toggle();return false;" class="brackets">View</a> Flags:</strong></td>
</tr>
</table>
<table id="debug_flags" class="debug_table hidden" width="100%">
@ -441,7 +441,7 @@ public function constant_table($Constants=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_constants').toggle();return false;">(View)</a> Constants:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_constants').toggle();return false;" class="brackets">View</a> Constants:</strong></td>
</tr>
</table>
<table id="debug_constants" class="debug_table hidden" width="100%">
@ -469,7 +469,7 @@ public function cache_table($CacheKeys=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_cache').toggle();return false;">(View)</a><?=$Header?></strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_cache').toggle();return false;" class="brackets">View</a><?=$Header?></strong></td>
</tr>
</table>
<table id="debug_cache" class="debug_table hidden" width="100%">
@ -497,7 +497,7 @@ public function error_table($Errors=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_error').toggle();return false;">(View)</a> <?=number_format(count($Errors))?> Errors:</strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_error').toggle();return false;" class="brackets">View</a> <?=number_format(count($Errors))?> Errors:</strong></td>
</tr>
</table>
<table id="debug_error" class="debug_table hidden" width="100%">
@ -536,7 +536,7 @@ public function query_table($Queries=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_database').toggle();return false;">(View)</a><?=$Header?></strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_database').toggle();return false;" class="brackets">View</a><?=$Header?></strong></td>
</tr>
</table>
<table id="debug_database" class="debug_table hidden" width="100%">
@ -571,7 +571,7 @@ public function sphinx_table($Queries=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_sphinx').toggle();return false;">(View)</a><?=$Header?></strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_sphinx').toggle();return false;" class="brackets">View</a><?=$Header?></strong></td>
</tr>
</table>
<table id="debug_sphinx" class="debug_table hidden" width="100%">
@ -603,7 +603,7 @@ public function vars_table($Vars=false) {
?>
<table class="layout" width="100%">
<tr>
<td align="left"><strong><a href="#" onclick="$('#debug_loggedvars').toggle();return false;">(View)</a><?=$Header?></strong></td>
<td align="left"><strong><a href="#" onclick="$('#debug_loggedvars').toggle();return false;" class="brackets">View</a><?=$Header?></strong></td>
</tr>
</table>
<table id="debug_loggedvars" class="debug_table hidden" width="100%">

View File

@ -72,8 +72,7 @@ class MASS_USER_TORRENTS_TABLE_VIEW
* @param string $EditType
* @param string $Heading
*/
public function __construct (array &$TorrentList, array &$CollageDataList, $EditType, $Heading = null)
{
public function __construct (array &$TorrentList, array &$CollageDataList, $EditType, $Heading = null) {
global $UserID, $LoggedUser;
$this->set_heading($Heading);
@ -86,11 +85,12 @@ public function __construct (array &$TorrentList, array &$CollageDataList, $Edit
$this->CollageDataList = $CollageDataList;
$this->HasTorrents = !empty($TorrentList);
if(!$this->HasTorrents) $this->no_torrents();
if (!$this->HasTorrents) {
$this->no_torrents();
}
}
private function no_torrents ()
{
private function no_torrents () {
?>
<div class="thin">
<div class="header">
@ -106,8 +106,7 @@ private function no_torrents ()
/**
* Renders a complete page and table
*/
public function render_all ()
{
public function render_all () {
$this->header();
$this->body();
$this->footer();
@ -117,8 +116,7 @@ public function render_all ()
* Renders a comptele page/table header: div#thin, h2, scripts, notes,
* form, table, etc.
*/
public function header ()
{
public function header () {
if ($this->HasTorrents) :
?>
@ -166,8 +164,7 @@ public function header ()
/**
* Closes header code
*/
public function footer ()
{
public function footer () {
if ($this->HasTorrents) :
?>
@ -192,8 +189,7 @@ public function footer ()
* Formats data for use in row
*
*/
public function body ()
{
public function body () {
if ($this->HasTorrents)
foreach ($this->TorrentList as $GroupID => $Group) {
$Artists = array();
@ -221,8 +217,7 @@ public function body ()
* @param string $DisplayName
* @param string $TorrentLink
*/
public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink, $DateAdded)
{
public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink, $DateAdded) {
$CSS = $this->NumGroups % 2 === 0 ? 'rowa' : 'rowb';
?>
@ -248,8 +243,7 @@ public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink, $D
* @param string $VanityHouse
* @return string $DisplayName
*/
static public function display_name (array &$ExtendedArtists, array &$Artists, $VanityHouse)
{
static public function display_name (array &$ExtendedArtists, array &$Artists, $VanityHouse) {
$DisplayName = '';
if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4])
|| !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
@ -265,8 +259,7 @@ static public function display_name (array &$ExtendedArtists, array &$Artists, $
/**
* Renders buttons used at the top and bottom of the table
*/
public function buttons ()
{
public function buttons () {
?>
<div class="drag_drop_save">
<input type="submit" name="update" value="Update Ranking" title="Save your rank." class="save_sortable_collage" />
@ -279,8 +272,7 @@ public function buttons ()
/**
* @param string $EditType
*/
public function set_edit_type ($EditType)
{
public function set_edit_type ($EditType) {
$this->EditType = $EditType;
}
@ -288,8 +280,7 @@ public function set_edit_type ($EditType)
* Set's the current page's heading
* @param string $Heading
*/
public function set_heading ($Heading)
{
public function set_heading ($Heading) {
$this->Heading = $Heading;
}
}

View File

@ -253,8 +253,8 @@ function next_record($Type=MYSQLI_BOTH, $Escape = true) { // $Escape can be true
$this->Record = mysqli_fetch_array($this->QueryID,$Type);
$this->Row++;
if (!is_array($this->Record)) {
$this->QueryID = FALSE;
} elseif($Escape !== FALSE){
$this->QueryID = false;
} elseif ($Escape !== false) {
$this->Record = Misc::display_array($this->Record, $Escape);
}
return $this->Record;
@ -266,7 +266,7 @@ function close() {
if (!mysqli_close($this->LinkID)) {
$this->halt('Cannot close connection or connection did not open.');
}
$this->LinkID = FALSE;
$this->LinkID = false;
}
}
@ -302,7 +302,7 @@ function escape_str($Str) {
function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) {
$Return = array();
while ($Row = mysqli_fetch_array($this->QueryID,$Type)) {
if($Escape!==FALSE) {
if ($Escape !== false) {
$Row = Misc::display_array($Row, $Escape);
}
if ($Key !== false) {

View File

@ -476,10 +476,10 @@ public static function regenerate_filelist($TorrentID) {
list($GroupID, $Contents) = $DB->next_record(MYSQLI_NUM, false);
if (Misc::is_new_torrent($Contents)) {
$Tor = new BencodeTorrent($Contents);
$FilePath = isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : "";
$FilePath = isset($Tor->Dec['info']['files']) ? Format::make_utf8($Tor->get_name()) : '';
} else {
$Tor = new TORRENT(unserialize(base64_decode($Contents)), true);
$FilePath = isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : "";
$FilePath = isset($Tor->Val['info']->Val['files']) ? Format::make_utf8($Tor->get_name()) : '';
}
list($TotalSize, $FileList) = $Tor->file_list();
foreach($FileList as $File) {
@ -753,17 +753,32 @@ public static function has_snatched($TorrentID, $AllUsers = false) {
public static function edition_string(array $Torrent, array $Group) {
if ($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) {
$EditionName = $Torrent['RemasterYear'];
$AddExtra = " - ";
if ($Torrent['RemasterRecordLabel']) { $EditionName .= $AddExtra . display_str($Torrent['RemasterRecordLabel']); $AddExtra = ' / '; }
if ($Torrent['RemasterCatalogueNumber']) { $EditionName .= $AddExtra . display_str($Torrent['RemasterCatalogueNumber']); $AddExtra = ' / '; }
if ($Torrent['RemasterTitle']) { $EditionName .= $AddExtra . display_str($Torrent['RemasterTitle']); $AddExtra = ' / '; }
$AddExtra = ' - ';
if ($Torrent['RemasterRecordLabel']) {
$EditionName .= $AddExtra . display_str($Torrent['RemasterRecordLabel']);
$AddExtra = ' / ';
}
if ($Torrent['RemasterCatalogueNumber']) {
$EditionName .= $AddExtra . display_str($Torrent['RemasterCatalogueNumber']);
$AddExtra = ' / ';
}
if ($Torrent['RemasterTitle']) {
$EditionName .= $AddExtra . display_str($Torrent['RemasterTitle']);
$AddExtra = ' / ';
}
$EditionName .= $AddExtra . display_str($Torrent['Media']);
} else {
$AddExtra = " / ";
if (!$Torrent['Remastered']) {
$EditionName = "Original Release";
if ($Group['RecordLabel']) { $EditionName .= $AddExtra . $Group['RecordLabel']; $AddExtra = ' / '; }
if ($Group['CatalogueNumber']) { $EditionName .= $AddExtra . $Group['CatalogueNumber']; $AddExtra = ' / '; }
if ($Group['RecordLabel']) {
$EditionName .= $AddExtra . $Group['RecordLabel'];
$AddExtra = ' / ';
}
if ($Group['CatalogueNumber']) {
$EditionName .= $AddExtra . $Group['CatalogueNumber'];
$AddExtra = ' / ';
}
} else {
$EditionName = "Unknown Release(s)";
}

View File

@ -40,61 +40,132 @@ function ValidateForm($ValidateArray) {
foreach ($this->Fields as $FieldKey => $Field) {
$ValidateVar = $ValidateArray[$FieldKey];
if($ValidateVar!="" || !empty($Field['Required']) || $Field['Type']=="date") {
if($Field['Type']=="string") {
if(isset($Field['MaxLength'])) { $MaxLength=$Field['MaxLength']; } else { $MaxLength=255; }
if(isset($Field['MinLength'])) { $MinLength=$Field['MinLength']; } else { $MinLength=1; }
if ($ValidateVar != '' || !empty($Field['Required']) || $Field['Type'] == 'date') {
if ($Field['Type'] == 'string') {
if (isset($Field['MaxLength'])) {
$MaxLength = $Field['MaxLength'];
} else {
$MaxLength = 255;
}
if (isset($Field['MinLength'])) {
$MinLength = $Field['MinLength'];
} else {
$MinLength = 1;
}
if(strlen($ValidateVar)>$MaxLength) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)<$MinLength) { return $Field['ErrorMessage']; }
if (strlen($ValidateVar) > $MaxLength) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) < $MinLength) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="number") {
if(isset($Field['MaxLength'])) { $MaxLength=$Field['MaxLength']; } else { $MaxLength=''; }
if(isset($Field['MinLength'])) { $MinLength=$Field['MinLength']; } else { $MinLength=0; }
} elseif ($Field['Type'] == 'number') {
if (isset($Field['MaxLength'])) {
$MaxLength = $Field['MaxLength'];
} else {
$MaxLength = '';
}
if (isset($Field['MinLength'])) {
$MinLength = $Field['MinLength'];
} else {
$MinLength = 0;
}
$Match = '0-9';
if(isset($Field['AllowPeriod'])) { $Match.='.'; }
if(isset($Field['AllowComma'])) { $Match.=','; }
if (isset($Field['AllowPeriod'])) {
$Match.='.';
}
if (isset($Field['AllowComma'])) {
$Match.=',';
}
if(preg_match('/[^'.$Match.']/', $ValidateVar) || strlen($ValidateVar)<1) { return $Field['ErrorMessage']; }
elseif($MaxLength!="" && $ValidateVar>$MaxLength) { return $Field['ErrorMessage']."!!"; }
elseif($ValidateVar<$MinLength) { return $Field['ErrorMessage']."$MinLength"; }
if (preg_match('/[^'.$Match.']/', $ValidateVar) || strlen($ValidateVar) < 1) {
return $Field['ErrorMessage'];
} elseif ($MaxLength != '' && $ValidateVar > $MaxLength) {
return $Field['ErrorMessage'].'!!';
} elseif ($ValidateVar < $MinLength) {
return $Field['ErrorMessage']."$MinLength";
}
} elseif($Field['Type']=="email") {
if(isset($Field['MaxLength'])) { $MaxLength=$Field['MaxLength']; } else { $MaxLength=255; }
if(isset($Field['MinLength'])) { $MinLength=$Field['MinLength']; } else { $MinLength=6; }
} elseif ($Field['Type'] == 'email') {
if (isset($Field['MaxLength'])) {
$MaxLength = $Field['MaxLength'];
} else {
$MaxLength = 255;
}
if (isset($Field['MinLength'])) {
$MinLength = $Field['MinLength'];
} else {
$MinLength = 6;
}
if(!preg_match("/^".EMAIL_REGEX."$/i", $ValidateVar)) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)>$MaxLength) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)<$MinLength) { return $Field['ErrorMessage']; }
if (!preg_match("/^".EMAIL_REGEX."$/i", $ValidateVar)) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) > $MaxLength) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) < $MinLength) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="link") {
if(isset($Field['MaxLength'])) { $MaxLength=$Field['MaxLength']; } else { $MaxLength=255; }
if(isset($Field['MinLength'])) { $MinLength=$Field['MinLength']; } else { $MinLength=10; }
} elseif ($Field['Type'] == 'link') {
if (isset($Field['MaxLength'])) {
$MaxLength = $Field['MaxLength'];
} else {
$MaxLength = 255;
}
if (isset($Field['MinLength'])) {
$MinLength = $Field['MinLength'];
} else {
$MinLength = 10;
}
if(!preg_match('/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i', $ValidateVar)) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)>$MaxLength) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)<$MinLength) { return $Field['ErrorMessage']; }
if (!preg_match('/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i', $ValidateVar)) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) > $MaxLength) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) < $MinLength) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="username") {
if(isset($Field['MaxLength'])) { $MaxLength=$Field['MaxLength']; } else { $MaxLength=20; }
if(isset($Field['MinLength'])) { $MinLength=$Field['MinLength']; } else { $MinLength=1; }
} elseif ($Field['Type'] == 'username') {
if (isset($Field['MaxLength'])) {
$MaxLength = $Field['MaxLength'];
} else {
$MaxLength = 20;
}
if (isset($Field['MinLength'])) {
$MinLength = $Field['MinLength'];
} else {
$MinLength = 1;
}
if(preg_match('/[^a-z0-9_\-?]/i', $ValidateVar)) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)>$MaxLength) { return $Field['ErrorMessage']; }
elseif(strlen($ValidateVar)<$MinLength) { return $Field['ErrorMessage']; }
if (preg_match('/[^a-z0-9_\-?]/i', $ValidateVar)) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) > $MaxLength) {
return $Field['ErrorMessage'];
} elseif (strlen($ValidateVar) < $MinLength) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="checkbox") {
if(!isset($ValidateArray[$FieldKey])) { return $Field['ErrorMessage']; }
} elseif ($Field['Type'] == 'checkbox') {
if (!isset($ValidateArray[$FieldKey])) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="compare") {
if($ValidateArray[$Field['CompareField']]!=$ValidateVar) { return $Field['ErrorMessage']; }
} elseif ($Field['Type'] == 'compare') {
if ($ValidateArray[$Field['CompareField']]!=$ValidateVar) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="inarray") {
if(array_search($ValidateVar, $Field['InArray'])===false) { return $Field['ErrorMessage']; }
} elseif ($Field['Type'] == 'inarray') {
if (array_search($ValidateVar, $Field['InArray']) === false) {
return $Field['ErrorMessage'];
}
} elseif($Field['Type']=="regex") {
if(!preg_match($Field['Regex'], $ValidateVar)) { return $Field['ErrorMessage']; }
} elseif ($Field['Type'] == 'regex') {
if (!preg_match($Field['Regex'], $ValidateVar)) {
return $Field['ErrorMessage'];
}
}
}
} // while
@ -108,46 +179,84 @@ function GenerateJS($FormID) {
reset($this->Fields);
foreach ($this->Fields as $FieldKey => $Field) {
if($Field['Type']=="string") {
if ($Field['Type'] == 'string') {
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value==""';
if(!empty($Field['MaxLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength']; } else { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255'; }
if(!empty($Field['MinLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength']; }
if (!empty($Field['MaxLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
} else {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
}
if (!empty($Field['MinLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
}
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="number") {
} elseif ($Field['Type'] == 'number') {
$Match='0-9';
if(!empty($Field['AllowPeriod'])) { $Match.='.'; }
if(!empty($Field['AllowComma'])) { $Match.=','; }
if (!empty($Field['AllowPeriod'])) {
$Match.='.';
}
if (!empty($Field['AllowComma'])) {
$Match.=',';
}
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^'.$Match.']/) || $(\'#'.$FieldKey.'\').raw().value.length<1';
if(!empty($Field['MaxLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1>'.$Field['MaxLength']; }
if(!empty($Field['MinLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1<'.$Field['MinLength']; }
if (!empty($Field['MaxLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1>'.$Field['MaxLength'];
}
if (!empty($Field['MinLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value/1<'.$Field['MinLength'];
}
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="email") {
} elseif ($Field['Type'] == 'email') {
$ValItem=' if (!validEmail($(\'#'.$FieldKey.'\').raw().value)';
if(!empty($Field['MaxLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength']; } else { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255'; }
if(!empty($Field['MinLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength']; } else { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<6'; }
if (!empty($Field['MaxLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
} else {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
}
if (!empty($Field['MinLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
} else {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<6';
}
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="link") {
} elseif ($Field['Type'] == 'link') {
$ValItem=' if (!validLink($(\'#'.$FieldKey.'\').raw().value)';
if(!empty($Field['MaxLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength']; } else { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255'; }
if(!empty($Field['MinLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength']; } else { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<10'; }
if (!empty($Field['MaxLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
} else {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>255';
}
if (!empty($Field['MinLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
} else {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<10';
}
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="username") {
} elseif ($Field['Type'] == 'username') {
$ValItem = ' if ($(\'#'.$FieldKey.'\').raw().value.match(/[^a-zA-Z0-9_\-]/)';
if(!empty($Field['MaxLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength']; }
if(!empty($Field['MinLength'])) { $ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength']; }
if (!empty($Field['MaxLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length>'.$Field['MaxLength'];
}
if (!empty($Field['MinLength'])) {
$ValItem.=' || $(\'#'.$FieldKey.'\').raw().value.length<'.$Field['MinLength'];
}
$ValItem.=') { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="regex") {
} elseif ($Field['Type'] == 'regex') {
$ValItem=' if (!$(\'#'.$FieldKey.'\').raw().value.match('.$Field['Regex'].')) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="date") {
$DisplayError=$FieldKey."month";
if(isset($Field['MinLength']) && $Field['MinLength']==3) { $Day='$(\'#'.$FieldKey.'day\').raw().value'; $DisplayError.=",".$FieldKey."day"; } else { $Day="1"; }
} elseif ($Field['Type'] == 'date') {
$DisplayError = $FieldKey.'month';
if (isset($Field['MinLength']) && $Field['MinLength'] == 3) {
$Day = '$(\'#'.$FieldKey.'day\').raw().value'; $DisplayError.=",".$FieldKey."day";
} else {
$Day = '1';
}
$DisplayError.=",".$FieldKey."year";
$ValItemHold=' if (!validDate($(\'#'.$FieldKey.'month\').raw().value+\'/\'+'.$Day.'+\'/\'+$(\'#'.$FieldKey.'year\').raw().value)) { return showError(\''.$DisplayError.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
@ -161,14 +270,14 @@ function GenerateJS($FormID) {
$ValItem.=$ValItemHold;
}
} elseif($Field['Type']=="checkbox") {
} elseif ($Field['Type'] == 'checkbox') {
$ValItem=' if (!$(\'#'.$FieldKey.'\').checked) { return showError(\''.$FieldKey.'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
} elseif($Field['Type']=="compare") {
} elseif ($Field['Type'] == 'compare') {
$ValItem=' if ($(\'#'.$FieldKey.'\').raw().value!=$(\'#'.$Field['CompareField'].'\').raw().value) { return showError(\''.$FieldKey.','.$Field['CompareField'].'\',\''.$Field['ErrorMessage'].'\'); }'."\r\n";
}
if(empty($Field['Required']) && $Field['Type']!="date") {
if (empty($Field['Required']) && $Field['Type'] != 'date') {
$ReturnJS.=' if ($(\'#'.$FieldKey.'\').raw().value!="") {'."\r\n ";
$ReturnJS.=$ValItem;
$ReturnJS.=" }\r\n";

View File

@ -35,7 +35,7 @@ public static function get_user_votes($UserID) {
}
$UserVotes = $Cache->get_value('voted_albums_'.$UserID);
if ($UserVotes === FALSE) {
if ($UserVotes === false) {
$DB->query('SELECT GroupID, Type FROM users_votes WHERE UserID='.$UserID);
$UserVotes = $DB->to_array('GroupID', MYSQL_ASSOC, false);
$Cache->cache_value('voted_albums_'.$UserID, $UserVotes);
@ -54,7 +54,7 @@ public static function get_group_votes($GroupID) {
global $DB, $Cache;
$GroupVotes = $Cache->get_value('votes_'.$GroupID);
if ($GroupVotes === FALSE) {
if ($GroupVotes === false) {
$DB->query("SELECT Ups AS Ups, Total AS Total FROM torrents_votes WHERE GroupID=$GroupID");
if ($DB->record_count() == 0) {
$GroupVotes = array('Ups'=>0, 'Total'=>0);
@ -204,7 +204,7 @@ public static function get_rank_all($GroupID) {
}
$Rankings = $Cache->get_value('voting_ranks_overall');
if ($Rankings === FALSE) {
if ($Rankings === false) {
$Rankings = array();
$i = 0;
$DB->query("SELECT GroupID FROM torrents_votes ORDER BY Score DESC LIMIT 100");
@ -235,7 +235,7 @@ public static function get_rank_year($GroupID, $Year) {
}
$Rankings = $Cache->get_value('voting_ranks_year_'.$Year);
if ($Rankings === FALSE) {
if ($Rankings === false) {
$Rankings = array();
$i = 0;
$DB->query("SELECT GroupID
@ -274,7 +274,7 @@ public static function get_rank_decade($GroupID, $Year) {
$Year = $Year - ($Year % 10);
$Rankings = $Cache->get_value('voting_ranks_decade_'.$Year);
if ($Rankings === FALSE) {
if ($Rankings === false) {
$Rankings = array();
$i = 0;
$DB->query("SELECT GroupID

View File

@ -80,7 +80,9 @@
//Handles timestamps
function dostime($TimeStamp = 0) {
if (!is_number($TimeStamp)) { // Assume that $TimeStamp is SQL timestamp
if($TimeStamp == '0000-00-00 00:00:00') { return 'Never'; }
if ($TimeStamp == '0000-00-00 00:00:00') {
return 'Never';
}
$TimeStamp = strtotime($TimeStamp);
}
$Date = ($TimeStamp == 0) ? getdate() : getdate($TimeStamp);

View File

@ -30,7 +30,7 @@ function is_number($Str) {
* @return string escaped string.
*/
function display_str($Str) {
if ($Str === NULL || $Str === FALSE || is_array($Str)) {
if ($Str === NULL || $Str === false || is_array($Str)) {
return '';
}
if ($Str != '' && !is_number($Str)) {

View File

@ -26,11 +26,21 @@
global $LoggedUser, $HeavyInfo, $UserSubscriptions, $ThreadInfo,
$ForumsDoublePost;
if ($LoggedUser['DisablePosting']) return;
if (!isset($TextareaCols)) $TextareaCols = 70;
if (!isset($TextareaRows)) $TextareaRows = 8;
if (!isset($InputAction)) $InputAction = 'reply';
if (!isset($InputTitle)) $InputTitle = 'Post comment';
if ($LoggedUser['DisablePosting']) {
return;
}
if (!isset($TextareaCols)) {
$TextareaCols = 70;
}
if (!isset($TextareaRows)) {
$TextareaRows = 8;
}
if (!isset($InputAction)) {
$InputAction = 'reply';
}
if (!isset($InputTitle)) {
$InputTitle = 'Post comment';
}
// TODO: Remove inline styles
@ -63,7 +73,7 @@
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
</div>
<div style="float: right;">
[<a href="#quickreplypreview">Report</a>]
<a href="#quickreplypreview" class="brackets">Report</a>
&nbsp;
<a href="#">&uarr;</a>
</div>
@ -109,11 +119,12 @@
?>
<input id="mergebox" type="checkbox" name="merge" tabindex="2" />
<label for="mergebox">Merge</label>
<? } ?>
<? if (!$LoggedUser['DisableAutoSave']) { ?>
<? }
if (!$LoggedUser['DisableAutoSave']) { ?>
<script type="application/javascript">var storedTempTextarea = new StoreText('quickpost', 'quickpostform', <?=$InputID?>);</script>
<? } ?>
<? } ?>
<? }
}
?>
<input type="button" value="Preview" class="hidden button_preview_<?=$ReplyText->getID()?>" title="Preview text" tabindex="1" />
<input type="submit" value="Post reply" id="submit_button" tabindex="1" />
</div>

View File

@ -17,7 +17,9 @@
require('classes/config.php'); //The config contains all site wide configuration information as well as memcached rules
if (!extension_loaded('gd')) { error('nogd'); }
if (!extension_loaded('gd')) {
error('nogd');
}
require(SERVER_ROOT.'/classes/class_cache.php'); //Require the caching class
require(SERVER_ROOT.'/classes/class_encrypt.php'); //Require the encryption class
@ -26,7 +28,9 @@
$Cache = NEW CACHE($MemcachedServers); //Load the caching class
$Enc = NEW CRYPT; //Load the encryption class
if (isset($_COOKIE['session'])) { $LoginCookie=$Enc->decrypt($_COOKIE['session']); }
if (isset($_COOKIE['session'])) {
$LoginCookie=$Enc->decrypt($_COOKIE['session']);
}
if (isset($LoginCookie)) {
list($SessionID, $UserID) = explode("|~|",$Enc->decrypt($LoginCookie));
$UserID = (int)$UserID;
@ -46,7 +50,9 @@ function error($Type) {
function invisible($Image) {
$Count = imagecolorstotal($Image);
if ($Count == 0) { return false; }
if ($Count == 0) {
return false;
}
$TotalAlpha = 0;
for ($i = 0; $i < $Count; ++$i) {
$Color = imagecolorsforindex($Image,$i);
@ -58,7 +64,9 @@ function invisible($Image) {
function is_number($Str) {
$Return = true;
if ($Str < 0) { $Return = false; }
if ($Str < 0) {
$Return = false;
}
// We're converting input to a int, then string and comparing to original
$Return = ($Str == strval(intval($Str)) ? true : false);
return $Return;
@ -134,7 +142,7 @@ function send_pm($ToID,$FromID,$Subject,$Body,$ConvID='') {
return;
}
if ($ConvID == '') {
$DB->query("INSERT INTO pm_conversations(Subject) VALUES ('".$Subject."')");
$DB->query("INSERT INTO pm_conversations(Subject) VALUES ('$Subject')");
$ConvID = $DB->inserted_id();
$DB->query("INSERT INTO pm_conversations_users
(UserID, ConvID, InInbox, InSentbox, SentDate, ReceivedDate, UnRead) VALUES
@ -181,7 +189,7 @@ function send_irc($Raw) {
}
function display_str($Str) {
if ($Str === NULL || $Str === FALSE || is_array($Str)) {
if ($Str === NULL || $Str === false || is_array($Str)) {
return '';
}
if ($Str != '' && !is_number($Str)) {
@ -205,12 +213,21 @@ function display_str($Str) {
}
function make_utf8($Str) {
if ($Str!="") {
if (is_utf8($Str)) { $Encoding="UTF-8"; }
if (empty($Encoding)) { $Encoding=mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); }
if (empty($Encoding)) { $Encoding="ISO-8859-1"; }
if ($Encoding=="UTF-8") { return $Str; }
else { return @mb_convert_encoding($Str,"UTF-8",$Encoding); }
if ($Str != '') {
if (is_utf8($Str)) {
$Encoding = 'UTF-8';
}
if (empty($Encoding)) {
$Encoding = mb_detect_encoding($Str,'UTF-8, ISO-8859-1');
}
if (empty($Encoding)) {
$Encoding = 'ISO-8859-1';
}
if ($Encoding == 'UTF-8') {
return $Str;
} else {
return @mb_convert_encoding($Str,'UTF-8',$Encoding);
}
}
}

View File

@ -39,7 +39,7 @@
$JsonForums = array();
foreach ($Forums as $Forum) {
list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead>$LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== FALSE)) {
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead>$LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== false)) {
continue;
}
$ForumDescription = display_str($ForumDescription);

View File

@ -20,8 +20,7 @@
if (!isset($_GET['threadid']) || !is_number($_GET['threadid'])) {
if (isset($_GET['topicid']) && is_number($_GET['topicid'])) {
$ThreadID = $_GET['topicid'];
}
elseif(isset($_GET['postid']) && is_number($_GET['postid'])) {
} elseif (isset($_GET['postid']) && is_number($_GET['postid'])) {
$DB->query("SELECT TopicID FROM forums_posts WHERE ID = $_GET[postid]");
list($ThreadID) = $DB->next_record();
if ($ThreadID) {
@ -41,8 +40,7 @@
if (isset($_GET['pp'])) {
$PerPage = $_GET['pp'];
}
else if (isset($LoggedUser['PostsPerPage'])) {
} elseif (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage'];
} else {
$PerPage = POSTS_PER_PAGE;
@ -119,7 +117,7 @@
}
//Handle subscriptions
if(($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === FALSE) {
if (($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT TopicID FROM users_subscriptions WHERE UserID = '$LoggedUser[ID]'");
$UserSubscriptions = $DB->collect(0);
$Cache->cache_value('subscriptions_user_'.$LoggedUser['ID'],$UserSubscriptions,0);

View File

@ -72,7 +72,7 @@
// Subscriptions
$NewSubscriptions = $Cache->get_value('subscriptions_user_new_' . $LoggedUser['ID']);
if ($NewSubscriptions === FALSE) {
if ($NewSubscriptions === false) {
if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));

View File

@ -58,7 +58,7 @@
// our life just got a bit easier. We're only tracking paired votes on upvotes.
if ($Type == 'Up') {
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
if ($VotePairs !== FALSE) {
if ($VotePairs !== false) {
foreach ($UserVotes as $Vote) {
if ($Vote['GroupID'] == $GroupID) {
continue;
@ -91,7 +91,7 @@
}
// Again, if the cache key is not set, move along
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID, true);
if ($VotePairs !== FALSE) {
if ($VotePairs !== false) {
// Go through all of the other albums paired to this one, and update
// this group's entry in their vote_pairs keys
if (isset($VotePairs[$GroupID])) {
@ -139,7 +139,7 @@
// our life just got a bit easier. We're only tracking paired votes on upvotes.
if ($Type == 'Up') {
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
if ($VotePairs !== FALSE) {
if ($VotePairs !== false) {
foreach ($UserVotes as $Vote) {
if (isset($VotePairs[$Vote['GroupID']])) {
if ($VotePairs[$Vote['GroupID']]['Total'] == 0) {
@ -172,7 +172,7 @@
}
// Again, if the cache key is not set, move along
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID, true);
if ($VotePairs !== FALSE) {
if ($VotePairs !== false) {
if (isset($VotePairs[$GroupID])) {
if ($VotePairs[$GroupID]['Total'] == 0) {
// Something is screwy

View File

@ -4,9 +4,9 @@
User post history page
*/
function error_out($reason = "") {
function error_out($reason = '') {
$error = array('status' => 'failure');
if ($reason != "")
if ($reason != '')
$error['reason'] = $reason;
print $error;
die();
@ -34,7 +34,7 @@ function error_out($reason = "") {
list($Page,$Limit) = Format::page_limit($PerPage);
if(($UserInfo = $Cache->get_value('user_info_'.$UserID)) === FALSE) {
if (($UserInfo = $Cache->get_value('user_info_'.$UserID)) === false) {
$DB->query("SELECT
m.Username,
m.Enabled,

View File

@ -1,8 +1,12 @@
<?
authorize();
if(!check_perms('site_torrents_notify')) { error(403); }
if (!check_perms('site_torrents_notify')) {
error(403);
}
$ArtistID = $_GET['artistid'];
if(!is_number($ArtistID)) { error(0); }
if (!is_number($ArtistID)) {
error(0);
}
$DB->query("SELECT GROUP_CONCAT(Name SEPARATOR '|') FROM artists_alias WHERE ArtistID = '$ArtistID' AND Redirect = 0 GROUP BY ArtistID");
list($ArtistAliases) = $DB->next_record(MYSQLI_NUM, FALSE);
@ -20,7 +24,7 @@
$Cache->delete_value('notify_artists_'.$LoggedUser['ID']);
} else {
list($ID, $ArtistNames) = $DB->next_record(MYSQLI_NUM, FALSE);
if(stripos($ArtistNames,$ArtistAliases) === FALSE) {
if (stripos($ArtistNames,$ArtistAliases) === false) {
$ArtistNames.=$ArtistAliases.'|';
$DB->query("UPDATE users_notify_filters SET Artists='".db_string($ArtistNames)."' WHERE ID='$ID'");
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);

View File

@ -1,10 +1,14 @@
<?
authorize();
if(!check_perms('site_torrents_notify')) { error(403); }
if (!check_perms('site_torrents_notify')) {
error(403);
}
$ArtistID = $_GET['artistid'];
if(!is_number($ArtistID)) { error(0); }
if (!is_number($ArtistID)) {
error(0);
}
if(($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === FALSE) {
if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT ID, Artists FROM users_notify_filters WHERE Label='Artist notifications' AND UserID='$LoggedUser[ID]' ORDER BY ID LIMIT 1");
} else {
$DB->query("SELECT ID, Artists FROM users_notify_filters WHERE ID='$Notify[ID]'");
@ -12,7 +16,7 @@
list($ID,$Artists) = $DB->next_record(MYSQLI_NUM, FALSE);
$DB->query("SELECT Name FROM artists_alias WHERE ArtistID = '$ArtistID' AND Redirect=0");
while (list($Alias) = $DB->next_record(MYSQLI_NUM, FALSE)) {
while(stripos($Artists, '|'.$Alias.'|') !== FALSE) {
while (stripos($Artists, '|'.$Alias.'|') !== false) {
$Artists = str_ireplace('|'.$Alias.'|', '|', $Artists);
}
}

View File

@ -65,12 +65,12 @@
<span style="float: right">
<?
if (check_perms('site_torrents_notify')) {
if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === FALSE) {
if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT ID, Artists FROM users_notify_filters WHERE UserID='$LoggedUser[ID]' AND Label='Artist notifications' LIMIT 1");
$Notify = $DB->next_record(MYSQLI_ASSOC);
$Cache->cache_value('notify_artists_'.$LoggedUser['ID'], $Notify, 0);
}
if (stripos($Notify['Artists'], '|'.$Name.'|') === FALSE) {
if (stripos($Notify['Artists'], '|'.$Name.'|') === false) {
?>
<a href="artist.php?action=notify&amp;artistid=<?=$ArtistID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Notify of new uploads</a>
<?

View File

@ -49,7 +49,7 @@ function compare($X, $Y){
}
//Handle subscriptions
if(($CollageSubscriptions = $Cache->get_value('collage_subs_user_'.$LoggedUser['ID'])) === FALSE) {
if (($CollageSubscriptions = $Cache->get_value('collage_subs_user_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT CollageID FROM users_collage_subs WHERE UserID = '$LoggedUser[ID]'");
$CollageSubscriptions = $DB->collect(0);
$Cache->cache_value('collage_subs_user_'.$LoggedUser['ID'],$CollageSubscriptions,0);
@ -119,12 +119,13 @@ function compare($X, $Y){
if ($CountArtists) {
foreach ($CountArtists as $Artist) {
if (!isset($TopArtists[$Artist['id']]))
if (!isset($TopArtists[$Artist['id']])) {
$TopArtists[$Artist['id']] = array('name'=>$Artist['name'], 'count'=>1);
else
} else {
$TopArtists[$Artist['id']]['count']++;
}
}
}
if ($Username) {
if (!isset($Users[$UserID])) {
@ -277,7 +278,9 @@ function compare($X, $Y){
$DisplayName .= Artists::display_artists(array('1'=>$GroupArtists), false);
}
$DisplayName .= $GroupName;
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
if ($GroupYear > 0) {
$DisplayName = $DisplayName. ' ['. $GroupYear .']';
}
?>
<li class="image_group_<?=$GroupID?>">
<a href="torrents.php?id=<?=$GroupID?>">
@ -460,7 +463,9 @@ function compare($X, $Y){
$i = 0;
foreach ($TopArtists as $ID => $Artist) {
$i++;
if($i>10) { break; }
if ($i > 10) {
break;
}
?>
<li><a href="artist.php?id=<?=$ID?>"><?=$Artist['name']?></a> (<?=number_format($Artist['count'])?>)</li>
<?
@ -479,14 +484,15 @@ function compare($X, $Y){
$i = 0;
foreach ($Users as $ID => $User) {
$i++;
if($i>5) { break; }
if ($i > 5) {
break;
}
?>
<li><?=Users::format_username($ID, false, false, false)?> (<?=number_format($User['count'])?>)</li>
<?
}
?>
</ol>
</div>
</div>
<? if (check_perms('site_collages_manage') && !$PreventAdditions) { ?>

View File

@ -43,7 +43,7 @@
$PermittedForums = array_keys($LoggedUser['PermittedForums']);
foreach ($Forums as $Forum) {
list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead>$LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== FALSE)) {
if ($LoggedUser['CustomForums'][$ForumID] != 1 && ($MinRead > $LoggedUser['Class'] || array_search($ForumID, $RestrictedForums) !== false)) {
continue;
}
$Row = ($Row == 'a') ? 'b' : 'a';

View File

@ -124,7 +124,7 @@
}
//Handle subscriptions
if(($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === FALSE) {
if (($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT TopicID FROM users_subscriptions WHERE UserID = '$LoggedUser[ID]'");
$UserSubscriptions = $DB->collect(0);
$Cache->cache_value('subscriptions_user_'.$LoggedUser['ID'],$UserSubscriptions,0);

View File

@ -15,7 +15,7 @@
Many forums (Tutorials, The Library, etc.) have their own set of rules. Make sure you read and take note of these rules before you attempt to post in one of these forums.
</li>
<li>
Don't use all capital letters, excessive !!! (exclamation marks) or ??? (question marks), it seems like you're shouting!
Don't use all capital letters, excessive !!! (exclamation marks) or ??? (question marks). It seems like you're shouting!
</li>
<li>
No lame referral schemes. This includes freeipods.com, freepsps.com, or any other similar scheme in which the poster gets personal gain from users clicking a link.
@ -24,22 +24,22 @@
No asking for money for any reason whatsoever. We don't know or care about your friend who lost everything, or dying relative who wants to enjoy their last few moments alive by being given lots of money.
</li>
<li>
No advertising your uploads.
Do not inappropriately advertise your uploads. In special cases, it is acceptable to mention new uploads in an approved thread (e.g. <a href="forums.php?action=viewthread&amp;threadid=133982">New Users We'll Snatch Your First 100% FLAC</a>), but be sure to carefully read the thread's rules before posting. It is also acceptable to discuss releases you have uploaded when conversing about the music itself. Blatant attempts to advertise your uploads outside of the appropriate forums or threads may result in a warning or the loss of forum privileges.
</li>
<li>
No posting music requests in forums, there's a request link on the top bar, please use that instead.
No posting music requests in forums. There's a request link at the top of the page; please use that instead.
</li>
<li>
No flaming, be pleasant and polite. Don't use offensive language, and don't be confrontational for the sake of confrontation.
No flaming; be pleasant and polite. Don't use offensive language, and don't be confrontational for the sake of confrontation.
</li>
<li>
Don't point out or attack other members' share ratios. A higher ratio does not make you better than someone else.
</li>
<li>
Try not to ask stupid questions. A stupid question is one that you could have found the answer to yourself with a little research, or one that you're asking in the wrong place. If you do the basic research suggested (i.e., read the rules/wiki) or search the forums and don't find the answer to your question, then go ahead and ask. Staff/FLS are not here to hand-feed you the answers you could have found on your own with a little bit of effort.
Try not to ask stupid questions. A stupid question is one that you could have found the answer to yourself with a little research, or one that you're asking in the wrong place. If you do the basic research suggested (i.e., read the rules/wiki) or search the forums and don't find the answer to your question, then go ahead and ask. Staff and First Line Support (FLS) are not here to hand-feed you the answers you could have found on your own with a little bit of effort.
</li>
<li>
Be sure you read all the stickies.
Be sure you read all the sticky threads in a forum before you post.
</li>
<li>
Use descriptive and specific subject lines. This helps others decide whether your particular words of wisdom relate to a topic they care about.
@ -75,10 +75,10 @@
Be cautious when posting mature content on the forums. All mature imagery must abide by <a href="wiki.php?action=article&amp;id=1063">the rules found here</a>. Gratuitously sexual or violent content which falls outside of the allowable categories will result in a warning or worse.
</li>
<li>
Mature content in posts must be properly tagged. The correct format is as follows: <strong>[mature=description] ...content... [/mature]</strong>, where “description” is a mandatory description of the post contents. Misleading or inadequate descriptions will be penalized.
Mature content in posts must be properly tagged. The correct format is as follows: <strong>[mature=description] ...content... [/mature]</strong>, where "description" is a mandatory description of the post contents. Misleading or inadequate descriptions will be penalized.
</li>
<li>
Threads created for the exclusive purpose of posting mature imagery will be trashed. Mature content (including graphic album art) should be contextually relevant to the thread and/or forum youre posting in. Mature content is only allowed in: The Lounge, The Lounge +1, The Library, Music, Power Users, Elite, Torrent Masters, VIPs, Comics, Contests &amp; Designs, The Laboratory. If you are in doubt about a posts appropriateness, send a <a href="staffpm.php">Staff PM to the Forum Moderators</a> and wait for a reply before proceeding.
Threads created for the exclusive purpose of posting mature imagery will be trashed. Mature content (including graphic album art) should be contextually relevant to the thread and/or forum you're posting in. Mature content is only allowed in: The Lounge, The Lounge +1, The Library, Music, Power Users, Elite, Torrent Masters, VIPs, Comics, Contests &amp; Designs, The Laboratory. If you are in doubt about a post's appropriateness, send a <a href="staffpm.php">Staff PM to the Forum Moderators</a> and wait for a reply before proceeding.
</li>
</ul>
</div>

View File

@ -41,7 +41,12 @@
<?=Users::format_username($ID, false, false, false) ?>
</td>
<td class="nobr">
<? if (check_paranoia('lastseen', $Paranoia, $Class)) { echo time_diff($LastAccess); } else { echo 'Hidden by user'; }?>
<? if (check_paranoia('lastseen', $Paranoia, $Class)) {
echo time_diff($LastAccess);
} else {
echo 'Hidden by user';
}
?>
</td>
<td class="nobr">
<?=$SupportFor?>
@ -71,7 +76,12 @@
<?=Users::format_username($ID, false, false, false) ?>
</td>
<td class="nobr">
<? if (check_paranoia('lastseen', $Paranoia, $Class)) { echo time_diff($LastAccess); } else { echo 'Hidden by user'; }?>
<? if (check_paranoia('lastseen', $Paranoia, $Class)) {
echo time_diff($LastAccess);
} else {
echo 'Hidden by user';
}
?>
</td>
<td class="nobr">
<?=$SupportFor?>
@ -114,7 +124,12 @@
<?=Users::format_username($ID, false, false, false) ?>
</td>
<td class="nobr">
<? if (check_paranoia('lastseen', $Paranoia, $Class)) { echo time_diff($LastAccess); } else { echo 'Hidden by staff member'; }?>
<? if (check_paranoia('lastseen', $Paranoia, $Class)) {
echo time_diff($LastAccess);
} else {
echo 'Hidden by staff member';
}
?>
</td>
<td class="nobr">
<?=$Remark?>

View File

@ -120,7 +120,9 @@
break;
case 'takeeditnews':
if(!check_perms('admin_manage_news')){ error(403); }
if (!check_perms('admin_manage_news')) {
error(403);
}
if (is_number($_POST['newsid'])){
$DB->query("UPDATE news SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."' WHERE ID='".db_string($_POST['newsid'])."'");
$Cache->delete_value('news');
@ -130,7 +132,9 @@
break;
case 'deletenews':
if(!check_perms('admin_manage_news')){ error(403); }
if (!check_perms('admin_manage_news')) {
error(403);
}
if (is_number($_GET['id'])){
authorize();
$DB->query("DELETE FROM news WHERE ID='".db_string($_GET['id'])."'");
@ -139,7 +143,7 @@
// Deleting latest news
$LatestNews = $Cache->get_value('news_latest_id');
if ($LatestNews !== FALSE && $LatestNews == $_GET['id']) {
if ($LatestNews !== false && $LatestNews == $_GET['id']) {
$Cache->delete_value('news_latest_id');
}
}
@ -147,7 +151,9 @@
break;
case 'takenewnews':
if(!check_perms('admin_manage_news')){ error(403); }
if (!check_perms('admin_manage_news')) {
error(403);
}
$DB->query("INSERT INTO news (UserID, Title, Body, Time) VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')");
@ -173,7 +179,9 @@
include('managers/tag_aliases.php');
break;
case 'permissions':
if (!check_perms('admin_manage_permissions')) { error(403); }
if (!check_perms('admin_manage_permissions')) {
error(403);
}
if (!empty($_REQUEST['id'])) {
$Val->SetFields('name',true,'string','You did not enter a valid name for this permission set.');
@ -205,7 +213,9 @@
$Values=array();
foreach ($_REQUEST as $Key => $Perms) {
if (substr($Key,0,5)=="perm_") { $Values[substr($Key,5)]= (int)$Perms; }
if (substr($Key,0,5) == 'perm_') {
$Values[substr($Key,5)] = (int)$Perms;
}
}
$Name = $_REQUEST['name'];

View File

@ -77,8 +77,8 @@
</td>
<? if (check_perms('users_mod')) { ?>
<td>
<input type="submit" name="save" value="Save Alias" />
<input type="submit" name="delete" value="Delete Alias" />
<input type="submit" name="save" value="Save alias" />
<input type="submit" name="delete" value="Delete alias" />
</td>
<? } ?>
</form>

View File

@ -38,7 +38,7 @@
/* uTorrent remote redownloads .torrent files every fifteen minutes
to prevent this retardation from blowing bandwidth etc., let's block it
if he's downloaded the .torrent file twice before */
if (strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== FALSE) {
if (strpos($_SERVER['HTTP_USER_AGENT'], 'BTWebClient') !== false) {
$DB->query("SELECT 1 FROM users_downloads WHERE UserID=$UserID AND TorrentID=$TorrentID LIMIT 3");
if ($DB->record_count() > 2) {
error('You have already downloaded this .torrent three times. If you need to download it again, please do so from your browser, not through uTorrent remote.');

View File

@ -168,7 +168,7 @@ function get_group_requests($GroupID) {
global $DB, $Cache;
$Requests = $Cache->get_value('requests_group_'.$GroupID);
if ($Requests === FALSE) {
if ($Requests === false) {
$DB->query("SELECT ID FROM requests WHERE GroupID = $GroupID AND TimeFilled = '0000-00-00 00:00:00'");
$Requests = $DB->collect('ID');
$Cache->cache_value('requests_group_'.$GroupID, $Requests, 0);

View File

@ -85,7 +85,7 @@
$Cache->delete_value('vote_pairs_'.$CacheGroupID);
}
// 4. Clear the new groups vote keys
$Cache->delete_value('votes_'.$NewGroupID);
$DB->query("UPDATE torrents SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
$DB->query("UPDATE wiki_torrents SET PageID='$NewGroupID' WHERE PageID='$GroupID'");

View File

@ -76,7 +76,7 @@ function unlink_user($UserID) {
error(403);
}
$UserInfo = Users::user_info($UserID);
if ($UserInfo === FALSE) {
if ($UserInfo === false) {
return;
}
$AdminComment = sqltime()." - Linked accounts updated: [user]".$UserInfo['Username']."[/user] unlinked by ".$LoggedUser['Username'];
@ -167,7 +167,7 @@ function user_dupes_table($UserID) {
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" />
<div class="box">
<div class="head"><?=max($DupeCount - 1, 0)?> linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a></div>
<div class="head"><?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a></div>
<table width="100%" class="layout hidden linkedaccounts">
<?=$DupeCount?'<tr>':''?>
<?

View File

@ -1,5 +1,7 @@
<?
if(!check_perms('site_torrents_notify')){ error(403); }
if (!check_perms('site_torrents_notify')) {
error(403);
}
View::show_header('Manage notifications');
?>
<div class="thin">
@ -65,7 +67,7 @@
<td>
<textarea name="artists<?=$i?>" style="width:100%" rows="5"><?=display_str($N['Artists'])?></textarea>
<p class="min_padding">Comma-separated list &mdash; e.g. <em>Pink Floyd, Led Zeppelin, Neil Young</em></p>
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if($N['ExcludeVA']=="1") { echo ' checked="checked"';} ?> />
<input type="checkbox" name="excludeva<?=$i?>" id="excludeva_<?=$N['ID']?>"<? if ($N['ExcludeVA'] == '1') { echo ' checked="checked"';} ?> />
<label for="excludeva_<?=$N['ID']?>">Exclude Various Artists releases</label>
</td>
</tr>
@ -139,7 +141,7 @@
<tr>
<td class="label"><strong>Only new releases</strong></td>
<td>
<input type="checkbox" name="newgroupsonly<?=$i?>" id="newgroupsonly_<?=$N['ID']?>"<? if($N['NewGroupsOnly']=="1") { echo ' checked="checked"';} ?> />
<input type="checkbox" name="newgroupsonly<?=$i?>" id="newgroupsonly_<?=$N['ID']?>"<? if ($N['NewGroupsOnly'] == '1') { echo ' checked="checked"';} ?> />
<label for="newgroupsonly_<?=$N['ID']?>">Only notify for new releases, not new formats</label>
</td>
</tr>

View File

@ -1,5 +1,7 @@
<?
if(!check_perms('site_torrents_notify')){ error(403); }
if (!check_perms('site_torrents_notify')) {
error(403);
}
authorize();
$FormID = '';
@ -155,7 +157,7 @@
}
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);
if(($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) !== FALSE && $Notify['ID'] == $_POST['id'.$FormID]) {
if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) !== false && $Notify['ID'] == $_POST['id'.$FormID]) {
$Cache->delete_value('notify_artists_'.$LoggedUser['ID']);
}
header('Location: user.php?action=notify');

View File

@ -27,7 +27,9 @@
$Artist = (isset($_POST['Artist'])) ? 1 : 0;
$SecondaryClasses = isset($_POST['secondary_classes']) ? $_POST['secondary_classes'] : array();
foreach ($SecondaryClasses as $i => $Val) {
if(!is_number($Val)) { unset($SecondaryClasses[$i]); }
if (!is_number($Val)) {
unset($SecondaryClasses[$i]);
}
}
$Visible = (isset($_POST['Visible'])) ? 1 : 0;
$Invites = (int)$_POST['Invites'];
@ -36,11 +38,11 @@
$Warned = (isset($_POST['Warned'])) ? 1 : 0;
$Logs095 = (int)$_POST['095logs'];
if (isset($_POST['Uploaded']) && isset($_POST['Downloaded'])) {
$Uploaded = ($_POST['Uploaded'] == "" ? 0 : $_POST['Uploaded']);
$Uploaded = ($_POST['Uploaded'] == '' ? 0 : $_POST['Uploaded']);
if ($Arithmetic = strpbrk($Uploaded, '+-')) {
$Uploaded += max(-$Uploaded, Format::get_bytes($Arithmetic));
}
$Downloaded = ($_POST['Downloaded'] == "" ? 0 : $_POST['Downloaded']);
$Downloaded = ($_POST['Downloaded'] == '' ? 0 : $_POST['Downloaded']);
if ($Arithmetic = strpbrk($Downloaded, '+-')) {
$Downloaded += max(-$Downloaded, Format::get_bytes($Arithmetic));
}
@ -199,12 +201,12 @@
if ($_POST['ResetSnatchList'] && check_perms('users_edit_reset_keys')) {
$DB->query("DELETE FROM xbt_snatched WHERE uid='$UserID'");
$EditSummary[]='Snatch List cleared';
$EditSummary[] = 'Snatch list cleared';
}
if ($_POST['ResetDownloadList'] && check_perms('users_edit_reset_keys')) {
$DB->query("DELETE FROM users_downloads WHERE UserID='$UserID'");
$EditSummary[]='Download List cleared';
$EditSummary[] = 'Download list cleared';
}
if (($_POST['ResetSession'] || $_POST['LogOut']) && check_perms('users_logout')) {
@ -368,7 +370,9 @@
Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=https://".SSL_SITE_URL."/wiki.php?action=article&amp;id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason");
$UpdateSet[] = "Warned='".sqltime()."' + INTERVAL $WarnLength WEEK";
$Msg = "warned for $WarnLength week(s)";
if ($WarnReason) { $Msg.=" for $WarnReason"; }
if ($WarnReason) {
$Msg.=" for $WarnReason";
}
$EditSummary[] = db_string($Msg);
$LightUpdates['Warned'] = time_plus(3600*24*7*$WarnLength);
@ -385,7 +389,9 @@
$DB->query("SELECT Warned + INTERVAL $ExtendWarning WEEK FROM users_info WHERE UserID='$UserID'");
list($WarnedUntil) = $DB->next_record();
$Msg = "warning extended by $ExtendWarning week(s) to $WarnedUntil";
if ($WarnReason) { $Msg.=" for $WarnReason"; }
if ($WarnReason) {
$Msg.=" for $WarnReason";
}
$EditSummary[] = db_string($Msg);
$LightUpdates['Warned'] = $WarnedUntil;
} elseif ($Warned == 1 && $ExtendWarning == '---' && $ReduceWarning != '---' && check_perms('users_warn')) {
@ -396,14 +402,16 @@
$DB->query("SELECT Warned - INTERVAL $ReduceWarning WEEK FROM users_info WHERE UserID='$UserID'");
list($WarnedUntil) = $DB->next_record();
$Msg = "warning reduced by $ReduceWarning week(s) to $WarnedUntil";
if ($WarnReason) { $Msg.=" for $WarnReason"; }
if ($WarnReason) {
$Msg.=" for $WarnReason";
}
$EditSummary[] = db_string($Msg);
$LightUpdates['Warned'] = $WarnedUntil;
}
if ($SupportFor != db_string($Cur['SupportFor']) && (check_perms('admin_manage_fls') || (check_perms('users_mod') && $UserID == $LoggedUser['ID']))) {
$UpdateSet[] = "SupportFor='$SupportFor'";
$EditSummary[]="first-line support status changed to $SupportFor";
$EditSummary[] = "First-Line Support status changed to $SupportFor";
}
if ($RestrictedForums != db_string($Cur['RestrictedForums']) && check_perms('users_mod')) {
@ -533,7 +541,6 @@
}
if ($EnableUser != $Cur['Enabled'] && check_perms('users_disable_users')) {
$EnableStr = 'account '.translateUserStatus($Cur['Enabled']).'->'.translateUserStatus($EnableUser);
if ($EnableUser == '2') {

View File

@ -542,7 +542,9 @@ function check_paranoia_here($Setting) {
<?
}
if(!isset($Uploads)) { $Uploads = 0; }
if (!isset($Uploads)) {
$Uploads = 0;
}
if ($Uploads > 4 && check_paranoia_here('uploads')) {
$RecentUploads = $Cache->get_value('recent_uploads_'.$UserID);
if (!is_array($RecentUploads)) {
@ -784,7 +786,9 @@ function check_paranoia_here($Setting) {
// Assigned to class
$Assigned = ($Level == 0) ? "First Line Support" : $ClassLevels[$Level]['Name'];
// No + on Sysops
if ($Assigned != 'Sysop') { $Assigned .= "+"; }
if ($Assigned != 'Sysop') {
$Assigned .= "+";
}
} else {
// Assigned to user
@ -879,10 +883,20 @@ function check_paranoia_here($Setting) {
<select name="Class">
<?
foreach ($ClassLevels as $CurClass) {
if (check_perms('users_promote_below', $Class) && $CurClass['ID']>=$LoggedUser['EffectiveClass']) { break; }
if ($CurClass['ID']>$LoggedUser['EffectiveClass']) { break; }
if ($CurClass['Secondary']) { continue; }
if ($Class===$CurClass['Level']) { $Selected=' selected="selected"'; } else { $Selected=""; }
if (check_perms('users_promote_below', $Class) && $CurClass['ID'] >= $LoggedUser['EffectiveClass']) {
break;
}
if ($CurClass['ID'] > $LoggedUser['EffectiveClass']) {
break;
}
if ($CurClass['Secondary']) {
continue;
}
if ($Class === $CurClass['Level']) {
$Selected = ' selected="selected"';
} else {
$Selected = '';
}
?>
<option value="<?=$CurClass['ID']?>"<?=$Selected?>><?=$CurClass['Name'].' ('.$CurClass['Level'].')'?></option>
<? } ?>
@ -915,7 +929,9 @@ function check_paranoia_here($Setting) {
$i++;
?>
<input type="checkbox" id="perm_<?=$PermID?>" name="secondary_classes[]" value="<?=$PermID?>"<? if ($IsSet) { ?> checked="checked"<? } ?> />&nbsp;<label for="perm_<?=$PermID?>" style="margin-right: 10px;"><?=$PermName?></label>
<? if ($i % 5 == 0) { echo '<br />'; }
<? if ($i % 5 == 0) {
echo '<br />';
}
} ?>
</td>
</tr>

View File

@ -12,7 +12,7 @@
$Cache->cache_value('collage_subs_user_'.$LoggedUser['ID'],$UserSubscriptions,0);
}
if(($Key = array_search($_GET['collageid'],$UserSubscriptions)) !== FALSE) {
if (($Key = array_search($_GET['collageid'],$UserSubscriptions)) !== false) {
$DB->query('DELETE FROM users_collage_subs WHERE UserID = '.db_string($LoggedUser['ID']).' AND CollageID = '.db_string($_GET['collageid']));
unset($UserSubscriptions[$Key]);
} else {

View File

@ -26,7 +26,7 @@
list($Page,$Limit) = Format::page_limit($PerPage);
if(($UserInfo = $Cache->get_value('user_info_'.$UserID)) === FALSE) {
if(($UserInfo = $Cache->get_value('user_info_'.$UserID)) === false) {
$DB->query("SELECT
m.Username,
m.Enabled,
@ -202,7 +202,7 @@
<div class="linkbox">
<?
if($ViewingOwn) {
if(($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === FALSE) {
if(($UserSubscriptions = $Cache->get_value('subscriptions_user_'.$LoggedUser['ID'])) === false) {
$DB->query("SELECT TopicID FROM users_subscriptions WHERE UserID = '$LoggedUser[ID]'");
$UserSubscriptions = $DB->collect(0);
$Cache->cache_value('subscriptions_user_'.$LoggedUser['ID'],$UserSubscriptions,0);

View File

@ -23,7 +23,7 @@
$Cache->cache_value('subscriptions_user_'.$LoggedUser['ID'],$UserSubscriptions,0);
}
if(($Key = array_search($_GET['topicid'],$UserSubscriptions)) !== FALSE) {
if (($Key = array_search($_GET['topicid'],$UserSubscriptions)) !== false) {
$DB->query('DELETE FROM users_subscriptions WHERE UserID = '.db_string($LoggedUser['ID']).' AND TopicID = '.db_string($_GET['topicid']));
unset($UserSubscriptions[$Key]);
} else {