mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 10:31:37 +00:00
Empty commit
This commit is contained in:
parent
cbc1680acf
commit
fec9c0ca19
@ -1,6 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
class Format
|
class Format {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Torrent Labels
|
* Torrent Labels
|
||||||
* Map a common display string to a CSS class
|
* Map a common display string to a CSS class
|
||||||
@ -53,10 +52,14 @@ public static function cut_string($Str, $Length, $Hard = false, $ShowDots = true
|
|||||||
array_pop($DescArr);
|
array_pop($DescArr);
|
||||||
$CutDesc = implode(' ', $DescArr);
|
$CutDesc = implode(' ', $DescArr);
|
||||||
}
|
}
|
||||||
if ($ShowDots) { $CutDesc .= '...'; }
|
if ($ShowDots) {
|
||||||
|
$CutDesc .= '...';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$CutDesc = mb_substr($Str, 0, $Length, 'UTF-8');
|
$CutDesc = mb_substr($Str, 0, $Length, 'UTF-8');
|
||||||
if ($ShowDots) { $CutDesc .= '...'; }
|
if ($ShowDots) {
|
||||||
|
$CutDesc .= '...';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $CutDesc;
|
return $CutDesc;
|
||||||
} else {
|
} else {
|
||||||
@ -96,19 +99,22 @@ public static function get_ratio_color($Ratio) {
|
|||||||
* @param boolean $Color if true, ratio will be coloured.
|
* @param boolean $Color if true, ratio will be coloured.
|
||||||
* @return string formatted ratio HTML
|
* @return string formatted ratio HTML
|
||||||
*/
|
*/
|
||||||
public static function get_ratio_html($Dividend, $Divisor, $Color = true)
|
public static function get_ratio_html($Dividend, $Divisor, $Color = true) {
|
||||||
{
|
|
||||||
$Ratio = self::get_ratio($Dividend, $Divisor);
|
$Ratio = self::get_ratio($Dividend, $Divisor);
|
||||||
|
|
||||||
if ($Ratio === false) return '--';
|
if ($Ratio === false) {
|
||||||
if ($Ratio === '∞') return '<span class="r99" title="Infinite">∞</span>';
|
return '--';
|
||||||
|
}
|
||||||
if ($Color)
|
if ($Ratio === '∞') {
|
||||||
|
return '<span class="r99" title="Infinite">∞</span>';
|
||||||
|
}
|
||||||
|
if ($Color) {
|
||||||
$Ratio = sprintf('<span class="%s" title="%s">%s</span>',
|
$Ratio = sprintf('<span class="%s" title="%s">%s</span>',
|
||||||
self::get_ratio_color($Ratio),
|
self::get_ratio_color($Ratio),
|
||||||
self::get_ratio($Dividend, $Divisor, 5),
|
self::get_ratio($Dividend, $Divisor, 5),
|
||||||
$Ratio
|
$Ratio
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return $Ratio;
|
return $Ratio;
|
||||||
}
|
}
|
||||||
@ -120,11 +126,14 @@ public static function get_ratio_html($Dividend, $Divisor, $Color = true)
|
|||||||
* @param int $Decimal floor to n decimals (eg Subtract .005 to floor to 2 decimals)
|
* @param int $Decimal floor to n decimals (eg Subtract .005 to floor to 2 decimals)
|
||||||
* @return boolean|string
|
* @return boolean|string
|
||||||
*/
|
*/
|
||||||
public function get_ratio ($Dividend, $Divisor, $Decimal = 2)
|
public function get_ratio ($Dividend, $Divisor, $Decimal = 2) {
|
||||||
{
|
if ($Divisor == 0 && $Dividend == 0) {
|
||||||
if ($Divisor == 0 && $Dividend == 0) return false;
|
return false;
|
||||||
if ($Divisor == 0) return '∞';
|
}
|
||||||
return number_format(max($Dividend/$Divisor - (0.5/pow(10, $Decimal)), 0), $Decimal);
|
if ($Divisor == 0) {
|
||||||
|
return '∞';
|
||||||
|
}
|
||||||
|
return number_format(max($Dividend / $Divisor - (0.5 / pow(10, $Decimal)), 0), $Decimal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -188,8 +197,8 @@ public static function catalogue_limit($Page, $PerPage, $CatalogueSize=500) {
|
|||||||
return array($CatalogueID, $CatalogueLimit);
|
return array($CatalogueID, $CatalogueLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function catalogue_select($Catalogue, $Page, $PerPage, $CatalogueSize=500) {
|
public static function catalogue_select($Catalogue, $Page, $PerPage, $CatalogueSize = 500) {
|
||||||
return array_slice($Catalogue,(($PerPage*$Page-$PerPage)%$CatalogueSize),$PerPage,true);
|
return array_slice($Catalogue,(($PerPage * $Page - $PerPage) % $CatalogueSize),$PerPage,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -197,41 +206,41 @@ public static function catalogue_select($Catalogue, $Page, $PerPage, $CatalogueS
|
|||||||
* Returns a page list, given certain information about the pages.
|
* Returns a page list, given certain information about the pages.
|
||||||
*
|
*
|
||||||
* @param int $StartPage: The current record the page you're on starts with.
|
* @param int $StartPage: The current record the page you're on starts with.
|
||||||
* eg. if you're on page 2 of a forum thread with 25 posts per page, $StartPage is 25.
|
* e.g. if you're on page 2 of a forum thread with 25 posts per page, $StartPage is 25.
|
||||||
* If you're on page 1, $StartPage is 0.
|
* If you're on page 1, $StartPage is 0.
|
||||||
* @param int $TotalRecords: The total number of records in the result set.
|
* @param int $TotalRecords: The total number of records in the result set.
|
||||||
* eg. if you're on a forum thread with 152 posts, $TotalRecords is 152.
|
* e.g. if you're on a forum thread with 152 posts, $TotalRecords is 152.
|
||||||
* @param int $ItemsPerPage: Self-explanatory. The number of records shown on each page
|
* @param int $ItemsPerPage: Self-explanatory. The number of records shown on each page
|
||||||
* eg. if there are 25 posts per forum page, $ItemsPerPage is 25.
|
* e.g. if there are 25 posts per forum page, $ItemsPerPage is 25.
|
||||||
* @param int $ShowPages: The number of page links that are shown.
|
* @param int $ShowPages: The number of page links that are shown.
|
||||||
* eg. If there are 20 pages that exist, but $ShowPages is only 11, only 11 links will be shown.
|
* e.g. If there are 20 pages that exist, but $ShowPages is only 11, only 11 links will be shown.
|
||||||
* @param string $Anchor A URL fragment to attach to the links.
|
* @param string $Anchor A URL fragment to attach to the links.
|
||||||
* eg. '#comment12'
|
* e.g. '#comment12'
|
||||||
* @return A sanitized HTML page listing.
|
* @return A sanitized HTML page listing.
|
||||||
*/
|
*/
|
||||||
public static function get_pages($StartPage,$TotalRecords,$ItemsPerPage,$ShowPages=11,$Anchor='') {
|
public static function get_pages($StartPage, $TotalRecords, $ItemsPerPage, $ShowPages = 11, $Anchor = '') {
|
||||||
global $Document, $Method, $Mobile;
|
global $Document, $Method, $Mobile;
|
||||||
$Location = $Document.'.php';
|
$Location = $Document.'.php';
|
||||||
$StartPage = ceil($StartPage);
|
$StartPage = ceil($StartPage);
|
||||||
$TotalPages = 0;
|
$TotalPages = 0;
|
||||||
if ($TotalRecords > 0) {
|
if ($TotalRecords > 0) {
|
||||||
$StartPage = min($StartPage, ceil($TotalRecords/$ItemsPerPage));
|
$StartPage = min($StartPage, ceil($TotalRecords / $ItemsPerPage));
|
||||||
|
|
||||||
$ShowPages--;
|
$ShowPages--;
|
||||||
$TotalPages = ceil($TotalRecords/$ItemsPerPage);
|
$TotalPages = ceil($TotalRecords / $ItemsPerPage);
|
||||||
|
|
||||||
if ($TotalPages > $ShowPages) {
|
if ($TotalPages > $ShowPages) {
|
||||||
$StartPosition = $StartPage-round($ShowPages/2);
|
$StartPosition = $StartPage - round($ShowPages / 2);
|
||||||
|
|
||||||
if ($StartPosition <= 0) {
|
if ($StartPosition <= 0) {
|
||||||
$StartPosition = 1;
|
$StartPosition = 1;
|
||||||
} else {
|
} else {
|
||||||
if ($StartPosition >= ($TotalPages-$ShowPages)) {
|
if ($StartPosition >= ($TotalPages - $ShowPages)) {
|
||||||
$StartPosition = $TotalPages-$ShowPages;
|
$StartPosition = $TotalPages - $ShowPages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$StopPage = $ShowPages+$StartPosition;
|
$StopPage = $ShowPages + $StartPosition;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$StopPage = $TotalPages;
|
$StopPage = $TotalPages;
|
||||||
@ -259,18 +268,18 @@ public static function get_pages($StartPage,$TotalRecords,$ItemsPerPage,$ShowPag
|
|||||||
$Pages .= '<a href="'.$Location.'?page='.$i.$QueryString.$Anchor.'">';
|
$Pages .= '<a href="'.$Location.'?page='.$i.$QueryString.$Anchor.'">';
|
||||||
}
|
}
|
||||||
$Pages .= "<strong>";
|
$Pages .= "<strong>";
|
||||||
if ($i*$ItemsPerPage > $TotalRecords) {
|
if ($i * $ItemsPerPage > $TotalRecords) {
|
||||||
$Pages .= ((($i-1)*$ItemsPerPage)+1).'-'.($TotalRecords);
|
$Pages .= ((($i - 1) * $ItemsPerPage) + 1).'-'.($TotalRecords);
|
||||||
} else {
|
} else {
|
||||||
$Pages .= ((($i-1)*$ItemsPerPage)+1).'-'.($i*$ItemsPerPage);
|
$Pages .= ((($i - 1) * $ItemsPerPage) + 1).'-'.($i * $ItemsPerPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Pages .= "</strong>";
|
$Pages .= '</strong>';
|
||||||
if ($i != $StartPage) {
|
if ($i != $StartPage) {
|
||||||
$Pages.='</a>';
|
$Pages.='</a>';
|
||||||
}
|
}
|
||||||
if ($i < $StopPage) {
|
if ($i < $StopPage) {
|
||||||
$Pages.=" | ";
|
$Pages.=' | ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -278,7 +287,7 @@ public static function get_pages($StartPage,$TotalRecords,$ItemsPerPage,$ShowPag
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($StartPage && $StartPage < $TotalPages) {
|
if ($StartPage && $StartPage < $TotalPages) {
|
||||||
$Pages .= ' | <a href="'.$Location.'?page='.($StartPage+1).$QueryString.$Anchor.'" class="pager_next"><strong>Next ></strong></a> ';
|
$Pages .= ' | <a href="'.$Location.'?page='.($StartPage + 1).$QueryString.$Anchor.'" class="pager_next"><strong>Next ></strong></a> ';
|
||||||
$Pages .= '<a href="'.$Location.'?page='.$TotalPages.$QueryString.$Anchor.'"><strong> Last >></strong></a>';
|
$Pages .= '<a href="'.$Location.'?page='.$TotalPages.$QueryString.$Anchor.'"><strong> Last >></strong></a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -314,9 +323,9 @@ public static function get_size($Size, $Levels = 2) {
|
|||||||
*/
|
*/
|
||||||
public static function human_format($Number) {
|
public static function human_format($Number) {
|
||||||
$Steps = 0;
|
$Steps = 0;
|
||||||
while($Number>=1000) {
|
while ($Number >= 1000) {
|
||||||
$Steps++;
|
$Steps++;
|
||||||
$Number=$Number/1000;
|
$Number = $Number / 1000;
|
||||||
}
|
}
|
||||||
switch ($Steps) {
|
switch ($Steps) {
|
||||||
case 0: return round($Number); break;
|
case 0: return round($Number); break;
|
||||||
@ -393,11 +402,11 @@ public static function form($Index, $Return = false) {
|
|||||||
* @param $Array The array the option is in, defaults to GET.
|
* @param $Array The array the option is in, defaults to GET.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static function selected($Name, $Value, $Attribute='selected', $Array = array()) {
|
public static function selected($Name, $Value, $Attribute = 'selected', $Array = array()) {
|
||||||
if (empty($Array)) {
|
if (empty($Array)) {
|
||||||
$Array = $_GET;
|
$Array = $_GET;
|
||||||
}
|
}
|
||||||
if (isset($Array[$Name]) && $Array[$Name]!=='') {
|
if (isset($Array[$Name]) && $Array[$Name] !== '') {
|
||||||
if ($Array[$Name] == $Value) {
|
if ($Array[$Name] == $Value) {
|
||||||
echo ' '.$Attribute.'="'.$Attribute.'"';
|
echo ' '.$Attribute.'="'.$Attribute.'"';
|
||||||
}
|
}
|
||||||
@ -468,12 +477,21 @@ public static function add_class($Target, $Tests, $ClassName, $AddAttribute, $Us
|
|||||||
* @return UTF-8 encoded version of $Str
|
* @return UTF-8 encoded version of $Str
|
||||||
*/
|
*/
|
||||||
public static function make_utf8($Str) {
|
public static function make_utf8($Str) {
|
||||||
if ($Str!="") {
|
if ($Str != '') {
|
||||||
if (self::is_utf8($Str)) { $Encoding="UTF-8"; }
|
if (self::is_utf8($Str)) {
|
||||||
if (empty($Encoding)) { $Encoding=mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); }
|
$Encoding = 'UTF-8';
|
||||||
if (empty($Encoding)) { $Encoding="ISO-8859-1"; }
|
}
|
||||||
if ($Encoding=="UTF-8") { return $Str; }
|
if (empty($Encoding)) {
|
||||||
else { return @mb_convert_encoding($Str,"UTF-8",$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,9 +526,12 @@ public static function is_utf8($Str) {
|
|||||||
public static function find_torrent_label_class ($text)
|
public static function find_torrent_label_class ($text)
|
||||||
{
|
{
|
||||||
$index = mb_eregi_replace('(?:[^\w\d\s]+)', '', strtolower($text));
|
$index = mb_eregi_replace('(?:[^\w\d\s]+)', '', strtolower($text));
|
||||||
if (isset(self::$TorrentLabels[$index])) return self::$TorrentLabels[$index];
|
if (isset(self::$TorrentLabels[$index])) {
|
||||||
|
return self::$TorrentLabels[$index];
|
||||||
|
} else {
|
||||||
return self::$TorrentLabels['default'];
|
return self::$TorrentLabels['default'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a strong element that notes the torrent's state.
|
* Creates a strong element that notes the torrent's state.
|
||||||
@ -522,9 +543,11 @@ public static function find_torrent_label_class ($text)
|
|||||||
* @param string $class Custom CSS class
|
* @param string $class Custom CSS class
|
||||||
* @return string Strong element
|
* @return string Strong element
|
||||||
*/
|
*/
|
||||||
public static function torrent_label ($text, $class='')
|
public static function torrent_label ($text, $class = '')
|
||||||
{
|
{
|
||||||
if (empty($class)) $class = self::find_torrent_label_class($text);
|
if (empty($class)) {
|
||||||
|
$class = self::find_torrent_label_class($text);
|
||||||
|
}
|
||||||
return sprintf('<strong class="torrent_label %1$s" title="%2$s">%2$s</strong>',
|
return sprintf('<strong class="torrent_label %1$s" title="%2$s">%2$s</strong>',
|
||||||
display_str($class), display_str($text));
|
display_str($class), display_str($text));
|
||||||
}
|
}
|
||||||
|
@ -180,6 +180,7 @@ protected function listen() {
|
|||||||
}
|
}
|
||||||
if (isset($this->DisabledUsers[$Nick[1]])) {
|
if (isset($this->DisabledUsers[$Nick[1]])) {
|
||||||
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[1] . "'");
|
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[1] . "'");
|
||||||
|
$Cache->increment_value('num_disablees', -1);
|
||||||
unset($this->DisabledUsers[$Nick[1]]);
|
unset($this->DisabledUsers[$Nick[1]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,6 +188,7 @@ protected function listen() {
|
|||||||
if (preg_match("/:([^!]+)![^\s]* PART #what.cd-disabled/", $this->Data, $Nick)) {
|
if (preg_match("/:([^!]+)![^\s]* PART #what.cd-disabled/", $this->Data, $Nick)) {
|
||||||
if (isset($this->DisabledUsers[$Nick[1]])) {
|
if (isset($this->DisabledUsers[$Nick[1]])) {
|
||||||
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[1] . "'");
|
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[1] . "'");
|
||||||
|
$Cache->increment_value('num_disablees', -1);
|
||||||
unset($this->DisabledUsers[$Nick[1]]);
|
unset($this->DisabledUsers[$Nick[1]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,6 +197,7 @@ protected function listen() {
|
|||||||
$Nick = explode(" ", $Nick[0]);
|
$Nick = explode(" ", $Nick[0]);
|
||||||
if (isset($this->DisabledUsers[$Nick[3]])) {
|
if (isset($this->DisabledUsers[$Nick[3]])) {
|
||||||
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[3] . "'");
|
$DB->query("DELETE FROM disable_list WHERE Nick = '" . $Nick[3] . "'");
|
||||||
|
$Cache->increment_value('num_disablees', -1);
|
||||||
unset($this->DisabledUsers[$Nick[3]]);
|
unset($this->DisabledUsers[$Nick[3]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
$BookmarkView = false;
|
$BookmarkView = false;
|
||||||
|
|
||||||
if(empty($_GET['type'])) {
|
if (empty($_GET['type'])) {
|
||||||
$Title = 'Requests';
|
$Title = 'Requests';
|
||||||
if(!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
if (!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
||||||
$SS->set_filter('visible', array(1));
|
$SS->set_filter('visible', array(1));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -27,8 +27,8 @@
|
|||||||
$SS->set_filter('userid', array($LoggedUser['ID']));
|
$SS->set_filter('userid', array($LoggedUser['ID']));
|
||||||
break;
|
break;
|
||||||
case 'voted':
|
case 'voted':
|
||||||
if(!empty($_GET['userid'])) {
|
if (!empty($_GET['userid'])) {
|
||||||
if(is_number($_GET['userid'])) {
|
if (is_number($_GET['userid'])) {
|
||||||
if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $_GET['userid'])) {
|
if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $_GET['userid'])) {
|
||||||
print json_encode(array('status' => 'failure'));
|
print json_encode(array('status' => 'failure'));
|
||||||
die();
|
die();
|
||||||
@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'filled':
|
case 'filled':
|
||||||
if(empty($_GET['userid']) || !is_number($_GET['userid'])) {
|
if (empty($_GET['userid']) || !is_number($_GET['userid'])) {
|
||||||
print json_encode(array('status' => 'failure'));
|
print json_encode(array('status' => 'failure'));
|
||||||
die();
|
die();
|
||||||
} else {
|
} else {
|
||||||
@ -68,132 +68,132 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Submitted && empty($_GET['show_filled'])) {
|
if ($Submitted && empty($_GET['show_filled'])) {
|
||||||
$SS->set_filter('torrentid', array(0));
|
$SS->set_filter('torrentid', array(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['search'])) {
|
if (!empty($_GET['search'])) {
|
||||||
$Words = explode(' ', $_GET['search']);
|
$Words = explode(' ', $_GET['search']);
|
||||||
foreach($Words as $Key => &$Word) {
|
foreach ($Words as $Key => &$Word) {
|
||||||
if($Word[0] == '!' && strlen($Word) > 2) {
|
if ($Word[0] == '!' && strlen($Word) > 2) {
|
||||||
if(strpos($Word,'!',1) === false) {
|
if (strpos($Word,'!',1) === false) {
|
||||||
$Word = '!'.$SS->EscapeString(substr($Word,1));
|
$Word = '!'.$SS->EscapeString(substr($Word,1));
|
||||||
} else {
|
} else {
|
||||||
$Word = $SS->EscapeString($Word);
|
$Word = $SS->EscapeString($Word);
|
||||||
}
|
}
|
||||||
} elseif(strlen($Word) >= 2) {
|
} elseif (strlen($Word) >= 2) {
|
||||||
$Word = $SS->EscapeString($Word);
|
$Word = $SS->EscapeString($Word);
|
||||||
} else {
|
} else {
|
||||||
unset($Words[$Key]);
|
unset($Words[$Key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($Words)) {
|
if (!empty($Words)) {
|
||||||
$Queries[] = "@* ".implode(' ', $Words);
|
$Queries[] = "@* ".implode(' ', $Words);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['tags'])){
|
if (!empty($_GET['tags'])){
|
||||||
$Tags = explode(',', $_GET['tags']);
|
$Tags = explode(',', $_GET['tags']);
|
||||||
$TagNames = array();
|
$TagNames = array();
|
||||||
foreach ($Tags as $Tag) {
|
foreach ($Tags as $Tag) {
|
||||||
$Tag = Misc::sanitize_tag($Tag);
|
$Tag = Misc::sanitize_tag($Tag);
|
||||||
if(!empty($Tag)) {
|
if (!empty($Tag)) {
|
||||||
$TagNames[] = $Tag;
|
$TagNames[] = $Tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$Tags = Misc::get_tags($TagNames);
|
$Tags = Misc::get_tags($TagNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_GET['tags_type']) && !empty($Tags)) {
|
if (empty($_GET['tags_type']) && !empty($Tags)) {
|
||||||
$_GET['tags_type'] = '0';
|
$_GET['tags_type'] = '0';
|
||||||
$SS->set_filter('tagid', array_keys($Tags));
|
$SS->set_filter('tagid', array_keys($Tags));
|
||||||
} elseif(!empty($Tags)) {
|
} elseif (!empty($Tags)) {
|
||||||
foreach(array_keys($Tags) as $Tag) {
|
foreach (array_keys($Tags) as $Tag) {
|
||||||
$SS->set_filter('tagid', array($Tag));
|
$SS->set_filter('tagid', array($Tag));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$_GET['tags_type'] = '1';
|
$_GET['tags_type'] = '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['filter_cat'])) {
|
if (!empty($_GET['filter_cat'])) {
|
||||||
$CategoryArray = array_keys($_GET['filter_cat']);
|
$CategoryArray = array_keys($_GET['filter_cat']);
|
||||||
if(count($CategoryArray) != count($Categories)) {
|
if (count($CategoryArray) != count($Categories)) {
|
||||||
foreach($CategoryArray as $Key => $Index) {
|
foreach ($CategoryArray as $Key => $Index) {
|
||||||
if(!isset($Categories[$Index-1])) {
|
if (!isset($Categories[$Index-1])) {
|
||||||
unset($CategoryArray[$Key]);
|
unset($CategoryArray[$Key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(count($CategoryArray) >= 1) {
|
if (count($CategoryArray) >= 1) {
|
||||||
$SS->set_filter('categoryid', $CategoryArray);
|
$SS->set_filter('categoryid', $CategoryArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['releases'])) {
|
if (!empty($_GET['releases'])) {
|
||||||
$ReleaseArray = $_GET['releases'];
|
$ReleaseArray = $_GET['releases'];
|
||||||
if(count($ReleaseArray) != count($ReleaseTypes)) {
|
if (count($ReleaseArray) != count($ReleaseTypes)) {
|
||||||
foreach($ReleaseArray as $Index => $Value) {
|
foreach ($ReleaseArray as $Index => $Value) {
|
||||||
if(!isset($ReleaseTypes[$Value])) {
|
if (!isset($ReleaseTypes[$Value])) {
|
||||||
unset($ReleaseArray[$Index]);
|
unset($ReleaseArray[$Index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($ReleaseArray) >= 1) {
|
if (count($ReleaseArray) >= 1) {
|
||||||
$SS->set_filter('releasetype', $ReleaseArray);
|
$SS->set_filter('releasetype', $ReleaseArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['formats'])) {
|
if (!empty($_GET['formats'])) {
|
||||||
$FormatArray = $_GET['formats'];
|
$FormatArray = $_GET['formats'];
|
||||||
if(count($FormatArray) != count($Formats)) {
|
if (count($FormatArray) != count($Formats)) {
|
||||||
$FormatNameArray = array();
|
$FormatNameArray = array();
|
||||||
foreach($FormatArray as $Index => $MasterIndex) {
|
foreach ($FormatArray as $Index => $MasterIndex) {
|
||||||
if(isset($Formats[$MasterIndex])) {
|
if (isset($Formats[$MasterIndex])) {
|
||||||
$FormatNameArray[$Index] = '"'.strtr($Formats[$MasterIndex], '-.', ' ').'"';
|
$FormatNameArray[$Index] = '"'.strtr($Formats[$MasterIndex], '-.', ' ').'"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($FormatNameArray) >= 1) {
|
if (count($FormatNameArray) >= 1) {
|
||||||
$Queries[]='@formatlist (any | '.implode(' | ', $FormatNameArray).')';
|
$Queries[]='@formatlist (any | '.implode(' | ', $FormatNameArray).')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['media'])) {
|
if (!empty($_GET['media'])) {
|
||||||
$MediaArray = $_GET['media'];
|
$MediaArray = $_GET['media'];
|
||||||
if(count($MediaArray) != count($Media)) {
|
if (count($MediaArray) != count($Media)) {
|
||||||
$MediaNameArray = array();
|
$MediaNameArray = array();
|
||||||
foreach($MediaArray as $Index => $MasterIndex) {
|
foreach ($MediaArray as $Index => $MasterIndex) {
|
||||||
if(isset($Media[$MasterIndex])) {
|
if (isset($Media[$MasterIndex])) {
|
||||||
$MediaNameArray[$Index] = '"'.strtr($Media[$MasterIndex], '-.', ' ').'"';
|
$MediaNameArray[$Index] = '"'.strtr($Media[$MasterIndex], '-.', ' ').'"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($MediaNameArray) >= 1) {
|
if (count($MediaNameArray) >= 1) {
|
||||||
$Queries[]='@medialist (any | '.implode(' | ', $MediaNameArray).')';
|
$Queries[]='@medialist (any | '.implode(' | ', $MediaNameArray).')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['bitrates'])) {
|
if (!empty($_GET['bitrates'])) {
|
||||||
$BitrateArray = $_GET['bitrates'];
|
$BitrateArray = $_GET['bitrates'];
|
||||||
if(count($BitrateArray) != count($Bitrates)) {
|
if (count($BitrateArray) != count($Bitrates)) {
|
||||||
$BitrateNameArray = array();
|
$BitrateNameArray = array();
|
||||||
foreach($BitrateArray as $Index => $MasterIndex) {
|
foreach ($BitrateArray as $Index => $MasterIndex) {
|
||||||
if(isset($Bitrates[$MasterIndex])) {
|
if (isset($Bitrates[$MasterIndex])) {
|
||||||
$BitrateNameArray[$Index] = '"'.strtr($SS->EscapeString($Bitrates[$MasterIndex]), '-.', ' ').'"';
|
$BitrateNameArray[$Index] = '"'.strtr($SS->EscapeString($Bitrates[$MasterIndex]), '-.', ' ').'"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($BitrateNameArray) >= 1) {
|
if (count($BitrateNameArray) >= 1) {
|
||||||
$Queries[]='@bitratelist (any | '.implode(' | ', $BitrateNameArray).')';
|
$Queries[]='@bitratelist (any | '.implode(' | ', $BitrateNameArray).')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
if (!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
||||||
if(is_number($_GET['requestor'])) {
|
if (is_number($_GET['requestor'])) {
|
||||||
$SS->set_filter('userid', array($_GET['requestor']));
|
$SS->set_filter('userid', array($_GET['requestor']));
|
||||||
} else {
|
} else {
|
||||||
print json_encode(array('status' => 'failure'));
|
print json_encode(array('status' => 'failure'));
|
||||||
@ -201,8 +201,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET['year'])) {
|
if (isset($_GET['year'])) {
|
||||||
if(is_number($_GET['year']) || $_GET['year'] == 0) {
|
if (is_number($_GET['year']) || $_GET['year'] == 0) {
|
||||||
$SS->set_filter('year', array($_GET['year']));
|
$SS->set_filter('year', array($_GET['year']));
|
||||||
} else {
|
} else {
|
||||||
print json_encode(array('status' => 'failure'));
|
print json_encode(array('status' => 'failure'));
|
||||||
@ -210,7 +210,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
if (!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
||||||
$Page = $_GET['page'];
|
$Page = $_GET['page'];
|
||||||
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
|
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
|
||||||
} else {
|
} else {
|
||||||
@ -218,15 +218,15 @@
|
|||||||
$SS->limit(0, REQUESTS_PER_PAGE);
|
$SS->limit(0, REQUESTS_PER_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_GET['order'])) {
|
if (empty($_GET['order'])) {
|
||||||
$CurrentOrder = 'created';
|
$CurrentOrder = 'created';
|
||||||
$CurrentSort = 'desc';
|
$CurrentSort = 'desc';
|
||||||
$Way = SPH_SORT_ATTR_DESC;
|
$Way = SPH_SORT_ATTR_DESC;
|
||||||
$NewSort = 'asc';
|
$NewSort = 'asc';
|
||||||
} else {
|
} else {
|
||||||
if(in_array($_GET['order'], $OrderWays)) {
|
if (in_array($_GET['order'], $OrderWays)) {
|
||||||
$CurrentOrder = $_GET['order'];
|
$CurrentOrder = $_GET['order'];
|
||||||
if($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
if ($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
||||||
$CurrentSort = $_GET['sort'];
|
$CurrentSort = $_GET['sort'];
|
||||||
$Way = ($CurrentSort == 'asc' ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC);
|
$Way = ($CurrentSort == 'asc' ? SPH_SORT_ATTR_ASC : SPH_SORT_ATTR_DESC);
|
||||||
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
||||||
@ -266,10 +266,10 @@
|
|||||||
//print($Way); print($OrderBy); die();
|
//print($Way); print($OrderBy); die();
|
||||||
$SS->SetSortMode($Way, $OrderBy);
|
$SS->SetSortMode($Way, $OrderBy);
|
||||||
|
|
||||||
if(count($Queries) > 0) {
|
if (count($Queries) > 0) {
|
||||||
$Query = implode(' ',$Queries);
|
$Query = implode(' ',$Queries);
|
||||||
} else {
|
} else {
|
||||||
$Query='';
|
$Query = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$SS->set_index('requests requests_delta');
|
$SS->set_index('requests requests_delta');
|
||||||
@ -277,19 +277,19 @@
|
|||||||
$NumResults = $SS->TotalResults;
|
$NumResults = $SS->TotalResults;
|
||||||
//We don't use sphinxapi's default cache searcher, we use our own functions
|
//We don't use sphinxapi's default cache searcher, we use our own functions
|
||||||
|
|
||||||
if(!empty($SphinxResults['notfound'])) {
|
if (!empty($SphinxResults['notfound'])) {
|
||||||
$SQLResults = Requests::get_requests($SphinxResults['notfound']);
|
$SQLResults = Requests::get_requests($SphinxResults['notfound']);
|
||||||
if(is_array($SQLResults['notfound'])) {
|
if (is_array($SQLResults['notfound'])) {
|
||||||
//Something wasn't found in the db, remove it from results
|
//Something wasn't found in the db, remove it from results
|
||||||
reset($SQLResults['notfound']);
|
reset($SQLResults['notfound']);
|
||||||
foreach($SQLResults['notfound'] as $ID) {
|
foreach ($SQLResults['notfound'] as $ID) {
|
||||||
unset($SQLResults['matches'][$ID]);
|
unset($SQLResults['matches'][$ID]);
|
||||||
unset($SphinxResults['matches'][$ID]);
|
unset($SphinxResults['matches'][$ID]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge SQL results with memcached results
|
// Merge SQL results with memcached results
|
||||||
foreach($SQLResults['matches'] as $ID => $SQLResult) {
|
foreach ($SQLResults['matches'] as $ID => $SQLResult) {
|
||||||
$SphinxResults['matches'][$ID] = $SQLResult;
|
$SphinxResults['matches'][$ID] = $SQLResult;
|
||||||
|
|
||||||
//$Requests['matches'][$ID] = array_merge($Requests['matches'][$ID], $SQLResult);
|
//$Requests['matches'][$ID] = array_merge($Requests['matches'][$ID], $SQLResult);
|
||||||
@ -328,14 +328,14 @@
|
|||||||
|
|
||||||
$VoteCount = count($RequestVotes['Voters']);
|
$VoteCount = count($RequestVotes['Voters']);
|
||||||
|
|
||||||
if($CategoryID == 0) {
|
if ($CategoryID == 0) {
|
||||||
$CategoryName = "Unknown";
|
$CategoryName = "Unknown";
|
||||||
} else {
|
} else {
|
||||||
$CategoryName = $Categories[$CategoryID - 1];
|
$CategoryName = $Categories[$CategoryID - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
$JsonArtists = array();
|
$JsonArtists = array();
|
||||||
if($CategoryName == "Music") {
|
if ($CategoryName == "Music") {
|
||||||
$ArtistForm = get_request_artists($RequestID);
|
$ArtistForm = get_request_artists($RequestID);
|
||||||
$JsonArtists = array_values($ArtistForm);
|
$JsonArtists = array_values($ArtistForm);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
|
if (isset($_GET['details'])) {
|
||||||
|
if (in_array($_GET['details'],array('ul','dl','numul','uls','dls'))) {
|
||||||
if(isset($_GET['details'])) {
|
|
||||||
if(in_array($_GET['details'],array('ul','dl','numul','uls','dls'))) {
|
|
||||||
$Details = $_GET['details'];
|
$Details = $_GET['details'];
|
||||||
} else {
|
} else {
|
||||||
print json_encode(array('status' => 'failure'));
|
print json_encode(array('status' => 'failure'));
|
||||||
@ -16,7 +14,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,
|
||||||
u.Username,
|
u.Username,
|
||||||
ui.JoinDate,
|
ui.JoinDate,
|
||||||
@ -29,54 +28,54 @@
|
|||||||
JOIN users_info AS ui ON ui.UserID = u.ID
|
JOIN users_info AS ui ON ui.UserID = u.ID
|
||||||
LEFT JOIN torrents AS t ON t.UserID=u.ID
|
LEFT JOIN torrents AS t ON t.UserID=u.ID
|
||||||
WHERE u.Enabled='1'
|
WHERE u.Enabled='1'
|
||||||
AND Uploaded>'". 5*1024*1024*1024 ."'
|
AND Uploaded>'". 5 * 1024 * 1024 * 1024 ."'
|
||||||
AND Downloaded>'". 5*1024*1024*1024 ."'
|
AND Downloaded>'". 5 * 1024 * 1024 * 1024 ."'
|
||||||
AND (Paranoia IS NULL OR (Paranoia NOT LIKE '%\"uploaded\"%' AND Paranoia NOT LIKE '%\"downloaded\"%'))
|
AND (Paranoia IS NULL OR (Paranoia NOT LIKE '%\"uploaded\"%' AND Paranoia NOT LIKE '%\"downloaded\"%'))
|
||||||
GROUP BY u.ID";
|
GROUP BY u.ID";
|
||||||
|
|
||||||
$OuterResults = array();
|
$OuterResults = array();
|
||||||
|
|
||||||
if($Details == 'all' || $Details == 'ul') {
|
if ($Details == 'all' || $Details == 'ul') {
|
||||||
if (!$TopUserUploads = $Cache->get_value('topuser_ul_'.$Limit)) {
|
if (!$TopUserUploads = $Cache->get_value('topuser_ul_'.$Limit)) {
|
||||||
$DB->query("$BaseQuery ORDER BY u.Uploaded DESC LIMIT $Limit;");
|
$DB->query("$BaseQuery ORDER BY u.Uploaded DESC LIMIT $Limit;");
|
||||||
$TopUserUploads = $DB->to_array();
|
$TopUserUploads = $DB->to_array();
|
||||||
$Cache->cache_value('topuser_ul_'.$Limit,$TopUserUploads,3600*12);
|
$Cache->cache_value('topuser_ul_'.$Limit,$TopUserUploads,3600 * 12);
|
||||||
}
|
}
|
||||||
$OuterResults[] = generate_user_json('Uploaders', 'ul', $TopUserUploads, $Limit);
|
$OuterResults[] = generate_user_json('Uploaders', 'ul', $TopUserUploads, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details == 'all' || $Details == 'dl') {
|
if ($Details == 'all' || $Details == 'dl') {
|
||||||
if (!$TopUserDownloads = $Cache->get_value('topuser_dl_'.$Limit)) {
|
if (!$TopUserDownloads = $Cache->get_value('topuser_dl_'.$Limit)) {
|
||||||
$DB->query("$BaseQuery ORDER BY u.Downloaded DESC LIMIT $Limit;");
|
$DB->query("$BaseQuery ORDER BY u.Downloaded DESC LIMIT $Limit;");
|
||||||
$TopUserDownloads = $DB->to_array();
|
$TopUserDownloads = $DB->to_array();
|
||||||
$Cache->cache_value('topuser_dl_'.$Limit,$TopUserDownloads,3600*12);
|
$Cache->cache_value('topuser_dl_'.$Limit,$TopUserDownloads,3600 * 12);
|
||||||
}
|
}
|
||||||
$OuterResults[] = generate_user_json('Downloaders', 'dl', $TopUserDownloads, $Limit);
|
$OuterResults[] = generate_user_json('Downloaders', 'dl', $TopUserDownloads, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details == 'all' || $Details == 'numul') {
|
if ($Details == 'all' || $Details == 'numul') {
|
||||||
if (!$TopUserNumUploads = $Cache->get_value('topuser_numul_'.$Limit)) {
|
if (!$TopUserNumUploads = $Cache->get_value('topuser_numul_'.$Limit)) {
|
||||||
$DB->query("$BaseQuery ORDER BY NumUploads DESC LIMIT $Limit;");
|
$DB->query("$BaseQuery ORDER BY NumUploads DESC LIMIT $Limit;");
|
||||||
$TopUserNumUploads = $DB->to_array();
|
$TopUserNumUploads = $DB->to_array();
|
||||||
$Cache->cache_value('topuser_numul_'.$Limit,$TopUserNumUploads,3600*12);
|
$Cache->cache_value('topuser_numul_'.$Limit,$TopUserNumUploads,3600 * 12);
|
||||||
}
|
}
|
||||||
$OuterResults[] = generate_user_json('Torrents Uploaded', 'numul', $TopUserNumUploads, $Limit);
|
$OuterResults[] = generate_user_json('Torrents Uploaded', 'numul', $TopUserNumUploads, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details == 'all' || $Details == 'uls') {
|
if ($Details == 'all' || $Details == 'uls') {
|
||||||
if (!$TopUserUploadSpeed = $Cache->get_value('topuser_ulspeed_'.$Limit)) {
|
if (!$TopUserUploadSpeed = $Cache->get_value('topuser_ulspeed_'.$Limit)) {
|
||||||
$DB->query("$BaseQuery ORDER BY UpSpeed DESC LIMIT $Limit;");
|
$DB->query("$BaseQuery ORDER BY UpSpeed DESC LIMIT $Limit;");
|
||||||
$TopUserUploadSpeed = $DB->to_array();
|
$TopUserUploadSpeed = $DB->to_array();
|
||||||
$Cache->cache_value('topuser_ulspeed_'.$Limit,$TopUserUploadSpeed,3600*12);
|
$Cache->cache_value('topuser_ulspeed_'.$Limit,$TopUserUploadSpeed,3600 * 12);
|
||||||
}
|
}
|
||||||
$OuterResults[] = generate_user_json('Fastest Uploaders', 'uls', $TopUserUploadSpeed, $Limit);
|
$OuterResults[] = generate_user_json('Fastest Uploaders', 'uls', $TopUserUploadSpeed, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details == 'all' || $Details == 'dls') {
|
if ($Details == 'all' || $Details == 'dls') {
|
||||||
if (!$TopUserDownloadSpeed = $Cache->get_value('topuser_dlspeed_'.$Limit)) {
|
if (!$TopUserDownloadSpeed = $Cache->get_value('topuser_dlspeed_'.$Limit)) {
|
||||||
$DB->query("$BaseQuery ORDER BY DownSpeed DESC LIMIT $Limit;");
|
$DB->query("$BaseQuery ORDER BY DownSpeed DESC LIMIT $Limit;");
|
||||||
$TopUserDownloadSpeed = $DB->to_array();
|
$TopUserDownloadSpeed = $DB->to_array();
|
||||||
$Cache->cache_value('topuser_dlspeed_'.$Limit,$TopUserDownloadSpeed,3600*12);
|
$Cache->cache_value('topuser_dlspeed_'.$Limit,$TopUserDownloadSpeed,3600 * 12);
|
||||||
}
|
}
|
||||||
$OuterResults[] = generate_user_json('Fastest Downloaders', 'dls', $TopUserDownloadSpeed, $Limit);
|
$OuterResults[] = generate_user_json('Fastest Downloaders', 'dls', $TopUserDownloadSpeed, $Limit);
|
||||||
}
|
}
|
||||||
@ -91,7 +90,7 @@
|
|||||||
|
|
||||||
function generate_user_json($Caption, $Tag, $Details, $Limit) {
|
function generate_user_json($Caption, $Tag, $Details, $Limit) {
|
||||||
$results = array();
|
$results = array();
|
||||||
foreach($Details as $Details) {
|
foreach ($Details as $Details) {
|
||||||
$results[] = array(
|
$results[] = array(
|
||||||
'id' => (int) $Detail['ID'],
|
'id' => (int) $Detail['ID'],
|
||||||
'username' => $Detail['Username'],
|
'username' => $Detail['Username'],
|
||||||
|
@ -11,8 +11,7 @@
|
|||||||
array('status' => 'failure')
|
array('status' => 'failure')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
print json_encode(
|
print json_encode(
|
||||||
array('status' => 'failure')
|
array('status' => 'failure')
|
||||||
);
|
);
|
||||||
|
@ -13,7 +13,7 @@ function error_out($reason = '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($LoggedUser['DisableForums'])) {
|
if (!empty($LoggedUser['DisableForums'])) {
|
||||||
error_out("You do not have access to the forums!");
|
error_out('You do not have access to the forums!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ function error_out($reason = '') {
|
|||||||
|
|
||||||
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
|
$UserID = empty($_GET['userid']) ? $LoggedUser['ID'] : $_GET['userid'];
|
||||||
if (!is_number($UserID)) {
|
if (!is_number($UserID)) {
|
||||||
error_out("User does not exist!");
|
error_out('User does not exist!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($LoggedUser['PostsPerPage'])) {
|
if (isset($LoggedUser['PostsPerPage'])) {
|
||||||
@ -47,7 +47,7 @@ function error_out($reason = '') {
|
|||||||
WHERE m.ID = $UserID");
|
WHERE m.ID = $UserID");
|
||||||
|
|
||||||
if ($DB->record_count() == 0){ // If user doesn't exist
|
if ($DB->record_count() == 0){ // If user doesn't exist
|
||||||
error_out("User does not exist!");
|
error_out('User does not exist!');
|
||||||
}
|
}
|
||||||
list($Username, $Enabled, $Title, $Avatar, $Donor, $Warned) = $DB->next_record();
|
list($Username, $Enabled, $Title, $Avatar, $Donor, $Warned) = $DB->next_record();
|
||||||
} else {
|
} else {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//~~~~~~~~~~~ Main artist page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
//~~~~~~~~~~~ Main artist page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
//For sorting tags
|
//For sorting tags
|
||||||
function compare($X, $Y){
|
function compare($X, $Y) {
|
||||||
return($Y['count'] - $X['count']);
|
return($Y['count'] - $X['count']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,12 +18,14 @@ function compare($X, $Y){
|
|||||||
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
|
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
|
||||||
|
|
||||||
$ArtistID = $_GET['id'];
|
$ArtistID = $_GET['id'];
|
||||||
if(!is_number($ArtistID)) { error(0); }
|
if (!is_number($ArtistID)) {
|
||||||
|
error(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!empty($_GET['revisionid'])) { // if they're viewing an old revision
|
if (!empty($_GET['revisionid'])) { // if they're viewing an old revision
|
||||||
$RevisionID=$_GET['revisionid'];
|
$RevisionID=$_GET['revisionid'];
|
||||||
if(!is_number($RevisionID)) {
|
if (!is_number($RevisionID)) {
|
||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
$Data = $Cache->get_value("artist_$ArtistID"."_revision_$RevisionID", true);
|
$Data = $Cache->get_value("artist_$ArtistID"."_revision_$RevisionID", true);
|
||||||
@ -32,7 +34,7 @@ function compare($X, $Y){
|
|||||||
$RevisionID = false;
|
$RevisionID = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Data) {
|
if ($Data) {
|
||||||
if (!is_array($Data)) {
|
if (!is_array($Data)) {
|
||||||
$Data = unserialize($Data);
|
$Data = unserialize($Data);
|
||||||
}
|
}
|
||||||
@ -60,7 +62,9 @@ function compare($X, $Y){
|
|||||||
$sql .= " GROUP BY a.ArtistID";
|
$sql .= " GROUP BY a.ArtistID";
|
||||||
$DB->query($sql);
|
$DB->query($sql);
|
||||||
|
|
||||||
if($DB->record_count()==0) { error(404); }
|
if ($DB->record_count() == 0) {
|
||||||
|
error(404);
|
||||||
|
}
|
||||||
|
|
||||||
list($Name, $Image, $Body, $VanityHouseArtist) = $DB->next_record(MYSQLI_NUM, array(0));
|
list($Name, $Image, $Body, $VanityHouseArtist) = $DB->next_record(MYSQLI_NUM, array(0));
|
||||||
}
|
}
|
||||||
@ -72,7 +76,7 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
// Requests
|
// Requests
|
||||||
$Requests = $Cache->get_value('artists_requests_'.$ArtistID);
|
$Requests = $Cache->get_value('artists_requests_'.$ArtistID);
|
||||||
if(!is_array($Requests)) {
|
if (!is_array($Requests)) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
r.ID,
|
r.ID,
|
||||||
r.CategoryID,
|
r.CategoryID,
|
||||||
@ -89,7 +93,7 @@ function compare($X, $Y){
|
|||||||
GROUP BY r.ID
|
GROUP BY r.ID
|
||||||
ORDER BY Votes DESC");
|
ORDER BY Votes DESC");
|
||||||
|
|
||||||
if($DB->record_count() > 0) {
|
if ($DB->record_count() > 0) {
|
||||||
$Requests = $DB->to_array();
|
$Requests = $DB->to_array();
|
||||||
} else {
|
} else {
|
||||||
$Requests = array();
|
$Requests = array();
|
||||||
@ -206,7 +210,7 @@ function compare($X, $Y){
|
|||||||
if (!empty($UsedReleases)) { ?>
|
if (!empty($UsedReleases)) { ?>
|
||||||
<div class="box center">
|
<div class="box center">
|
||||||
<?
|
<?
|
||||||
foreach($UsedReleases as $ReleaseID) {
|
foreach ($UsedReleases as $ReleaseID) {
|
||||||
switch($ReleaseTypes[$ReleaseID]) {
|
switch($ReleaseTypes[$ReleaseID]) {
|
||||||
case "Remix" :
|
case "Remix" :
|
||||||
$DisplayName = "Remixes";
|
$DisplayName = "Remixes";
|
||||||
@ -295,7 +299,7 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
$TorrentTags = new Tags($TagList, false);
|
$TorrentTags = new Tags($TagList, false);
|
||||||
|
|
||||||
if($ReleaseType!=$LastReleaseType) {
|
if ($ReleaseType != $LastReleaseType) {
|
||||||
switch($ReleaseTypes[$ReleaseType]) {
|
switch($ReleaseTypes[$ReleaseType]) {
|
||||||
case "Remix" :
|
case "Remix" :
|
||||||
$DisplayName = "Remixes";
|
$DisplayName = "Remixes";
|
||||||
@ -312,7 +316,7 @@ function compare($X, $Y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ReleaseTypeLabel = strtolower(str_replace(' ','_',$ReleaseTypes[$ReleaseType]));
|
$ReleaseTypeLabel = strtolower(str_replace(' ','_',$ReleaseTypes[$ReleaseType]));
|
||||||
if($OpenTable) { ?>
|
if ($OpenTable) { ?>
|
||||||
</table>
|
</table>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<table class="torrent_table grouped release_table" id="torrents_<?=$ReleaseTypeLabel?>">
|
<table class="torrent_table grouped release_table" id="torrents_<?=$ReleaseTypeLabel?>">
|
||||||
@ -330,7 +334,7 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
|
|
||||||
$DisplayName ='<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
$DisplayName ='<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||||
if(check_perms('users_mod') || check_perms('torrents_fix_ghosts')) {
|
if (check_perms('users_mod') || check_perms('torrents_fix_ghosts')) {
|
||||||
$DisplayName .= ' <a href="torrents.php?action=fix_group&groupid='.$GroupID.'&artistid='.$ArtistID.'&auth='.$LoggedUser['AuthKey'].'" class="brackets" title="Fix ghost DB entry">Fix</a>';
|
$DisplayName .= ' <a href="torrents.php?action=fix_group&groupid='.$GroupID.'&artistid='.$ArtistID.'&auth='.$LoggedUser['AuthKey'].'" class="brackets" title="Fix ghost DB entry">Fix</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +348,7 @@ function compare($X, $Y){
|
|||||||
unset($ExtendedArtists[2]);
|
unset($ExtendedArtists[2]);
|
||||||
unset($ExtendedArtists[3]);
|
unset($ExtendedArtists[3]);
|
||||||
$DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName;
|
$DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName;
|
||||||
} elseif(count($GroupArtists)>0) {
|
} elseif (count($GroupArtists) > 0) {
|
||||||
$DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName;
|
$DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -354,7 +358,7 @@ function compare($X, $Y){
|
|||||||
unset($ExtendedArtists[3]);
|
unset($ExtendedArtists[3]);
|
||||||
unset($ExtendedArtists[6]);
|
unset($ExtendedArtists[6]);
|
||||||
$DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName;
|
$DisplayName = Artists::display_artists($ExtendedArtists).$DisplayName;
|
||||||
} elseif(count($GroupArtists)>0) {
|
} elseif (count($GroupArtists) > 0) {
|
||||||
$DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName;
|
$DisplayName = Artists::display_artists(array(1 => $Artists), true, true).$DisplayName;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -364,9 +368,13 @@ function compare($X, $Y){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($GroupYear>0) { $DisplayName = $GroupYear. ' - '.$DisplayName; }
|
if ($GroupYear > 0) {
|
||||||
|
$DisplayName = $GroupYear. ' - '.$DisplayName;
|
||||||
|
}
|
||||||
|
|
||||||
if($GroupVanityHouse) { $DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]'; }
|
if ($GroupVanityHouse) {
|
||||||
|
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
|
||||||
|
}
|
||||||
|
|
||||||
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
|
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
|
||||||
?>
|
?>
|
||||||
@ -410,8 +418,9 @@ function compare($X, $Y){
|
|||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
|
|
||||||
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
if ($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] !=
|
||||||
|
$LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||||
|
|
||||||
$EditionID++;
|
$EditionID++;
|
||||||
|
|
||||||
@ -445,7 +454,7 @@ function compare($X, $Y){
|
|||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty($TorrentList)) { ?>
|
if (!empty($TorrentList)) { ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?}
|
<?}
|
||||||
@ -481,7 +490,7 @@ function compare($X, $Y){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Bookmarks::has_bookmarked('artist', $ArtistID)) {
|
if (Bookmarks::has_bookmarked('artist', $ArtistID)) {
|
||||||
?>
|
?>
|
||||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Unbookmark('artist', <?=$ArtistID?>,'Bookmark');return false;" class="brackets">Remove bookmark</a>
|
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Unbookmark('artist', <?=$ArtistID?>,'Bookmark');return false;" class="brackets">Remove bookmark</a>
|
||||||
|
|
||||||
@ -490,12 +499,12 @@ function compare($X, $Y){
|
|||||||
?>
|
?>
|
||||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Bookmark('artist', <?=$ArtistID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
|
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Bookmark('artist', <?=$ArtistID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!-- <a href="#" id="recommend" class="brackets">Recommend</a>
|
<!-- <a href="#" id="recommend" class="brackets">Recommend</a>
|
||||||
-->
|
-->
|
||||||
<?
|
<?
|
||||||
if (check_perms('site_edit_wiki')) {
|
if (check_perms('site_edit_wiki')) {
|
||||||
?>
|
?>
|
||||||
<a href="artist.php?action=edit&artistid=<?=$ArtistID?>" class="brackets">Edit</a>
|
<a href="artist.php?action=edit&artistid=<?=$ArtistID?>" class="brackets">Edit</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -509,7 +518,7 @@ function compare($X, $Y){
|
|||||||
<a href="artist.php?action=delete&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Delete</a>
|
<a href="artist.php?action=delete&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Delete</a>
|
||||||
<? }
|
<? }
|
||||||
|
|
||||||
if ($RevisionID && check_perms('site_edit_wiki')) {
|
if ($RevisionID && check_perms('site_edit_wiki')) {
|
||||||
?>
|
?>
|
||||||
<a href="artist.php?action=revert&artistid=<?=$ArtistID?>&revisionid=<?=$RevisionID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">
|
<a href="artist.php?action=revert&artistid=<?=$ArtistID?>&revisionid=<?=$RevisionID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">
|
||||||
Revert to this revision
|
Revert to this revision
|
||||||
@ -519,10 +528,10 @@ function compare($X, $Y){
|
|||||||
</div>
|
</div>
|
||||||
<? /* Misc::display_recommend($ArtistID, "artist"); */ ?>
|
<? /* Misc::display_recommend($ArtistID, "artist"); */ ?>
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<? if($Image) { ?>
|
<? if ($Image) { ?>
|
||||||
<div class="box box_image">
|
<div class="box box_image">
|
||||||
<div class="head"><strong><?=$Name?></strong></div>
|
<div class="head"><strong><?=$Name?></strong></div>
|
||||||
<div style="text-align:center;padding:10px 0px;">
|
<div style="text-align: center; padding: 10px 0px;">
|
||||||
<img style="max-width: 220px;" src="<?=ImageTools::thumbnail($Image)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=$Image?>',220);" />
|
<img style="max-width: 220px;" src="<?=ImageTools::thumbnail($Image)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=$Image?>',220);" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -543,8 +552,8 @@ function compare($X, $Y){
|
|||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if(check_perms('zip_downloader')){
|
if (check_perms('zip_downloader')) {
|
||||||
if(isset($LoggedUser['Collector'])) {
|
if (isset($LoggedUser['Collector'])) {
|
||||||
list($ZIPList,$ZIPPrefs) = $LoggedUser['Collector'];
|
list($ZIPList,$ZIPPrefs) = $LoggedUser['Collector'];
|
||||||
$ZIPList = explode(':',$ZIPList);
|
$ZIPList = explode(':',$ZIPList);
|
||||||
} else {
|
} else {
|
||||||
@ -563,40 +572,40 @@ function compare($X, $Y){
|
|||||||
<? foreach ($ZIPList as $ListItem) { ?>
|
<? foreach ($ZIPList as $ListItem) { ?>
|
||||||
<li id="list<?=$ListItem?>">
|
<li id="list<?=$ListItem?>">
|
||||||
<input type="hidden" name="list[]" value="<?=$ListItem?>" />
|
<input type="hidden" name="list[]" value="<?=$ListItem?>" />
|
||||||
<span style="float:left;"><?=$ZIPOptions[$ListItem]['2']?></span>
|
<span style="float: left;"><?=$ZIPOptions[$ListItem]['2']?></span>
|
||||||
<span class="remove remove_collector"><a href="#" onclick="remove_selection('<?=$ListItem?>');return false;" style="float:right;" class="brackets" title="Remove format from the Collector">X</a></span>
|
<span class="remove remove_collector"><a href="#" onclick="remove_selection('<?=$ListItem?>');return false;" style="float: right;" class="brackets" title="Remove format from the Collector">X</a></span>
|
||||||
<br style="clear:all;" />
|
<br style="clear: all;" />
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<select id="formats" style="width:180px">
|
<select id="formats" style="width: 180px;">
|
||||||
<?
|
<?
|
||||||
$OpenGroup = false;
|
$OpenGroup = false;
|
||||||
$LastGroupID=-1;
|
$LastGroupID = -1;
|
||||||
|
|
||||||
foreach ($ZIPOptions as $Option) {
|
foreach ($ZIPOptions as $Option) {
|
||||||
list($GroupID,$OptionID,$OptName) = $Option;
|
list($GroupID,$OptionID,$OptName) = $Option;
|
||||||
|
|
||||||
if($GroupID!=$LastGroupID) {
|
if ($GroupID != $LastGroupID) {
|
||||||
$LastGroupID=$GroupID;
|
$LastGroupID = $GroupID;
|
||||||
if($OpenGroup) { ?>
|
if ($OpenGroup) { ?>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<optgroup label="<?=$ZIPGroups[$GroupID]?>">
|
<optgroup label="<?=$ZIPGroups[$GroupID]?>">
|
||||||
<? $OpenGroup = true;
|
<? $OpenGroup = true;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if(in_array($GroupID.$OptionID,$ZIPList)){ echo ' disabled="disabled"'; }?>><?=$OptName?></option>
|
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID,$ZIPList)){ echo ' disabled="disabled"'; }?>><?=$OptName?></option>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
<button type="button" onclick="add_selection()">+</button>
|
<button type="button" onclick="add_selection()">+</button>
|
||||||
<select name="preference" style="width:210px">
|
<select name="preference" style="width: 210px">
|
||||||
<option value="0"<? if($ZIPPrefs==0){ echo ' selected="selected"'; } ?>>Prefer Original</option>
|
<option value="0"<? if ($ZIPPrefs == 0){ echo ' selected="selected"'; } ?>>Prefer Original</option>
|
||||||
<option value="1"<? if($ZIPPrefs==1){ echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
|
<option value="1"<? if ($ZIPPrefs == 1){ echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
|
||||||
<option value="2"<? if($ZIPPrefs==2){ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
|
<option value="2"<? if ($ZIPPrefs == 2){ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" style="width:210px" value="Download" />
|
<input type="submit" style="width:210px" value="Download" />
|
||||||
</form>
|
</form>
|
||||||
@ -628,7 +637,7 @@ function compare($X, $Y){
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
|
|
||||||
if(empty($SimilarArray)) {
|
if (empty($SimilarArray)) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
s2.ArtistID,
|
s2.ArtistID,
|
||||||
@ -651,14 +660,14 @@ function compare($X, $Y){
|
|||||||
<div class="head"><strong>Similar artists</strong></div>
|
<div class="head"><strong>Similar artists</strong></div>
|
||||||
<ul class="stats nobullet">
|
<ul class="stats nobullet">
|
||||||
<?
|
<?
|
||||||
if($NumSimilar == 0) { ?>
|
if ($NumSimilar == 0) { ?>
|
||||||
<li><span style="font-style: italic;">None found</span></li>
|
<li><span style="font-style: italic;">None found</span></li>
|
||||||
<? }
|
<? }
|
||||||
$First = true;
|
$First = true;
|
||||||
foreach ($SimilarArray as $SimilarArtist) {
|
foreach ($SimilarArray as $SimilarArtist) {
|
||||||
list($Artist2ID, $Artist2Name, $Score, $SimilarID) = $SimilarArtist;
|
list($Artist2ID, $Artist2Name, $Score, $SimilarID) = $SimilarArtist;
|
||||||
$Score = $Score/100;
|
$Score = $Score / 100;
|
||||||
if($First) {
|
if ($First) {
|
||||||
$Max = $Score + 1;
|
$Max = $Score + 1;
|
||||||
$First = false;
|
$First = false;
|
||||||
}
|
}
|
||||||
@ -667,11 +676,11 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<span title="<?=$Score?>"><a href="artist.php?id=<?=$Artist2ID?>" style="float:left; display:block;"><?=$Artist2Name?></a></span>
|
<span title="<?=$Score?>"><a href="artist.php?id=<?=$Artist2ID?>" style="float: left; display: block;"><?=$Artist2Name?></a></span>
|
||||||
<div style="float:right; display:block; letter-spacing: -1px;">
|
<div style="float: right; display: block; letter-spacing: -1px;">
|
||||||
<a href="artist.php?action=vote_similar&artistid=<?=$ArtistID?>&similarid=<?=$SimilarID?>&way=down" style="font-family: monospace;" title="Vote down this similar artist. Use this when you feel that the two artists are not all that similar." class="brackets">−</a>
|
<a href="artist.php?action=vote_similar&artistid=<?=$ArtistID?>&similarid=<?=$SimilarID?>&way=down" style="font-family: monospace;" title="Vote down this similar artist. Use this when you feel that the two artists are not all that similar." class="brackets">−</a>
|
||||||
<a href="artist.php?action=vote_similar&artistid=<?=$ArtistID?>&similarid=<?=$SimilarID?>&way=up" style="font-family: monospace;" title="Vote up this similar artist. Use this when you feel that the two artists are quite similar." class="brackets">+</a>
|
<a href="artist.php?action=vote_similar&artistid=<?=$ArtistID?>&similarid=<?=$SimilarID?>&way=up" style="font-family: monospace;" title="Vote up this similar artist. Use this when you feel that the two artists are quite similar." class="brackets">+</a>
|
||||||
<? if(check_perms('site_delete_tag')) { ?>
|
<? if (check_perms('site_delete_tag')) { ?>
|
||||||
<span class="remove remove_artist"><a href="artist.php?action=delete_similar&similarid=<?=$SimilarID?>&auth=<?=$LoggedUser['AuthKey']?>" title="Remove this similar artist" class="brackets">X</a></span>
|
<span class="remove remove_artist"><a href="artist.php?action=delete_similar&similarid=<?=$SimilarID?>&auth=<?=$LoggedUser['AuthKey']?>" title="Remove this similar artist" class="brackets">X</a></span>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</div>
|
</div>
|
||||||
@ -700,7 +709,7 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
echo $TorrentDisplayList;
|
echo $TorrentDisplayList;
|
||||||
|
|
||||||
if($NumRequests > 0) {
|
if ($NumRequests > 0) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<table cellpadding="6" cellspacing="1" border="0" class="request_table border" width="100%" id="requests">
|
<table cellpadding="6" cellspacing="1" border="0" class="request_table border" width="100%" id="requests">
|
||||||
@ -720,16 +729,16 @@ function compare($X, $Y){
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
foreach($Requests as $Request) {
|
foreach ($Requests as $Request) {
|
||||||
list($RequestID, $CategoryID, $Title, $Year, $TimeAdded, $Votes, $Bounty) = $Request;
|
list($RequestID, $CategoryID, $Title, $Year, $TimeAdded, $Votes, $Bounty) = $Request;
|
||||||
|
|
||||||
$CategoryName = $Categories[$CategoryID - 1];
|
$CategoryName = $Categories[$CategoryID - 1];
|
||||||
|
|
||||||
if($CategoryName == "Music") {
|
if ($CategoryName == "Music") {
|
||||||
$ArtistForm = get_request_artists($RequestID);
|
$ArtistForm = get_request_artists($RequestID);
|
||||||
$ArtistLink = Artists::display_artists($ArtistForm, true, true);
|
$ArtistLink = Artists::display_artists($ArtistForm, true, true);
|
||||||
$FullName = $ArtistLink."<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
$FullName = $ArtistLink."<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
||||||
} else if($CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
|
} elseif ($CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
|
||||||
$FullName = "<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
$FullName = "<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
||||||
} else {
|
} else {
|
||||||
$FullName ="<a href='requests.php?action=view&id=".$RequestID."'>".$Title."</a>";
|
$FullName ="<a href='requests.php?action=view&id=".$RequestID."'>".$Title."</a>";
|
||||||
@ -739,7 +748,7 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
$Tags = get_request_tags($RequestID);
|
$Tags = get_request_tags($RequestID);
|
||||||
$ReqTagList = array();
|
$ReqTagList = array();
|
||||||
foreach($Tags as $TagID => $TagName) {
|
foreach ($Tags as $TagID => $TagName) {
|
||||||
$ReqTagList[] = "<a href='requests.php?tags=".$TagName."'>".display_str($TagName)."</a>";
|
$ReqTagList[] = "<a href='requests.php?tags=".$TagName."'>".display_str($TagName)."</a>";
|
||||||
}
|
}
|
||||||
$ReqTagList = implode(', ', $ReqTagList);
|
$ReqTagList = implode(', ', $ReqTagList);
|
||||||
@ -751,7 +760,7 @@ function compare($X, $Y){
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span id="vote_count_<?=$RequestID?>"><?=$Votes?></span>
|
<span id="vote_count_<?=$RequestID?>"><?=$Votes?></span>
|
||||||
<? if(check_perms('site_vote')){ ?>
|
<? if (check_perms('site_vote')){ ?>
|
||||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets"><strong>+</strong></a>
|
<a href="javascript:Vote(0, <?=$RequestID?>)" class="brackets"><strong>+</strong></a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -770,15 +779,15 @@ function compare($X, $Y){
|
|||||||
|
|
||||||
// Similar artist map
|
// Similar artist map
|
||||||
|
|
||||||
if($NumSimilar>0) {
|
if ($NumSimilar > 0) {
|
||||||
if($SimilarData = $Cache->get_value('similar_positions_'.$ArtistID)) {
|
if ($SimilarData = $Cache->get_value('similar_positions_'.$ArtistID)) {
|
||||||
$Similar = new ARTISTS_SIMILAR($ArtistID, $Name);
|
$Similar = new ARTISTS_SIMILAR($ArtistID, $Name);
|
||||||
$Similar->load_data($SimilarData);
|
$Similar->load_data($SimilarData);
|
||||||
if(!(current($Similar->Artists)->NameLength)) {
|
if (!(current($Similar->Artists)->NameLength)) {
|
||||||
unset($Similar);
|
unset($Similar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(empty($Similar) || empty($Similar->Artists)) {
|
if (empty($Similar) || empty($Similar->Artists)) {
|
||||||
include(SERVER_ROOT.'/classes/class_image.php');
|
include(SERVER_ROOT.'/classes/class_image.php');
|
||||||
$Img = new IMAGE;
|
$Img = new IMAGE;
|
||||||
$Img->create(WIDTH, HEIGHT);
|
$Img->create(WIDTH, HEIGHT);
|
||||||
@ -820,13 +829,13 @@ function compare($X, $Y){
|
|||||||
function flipView() {
|
function flipView() {
|
||||||
var state = document.getElementById('flip_view_1').style.display == 'block';
|
var state = document.getElementById('flip_view_1').style.display == 'block';
|
||||||
|
|
||||||
if(state) {
|
if (state) {
|
||||||
document.getElementById('flip_view_1').style.display='none';
|
document.getElementById('flip_view_1').style.display='none';
|
||||||
document.getElementById('flip_view_2').style.display='block';
|
document.getElementById('flip_view_2').style.display='block';
|
||||||
document.getElementById('flipper_title').innerHTML = 'Similar artist cloud';
|
document.getElementById('flipper_title').innerHTML = 'Similar artist cloud';
|
||||||
document.getElementById('flip_to').innerHTML = 'Switch to map';
|
document.getElementById('flip_to').innerHTML = 'Switch to map';
|
||||||
|
|
||||||
if(!cloudLoaded) {
|
if (!cloudLoaded) {
|
||||||
require("static/functions/jquery.js", function () {
|
require("static/functions/jquery.js", function () {
|
||||||
require("static/functions/tagcanvas.js", function () {
|
require("static/functions/tagcanvas.js", function () {
|
||||||
require("static/functions/artist_cloud.js", function () {
|
require("static/functions/artist_cloud.js", function () {
|
||||||
@ -882,7 +891,7 @@ function require(file, callback) {
|
|||||||
|
|
||||||
// gets the amount of comments for this group
|
// gets the amount of comments for this group
|
||||||
$Results = $Cache->get_value('artist_comments_'.$ArtistID);
|
$Results = $Cache->get_value('artist_comments_'.$ArtistID);
|
||||||
if($Results === false) {
|
if ($Results === false) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
COUNT(c.ID)
|
COUNT(c.ID)
|
||||||
FROM artist_comments as c
|
FROM artist_comments as c
|
||||||
@ -891,7 +900,7 @@ function require(file, callback) {
|
|||||||
$Cache->cache_value('artist_comments_'.$ArtistID, $Results, 0);
|
$Cache->cache_value('artist_comments_'.$ArtistID, $Results, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
||||||
$DB->query("SELECT COUNT(ID) FROM artist_comments WHERE ArtistID = $ArtistID AND ID <= $_GET[postid]");
|
$DB->query("SELECT COUNT(ID) FROM artist_comments WHERE ArtistID = $ArtistID AND ID <= $_GET[postid]");
|
||||||
list($PostNum) = $DB->next_record();
|
list($PostNum) = $DB->next_record();
|
||||||
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
|
list($Page,$Limit) = Format::page_limit(TORRENT_COMMENTS_PER_PAGE,$PostNum);
|
||||||
@ -907,7 +916,7 @@ function require(file, callback) {
|
|||||||
|
|
||||||
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
|
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
|
||||||
$Catalogue = $Cache->get_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID);
|
$Catalogue = $Cache->get_value('artist_comments_'.$ArtistID.'_catalogue_'.$CatalogueID);
|
||||||
if($Catalogue === false) {
|
if ($Catalogue === false) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
c.ID,
|
c.ID,
|
||||||
c.AuthorID,
|
c.AuthorID,
|
||||||
@ -938,7 +947,7 @@ function require(file, callback) {
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
//---------- Begin printing
|
//---------- Begin printing
|
||||||
foreach($Thread as $Key => $Post) {
|
foreach ($Thread as $Key => $Post) {
|
||||||
list($PostID, $AuthorID, $AddedTime, $CommentBody, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
list($PostID, $AuthorID, $AddedTime, $CommentBody, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||||
?>
|
?>
|
||||||
|
@ -28,16 +28,15 @@
|
|||||||
<a href="#">↑</a> <strong>Upcoming concerts</strong>
|
<a href="#">↑</a> <strong>Upcoming concerts</strong>
|
||||||
<a href="#" class="brackets" onclick="$('#concertsbody').toggle(); return false;">Toggle</a>
|
<a href="#" class="brackets" onclick="$('#concertsbody').toggle(); return false;">Toggle</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="concertsbody"<?=$Hidden ? ' class="hidden"' : ''?>>
|
<div id="concertsbody"<?=$Hidden ? ' class="hidden"' : '' ?>>
|
||||||
<?=$Concerts?>
|
<?=$Concerts?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
function make_concert_link($Event)
|
function make_concert_link($Event) {
|
||||||
{
|
|
||||||
// The event doesn't have a start date (this should never happen)
|
// The event doesn't have a start date (this should never happen)
|
||||||
if ($Event['startDate'] == "") {
|
if ($Event['startDate'] == '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$Date = get_date_title($Event['startDate']);
|
$Date = get_date_title($Event['startDate']);
|
||||||
@ -46,22 +45,21 @@ function make_concert_link($Event)
|
|||||||
$Concert = "<a href='" . $Event['url'] . "'>" . $ConcertTitle . "</a>";
|
$Concert = "<a href='" . $Event['url'] . "'>" . $ConcertTitle . "</a>";
|
||||||
?>
|
?>
|
||||||
<form class="hidden" action="" id="concert<?=$Event['id']?>" method="post">
|
<form class="hidden" action="" id="concert<?=$Event['id']?>" method="post">
|
||||||
<input type="hidden" name="action" value="concert_thread"/>
|
<input type="hidden" name="action" value="concert_thread" />
|
||||||
<input type="hidden" name="concert_title" value="<?="[Concert] " . display_str($Name) . " - " . $ConcertTitle?>"/>
|
<input type="hidden" name="concert_title" value="<?="[Concert] " . display_str($Name) . " - " . $ConcertTitle?>" />
|
||||||
<input type="hidden" name="concert_id" value="<?=$Event['id']?>"/>
|
<input type="hidden" name="concert_id" value="<?=$Event['id']?>" />
|
||||||
<input type="hidden" name="concert_template" value="<?=get_concert_post_template($Name, $Event)?>"/>
|
<input type="hidden" name="concert_template" value="<?=get_concert_post_template($Name, $Event)?>" />
|
||||||
</form>
|
</form>
|
||||||
<li><?=$Concert?> - <a href="#" class="brackets" onclick="$('#concert<?=$Event['id']?>').raw().submit(); return false;">Go to thread</a></li>
|
<li><?=$Concert?> - <a href="#" class="brackets" onclick="$('#concert<?=$Event['id']?>').raw().submit(); return false;">Go to thread</a></li>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_concert_post_template($Artist, $Event)
|
function get_concert_post_template($Artist, $Event) {
|
||||||
{
|
$With = '';
|
||||||
$With = "";
|
$EventTitle = '';
|
||||||
$EventTitle = "";
|
$Location = '';
|
||||||
$Location = "";
|
$Directions = '';
|
||||||
$Directions = "";
|
$Website = '';
|
||||||
$Website = "";
|
|
||||||
if (!empty($Event['venue']['website'])) {
|
if (!empty($Event['venue']['website'])) {
|
||||||
$Url = $Event['venue']['website'];
|
$Url = $Event['venue']['website'];
|
||||||
if (strpos ($Url, '://') === false) {
|
if (strpos ($Url, '://') === false) {
|
||||||
@ -82,7 +80,7 @@ function get_concert_post_template($Artist, $Event)
|
|||||||
if (strpos ($Url, '://') === false) {
|
if (strpos ($Url, '://') === false) {
|
||||||
$Url = 'http://' . $Url;
|
$Url = 'http://' . $Url;
|
||||||
}
|
}
|
||||||
$Website = "[b]Web site:[/b] " . $Url;
|
$Website = '[b]Web site:[/b] ' . $Url;
|
||||||
}
|
}
|
||||||
if (isset($Event['artists']['artist']) && (count($Event['artists']['artist']) == 1 && strtolower($Event['artists']['artist'][1]) == strtolower($Artist))) {
|
if (isset($Event['artists']['artist']) && (count($Event['artists']['artist']) == 1 && strtolower($Event['artists']['artist'][1]) == strtolower($Artist))) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -111,17 +109,15 @@ function get_concert_post_template($Artist, $Event)
|
|||||||
[align=center]. . . . . . . . . .[/align]";
|
[align=center]. . . . . . . . . .[/align]";
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_date_title($Str)
|
function get_date_title($Str) {
|
||||||
{
|
|
||||||
$Exploded = explode(' ', $Str);
|
$Exploded = explode(' ', $Str);
|
||||||
$Date = $Exploded[2] . " " . $Exploded[1] . ", " . $Exploded[3];
|
$Date = $Exploded[2] . ' ' . $Exploded[1] . ', ' . $Exploded[3];
|
||||||
return $Date;
|
return $Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_date_post($Str)
|
function get_date_post($Str) {
|
||||||
{
|
|
||||||
$Exploded = explode(' ', $Str);
|
$Exploded = explode(' ', $Str);
|
||||||
$Date = $Exploded[2] . " " . $Exploded[1] . ", " . $Exploded[3] . " (" . rtrim($Exploded[0], ',') . ")";
|
$Date = $Exploded[2] . ' ' . $Exploded[1] . ', ' . $Exploded[3] . ' (' . rtrim($Exploded[0], ',') . ')';
|
||||||
return $Date;
|
return $Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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('artistid', 'postid', 'userid', 'key'));
|
Misc::assert_isset_request($_POST, array('artistid', 'postid', 'userid', 'key'));
|
||||||
|
|
||||||
$ArtistID = (int) $_POST['artistid'];
|
$ArtistID = (int) $_POST['artistid'];
|
||||||
@ -23,11 +25,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="thin box pad">
|
<div class="thin box pad">
|
||||||
<form class="create_form" name="warning" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
<form class="create_form" name="warning" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>"/>
|
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||||
<input type="hidden" name="postid" value="<?=$PostID?>"/>
|
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||||
<input type="hidden" name="userid" value="<?=$UserID?>"/>
|
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||||
<input type="hidden" name="key" value="<?=$Key?>"/>
|
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||||
<input type="hidden" name="action" value="take_warn"/>
|
<input type="hidden" name="action" value="take_warn" />
|
||||||
<table class="layout" align="center">
|
<table class="layout" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Reason:</td>
|
<td class="label">Reason:</td>
|
||||||
@ -41,25 +43,25 @@
|
|||||||
<select name="length">
|
<select name="length">
|
||||||
<option value="verbal">Verbal</option>
|
<option value="verbal">Verbal</option>
|
||||||
<option value="1">1 week</option>
|
<option value="1">1 week</option>
|
||||||
<option value="2">2 week</option>
|
<option value="2">2 weeks</option>
|
||||||
<option value="4">4 week</option>
|
<option value="4">4 weeks</option>
|
||||||
<? if(check_perms("users_mod")) { ?>
|
<? if(check_perms('users_mod')) { ?>
|
||||||
<option value="8">8 week</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 />
|
||||||
<input type="submit" id="submit_button" value="Warn User" tabindex="1" />
|
<input type="submit" id="submit_button" value="Warn user" tabindex="1" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?
|
<?
|
||||||
function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
|
function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
|
||||||
global $DB, $Cache;
|
global $DB, $Cache;
|
||||||
if((!$ThreadInfo = $Cache->get_value('thread_'.$ThreadID.'_info')) || !isset($ThreadInfo['OP'])) {
|
if ((!$ThreadInfo = $Cache->get_value('thread_'.$ThreadID.'_info')) || !isset($ThreadInfo['OP'])) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
t.Title,
|
t.Title,
|
||||||
t.ForumID,
|
t.ForumID,
|
||||||
@ -17,9 +17,11 @@ function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
|
|||||||
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
||||||
WHERE t.ID = '$ThreadID'
|
WHERE t.ID = '$ThreadID'
|
||||||
GROUP BY fp.TopicID");
|
GROUP BY fp.TopicID");
|
||||||
if($DB->record_count()==0) { error(404); }
|
if ($DB->record_count() == 0) {
|
||||||
|
error(404);
|
||||||
|
}
|
||||||
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC, false);
|
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC, false);
|
||||||
if($ThreadInfo['StickyPostID']) {
|
if ($ThreadInfo['StickyPostID']) {
|
||||||
$ThreadInfo['Posts']--;
|
$ThreadInfo['Posts']--;
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
p.ID,
|
p.ID,
|
||||||
@ -34,11 +36,11 @@ function get_thread_info($ThreadID, $Return = true, $SelectiveCache = false) {
|
|||||||
WHERE p.TopicID = '$ThreadID' AND p.ID = '".$ThreadInfo['StickyPostID']."'");
|
WHERE p.TopicID = '$ThreadID' AND p.ID = '".$ThreadInfo['StickyPostID']."'");
|
||||||
list($ThreadInfo['StickyPost']) = $DB->to_array(false, MYSQLI_ASSOC);
|
list($ThreadInfo['StickyPost']) = $DB->to_array(false, MYSQLI_ASSOC);
|
||||||
}
|
}
|
||||||
if(!$SelectiveCache || !$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
|
if (!$SelectiveCache || !$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
|
||||||
$Cache->cache_value('thread_'.$ThreadID.'_info', $ThreadInfo, 0);
|
$Cache->cache_value('thread_'.$ThreadID.'_info', $ThreadInfo, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($Return) {
|
if ($Return) {
|
||||||
return $ThreadInfo;
|
return $ThreadInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -48,10 +50,10 @@ function check_forumperm($ForumID, $Perm = 'Read') {
|
|||||||
if ($LoggedUser['CustomForums'][$ForumID] == 1) {
|
if ($LoggedUser['CustomForums'][$ForumID] == 1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if($Forums[$ForumID]['MinClass'.$Perm] > $LoggedUser['Class'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
if ($Forums[$ForumID]['MinClass'.$Perm] > $LoggedUser['Class'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0) {
|
if (isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -62,7 +64,7 @@ function check_forumperm($ForumID, $Perm = 'Read') {
|
|||||||
function get_forum_info($ForumID) {
|
function get_forum_info($ForumID) {
|
||||||
global $DB, $Cache;
|
global $DB, $Cache;
|
||||||
$Forum = $Cache->get_value('ForumInfo_'.$ForumID);
|
$Forum = $Cache->get_value('ForumInfo_'.$ForumID);
|
||||||
if(!$Forum) {
|
if (!$Forum) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
Name,
|
Name,
|
||||||
MinClassRead,
|
MinClassRead,
|
||||||
@ -73,7 +75,7 @@ function get_forum_info($ForumID) {
|
|||||||
LEFT JOIN forums_topics ON forums_topics.ForumID=forums.ID
|
LEFT JOIN forums_topics ON forums_topics.ForumID=forums.ID
|
||||||
WHERE forums.ID='$ForumID'
|
WHERE forums.ID='$ForumID'
|
||||||
GROUP BY ForumID");
|
GROUP BY ForumID");
|
||||||
if($DB->record_count() == 0) {
|
if ($DB->record_count() == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Makes an array, with $Forum['Name'], etc.
|
// Makes an array, with $Forum['Name'], etc.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
ini_set('display_errors', '1');authorize();
|
ini_set('display_errors', '1');
|
||||||
|
authorize();
|
||||||
|
|
||||||
$ForumID = db_string($_GET['forumid']);
|
$ForumID = db_string($_GET['forumid']);
|
||||||
if($_GET['perform'] == 'add') {
|
if ($_GET['perform'] == 'add') {
|
||||||
$DB->query("INSERT IGNORE INTO subscribed_forums (ForumID, SubscriberID) VALUES ('$ForumID', '$LoggedUser[ID]')");
|
$DB->query("INSERT IGNORE INTO subscribed_forums (ForumID, SubscriberID) VALUES ('$ForumID', '$LoggedUser[ID]')");
|
||||||
}
|
} elseif ($_GET['perform'] == 'remove') {
|
||||||
elseif($_GET['perform'] == 'remove') {
|
|
||||||
$DB->query("DELETE FROM subscribed_forums WHERE ForumID = '$ForumID' AND SubscriberID = '$LoggedUser[ID]'");
|
$DB->query("DELETE FROM subscribed_forums WHERE ForumID = '$ForumID' AND SubscriberID = '$LoggedUser[ID]'");
|
||||||
}
|
}
|
||||||
header('Location: forums.php?action=viewforum&forumid=' . $ForumID);
|
header('Location: forums.php?action=viewforum&forumid=' . $ForumID);
|
||||||
|
@ -18,20 +18,20 @@
|
|||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$URL = "https://" . SSL_SITE_URL . "/forums.php?action=viewthread&postid=$PostID#post$PostID";
|
$URL = 'https://' . SSL_SITE_URL . "/forums.php?action=viewthread&postid=$PostID#post$PostID";
|
||||||
if ($Length != 'verbal') {
|
if ($Length != 'verbal') {
|
||||||
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
||||||
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
||||||
$Subject = "You have received a warning";
|
$Subject = 'You have received a warning';
|
||||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
||||||
|
|
||||||
$WarnTime = time_plus($Time);
|
$WarnTime = time_plus($Time);
|
||||||
$AdminComment = date("Y-m-d") . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
$AdminComment = date('Y-m-d') . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$Subject = "You have received a verbal warning";
|
$Subject = 'You have received a verbal warning';
|
||||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
|
||||||
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||||
Tools::update_user_notes($UserID, $AdminComment);
|
Tools::update_user_notes($UserID, $AdminComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,12 +45,11 @@
|
|||||||
p.AuthorID,
|
p.AuthorID,
|
||||||
p.TopicID,
|
p.TopicID,
|
||||||
t.ForumID,
|
t.ForumID,
|
||||||
CEIL((SELECT COUNT(ID)
|
CEIL( (SELECT COUNT(ID)
|
||||||
FROM forums_posts
|
FROM forums_posts
|
||||||
WHERE forums_posts.TopicID = p.TopicID
|
WHERE forums_posts.TopicID = p.TopicID
|
||||||
AND forums_posts.ID <= '$PostID')/" . POSTS_PER_PAGE
|
AND forums_posts.ID <= '$PostID')/" . POSTS_PER_PAGE
|
||||||
. ")
|
. ") AS Page
|
||||||
AS Page
|
|
||||||
FROM forums_posts as p
|
FROM forums_posts as p
|
||||||
JOIN forums_topics as t on p.TopicID = t.ID
|
JOIN forums_topics as t on p.TopicID = t.ID
|
||||||
JOIN forums as f ON t.ForumID=f.ID
|
JOIN forums as f ON t.ForumID=f.ID
|
||||||
@ -58,8 +57,8 @@
|
|||||||
list($OldBody, $AuthorID, $TopicID, $ForumID, $Page) = $DB->next_record();
|
list($OldBody, $AuthorID, $TopicID, $ForumID, $Page) = $DB->next_record();
|
||||||
|
|
||||||
// Perform the update
|
// Perform the update
|
||||||
$DB->query("UPDATE forums_posts SET
|
$DB->query("UPDATE forums_posts
|
||||||
Body = '" . db_string($Body) . "',
|
SET Body = '" . db_string($Body) . "',
|
||||||
EditedUserID = '$UserID',
|
EditedUserID = '$UserID',
|
||||||
EditedTime = '" . $SQLTime . "'
|
EditedTime = '" . $SQLTime . "'
|
||||||
WHERE ID='$PostID'");
|
WHERE ID='$PostID'");
|
||||||
|
@ -5,9 +5,11 @@
|
|||||||
$UserID = (int)$_POST['userid'];
|
$UserID = (int)$_POST['userid'];
|
||||||
$Key = (int)$_POST['key'];
|
$Key = (int)$_POST['key'];
|
||||||
$UserInfo = Users::user_info($UserID);
|
$UserInfo = Users::user_info($UserID);
|
||||||
$DB -> query("SELECT
|
$DB -> query(" SELECT
|
||||||
p.Body, t.ForumID
|
p.Body,
|
||||||
FROM forums_posts as p JOIN forums_topics as t on p.TopicID = t.ID
|
t.ForumID
|
||||||
|
FROM forums_posts as p
|
||||||
|
JOIN forums_topics as t on p.TopicID = t.ID
|
||||||
WHERE p.ID='$PostID'");
|
WHERE p.ID='$PostID'");
|
||||||
list($PostBody, $ForumID) = $DB -> next_record();
|
list($PostBody, $ForumID) = $DB -> next_record();
|
||||||
View::show_header('Warn User');
|
View::show_header('Warn User');
|
||||||
@ -38,9 +40,9 @@
|
|||||||
<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>
|
||||||
|
@ -37,7 +37,8 @@
|
|||||||
JOIN users_main AS m ON f.FriendID=m.ID
|
JOIN users_main AS m ON f.FriendID=m.ID
|
||||||
JOIN users_info AS i ON f.FriendID=i.UserID
|
JOIN users_info AS i ON f.FriendID=i.UserID
|
||||||
WHERE f.UserID='$UserID'
|
WHERE f.UserID='$UserID'
|
||||||
ORDER BY Username LIMIT $Limit");
|
ORDER BY Username
|
||||||
|
LIMIT $Limit");
|
||||||
$Friends = $DB->to_array(false, MYSQLI_BOTH, array(6, 'Paranoia'));
|
$Friends = $DB->to_array(false, MYSQLI_BOTH, array(6, 'Paranoia'));
|
||||||
|
|
||||||
// Number of results (for pagination)
|
// Number of results (for pagination)
|
||||||
@ -53,17 +54,17 @@
|
|||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<?
|
<?
|
||||||
// Pagination
|
// Pagination
|
||||||
$Pages=Format::get_pages($Page,$Results,FRIENDS_PER_PAGE,9);
|
$Pages = Format::get_pages($Page, $Results, FRIENDS_PER_PAGE, 9);
|
||||||
echo $Pages;
|
echo $Pages;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="box pad">
|
<div class="box pad">
|
||||||
<?
|
<?
|
||||||
if($Results == 0) {
|
if ($Results == 0) {
|
||||||
echo '<p>You have no friends! :(</p>';
|
echo '<p>You have no friends! :(</p>';
|
||||||
}
|
}
|
||||||
// Start printing out friends
|
// Start printing out friends
|
||||||
foreach($Friends as $Friend) {
|
foreach ($Friends as $Friend) {
|
||||||
list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Paranoia, $LastAccess, $Avatar) = $Friend;
|
list($FriendID, $Comment, $Username, $Uploaded, $Downloaded, $Class, $Paranoia, $LastAccess, $Avatar) = $Friend;
|
||||||
?>
|
?>
|
||||||
<form class="manage_form" name="friends" action="friends.php" method="post">
|
<form class="manage_form" name="friends" action="friends.php" method="post">
|
||||||
@ -72,17 +73,17 @@
|
|||||||
<tr class="colhead">
|
<tr class="colhead">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<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)) { ?>
|
||||||
Ratio: <strong><?=Format::get_ratio_html($Uploaded, $Downloaded)?></strong>
|
Ratio: <strong><?=Format::get_ratio_html($Uploaded, $Downloaded)?></strong>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if(check_paranoia('uploaded', $Paranoia, $Class, $FriendID)) { ?>
|
if (check_paranoia('uploaded', $Paranoia, $Class, $FriendID)) { ?>
|
||||||
Up: <strong><?=Format::get_size($Uploaded)?></strong>
|
Up: <strong><?=Format::get_size($Uploaded)?></strong>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if(check_paranoia('downloaded', $Paranoia, $Class, $FriendID)) { ?>
|
if (check_paranoia('downloaded', $Paranoia, $Class, $FriendID)) { ?>
|
||||||
Down: <strong><?=Format::get_size($Downloaded)?></strong>
|
Down: <strong><?=Format::get_size($Downloaded)?></strong>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</span>
|
</span>
|
||||||
<? if(check_paranoia('lastseen', $Paranoia, $Class, $FriendID)) { ?>
|
<? if (check_paranoia('lastseen', $Paranoia, $Class, $FriendID)) { ?>
|
||||||
<span style="float:right;"><?=time_diff($LastAccess)?></span>
|
<span style="float:right;"><?=time_diff($LastAccess)?></span>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</td>
|
</td>
|
||||||
@ -90,17 +91,16 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td width="50px" valign="top">
|
<td width="50px" valign="top">
|
||||||
<?
|
<?
|
||||||
if(empty($HeavyInfo['DisableAvatars'])) {
|
if (empty($HeavyInfo['DisableAvatars'])) {
|
||||||
if(!empty($Avatar)) {
|
if (!empty($Avatar)) {
|
||||||
if(check_perms('site_proxy_images')) {
|
if (check_perms('site_proxy_images')) {
|
||||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
<img src="<?=$Avatar?>" alt="<?=$Username?>'s avatar" width="50px" />
|
<img src="<?=$Avatar?>" alt="<?=$Username?>'s avatar" width="50px" />
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" />
|
<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?>" />
|
||||||
@ -109,9 +109,8 @@
|
|||||||
</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 />
|
||||||
<input type="submit" name="action" value="Defriend" /><br />
|
<input type="submit" name="action" value="Remove friend" /><br />
|
||||||
<input type="submit" name="action" value="Contact" /><br />
|
<input type="submit" name="action" value="Contact" /><br />
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
View::show_header('Disabled');
|
View::show_header('Disabled');
|
||||||
if(empty($_POST['submit']) || empty($_POST['username'])) {
|
if (empty($_POST['submit']) || empty($_POST['username'])) {
|
||||||
?>
|
?>
|
||||||
<p class="warning">
|
<p class="warning">
|
||||||
Your account has been disabled.<br />
|
Your account has been disabled.<br />
|
||||||
@ -10,12 +10,12 @@
|
|||||||
<strong>Be honest.</strong> At this point, lying will get you nowhere.<br /><br /><br />
|
<strong>Be honest.</strong> At this point, lying will get you nowhere.<br /><br /><br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<strong>Before joining the disabled channel, please read our <br /> <span style="color:gold;">Golden Rules</span> which can be found <a style="color:#1464F4;" href="#" onclick="toggle_visibility('golden_rules')">here.</a></strong> <br /><br />
|
<strong>Before joining the disabled channel, please read our <br /> <span style="color: gold;">Golden Rules</span> which can be found <a style="color: #1464F4;" href="#" onclick="toggle_visibility('golden_rules')">here</a>.</strong> <br /><br />
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggle_visibility(id) {
|
function toggle_visibility(id) {
|
||||||
var e = document.getElementById(id);
|
var e = document.getElementById(id);
|
||||||
if(e.style.display == 'block')
|
if (e.style.display == 'block')
|
||||||
e.style.display = 'none';
|
e.style.display = 'none';
|
||||||
else
|
else
|
||||||
e.style.display = 'block';
|
e.style.display = 'block';
|
||||||
@ -56,11 +56,11 @@ function toggle_visibility(id) {
|
|||||||
} else {
|
} else {
|
||||||
$nick = $_POST['username'];
|
$nick = $_POST['username'];
|
||||||
$nick = preg_replace('/[^a-zA-Z0-9\[\]\\`\^\{\}\|_]/', '', $nick);
|
$nick = preg_replace('/[^a-zA-Z0-9\[\]\\`\^\{\}\|_]/', '', $nick);
|
||||||
if(strlen($nick) == 0) {
|
if (strlen($nick) == 0) {
|
||||||
$nick = "WhatGuest????";
|
$nick = 'WhatGuest????';
|
||||||
} else {
|
} else {
|
||||||
if(is_numeric(substr($nick, 0, 1))) {
|
if (is_numeric(substr($nick, 0, 1))) {
|
||||||
$nick = "_" . $nick;
|
$nick = '_' . $nick;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -68,8 +68,8 @@ function toggle_visibility(id) {
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h3 id="general">Disabled IRC</h3>
|
<h3 id="general">Disabled IRC</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box pad" style="padding:10px 0px 10px 0px;">
|
<div class="box pad" style="padding: 10px 0px 10px 0px;">
|
||||||
<div style="padding:0px 10px 10px 20px;">
|
<div style="padding: 0px 10px 10px 20px;">
|
||||||
<p>Please read the topic carefully.</p>
|
<p>Please read the topic carefully.</p>
|
||||||
</div>
|
</div>
|
||||||
<applet codebase="static/irc/" code="IRCApplet.class" archive="irc.jar,sbox.jar" width="800" height="600" align="center">
|
<applet codebase="static/irc/" code="IRCApplet.class" archive="irc.jar,sbox.jar" width="800" height="600" align="center">
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
include(SERVER_ROOT.'/sections/reports/array.php');
|
include(SERVER_ROOT.'/sections/reports/array.php');
|
||||||
|
|
||||||
if(empty($_GET['type']) || empty($_GET['id']) || !is_number($_GET['id'])) {
|
if (empty($_GET['type']) || empty($_GET['id']) || !is_number($_GET['id'])) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!array_key_exists($_GET['type'], $Types)) {
|
if (!array_key_exists($_GET['type'], $Types)) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
$Short = $_GET['type'];
|
$Short = $_GET['type'];
|
||||||
@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
$ID = $_GET['id'];
|
$ID = $_GET['id'];
|
||||||
|
|
||||||
switch($Short) {
|
switch ($Short) {
|
||||||
case "user" :
|
case "user" :
|
||||||
$DB->query("SELECT Username FROM users_main WHERE ID=".$ID);
|
$DB->query("SELECT Username FROM users_main WHERE ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Username) = $DB->next_record();
|
list($Username) = $DB->next_record();
|
||||||
@ -26,18 +26,18 @@
|
|||||||
case "request_update" :
|
case "request_update" :
|
||||||
$NoReason = true;
|
$NoReason = true;
|
||||||
$DB->query("SELECT Title, Description, TorrentID, CategoryID, Year FROM requests WHERE ID=".$ID);
|
$DB->query("SELECT Title, Description, TorrentID, CategoryID, Year FROM requests WHERE ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Name, $Desc, $Filled, $CategoryID, $Year) = $DB->next_record();
|
list($Name, $Desc, $Filled, $CategoryID, $Year) = $DB->next_record();
|
||||||
if($Filled || ($CategoryID != 0 && ($Categories[$CategoryID-1] != "Music" || $Year != 0))) {
|
if ($Filled || ($CategoryID != 0 && ($Categories[$CategoryID-1] != "Music" || $Year != 0))) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "request" :
|
case "request" :
|
||||||
$DB->query("SELECT Title, Description, TorrentID FROM requests WHERE ID=".$ID);
|
$DB->query("SELECT Title, Description, TorrentID FROM requests WHERE ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Name, $Desc, $Filled) = $DB->next_record();
|
list($Name, $Desc, $Filled) = $DB->next_record();
|
||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
case "collage" :
|
case "collage" :
|
||||||
$DB->query("SELECT Name, Description FROM collages WHERE ID=".$ID);
|
$DB->query("SELECT Name, Description FROM collages WHERE ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Name, $Desc) = $DB->next_record();
|
list($Name, $Desc) = $DB->next_record();
|
||||||
@ -53,13 +53,13 @@
|
|||||||
|
|
||||||
case "thread" :
|
case "thread" :
|
||||||
$DB->query("SELECT ft.Title, ft.ForumID, um.Username FROM forums_topics AS ft JOIN users_main AS um ON um.ID=ft.AuthorID WHERE ft.ID=".$ID);
|
$DB->query("SELECT ft.Title, ft.ForumID, um.Username FROM forums_topics AS ft JOIN users_main AS um ON um.ID=ft.AuthorID WHERE ft.ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Title, $ForumID, $Username) = $DB->next_record();
|
list($Title, $ForumID, $Username) = $DB->next_record();
|
||||||
$DB->query("SELECT MinClassRead FROM forums WHERE ID = ".$ForumID);
|
$DB->query("SELECT MinClassRead FROM forums WHERE ID = ".$ForumID);
|
||||||
list($MinClassRead) = $DB->next_record();
|
list($MinClassRead) = $DB->next_record();
|
||||||
if(!empty($LoggedUser['DisableForums']) ||
|
if (!empty($LoggedUser['DisableForums']) ||
|
||||||
($MinClassRead > $LoggedUser['EffectiveClass'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) ||
|
($MinClassRead > $LoggedUser['EffectiveClass'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) ||
|
||||||
(isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
(isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
||||||
error(403);
|
error(403);
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
case "post" :
|
case "post" :
|
||||||
$DB->query("SELECT fp.Body, fp.TopicID, um.Username FROM forums_posts AS fp JOIN users_main AS um ON um.ID=fp.AuthorID WHERE fp.ID=".$ID);
|
$DB->query("SELECT fp.Body, fp.TopicID, um.Username FROM forums_posts AS fp JOIN users_main AS um ON um.ID=fp.AuthorID WHERE fp.ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Body, $TopicID, $Username) = $DB->next_record();
|
list($Body, $TopicID, $Username) = $DB->next_record();
|
||||||
@ -76,7 +76,7 @@
|
|||||||
list($ForumID) = $DB->next_record();
|
list($ForumID) = $DB->next_record();
|
||||||
$DB->query("SELECT MinClassRead FROM forums WHERE ID = ".$ForumID);
|
$DB->query("SELECT MinClassRead FROM forums WHERE ID = ".$ForumID);
|
||||||
list($MinClassRead) = $DB->next_record();
|
list($MinClassRead) = $DB->next_record();
|
||||||
if(!empty($LoggedUser['DisableForums']) ||
|
if (!empty($LoggedUser['DisableForums']) ||
|
||||||
($MinClassRead > $LoggedUser['EffectiveClass'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) ||
|
($MinClassRead > $LoggedUser['EffectiveClass'] && (!isset($LoggedUser['CustomForums'][$ForumID]) || $LoggedUser['CustomForums'][$ForumID] == 0)) ||
|
||||||
(isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
(isset($LoggedUser['CustomForums'][$ForumID]) && $LoggedUser['CustomForums'][$ForumID] == 0)) {
|
||||||
error(403);
|
error(403);
|
||||||
@ -88,13 +88,13 @@
|
|||||||
case "artist_comment":
|
case "artist_comment":
|
||||||
case "collages_comment" :
|
case "collages_comment" :
|
||||||
$Table = $Short.'s';
|
$Table = $Short.'s';
|
||||||
if($Short == "collages_comment") {
|
if ($Short == "collages_comment") {
|
||||||
$Column = "UserID";
|
$Column = "UserID";
|
||||||
} else {
|
} else {
|
||||||
$Column = "AuthorID";
|
$Column = "AuthorID";
|
||||||
}
|
}
|
||||||
$DB->query("SELECT ".$Short.".Body, um.Username FROM ".$Table." AS ".$Short." JOIN users_main AS um ON um.ID=".$Short.".".$Column." WHERE ".$Short.".ID=".$ID);
|
$DB->query("SELECT ".$Short.".Body, um.Username FROM ".$Table." AS ".$Short." JOIN users_main AS um ON um.ID=".$Short.".".$Column." WHERE ".$Short.".ID=".$ID);
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
list($Body, $Username) = $DB->next_record();
|
list($Body, $Username) = $DB->next_record();
|
||||||
@ -112,7 +112,7 @@
|
|||||||
<p>Following these guidelines will help the moderators deal with your report in a timely fashion. </p>
|
<p>Following these guidelines will help the moderators deal with your report in a timely fashion. </p>
|
||||||
<ul>
|
<ul>
|
||||||
<?
|
<?
|
||||||
foreach($Type['guidelines'] as $Guideline) {
|
foreach ($Type['guidelines'] as $Guideline) {
|
||||||
?>
|
?>
|
||||||
<li><?=$Guideline?></li>
|
<li><?=$Guideline?></li>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -125,7 +125,7 @@
|
|||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
|
|
||||||
|
|
||||||
switch($Short) {
|
switch ($Short) {
|
||||||
case "user" :
|
case "user" :
|
||||||
?>
|
?>
|
||||||
<p>You are reporting the user <strong><?=display_str($Username)?></strong></p>
|
<p>You are reporting the user <strong><?=display_str($Username)?></strong></p>
|
||||||
@ -271,7 +271,7 @@
|
|||||||
<?
|
<?
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(empty($NoReason)) {
|
if (empty($NoReason)) {
|
||||||
?>
|
?>
|
||||||
<h3>Reason</h3>
|
<h3>Reason</h3>
|
||||||
<div class="box pad center">
|
<div class="box pad center">
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
$Where .= " AND Type = 'request_update'";
|
$Where .= " AND Type = 'request_update'";
|
||||||
}
|
}
|
||||||
if (check_perms('site_moderate_forums')) {
|
if (check_perms('site_moderate_forums')) {
|
||||||
$Where .= " AND Type IN('collages_comment', 'Post', 'requests_comment', 'thread', 'torrents_comment', 'torrent_comments')";
|
$Where .= " AND Type IN('collages_comment', 'post', 'requests_comment', 'thread', 'torrents_comment', 'torrent_comments', 'artist_comment')";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -83,13 +83,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<?
|
<?
|
||||||
// pagination
|
// pagination
|
||||||
$Pages = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
|
$Pages = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
|
||||||
echo $Pages;
|
echo $Pages;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
while (list($ReportID, $SnitchID, $SnitchName, $ThingID, $Short, $ReportedTime, $Reason, $Status, $ClaimerID, $Notes, $ResolverID) = $DB->next_record()) {
|
while (list($ReportID, $SnitchID, $SnitchName, $ThingID, $Short, $ReportedTime, $Reason, $Status, $ClaimerID, $Notes, $ResolverID) = $DB->next_record()) {
|
||||||
$Type = $Types[$Short];
|
$Type = $Types[$Short];
|
||||||
$Reference = "reports.php?id=" . $ReportID . "#report" . $ReportID;
|
$Reference = "reports.php?id=" . $ReportID . "#report" . $ReportID;
|
||||||
@ -106,8 +106,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="center" colspan="2">
|
<td class="center" colspan="2">
|
||||||
<strong>
|
<strong>
|
||||||
<?
|
<? switch ($Short) {
|
||||||
switch ($Short) {
|
|
||||||
case "user" :
|
case "user" :
|
||||||
$DB->query("SELECT Username FROM users_main WHERE ID=" . $ThingID);
|
$DB->query("SELECT Username FROM users_main WHERE ID=" . $ThingID);
|
||||||
if ($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
@ -211,13 +210,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<? if ($ClaimerID == $LoggedUser['ID']) { ?>
|
<? if ($ClaimerID == $LoggedUser['ID']) { ?>
|
||||||
<span id="claimed_<?=$ReportID?>">Claimed by <?=Users::format_username($ClaimerID, false, false, false, false)?> <a href="#" onclick="unClaim(<?=$ReportID?>); return false;" class="brackets">Unclaim</a></span>
|
<span id="claimed_<?=$ReportID?>">Claimed by <?=Users::format_username($ClaimerID, false, false, false, false)?> <a href="#" onclick="unClaim(<?=$ReportID?>); return false;" class="brackets">Unclaim</a></span>
|
||||||
<? } else if ($ClaimerID) { ?>
|
<? } else if ($ClaimerID) { ?>
|
||||||
<span id="claimed_<?=$ReportID?>">Claimed by <?=Users::format_username($ClaimerID, false, false, false, false)?></span>
|
<span id="claimed_<?=$ReportID?>">Claimed by <?=Users::format_username($ClaimerID, false, false, false, false)?></span>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<a href="#" id="claim_<?=$ReportID?>" onclick="claim(<?=$ReportID?>); return false;" class="brackets">Claim</a>
|
<a href="#" id="claim_<?=$ReportID?>" onclick="claim(<?=$ReportID?>); return false;" class="brackets">Claim</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
||||||
<a href="#" onclick="toggleNotes(<?=$ReportID?>); return false;" class="brackets">Toggle notes</a>
|
<a href="#" onclick="toggleNotes(<?=$ReportID?>); return false;" class="brackets">Toggle notes</a>
|
||||||
|
|
||||||
@ -228,17 +227,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? if ($Status != "Resolved") { ?>
|
<? if ($Status != "Resolved") { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="center" colspan="2">
|
<td class="center" colspan="2">
|
||||||
<form id="report_form_<?=$ReportID?>" action="">
|
<form id="report_form_<?=$ReportID?>" action="">
|
||||||
<input type="hidden" name="reportid" value="<?=$ReportID?>" />
|
<input type="hidden" name="reportid" value="<?=$ReportID?>" />
|
||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<input type="submit" onclick="return resolve(<?=$ReportID?>, <?=($ClaimerID == $LoggedUser['ID'] || !$ClaimerID) ? "true" : "false"?>)" name="submit" value="Resolve" />
|
<input type="submit" onclick="return resolve(<?=$ReportID?>, <?=($ClaimerID == $LoggedUser['ID'] || !$ClaimerID) ? 'true' : 'false' ?>)" name="submit" value="Resolve" />
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } else {
|
<? } else {
|
||||||
$ResolverInfo = Users::user_info($ResolverID);
|
$ResolverInfo = Users::user_info($ResolverID);
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -246,16 +245,16 @@
|
|||||||
Resolved by <a href="users.php?id=<?=$ResolverID?>"><?=$ResolverInfo['Username']?></a>
|
Resolved by <a href="users.php?id=<?=$ResolverID?>"><?=$ResolverInfo['Username']?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<?
|
<?
|
||||||
$DB->set_query_id($Reports);
|
$DB->set_query_id($Reports);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<?
|
<?
|
||||||
echo $Pages;
|
echo $Pages;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
if(!check_perms('admin_reports') && !check_perms('site_moderate_forums')){
|
if (!check_perms('admin_reports') && !check_perms('site_moderate_forums')) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
View::show_header('Other reports stats');
|
View::show_header('Other reports stats');
|
||||||
@ -14,11 +14,18 @@
|
|||||||
<a href="reports.php?action=stats">Stats</a>
|
<a href="reports.php?action=stats">Stats</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box pad thin" style="padding: 0px 0px 0px 20px; margin-left: auto; margin-right: auto">
|
<div class="box pad thin" style="padding: 0px 0px 0px 20px; margin-left: auto; margin-right: auto;">
|
||||||
<table class="layout">
|
<table class="layout">
|
||||||
<?
|
<?
|
||||||
if(check_perms('admin_reports')) {
|
if (check_perms('admin_reports')) :
|
||||||
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reports AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.ReportedTime > '2009-08-21 22:39:41' AND r.ReportedTime > NOW() - INTERVAL 24 HOUR GROUP BY r.ResolverID ORDER BY Reports DESC");
|
$DB->query("SELECT um.Username,
|
||||||
|
COUNT(r.ID) AS Reports
|
||||||
|
FROM reports AS r
|
||||||
|
JOIN users_main AS um ON um.ID=r.ResolverID
|
||||||
|
WHERE r.ReportedTime > '2009-08-21 22:39:41'
|
||||||
|
AND r.ReportedTime > NOW() - INTERVAL 24 HOUR
|
||||||
|
GROUP BY r.ResolverID
|
||||||
|
ORDER BY Reports DESC");
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -29,7 +36,7 @@
|
|||||||
<td class="head colhead_dark">Username</td>
|
<td class="head colhead_dark">Username</td>
|
||||||
<td class="head colhead_dark">Reports</td>
|
<td class="head colhead_dark">Reports</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? foreach($Results as $Result) {
|
<? foreach ($Results as $Result) {
|
||||||
list($Username, $Reports) = $Result;
|
list($Username, $Reports) = $Result;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -42,7 +49,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?
|
<?
|
||||||
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reports AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.ReportedTime > '2009-08-21 22:39:41' AND r.ReportedTime > NOW() - INTERVAL 1 WEEK GROUP BY r.ResolverID ORDER BY Reports DESC");
|
$DB->query("SELECT um.Username,
|
||||||
|
COUNT(r.ID) AS Reports
|
||||||
|
FROM reports AS r
|
||||||
|
JOIN users_main AS um ON um.ID=r.ResolverID
|
||||||
|
WHERE r.ReportedTime > '2009-08-21 22:39:41'
|
||||||
|
AND r.ReportedTime > NOW() - INTERVAL 1 WEEK
|
||||||
|
GROUP BY r.ResolverID
|
||||||
|
ORDER BY Reports DESC");
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
?>
|
?>
|
||||||
<td class="label"><strong>Reports resolved in the last week</strong></td>
|
<td class="label"><strong>Reports resolved in the last week</strong></td>
|
||||||
@ -52,7 +66,7 @@
|
|||||||
<td class="head colhead_dark">Username</td>
|
<td class="head colhead_dark">Username</td>
|
||||||
<td class="head colhead_dark">Reports</td>
|
<td class="head colhead_dark">Reports</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? foreach($Results as $Result) {
|
<? foreach ($Results as $Result) {
|
||||||
list($Username, $Reports) = $Result;
|
list($Username, $Reports) = $Result;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -65,7 +79,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?
|
<?
|
||||||
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reports AS r JOIN users_main AS um ON um.ID=r.ResolverID WHERE r.ReportedTime > '2009-08-21 22:39:41' AND r.ReportedTime > NOW() - INTERVAL 1 MONTH GROUP BY r.ResolverID ORDER BY Reports DESC");
|
$DB->query("SELECT um.Username,
|
||||||
|
COUNT(r.ID) AS Reports
|
||||||
|
FROM reports AS r
|
||||||
|
JOIN users_main AS um ON um.ID=r.ResolverID
|
||||||
|
WHERE r.ReportedTime > '2009-08-21 22:39:41'
|
||||||
|
AND r.ReportedTime > NOW() - INTERVAL 1 MONTH
|
||||||
|
GROUP BY r.ResolverID
|
||||||
|
ORDER BY Reports DESC");
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
?>
|
?>
|
||||||
<td class="label"><strong>Reports resolved in the last month</strong></td>
|
<td class="label"><strong>Reports resolved in the last month</strong></td>
|
||||||
@ -75,7 +96,7 @@
|
|||||||
<td class="head colhead_dark">Username</td>
|
<td class="head colhead_dark">Username</td>
|
||||||
<td class="head colhead_dark">Reports</td>
|
<td class="head colhead_dark">Reports</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? foreach($Results as $Result) {
|
<? foreach ($Results as $Result) {
|
||||||
list($Username, $Reports) = $Result;
|
list($Username, $Reports) = $Result;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -88,17 +109,22 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?
|
<?
|
||||||
$DB->query("SELECT um.Username, COUNT(r.ID) AS Reports FROM reports AS r JOIN users_main AS um ON um.ID=r.ResolverID GROUP BY r.ResolverID ORDER BY Reports DESC");
|
$DB->query("SELECT um.Username,
|
||||||
|
COUNT(r.ID) AS Reports
|
||||||
|
FROM reports AS r
|
||||||
|
JOIN users_main AS um ON um.ID=r.ResolverID
|
||||||
|
GROUP BY r.ResolverID
|
||||||
|
ORDER BY Reports DESC");
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
?>
|
?>
|
||||||
<td class="label"><strong>Reports resolved since 'other' reports (2009-08-21)</strong></td>
|
<td class="label"><strong>Reports resolved since "other" reports (2009-08-21)</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
|
<table style="width: 50%; margin-left: auto; margin-right: auto;" class="border">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="head colhead_dark">Username</td>
|
<td class="head colhead_dark">Username</td>
|
||||||
<td class="head colhead_dark">Reports</td>
|
<td class="head colhead_dark">Reports</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? foreach($Results as $Result) {
|
<? foreach ($Results as $Result) {
|
||||||
list($Username, $Reports) = $Result;
|
list($Username, $Reports) = $Result;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -109,10 +135,17 @@
|
|||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? } ?>
|
<? endif; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<?
|
<?
|
||||||
$DB->query("select u.Username, count(LastPostAuthorID) as Trashed from forums_topics as f left join users_main as u on u.id = LastPostAuthorID where ForumID = 12 group by LastPostAuthorID order by Trashed desc limit 30;");
|
$DB->query("SELECT u.Username,
|
||||||
|
count(LastPostAuthorID) as Trashed
|
||||||
|
FROM forums_topics as f
|
||||||
|
LEFT JOIN users_main as u on u.id = LastPostAuthorID
|
||||||
|
WHERE ForumID = 12
|
||||||
|
GROUP BY LastPostAuthorID
|
||||||
|
ORDER BY Trashed DESC
|
||||||
|
LIMIT 30;");
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
?>
|
?>
|
||||||
<td class="label"><strong>Threads trashed since the beginning of time</strong></td>
|
<td class="label"><strong>Threads trashed since the beginning of time</strong></td>
|
||||||
@ -123,9 +156,9 @@
|
|||||||
<td class="head colhead_dark">Username</td>
|
<td class="head colhead_dark">Username</td>
|
||||||
<td class="head colhead_dark">Trashed</td>
|
<td class="head colhead_dark">Trashed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($Results as $Result) {
|
foreach ($Results as $Result) {
|
||||||
list($Username, $Trashed) = $Result;
|
list($Username, $Trashed) = $Result;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -133,7 +166,8 @@
|
|||||||
<td><?=$Username?></td>
|
<td><?=$Username?></td>
|
||||||
<td><?=number_format($Trashed)?></td>
|
<td><?=number_format($Trashed)?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? $i++; } ?>
|
<? $i++;
|
||||||
|
} ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* replicated on static.php.
|
* replicated on static.php.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(!check_perms('admin_reports')){
|
if (!check_perms('admin_reports')) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@
|
|||||||
LIMIT 1");
|
LIMIT 1");
|
||||||
|
|
||||||
|
|
||||||
if($DB->record_count() < 1) {
|
if ($DB->record_count() < 1) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,10 +83,10 @@
|
|||||||
$ModComment, $Tracks, $Images, $ExtraIDs, $Links, $LogMessage, $GroupName, $GroupID, $ArtistID, $ArtistName, $Year, $CategoryID, $Time, $Remastered, $RemasterTitle,
|
$ModComment, $Tracks, $Images, $ExtraIDs, $Links, $LogMessage, $GroupName, $GroupID, $ArtistID, $ArtistName, $Year, $CategoryID, $Time, $Remastered, $RemasterTitle,
|
||||||
$RemasterYear, $Media, $Format, $Encoding, $Size, $HasCue, $HasLog, $LogScore, $UploaderID, $UploaderName) = $DB->next_record(MYSQLI_BOTH, array("ModComment"));
|
$RemasterYear, $Media, $Format, $Encoding, $Size, $HasCue, $HasLog, $LogScore, $UploaderID, $UploaderName) = $DB->next_record(MYSQLI_BOTH, array("ModComment"));
|
||||||
|
|
||||||
if(!$GroupID) {
|
if (!$GroupID) {
|
||||||
//Torrent already deleted
|
//Torrent already deleted
|
||||||
$DB->query("UPDATE reportsv2 SET
|
$DB->query("UPDATE reportsv2
|
||||||
Status='Resolved',
|
SET Status='Resolved',
|
||||||
LastChangeTime='".sqltime()."',
|
LastChangeTime='".sqltime()."',
|
||||||
ModComment='Report already dealt with (torrent deleted)'
|
ModComment='Report already dealt with (torrent deleted)'
|
||||||
WHERE ID=".$ReportID);
|
WHERE ID=".$ReportID);
|
||||||
@ -103,14 +103,14 @@
|
|||||||
<?
|
<?
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$DB->query("UPDATE reportsv2 SET Status='InProgress',
|
$DB->query("UPDATE reportsv2
|
||||||
|
SET Status='InProgress',
|
||||||
ResolverID=".$LoggedUser['ID']."
|
ResolverID=".$LoggedUser['ID']."
|
||||||
WHERE ID=".$ReportID);
|
WHERE ID=".$ReportID);
|
||||||
|
|
||||||
|
|
||||||
if (array_key_exists($Type, $Types[$CategoryID])) {
|
if (array_key_exists($Type, $Types[$CategoryID])) {
|
||||||
$ReportType = $Types[$CategoryID][$Type];
|
$ReportType = $Types[$CategoryID][$Type];
|
||||||
} else if(array_key_exists($Type,$Types['master'])) {
|
} elseif (array_key_exists($Type,$Types['master'])) {
|
||||||
$ReportType = $Types['master'][$Type];
|
$ReportType = $Types['master'][$Type];
|
||||||
} else {
|
} else {
|
||||||
//There was a type but it wasn't an option!
|
//There was a type but it wasn't an option!
|
||||||
@ -154,7 +154,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label"><a href="reportsv2.php?view=report&id=<?=$ReportID?>">Reported</a> torrent:</td>
|
<td class="label"><a href="reportsv2.php?view=report&id=<?=$ReportID?>">Reported</a> torrent:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<? if(!$GroupID) { ?>
|
<? if (!$GroupID) { ?>
|
||||||
<a href="log.php?search=Torrent+<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)
|
<a href="log.php?search=Torrent+<?=$TorrentID?>"><?=$TorrentID?></a> (Deleted)
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<?=$LinkName?>
|
<?=$LinkName?>
|
||||||
@ -162,29 +162,29 @@
|
|||||||
uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?>
|
uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?>
|
||||||
<br />
|
<br />
|
||||||
<div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
|
<div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
|
||||||
<? $DB->query("SELECT r.ID
|
<? $DB->query("SELECT r.ID
|
||||||
FROM reportsv2 AS r
|
FROM reportsv2 AS r
|
||||||
LEFT JOIN torrents AS t ON t.ID=r.TorrentID
|
LEFT JOIN torrents AS t ON t.ID=r.TorrentID
|
||||||
WHERE r.Status != 'Resolved'
|
WHERE r.Status != 'Resolved'
|
||||||
AND t.GroupID=$GroupID");
|
AND t.GroupID=$GroupID");
|
||||||
$GroupOthers = ($DB->record_count() - 1);
|
$GroupOthers = ($DB->record_count() - 1);
|
||||||
|
|
||||||
if($GroupOthers > 0) { ?>
|
if ($GroupOthers > 0) { ?>
|
||||||
<div style="text-align: right;">
|
<div style="text-align: right;">
|
||||||
<a href="reportsv2.php?view=group&id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrents in this group</a>
|
<a href="reportsv2.php?view=group&id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrents in this group</a>
|
||||||
</div>
|
</div>
|
||||||
<? $DB->query("SELECT t.UserID
|
<? $DB->query("SELECT t.UserID
|
||||||
FROM reportsv2 AS r
|
FROM reportsv2 AS r
|
||||||
JOIN torrents AS t ON t.ID=r.TorrentID
|
JOIN torrents AS t ON t.ID=r.TorrentID
|
||||||
WHERE r.Status != 'Resolved'
|
WHERE r.Status != 'Resolved'
|
||||||
AND t.UserID=$UploaderID");
|
AND t.UserID=$UploaderID");
|
||||||
$UploaderOthers = ($DB->record_count() - 1);
|
$UploaderOthers = ($DB->record_count() - 1);
|
||||||
|
|
||||||
if($UploaderOthers > 0) { ?>
|
if ($UploaderOthers > 0) { ?>
|
||||||
<div style="text-align: right;">
|
<div style="text-align: right;">
|
||||||
<a href="reportsv2.php?view=uploader&id=<?=$UploaderID?>">There <?=(($UploaderOthers > 1) ? "are $UploaderOthers other reports" : "is 1 other report")?> for torrents uploaded by this user</a>
|
<a href="reportsv2.php?view=uploader&id=<?=$UploaderID?>">There <?=(($UploaderOthers > 1) ? "are $UploaderOthers other reports" : "is 1 other report")?> for torrents uploaded by this user</a>
|
||||||
</div>
|
</div>
|
||||||
<? }
|
<? }
|
||||||
|
|
||||||
$DB->query("SELECT DISTINCT req.ID,
|
$DB->query("SELECT DISTINCT req.ID,
|
||||||
req.FillerID,
|
req.FillerID,
|
||||||
@ -198,59 +198,54 @@
|
|||||||
AND req.TimeFilled > '2010-03-04 02:31:49'
|
AND req.TimeFilled > '2010-03-04 02:31:49'
|
||||||
AND req.TorrentID=$TorrentID");
|
AND req.TorrentID=$TorrentID");
|
||||||
$Requests = ($DB->record_count());
|
$Requests = ($DB->record_count());
|
||||||
if($Requests > 0) {
|
if ($Requests > 0) {
|
||||||
while(list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
|
while(list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
|
||||||
?>
|
?>
|
||||||
<div style="text-align: right;">
|
<div style="text-align: right;">
|
||||||
<strong class="important_text"><a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a> used this torrent to fill <a href="requests.php?action=view&id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong>
|
<strong class="important_text"><a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a> used this torrent to fill <a href="requests.php?action=view&id=<?=$RequestID?>">this request</a> <?=time_diff($FilledTime)?></strong>
|
||||||
</div>
|
</div>
|
||||||
<? }
|
<? }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? if($Tracks) { ?>
|
<? if ($Tracks) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Relevant tracks:</td>
|
<td class="label">Relevant tracks:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<?=str_replace(" ", ", ", $Tracks)?>
|
<?=str_replace(" ", ", ", $Tracks)?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? }
|
<? }
|
||||||
|
|
||||||
if($Links) {
|
if ($Links) { ?>
|
||||||
?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Relevant links:</td>
|
<td class="label">Relevant links:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<?
|
<?
|
||||||
$Links = explode(" ", $Links);
|
$Links = explode(" ", $Links);
|
||||||
foreach($Links as $Link) {
|
foreach ($Links as $Link) {
|
||||||
|
|
||||||
if ($local_url = $Text->local_url($Link)) {
|
if ($local_url = $Text->local_url($Link)) {
|
||||||
$Link = $local_url;
|
$Link = $local_url;
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
<a href="<?=$Link?>"><?=$Link?></a>
|
<a href="<?=$Link?>"><?=$Link?></a>
|
||||||
<?
|
<?
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
|
if ($ExtraIDs) { ?>
|
||||||
if($ExtraIDs) {
|
|
||||||
?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Relevant other torrents:</td>
|
<td class="label">Relevant other torrents:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<?
|
<?
|
||||||
$First = true;
|
$First = true;
|
||||||
$Extras = explode(" ", $ExtraIDs);
|
$Extras = explode(" ", $ExtraIDs);
|
||||||
foreach($Extras as $ExtraID) {
|
foreach ($Extras as $ExtraID) {
|
||||||
|
|
||||||
|
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
@ -292,7 +287,7 @@
|
|||||||
$ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
|
$ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record());
|
||||||
|
|
||||||
|
|
||||||
if($ExtraGroupName) {
|
if ($ExtraGroupName) {
|
||||||
if ($ArtistID == 0 && empty($ArtistName)) {
|
if ($ArtistID == 0 && empty($ArtistName)) {
|
||||||
$ExtraLinkName = "<a href='torrents.php?id=$ExtraGroupID'>$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : "")."</a> <a href='torrents.php?torrentid=$ExtraID'> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : "")."</a> ".($ExtraHasLog == '1' ? " <a href='torrents.php?action=viewlog&torrentid=$ExtraID&groupid=$ExtraGroupID'>(Log: $ExtraLogScore %)</a>" : "")." (".number_format($ExtraSize/(1024*1024), 2)." MB)";
|
$ExtraLinkName = "<a href='torrents.php?id=$ExtraGroupID'>$ExtraGroupName".($ExtraYear ? " ($ExtraYear)" : "")."</a> <a href='torrents.php?torrentid=$ExtraID'> [$ExtraFormat/$ExtraEncoding/$ExtraMedia]".($ExtraRemastered ? " <$ExtraRemasterTitle - $ExtraRemasterYear>" : "")."</a> ".($ExtraHasLog == '1' ? " <a href='torrents.php?action=viewlog&torrentid=$ExtraID&groupid=$ExtraGroupID'>(Log: $ExtraLogScore %)</a>" : "")." (".number_format($ExtraSize/(1024*1024), 2)." MB)";
|
||||||
} elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
|
} elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') {
|
||||||
@ -302,44 +297,39 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?=($First ? "" : "<br />")?>
|
<?=($First ? '' : '<br />')?>
|
||||||
<?=$ExtraLinkName?>
|
<?=$ExtraLinkName?>
|
||||||
<a href="torrents.php?action=download&id=<?=$ExtraID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
|
<a href="torrents.php?action=download&id=<?=$ExtraID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a>
|
||||||
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
uploaded by <a href="user.php?id=<?=$ExtraUploaderID?>"><?=$ExtraUploaderName?></a> <?=time_diff($ExtraTime)?> <a href="#" onclick="Switch(<?=$ReportID?>, <?=$TorrentID?>, <?=$ExtraID?>); return false;" class="brackets">Switch</a>
|
||||||
<?
|
<?
|
||||||
$First = false;
|
$First = false;
|
||||||
}
|
}
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
|
if ($Images) { ?>
|
||||||
if($Images) {
|
|
||||||
?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Relevant images:</td>
|
<td class="label">Relevant images:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<?
|
<?
|
||||||
$Images = explode(" ", $Images);
|
$Images = explode(" ", $Images);
|
||||||
foreach($Images as $Image) {
|
foreach ($Images as $Image) {
|
||||||
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Image);
|
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Image);
|
||||||
?>
|
?>
|
||||||
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=$Image?>" alt="Relevant image" />
|
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=$Image?>" alt="Relevant image" />
|
||||||
<?
|
<?
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">User comment:</td>
|
<td class="label">User comment:</td>
|
||||||
<td colspan="3"><?=$Text->full_format($UserComment)?></td>
|
<td colspan="3"><?=$Text->full_format($UserComment)?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<? // END REPORTED STUFF :|: BEGIN MOD STUFF ?>
|
<? // END REPORTED STUFF :|: BEGIN MOD STUFF ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Report comment:</td>
|
<td class="label">Report comment:</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
@ -361,13 +351,13 @@
|
|||||||
}
|
}
|
||||||
array_multisort($Priorities, SORT_ASC, $TypeList);
|
array_multisort($Priorities, SORT_ASC, $TypeList);
|
||||||
|
|
||||||
foreach($TypeList as $Type => $Data) {
|
foreach ($TypeList as $Type => $Data) {
|
||||||
?>
|
?>
|
||||||
<option value="<?=$Type?>"><?=$Data['title']?></option>
|
<option value="<?=$Type?>"><?=$Data['title']?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
<span id="options<?=$ReportID?>">
|
<span id="options<?=$ReportID?>">
|
||||||
<? if(check_perms('users_mod')) { ?>
|
<? if (check_perms('users_mod')) { ?>
|
||||||
<span title="Delete torrent?">
|
<span title="Delete torrent?">
|
||||||
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
|
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
|
||||||
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
|
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
|
||||||
@ -414,14 +404,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label"><strong>Extra</strong> log message:</td>
|
<td class="label"><strong>Extra</strong> log message:</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40" <? if($ExtraIDs) {
|
<input type="text" name="log_message" id="log_message<?=$ReportID?>" size="40"<? if ($ExtraIDs) {
|
||||||
$Extras = explode(" ", $ExtraIDs);
|
$Extras = explode(' ', $ExtraIDs);
|
||||||
$Value = "";
|
$Value = '';
|
||||||
foreach($Extras as $ExtraID) {
|
foreach ($Extras as $ExtraID) {
|
||||||
$Value .= 'https://'.SSL_SITE_URL.'/torrents.php?torrentid='.$ExtraID.' ';
|
$Value .= 'https://'.SSL_SITE_URL.'/torrents.php?torrentid='.$ExtraID.' ';
|
||||||
}
|
}
|
||||||
echo 'value="'.trim($Value).'"';
|
echo ' value="'.trim($Value).'"';
|
||||||
} ?>/>
|
} ?> />
|
||||||
</td>
|
</td>
|
||||||
<td class="label"><strong>Extra</strong> staff notes:</td>
|
<td class="label"><strong>Extra</strong> staff notes:</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
* they visit reportsv2.php?id=xxx
|
* they visit reportsv2.php?id=xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
include(SERVER_ROOT.'/sections/torrents/functions.php');
|
||||||
|
include(SERVER_ROOT.'/classes/class_text.php');
|
||||||
|
|
||||||
|
$Text = NEW TEXT;
|
||||||
|
|
||||||
//If we're not coming from torrents.php, check we're being returned because of an error.
|
//If we're not coming from torrents.php, check we're being returned because of an error.
|
||||||
if(!isset($_GET['id']) || !is_number($_GET['id'])) {
|
if(!isset($_GET['id']) || !is_number($_GET['id'])) {
|
||||||
if(!isset($Err)) {
|
if(!isset($Err)) {
|
||||||
@ -11,11 +16,52 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$TorrentID = $_GET['id'];
|
$TorrentID = $_GET['id'];
|
||||||
$DB->query("SELECT tg.CategoryID FROM torrents_group AS tg LEFT JOIN torrents AS t ON t.GroupID=tg.ID WHERE t.ID=".$_GET['id']);
|
$DB->query("SELECT tg.CategoryID, t.GroupID FROM torrents_group AS tg LEFT JOIN torrents AS t ON t.GroupID=tg.ID WHERE t.ID=" . $_GET['id']);
|
||||||
list($CategoryID) = $DB->next_record();
|
list($CategoryID, $GroupID) = $DB->next_record();
|
||||||
|
$Artists = Artists::get_artist($GroupID);
|
||||||
|
$TorrentCache = get_group_info($GroupID, true, $RevisionID);
|
||||||
|
$GroupDetails = $TorrentCache[0];
|
||||||
|
$TorrentList = $TorrentCache[1];
|
||||||
|
//Resolve the torrentlist to the one specific torrent being reported
|
||||||
|
foreach ($TorrentList as &$Torrent) {
|
||||||
|
//Remove unneeded entries
|
||||||
|
if ($Torrent["ID"] != $TorrentID)
|
||||||
|
unset($TorrentList[$Torrent["ID"]]);
|
||||||
|
}
|
||||||
|
// Group details
|
||||||
|
list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupYear,
|
||||||
|
$GroupRecordLabel, $GroupCatalogueNumber, $ReleaseType, $GroupCategoryID,
|
||||||
|
$GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
|
||||||
|
$TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($GroupDetails);
|
||||||
|
|
||||||
|
$DisplayName = $GroupName;
|
||||||
|
$AltName = $GroupName; // Goes in the alt text of the image
|
||||||
|
$Title = $GroupName; // goes in <title>
|
||||||
|
$WikiBody = $Text->full_format($WikiBody);
|
||||||
|
|
||||||
|
//Get the artist name, group name etc.
|
||||||
|
$Artists = Artists::get_artist($GroupID);
|
||||||
|
if ($Artists) {
|
||||||
|
$DisplayName = '<span dir="ltr">' . Artists::display_artists($Artists, true) . '<a href="torrents.php?torrentid=' . $TorrentID . '">' .$DisplayName . '</a></span>';
|
||||||
|
$AltName = display_str(Artists::display_artists($Artists, false)) . $AltName;
|
||||||
|
$Title = $AltName;
|
||||||
|
}
|
||||||
|
if ($GroupYear > 0) {
|
||||||
|
$DisplayName.=' [' . $GroupYear . ']';
|
||||||
|
$AltName.=' [' . $GroupYear . ']';
|
||||||
|
$Title.= ' [' . $GroupYear . ']';
|
||||||
|
}
|
||||||
|
if ($GroupVanityHouse) {
|
||||||
|
$DisplayName.=' [Vanity House]';
|
||||||
|
$AltName.=' [Vanity House]';
|
||||||
|
}
|
||||||
|
if ($GroupCategoryID == 1) {
|
||||||
|
$DisplayName.=' [' . $ReleaseTypes[$ReleaseType] . ']';
|
||||||
|
$AltName.=' [' . $ReleaseTypes[$ReleaseType] . ']';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View::show_header('Report', 'reportsv2');
|
View::show_header('Report', 'reportsv2,jquery,browse,torrent,bbcode,recommend');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="thin">
|
<div class="thin">
|
||||||
@ -23,6 +69,24 @@
|
|||||||
<h2>Report a torrent</h2>
|
<h2>Report a torrent</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<h3><?=$DisplayName?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="thin">
|
||||||
|
<table class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : ''?>" id="torrent_details">
|
||||||
|
<tr class="colhead_dark">
|
||||||
|
<td width="80%"><strong>Reported torrent</strong></td>
|
||||||
|
<td><strong>Size</strong></td>
|
||||||
|
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/snatched.png" alt="Snatches" title="Snatches" /></td>
|
||||||
|
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/seeders.png" alt="Seeders" title="Seeders" /></td>
|
||||||
|
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" /></td>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes);
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form class="create_form" name="report" action="reportsv2.php?action=takereport" enctype="multipart/form-data" method="post" id="reportform">
|
<form class="create_form" name="report" action="reportsv2.php?action=takereport" enctype="multipart/form-data" method="post" id="reportform">
|
||||||
<div>
|
<div>
|
||||||
<input type="hidden" name="submit" value="true" />
|
<input type="hidden" name="submit" value="true" />
|
||||||
@ -30,12 +94,15 @@
|
|||||||
<input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
|
<input type="hidden" name="torrentid" value="<?=$TorrentID?>" />
|
||||||
<input type="hidden" name="categoryid" value="<?=$CategoryID?>" />
|
<input type="hidden" name="categoryid" value="<?=$CategoryID?>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h3>Report information</h3>
|
||||||
|
<div class="box pad">
|
||||||
<table class="layout">
|
<table class="layout">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Reason :</td>
|
<td class="label">Reason:</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="type" name="type" onchange="ChangeReportType()">
|
<select id="type" name="type" onchange="ChangeReportType()">
|
||||||
<?
|
<?
|
||||||
if (!empty($Types[$CategoryID])) {
|
if (!empty($Types[$CategoryID])) {
|
||||||
$TypeList = $Types['master'] + $Types[$CategoryID];
|
$TypeList = $Types['master'] + $Types[$CategoryID];
|
||||||
$Priorities = array();
|
$Priorities = array();
|
||||||
@ -46,17 +113,14 @@
|
|||||||
} else {
|
} else {
|
||||||
$TypeList = $Types['master'];
|
$TypeList = $Types['master'];
|
||||||
}
|
}
|
||||||
foreach($TypeList as $Type => $Data) {
|
foreach ($TypeList as $Type => $Data) {
|
||||||
?>
|
?>
|
||||||
<option value="<?=$Type?>"><?=$Data['title']?></option>
|
<option value="<?= $Type ?>"><?= $Data['title'] ?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3>Reporting guidelines</h3>
|
|
||||||
<div class="box pad">
|
|
||||||
<p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
|
<p>Fields that contain lists of values (for example, listing more than one track number) should be separated by a space.</p>
|
||||||
<br />
|
<br />
|
||||||
<p><strong>Following the below report type specific guidelines will help the moderators deal with your report in a timely fashion. </strong></p>
|
<p><strong>Following the below report type specific guidelines will help the moderators deal with your report in a timely fashion. </strong></p>
|
||||||
|
@ -7,27 +7,27 @@ $ExtraJoins = array();
|
|||||||
|
|
||||||
$Submitted = !empty($_GET['submit']);
|
$Submitted = !empty($_GET['submit']);
|
||||||
|
|
||||||
if(!empty($_GET['search'])) {
|
if (!empty($_GET['search'])) {
|
||||||
$Words = explode(' ', $_GET['search']);
|
$Words = explode(' ', $_GET['search']);
|
||||||
$SearchWords = array();
|
$SearchWords = array();
|
||||||
foreach($Words AS $Word) {
|
foreach ($Words AS $Word) {
|
||||||
$Wheres[] = "LOCATE('".db_string($Word)."', r.Title)";
|
$Wheres[] = "LOCATE('".db_string($Word)."', r.Title)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$TagMatcher = (!empty($_GET['tagmatcher']) && $_GET['tagmatcher'] == "any") ? "any" : "all";
|
$TagMatcher = (!empty($_GET['tagmatcher']) && $_GET['tagmatcher'] == "any") ? "any" : "all";
|
||||||
|
|
||||||
if(!empty($_GET['tags'])){
|
if (!empty($_GET['tags'])) {
|
||||||
$Tags = explode(',', $_GET['tags']);
|
$Tags = explode(',', $_GET['tags']);
|
||||||
$TagNames = array();
|
$TagNames = array();
|
||||||
foreach ($Tags as $Tag){
|
foreach ($Tags as $Tag) {
|
||||||
$Tag = Misc::sanitize_tag($Tag);
|
$Tag = Misc::sanitize_tag($Tag);
|
||||||
if(!empty($Tag)) {
|
if (!empty($Tag)) {
|
||||||
$TagNames[] = $Tag;
|
$TagNames[] = $Tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($TagMatcher == "any") {
|
if ($TagMatcher == "any") {
|
||||||
$ExtraJoins[] = "LEFT JOIN requests_tags AS rt ON r.ID=rt.RequestID";
|
$ExtraJoins[] = "LEFT JOIN requests_tags AS rt ON r.ID=rt.RequestID";
|
||||||
$ExtraJoins[] = "LEFT JOIN tags AS t ON t.ID=rt.TagID";
|
$ExtraJoins[] = "LEFT JOIN tags AS t ON t.ID=rt.TagID";
|
||||||
$Wheres[] = "t.Name IN ('".implode("', '", $TagNames)."')";
|
$Wheres[] = "t.Name IN ('".implode("', '", $TagNames)."')";
|
||||||
@ -36,20 +36,20 @@ if(!empty($_GET['tags'])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
if (!empty($_GET['requestor']) && check_perms('site_see_old_requests')) {
|
||||||
$Wheres[] = "u.Username LIKE ".db_string($_GET['requestor']);
|
$Wheres[] = "u.Username LIKE ".db_string($_GET['requestor']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['filter_cat'])) {
|
if (!empty($_GET['filter_cat'])) {
|
||||||
$Keys = array_keys($_GET['filter_cat']);
|
$Keys = array_keys($_GET['filter_cat']);
|
||||||
$Wheres[] = "r.CategoryID IN (".implode(", ", $Keys).")";
|
$Wheres[] = "r.CategoryID IN (".implode(", ", $Keys).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['releases'])) {
|
if (!empty($_GET['releases'])) {
|
||||||
$ReleaseArray = $_GET['releases'];
|
$ReleaseArray = $_GET['releases'];
|
||||||
if(count($ReleaseArray) != count($ReleaseTypes)) {
|
if (count($ReleaseArray) != count($ReleaseTypes)) {
|
||||||
foreach($ReleaseArray as $Index => $Value) {
|
foreach ($ReleaseArray as $Index => $Value) {
|
||||||
if(is_number($Value)) {
|
if (is_number($Value)) {
|
||||||
$Wheres[] = "r.ReleaseType = ".$Value;
|
$Wheres[] = "r.ReleaseType = ".$Value;
|
||||||
} else {
|
} else {
|
||||||
error(0);
|
error(0);
|
||||||
@ -58,63 +58,63 @@ if(!empty($_GET['releases'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['formats'])) {
|
if (!empty($_GET['formats'])) {
|
||||||
$FormatArray = $_GET['formats'];
|
$FormatArray = $_GET['formats'];
|
||||||
if(count($FormatArray) != count($Formats)) {
|
if (count($FormatArray) != count($Formats)) {
|
||||||
$FormatNameArray = array();
|
$FormatNameArray = array();
|
||||||
foreach($FormatArray as $Index => $MasterIndex) {
|
foreach ($FormatArray as $Index => $MasterIndex) {
|
||||||
if(array_key_exists($Index, $Formats)) {
|
if (array_key_exists($Index, $Formats)) {
|
||||||
$FormatNameArray[$Index] = $Formats[$MasterIndex];
|
$FormatNameArray[$Index] = $Formats[$MasterIndex];
|
||||||
} else {
|
} else {
|
||||||
//Hax
|
//Hax
|
||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($FormatNameArray as $Index => $Name) {
|
foreach ($FormatNameArray as $Index => $Name) {
|
||||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.FormatList)";
|
$Wheres[] = "LOCATE('".db_string($Name)."', r.FormatList)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['media'])) {
|
if (!empty($_GET['media'])) {
|
||||||
$MediaArray = $_GET['media'];
|
$MediaArray = $_GET['media'];
|
||||||
if(count($MediaArray) != count($Media)) {
|
if (count($MediaArray) != count($Media)) {
|
||||||
$MediaNameArray = array();
|
$MediaNameArray = array();
|
||||||
foreach($MediaArray as $Index => $MasterIndex) {
|
foreach ($MediaArray as $Index => $MasterIndex) {
|
||||||
if(array_key_exists($Index, $Media)) {
|
if (array_key_exists($Index, $Media)) {
|
||||||
$MediaNameArray[$Index] = $Media[$MasterIndex];
|
$MediaNameArray[$Index] = $Media[$MasterIndex];
|
||||||
} else {
|
} else {
|
||||||
//Hax
|
//Hax
|
||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($MediaNameArray as $Index => $Name) {
|
foreach ($MediaNameArray as $Index => $Name) {
|
||||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.MediaList)";
|
$Wheres[] = "LOCATE('".db_string($Name)."', r.MediaList)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($_GET['bitrates'])) {
|
if (!empty($_GET['bitrates'])) {
|
||||||
$BitrateArray = $_GET['bitrates'];
|
$BitrateArray = $_GET['bitrates'];
|
||||||
if(count($BitrateArray) != count($Bitrates)) {
|
if (count($BitrateArray) != count($Bitrates)) {
|
||||||
$BitrateNameArray = array();
|
$BitrateNameArray = array();
|
||||||
foreach($BitrateArray as $Index => $MasterIndex) {
|
foreach ($BitrateArray as $Index => $MasterIndex) {
|
||||||
if(array_key_exists($Index, $Bitrates)) {
|
if (array_key_exists($Index, $Bitrates)) {
|
||||||
$BitrateNameArray[$Index] = $Bitrates[$MasterIndex];
|
$BitrateNameArray[$Index] = $Bitrates[$MasterIndex];
|
||||||
} else {
|
} else {
|
||||||
//Hax
|
//Hax
|
||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach($BitrateNameArray as $Index => $Name) {
|
foreach ($BitrateNameArray as $Index => $Name) {
|
||||||
$Wheres[] = "LOCATE('".db_string($Name)."', r.BitrateList)";
|
$Wheres[] = "LOCATE('".db_string($Name)."', r.BitrateList)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_GET['type'])) {
|
if (empty($_GET['type'])) {
|
||||||
$Title = 'Requests';
|
$Title = 'Requests';
|
||||||
if(!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
if (!check_perms('site_see_old_requests') || empty($_GET['showall'])) {
|
||||||
$Wheres[] = "(TorrentID = 0 OR (TimeFilled > (NOW() - INTERVAL 3 DAY)))";
|
$Wheres[] = "(TorrentID = 0 OR (TimeFilled > (NOW() - INTERVAL 3 DAY)))";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -129,7 +129,7 @@ if(empty($_GET['type'])) {
|
|||||||
$ExtraJoins[] = "LEFT JOIN requests_votes AS _rv ON _rv.RequestID=r.ID";
|
$ExtraJoins[] = "LEFT JOIN requests_votes AS _rv ON _rv.RequestID=r.ID";
|
||||||
break;
|
break;
|
||||||
case 'filled':
|
case 'filled':
|
||||||
if(empty($_GET['userid']) || !is_number($_GET['userid'])) {
|
if (empty($_GET['userid']) || !is_number($_GET['userid'])) {
|
||||||
error(404);
|
error(404);
|
||||||
} else {
|
} else {
|
||||||
$Title = "Requests filled";
|
$Title = "Requests filled";
|
||||||
@ -141,14 +141,14 @@ if(empty($_GET['type'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(empty($_GET['order'])) {
|
if (empty($_GET['order'])) {
|
||||||
$CurrentOrder = 'created';
|
$CurrentOrder = 'created';
|
||||||
$CurrentSort = 'desc';
|
$CurrentSort = 'desc';
|
||||||
$NewSort = 'asc';
|
$NewSort = 'asc';
|
||||||
} else {
|
} else {
|
||||||
if(in_array($_GET['order'], $OrderWays)) {
|
if (in_array($_GET['order'], $OrderWays)) {
|
||||||
$CurrentOrder = $_GET['order'];
|
$CurrentOrder = $_GET['order'];
|
||||||
if($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
if ($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
||||||
$CurrentSort = $_GET['sort'];
|
$CurrentSort = $_GET['sort'];
|
||||||
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
||||||
} else {
|
} else {
|
||||||
@ -192,17 +192,17 @@ switch($CurrentOrder) {
|
|||||||
}
|
}
|
||||||
$OrderBy = $OrderBy." ".$CurrentSort;
|
$OrderBy = $OrderBy." ".$CurrentSort;
|
||||||
|
|
||||||
$Matcher = "AND";
|
$Matcher = 'AND';
|
||||||
if(count($Wheres)) {
|
if (count($Wheres)) {
|
||||||
$Where = "WHERE (".implode(") ".$Matcher." (", $Wheres).")";
|
$Where = 'WHERE ('.implode(") ".$Matcher." (", $Wheres).")";
|
||||||
} else {
|
} else {
|
||||||
$Where = "";
|
$Where = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($ExtraJoins)) {
|
if (count($ExtraJoins)) {
|
||||||
$ExtraJoin = implode(" ", $ExtraJoins);
|
$ExtraJoin = implode(' ', $ExtraJoins);
|
||||||
} else {
|
} else {
|
||||||
$ExtraJoin = "";
|
$ExtraJoin = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build SQL query
|
// Build SQL query
|
||||||
@ -248,11 +248,11 @@ show_header($Title, 'requests');
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h2><?=$Title?></h2>
|
<h2><?=$Title?></h2>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<? if(check_perms('site_submit_requests')){ ?>
|
<? if (check_perms('site_submit_requests')) { ?>
|
||||||
<a href="requests.php?action=new" class="brackets">New request</a>
|
<a href="requests.php?action=new" class="brackets">New request</a>
|
||||||
<a href="requests.php?type=created" class="brackets">My requests</a>
|
<a href="requests.php?type=created" class="brackets">My requests</a>
|
||||||
<? }
|
<? }
|
||||||
if(check_perms('site_vote')){?>
|
if (check_perms('site_vote')) { ?>
|
||||||
<a href="requests.php?type=voted" class="brackets">Requests I've voted on</a>
|
<a href="requests.php?type=voted" class="brackets">Requests I've voted on</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</div>
|
</div>
|
||||||
@ -264,23 +264,23 @@ show_header($Title, 'requests');
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label">Search terms:</td>
|
<td class="label">Search terms:</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="search" size="75" value="<?if(isset($_GET['search'])) { echo display_str($_GET['search']); } ?>" />
|
<input type="text" name="search" size="75" value="<? if (isset($_GET['search'])) { echo display_str($_GET['search']); } ?>" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Tags (comma-separated):</td>
|
<td class="label">Tags (comma-separated):</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="tags" size="60" value="<?=display_str(implode(', ', $TagNames))?>" />
|
<input type="text" name="tags" size="60" value="<?=display_str(implode(', ', $TagNames))?>" />
|
||||||
<input type="radio" name="tagmatcher" value="any" <?=((empty($TagMatcher) || $TagMatcher == "any") ? ' checked="checked" ' : '')?>/>Any
|
<input type="radio" name="tagmatcher" value="any"<?=((empty($TagMatcher) || $TagMatcher == 'any') ? ' checked="checked"' : '') ?> />Any
|
||||||
<input type="radio" name="tagmatcher" value="all" <?=((!empty($TagMatcher) && $TagMatcher == "all") ? ' checked="checked" ' : '')?>/>All
|
<input type="radio" name="tagmatcher" value="all"<?=((!empty($TagMatcher) && $TagMatcher == 'all') ? ' checked="checked"' : '') ?> />All
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<? if(check_perms('site_see_old_requests')){ ?>
|
<? if (check_perms('site_see_old_requests')) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Include filled:</td>
|
<td class="label">Include filled:</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="showall" <? if($_GET['showall']) {?>checked="checked"<? } ?> />
|
<input type="checkbox" name="showall"<? if ($_GET['showall']) { ?> checked="checked"<? } ?> />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? /* ?>
|
<? /* ?>
|
||||||
@ -294,19 +294,19 @@ show_header($Title, 'requests');
|
|||||||
</table>
|
</table>
|
||||||
<table class="layout cat_list">
|
<table class="layout cat_list">
|
||||||
<?
|
<?
|
||||||
$x=1;
|
$x = 1;
|
||||||
reset($Categories);
|
reset($Categories);
|
||||||
foreach($Categories as $CatKey => $CatName) {
|
foreach ($Categories as $CatKey => $CatName) {
|
||||||
if($x%8==0 || $x==1) {
|
if ($x % 8 == 0 || $x == 1) {
|
||||||
?>
|
?>
|
||||||
<tr class="cat_list">
|
<tr class="cat_list">
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="filter_cat[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1" <? if(isset($_GET['filter_cat'][$CatKey+1])) { ?>checked="checked"<? } ?> />
|
<input type="checkbox" name="filter_cat[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1"<? if (isset($_GET['filter_cat'][$CatKey + 1])) { ?> checked="checked"<? } ?> />
|
||||||
<label for="cat_<?=($CatKey+1)?>"><?=$CatName?></label>
|
<label for="cat_<?=($CatKey + 1)?>"><?=$CatName?></label>
|
||||||
</td>
|
</td>
|
||||||
<?
|
<?
|
||||||
if($x%7==0) {
|
if ($x % 7 == 0) {
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
@ -322,7 +322,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<input type="checkbox" id="toggle_releases" onchange="Toggle('releases');" /> Toggle All
|
<input type="checkbox" id="toggle_releases" onchange="Toggle('releases');" /> Toggle All
|
||||||
<? $i = 0;
|
<? $i = 0;
|
||||||
foreach ($ReleaseTypes as $Key => $Val) {
|
foreach ($ReleaseTypes as $Key => $Val) {
|
||||||
if($i % 8 == 0) echo "<br />";?>
|
if ($i % 8 == 0) echo "<br />";?>
|
||||||
<input type="checkbox" name="releases[]" value="<?=$Key?>"
|
<input type="checkbox" name="releases[]" value="<?=$Key?>"
|
||||||
<?=(((!$Submitted) || !empty($ReleaseArray) && in_array($Key, $ReleaseArray)) ? ' checked="checked" ' : '')?>
|
<?=(((!$Submitted) || !empty($ReleaseArray) && in_array($Key, $ReleaseArray)) ? ' checked="checked" ' : '')?>
|
||||||
/> <?=$Val?>
|
/> <?=$Val?>
|
||||||
@ -335,7 +335,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="toggle_formats" onchange="Toggle('formats');" /> Toggle All
|
<input type="checkbox" id="toggle_formats" onchange="Toggle('formats');" /> Toggle All
|
||||||
<? foreach ($Formats as $Key => $Val) {
|
<? foreach ($Formats as $Key => $Val) {
|
||||||
if($Key % 8 == 0) echo "<br />";?>
|
if ($Key % 8 == 0) echo "<br />";?>
|
||||||
<input type="checkbox" name="formats[]" value="<?=$Key?>"
|
<input type="checkbox" name="formats[]" value="<?=$Key?>"
|
||||||
<?=(((!$Submitted) || !empty($FormatArray) && in_array($Key, $FormatArray)) ? ' checked="checked" ' : '')?>
|
<?=(((!$Submitted) || !empty($FormatArray) && in_array($Key, $FormatArray)) ? ' checked="checked" ' : '')?>
|
||||||
/> <?=$Val?>
|
/> <?=$Val?>
|
||||||
@ -347,7 +347,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="toggle_bitrates" onchange="Toggle('bitrates');" /> Toggle All
|
<input type="checkbox" id="toggle_bitrates" onchange="Toggle('bitrates');" /> Toggle All
|
||||||
<? foreach ($Bitrates as $Key => $Val) {
|
<? foreach ($Bitrates as $Key => $Val) {
|
||||||
if($Key % 8 == 0) echo "<br />";?>
|
if ($Key % 8 == 0) echo "<br />";?>
|
||||||
<input type="checkbox" name="bitrates[]" value="<?=$Key?>"
|
<input type="checkbox" name="bitrates[]" value="<?=$Key?>"
|
||||||
<?=(((!$Submitted) || !empty($BitrateArray) && in_array($Key, $BitrateArray)) ? ' checked="checked" ' : '')?>
|
<?=(((!$Submitted) || !empty($BitrateArray) && in_array($Key, $BitrateArray)) ? ' checked="checked" ' : '')?>
|
||||||
/> <?=$Val?>
|
/> <?=$Val?>
|
||||||
@ -359,7 +359,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="toggle_media" onchange="Toggle('media');" /> Toggle All
|
<input type="checkbox" id="toggle_media" onchange="Toggle('media');" /> Toggle All
|
||||||
<? foreach ($Media as $Key => $Val) {
|
<? foreach ($Media as $Key => $Val) {
|
||||||
if($Key % 8 == 0) echo "<br />";?>
|
if ($Key % 8 == 0) echo "<br />";?>
|
||||||
<input type="checkbox" name="media[]" value="<?=$Key?>"
|
<input type="checkbox" name="media[]" value="<?=$Key?>"
|
||||||
<?=(((!$Submitted) || !empty($MediaArray) && in_array($Key, $MediaArray)) ? ' checked="checked" ' : '')?>
|
<?=(((!$Submitted) || !empty($MediaArray) && in_array($Key, $MediaArray)) ? ' checked="checked" ' : '')?>
|
||||||
/> <?=$Val?>
|
/> <?=$Val?>
|
||||||
@ -405,7 +405,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<? if($Results == 0){ ?>
|
<? if ($Results == 0) { ?>
|
||||||
<tr class="rowb">
|
<tr class="rowb">
|
||||||
<td colspan="7">
|
<td colspan="7">
|
||||||
Nothing found!
|
Nothing found!
|
||||||
@ -419,11 +419,11 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
$CategoryName = $Categories[$CategoryID - 1];
|
$CategoryName = $Categories[$CategoryID - 1];
|
||||||
$IsFilled = ($TorrentID != 0);
|
$IsFilled = ($TorrentID != 0);
|
||||||
|
|
||||||
if($CategoryName == "Music") {
|
if ($CategoryName == "Music") {
|
||||||
$ArtistForm = get_request_artists($RequestID);
|
$ArtistForm = get_request_artists($RequestID);
|
||||||
$ArtistLink = display_artists($ArtistForm, true, true);
|
$ArtistLink = display_artists($ArtistForm, true, true);
|
||||||
$FullName = $ArtistLink."<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
$FullName = $ArtistLink."<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
||||||
} elseif($CategoryName == "Audiobooks" || $CategoryName == "Comedy") {
|
} elseif ($CategoryName == 'Audiobooks' || $CategoryName == 'Comedy') {
|
||||||
$FullName = "<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
$FullName = "<a href='requests.php?action=view&id=".$RequestID."'>".$Title." [".$Year."]</a>";
|
||||||
} else {
|
} else {
|
||||||
$FullName ="<a href='requests.php?action=view&id=".$RequestID."'>".$Title."</a>";
|
$FullName ="<a href='requests.php?action=view&id=".$RequestID."'>".$Title."</a>";
|
||||||
@ -439,7 +439,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<div class="tags">
|
<div class="tags">
|
||||||
<?
|
<?
|
||||||
$TagList = array();
|
$TagList = array();
|
||||||
foreach($Tags as $TagID => $TagName) {
|
foreach ($Tags as $TagID => $TagName) {
|
||||||
$TagList[] = "<a href='requests.php?tag=".$TagID."'>".display_str($TagName)."</a>";
|
$TagList[] = "<a href='requests.php?tag=".$TagID."'>".display_str($TagName)."</a>";
|
||||||
}
|
}
|
||||||
$TagList = implode(', ', $TagList);
|
$TagList = implode(', ', $TagList);
|
||||||
@ -449,7 +449,7 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?=$Votes?>
|
<?=$Votes?>
|
||||||
<? if(!$IsFilled && check_perms('site_vote')){ ?>
|
<? if (!$IsFilled && check_perms('site_vote')) { ?>
|
||||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<a href="javascript:Vote()" class="brackets"><strong>+</strong></a>
|
<a href="javascript:Vote()" class="brackets"><strong>+</strong></a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -458,14 +458,14 @@ foreach($Categories as $CatKey => $CatName) {
|
|||||||
<?=get_size($Bounty)?>
|
<?=get_size($Bounty)?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<? if($IsFilled){ ?>
|
<? if ($IsFilled) { ?>
|
||||||
<a href="torrents.php?id=<?=$TorrentID?>"><strong>Yes - <?=$TimeFilled?></strong></a>
|
<a href="torrents.php?id=<?=$TorrentID?>"><strong>Yes - <?=$TimeFilled?></strong></a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<strong>No - <a href="upload.php?requestid=<?=$RequestID?>" class="brackets">Upload</a></strong>
|
<strong>No - <a href="upload.php?requestid=<?=$RequestID?>" class="brackets">Upload</a></strong>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<? if($IsFilled){ ?>
|
<? if ($IsFilled) { ?>
|
||||||
<a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a>
|
<a href="user.php?id=<?=$FillerID?>"><?=$FillerName?></a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
--
|
--
|
||||||
|
@ -10,30 +10,24 @@
|
|||||||
<br />
|
<br />
|
||||||
<strong>Ratio System Overview:</strong><br />
|
<strong>Ratio System Overview:</strong><br />
|
||||||
<ul>
|
<ul>
|
||||||
<li>Your <strong>ratio</strong> is calculated by dividing the amount of data you've uploaded by the amount of data you've downloaded. You can view your ratio in the site header, or
|
<li>Your <strong>ratio</strong> is calculated by dividing the amount of data you've uploaded by the amount of data you've downloaded. You can view your ratio in the site header, or in the 'stats' section of your user profile.
|
||||||
in the 'stats' section of your user profile.
|
|
||||||
</li>
|
</li>
|
||||||
<li>To maintain <strong>leeching privileges</strong>, your ratio must remain above a minimum value. This minimum value is your <strong>required ratio</strong>.</li>
|
<li>To maintain <strong>leeching privileges</strong>, your ratio must remain above a minimum value. This minimum value is your <strong>required ratio</strong>.</li>
|
||||||
<li>If your ratio falls below your required ratio, you will be given two weeks to raise your ratio back above your required ratio. During this period, you are on <strong>ratio
|
<li>If your ratio falls below your required ratio, you will be given two weeks to raise your ratio back above your required ratio. During this period, you are on <strong>ratio watch</strong>.
|
||||||
watch</strong>.
|
|
||||||
</li>
|
</li>
|
||||||
<li>If you fail to raise your ratio above your required required ratio in the allotted time, your leeching privileges will be revoked. You will be unable to download more data. Your
|
<li>If you fail to raise your ratio above your required required ratio in the allotted time, your leeching privileges will be revoked. You will be unable to download more data. Your account will remain enabled.
|
||||||
account will remain enabled.
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<strong>Required Ratio Overview:</strong><br />
|
<strong>Required Ratio Overview:</strong><br />
|
||||||
<ul>
|
<ul>
|
||||||
<li>Your required ratio represents the minimum ratio you must maintain to avoid ratio watch. You can view your required ratio in the site header after the word 'required,' or in
|
<li>Your required ratio represents the minimum ratio you must maintain to avoid ratio watch. You can view your required ratio in the site header after the word 'required,' or in the 'stats' section of your user profile.
|
||||||
the 'stats' section of your user profile.
|
|
||||||
</li>
|
</li>
|
||||||
<li>Your required ratio is unique; each person's required ratio is calculated for their account specifically.</li>
|
<li>Your required ratio is unique; each person's required ratio is calculated for their account specifically.</li>
|
||||||
<li>Your required ratio is calculated using (1) the total amount of data you've downloaded and (2) the total number of torrents you're seeding. The seeding total is not limited to
|
<li>Your required ratio is calculated using (1) the total amount of data you've downloaded and (2) the total number of torrents you're seeding. The seeding total is not limited to snatched torrents (completed downloads)—the total includes, but is not limited to, your uploaded torrents.
|
||||||
snatched torrents (completed downloads)—the total includes, but is not limited to, your uploaded torrents.
|
|
||||||
</li>
|
</li>
|
||||||
<li>The required ratio system lowers your required ratio when you seed a greater number of torrents. The more torrents you seed, the lower your required ratio will be. The lower your
|
<li>The required ratio system lowers your required ratio when you seed a greater number of torrents. The more torrents you seed, the lower your required ratio will be. The lower your required ratio is, the less likely it is that you'll enter ratio watch.
|
||||||
required ratio is, the less likely it is that you'll enter ratio watch.
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
@ -150,8 +144,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<strong>Required Ratio Example:</strong><br />
|
<strong>Required Ratio Example:</strong><br />
|
||||||
<ul>
|
<ul>
|
||||||
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20-30 GB amount downloaded bracket in the table above. Rippy's maximum required ratio (0% seeded) is 0.30, and his
|
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20-30 GB amount downloaded bracket in the table above. Rippy's maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
|
||||||
minimum required ratio (100% seeded) is 0.05.
|
|
||||||
</li>
|
</li>
|
||||||
<li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li>
|
<li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li>
|
||||||
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 - seeding/snatched] (which is 0.50). Written out:
|
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 - seeding/snatched] (which is 0.50). Written out:
|
||||||
@ -183,8 +176,7 @@
|
|||||||
<li>To leave ratio watch, you must either raise your ratio by uploading more, or lower your required ratio by seeding more. Your ratio must be equal to or above your required ratio in
|
<li>To leave ratio watch, you must either raise your ratio by uploading more, or lower your required ratio by seeding more. Your ratio must be equal to or above your required ratio in
|
||||||
order for ratio watch to end.
|
order for ratio watch to end.
|
||||||
</li>
|
</li>
|
||||||
<li>If you fail to improve your ratio by the time ratio watch expires and lose leeching privileges, your required ratio will be temporarily set to the maximum possible requirement (as if
|
<li>If you fail to improve your ratio by the time ratio watch expires and lose leeching privileges, your required ratio will be temporarily set to the maximum possible requirement (as if 0% of snatched torrents were being seeded).
|
||||||
0% of snatched torrents were being seeded).
|
|
||||||
</li>
|
</li>
|
||||||
<li>After losing leeching privileges, in order to adjust the required ratio so that it reflects the actual number of torrents being seeded, you must seed for a combined 72 hours within a weeklong period. After 72
|
<li>After losing leeching privileges, in order to adjust the required ratio so that it reflects the actual number of torrents being seeded, you must seed for a combined 72 hours within a weeklong period. After 72
|
||||||
hours of seeding occur, the required ratio will update to reflect your current seeding total, just as it would for a leech-enabled user.
|
hours of seeding occur, the required ratio will update to reflect your current seeding total, just as it would for a leech-enabled user.
|
||||||
@ -193,9 +185,9 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<? include('jump.php'); ?>
|
<? include('jump.php'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
View::show_footer();
|
View::show_footer();
|
||||||
?>
|
?>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
function next_biweek() {
|
function next_biweek() {
|
||||||
$Date = date('d');
|
$Date = date('d');
|
||||||
if($Date < 22 && $Date >=8) {
|
if ($Date < 22 && $Date >=8) {
|
||||||
$Return = 22;
|
$Return = 22;
|
||||||
} else {
|
} else {
|
||||||
$Return = 8;
|
$Return = 8;
|
||||||
@ -29,12 +29,12 @@ function next_biweek() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function next_day() {
|
function next_day() {
|
||||||
$Tomorrow = time(0,0,0,date('m'),date('d')+1,date('Y'));
|
$Tomorrow = time(0,0,0,date('m'),date('d') + 1,date('Y'));
|
||||||
return date('d', $Tomorrow);
|
return date('d', $Tomorrow);
|
||||||
}
|
}
|
||||||
|
|
||||||
function next_hour() {
|
function next_hour() {
|
||||||
$Hour = time(date('H')+1,0,0,date('m'),date('d'),date('Y'));
|
$Hour = time(date('H') + 1,0,0,date('m'),date('d'),date('Y'));
|
||||||
return date('H', $Hour);
|
return date('H', $Hour);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,14 +73,24 @@ function next_hour() {
|
|||||||
|
|
||||||
//We use this to control 6 hour freeleeches. They're actually 7 hour, but don't tell anyone.
|
//We use this to control 6 hour freeleeches. They're actually 7 hour, but don't tell anyone.
|
||||||
/*
|
/*
|
||||||
$TimeMinus = time_minus(3600*7);
|
$TimeMinus = time_minus(3600 * 7);
|
||||||
|
|
||||||
$DB->query("SELECT DISTINCT GroupID FROM torrents WHERE FreeTorrent='1' AND FreeLeechType='3' AND Time<'$TimeMinus'");
|
$DB->query("SELECT DISTINCT GroupID
|
||||||
while(list($GroupID) = $DB->next_record()) {
|
FROM torrents
|
||||||
|
WHERE FreeTorrent='1'
|
||||||
|
AND FreeLeechType='3'
|
||||||
|
AND Time<'$TimeMinus'");
|
||||||
|
while (list($GroupID) = $DB->next_record()) {
|
||||||
$Cache->delete_value('torrents_details_'.$GroupID);
|
$Cache->delete_value('torrents_details_'.$GroupID);
|
||||||
$Cache->delete_value('torrent_group_'.$GroupID);
|
$Cache->delete_value('torrent_group_'.$GroupID);
|
||||||
}
|
}
|
||||||
$DB->query("UPDATE torrents SET FreeTorrent='0',FreeLeechType='0',flags='2' WHERE FreeTorrent='1' AND FreeLeechType='3' AND Time<'$TimeMinus'");
|
$DB->query("UPDATE torrents
|
||||||
|
SET FreeTorrent='0',
|
||||||
|
FreeLeechType='0',
|
||||||
|
flags='2'
|
||||||
|
WHERE FreeTorrent='1'
|
||||||
|
AND FreeLeechType='3'
|
||||||
|
AND Time<'$TimeMinus'");
|
||||||
*/
|
*/
|
||||||
sleep(5);
|
sleep(5);
|
||||||
//------------- Delete unpopular tags -----------------------------------//
|
//------------- Delete unpopular tags -----------------------------------//
|
||||||
@ -113,7 +123,7 @@ function next_hour() {
|
|||||||
\*************************************************************************/
|
\*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
if($Hour != next_hour() || $_GET['runhour'] || isset($argv[2])){
|
if ($Hour != next_hour() || $_GET['runhour'] || isset($argv[2])) {
|
||||||
echo "Ran hourly functions\n";
|
echo "Ran hourly functions\n";
|
||||||
|
|
||||||
//------------- Front page stats ----------------------------------------//
|
//------------- Front page stats ----------------------------------------//
|
||||||
@ -126,7 +136,11 @@ function next_hour() {
|
|||||||
$Cache->cache_value('stats_snatches',$SnatchStats,0);
|
$Cache->cache_value('stats_snatches',$SnatchStats,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid) FROM xbt_files_users WHERE active=1 GROUP BY Type");
|
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type,
|
||||||
|
COUNT(uid)
|
||||||
|
FROM xbt_files_users
|
||||||
|
WHERE active=1
|
||||||
|
GROUP BY Type");
|
||||||
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
|
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
|
||||||
$SeederCount = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0;
|
$SeederCount = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0;
|
||||||
$LeecherCount = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0;
|
$LeecherCount = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0;
|
||||||
@ -178,14 +192,21 @@ function next_hour() {
|
|||||||
$Criteria[]=array('From'=>TORRENT_MASTER, 'To'=>POWER_TM, 'MinUpload'=>500*1024*1024*1024, 'MinRatio'=>1.05, 'MinUploads'=>500, 'MaxTime'=>time_minus(3600*24*7*8), 'Extra'=>'(SELECT COUNT(DISTINCT GroupID) FROM torrents WHERE UserID=users_main.ID) >= 500');
|
$Criteria[]=array('From'=>TORRENT_MASTER, 'To'=>POWER_TM, 'MinUpload'=>500*1024*1024*1024, 'MinRatio'=>1.05, 'MinUploads'=>500, 'MaxTime'=>time_minus(3600*24*7*8), 'Extra'=>'(SELECT COUNT(DISTINCT GroupID) FROM torrents WHERE UserID=users_main.ID) >= 500');
|
||||||
$Criteria[]=array('From'=>POWER_TM, 'To'=>ELITE_TM, 'MinUpload'=>500*1024*1024*1024, 'MinRatio'=>1.05, 'MinUploads'=>500, 'MaxTime'=>time_minus(3600*24*7*8), 'Extra'=>"(SELECT COUNT(ID) FROM torrents WHERE ((LogScore = 100 AND Format = 'FLAC') OR (Media = 'Vinyl' AND Format = 'FLAC') OR (Media = 'WEB' AND Format = 'FLAC') OR (Media = 'DVD' AND Format = 'FLAC') OR (Media = 'Soundboard' AND Format = 'FLAC') OR (Media = 'Cassette' AND Format = 'FLAC') OR (Media = 'SACD' AND Format = 'FLAC') OR (Media = 'Blu-ray' AND Format = 'FLAC') OR (Media = 'DAT' AND Format = 'FLAC')) AND UserID = users_main.ID) >= 500");
|
$Criteria[]=array('From'=>POWER_TM, 'To'=>ELITE_TM, 'MinUpload'=>500*1024*1024*1024, 'MinRatio'=>1.05, 'MinUploads'=>500, 'MaxTime'=>time_minus(3600*24*7*8), 'Extra'=>"(SELECT COUNT(ID) FROM torrents WHERE ((LogScore = 100 AND Format = 'FLAC') OR (Media = 'Vinyl' AND Format = 'FLAC') OR (Media = 'WEB' AND Format = 'FLAC') OR (Media = 'DVD' AND Format = 'FLAC') OR (Media = 'Soundboard' AND Format = 'FLAC') OR (Media = 'Cassette' AND Format = 'FLAC') OR (Media = 'SACD' AND Format = 'FLAC') OR (Media = 'Blu-ray' AND Format = 'FLAC') OR (Media = 'DAT' AND Format = 'FLAC')) AND UserID = users_main.ID) >= 500");
|
||||||
|
|
||||||
foreach($Criteria as $L){ // $L = Level
|
foreach ($Criteria as $L) { // $L = Level
|
||||||
$Query = "SELECT ID FROM users_main JOIN users_info ON users_main.ID = users_info.UserID
|
$Query = "
|
||||||
|
SELECT ID
|
||||||
|
FROM users_main
|
||||||
|
JOIN users_info ON users_main.ID = users_info.UserID
|
||||||
WHERE PermissionID=".$L['From']."
|
WHERE PermissionID=".$L['From']."
|
||||||
AND Warned= '0000-00-00 00:00:00'
|
AND Warned= '0000-00-00 00:00:00'
|
||||||
AND Uploaded>='$L[MinUpload]'
|
AND Uploaded>='$L[MinUpload]'
|
||||||
AND (Uploaded/Downloaded >='$L[MinRatio]' OR (Uploaded/Downloaded IS NULL))
|
AND (Uploaded/Downloaded >='$L[MinRatio]' OR (Uploaded/Downloaded IS NULL))
|
||||||
AND JoinDate<'$L[MaxTime]'
|
AND JoinDate<'$L[MaxTime]'
|
||||||
AND (SELECT COUNT(ID) FROM torrents WHERE UserID=users_main.ID)>='$L[MinUploads]'
|
AND (
|
||||||
|
SELECT COUNT(ID)
|
||||||
|
FROM torrents
|
||||||
|
WHERE UserID=users_main.ID
|
||||||
|
) >= '$L[MinUploads]'
|
||||||
AND Enabled='1'";
|
AND Enabled='1'";
|
||||||
if (!empty($L['Extra'])) {
|
if (!empty($L['Extra'])) {
|
||||||
$Query .= ' AND '.$L['Extra'];
|
$Query .= ' AND '.$L['Extra'];
|
||||||
@ -196,7 +217,7 @@ function next_hour() {
|
|||||||
$UserIDs = $DB->collect('ID');
|
$UserIDs = $DB->collect('ID');
|
||||||
|
|
||||||
if (count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
/*$Cache->begin_transaction('user_info_'.$UserID);
|
/*$Cache->begin_transaction('user_info_'.$UserID);
|
||||||
$Cache->update_row(false, array('PermissionID'=>$L['To']));
|
$Cache->update_row(false, array('PermissionID'=>$L['To']));
|
||||||
$Cache->commit_transaction(0);*/
|
$Cache->commit_transaction(0);*/
|
||||||
@ -204,17 +225,25 @@ function next_hour() {
|
|||||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
$Cache->delete_value('user_stats_'.$UserID);
|
$Cache->delete_value('user_stats_'.$UserID);
|
||||||
$Cache->delete_value('enabled_'.$UserID);
|
$Cache->delete_value('enabled_'.$UserID);
|
||||||
$DB->query("UPDATE users_info SET AdminComment = CONCAT('".sqltime()." - Class changed to ".Users::make_class_string($L['To'])." by System\n\n', AdminComment) WHERE UserID = ".$UserID);
|
$DB->query("UPDATE users_info
|
||||||
|
SET AdminComment = CONCAT('".sqltime()." - Class changed to ".Users::make_class_string($L['To'])." by System\n\n', AdminComment)
|
||||||
|
WHERE UserID = ".$UserID);
|
||||||
}
|
}
|
||||||
$DB->query("UPDATE users_main SET PermissionID=".$L['To']." WHERE ID IN(".implode(',',$UserIDs).")");
|
$DB->query("UPDATE users_main SET PermissionID=".$L['To']." WHERE ID IN(".implode(',',$UserIDs).")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Demote users with less than the required uploads
|
// Demote users with less than the required uploads
|
||||||
|
|
||||||
$Query = "SELECT ID FROM users_main JOIN users_info ON users_main.ID = users_info.UserID
|
$Query = "
|
||||||
|
SELECT ID
|
||||||
|
FROM users_main
|
||||||
|
JOIN users_info ON users_main.ID = users_info.UserID
|
||||||
WHERE PermissionID='$L[To]'
|
WHERE PermissionID='$L[To]'
|
||||||
AND ( Uploaded<'$L[MinUpload]'
|
AND ( Uploaded<'$L[MinUpload]'
|
||||||
OR (SELECT COUNT(ID) FROM torrents WHERE UserID=users_main.ID)<'$L[MinUploads]'";
|
OR (
|
||||||
|
SELECT COUNT(ID)
|
||||||
|
FROM torrents
|
||||||
|
WHERE UserID=users_main.ID)<'$L[MinUploads]'";
|
||||||
if (!empty($L['Extra'])) {
|
if (!empty($L['Extra'])) {
|
||||||
$Query .= " OR NOT ".$L['Extra'];
|
$Query .= " OR NOT ".$L['Extra'];
|
||||||
}
|
}
|
||||||
@ -226,7 +255,7 @@ function next_hour() {
|
|||||||
$UserIDs = $DB->collect('ID');
|
$UserIDs = $DB->collect('ID');
|
||||||
|
|
||||||
if (count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
/*$Cache->begin_transaction('user_info_'.$UserID);
|
/*$Cache->begin_transaction('user_info_'.$UserID);
|
||||||
$Cache->update_row(false, array('PermissionID'=>$L['From']));
|
$Cache->update_row(false, array('PermissionID'=>$L['From']));
|
||||||
$Cache->commit_transaction(0);*/
|
$Cache->commit_transaction(0);*/
|
||||||
@ -234,7 +263,9 @@ function next_hour() {
|
|||||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
$Cache->delete_value('user_stats_'.$UserID);
|
$Cache->delete_value('user_stats_'.$UserID);
|
||||||
$Cache->delete_value('enabled_'.$UserID);
|
$Cache->delete_value('enabled_'.$UserID);
|
||||||
$DB->query("UPDATE users_info SET AdminComment = CONCAT('".sqltime()." - Class changed to ".Users::make_class_string($L['From'])." by System\n\n', AdminComment) WHERE UserID = ".$UserID);
|
$DB->query("UPDATE users_info
|
||||||
|
SET AdminComment = CONCAT('".sqltime()." - Class changed to ".Users::make_class_string($L['From'])." by System\n\n', AdminComment)
|
||||||
|
WHERE UserID = ".$UserID);
|
||||||
}
|
}
|
||||||
$DB->query("UPDATE users_main SET PermissionID=".$L['From']." WHERE ID IN(".implode(',',$UserIDs).")");
|
$DB->query("UPDATE users_main SET PermissionID=".$L['From']." WHERE ID IN(".implode(',',$UserIDs).")");
|
||||||
}
|
}
|
||||||
@ -270,16 +301,17 @@ function next_hour() {
|
|||||||
//------------- Remove dead sessions ---------------------------------------//
|
//------------- Remove dead sessions ---------------------------------------//
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
$AgoMins = time_minus(60*30);
|
$AgoMins = time_minus(60 * 30);
|
||||||
$AgoDays = time_minus(3600*24*30);
|
$AgoDays = time_minus(3600 * 24 * 30);
|
||||||
|
|
||||||
|
|
||||||
$SessionQuery = $DB->query("SELECT UserID, SessionID FROM users_sessions
|
$SessionQuery = $DB->query("SELECT UserID, SessionID
|
||||||
|
FROM users_sessions
|
||||||
WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')");
|
WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')");
|
||||||
$DB->query("DELETE FROM users_sessions WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')");
|
$DB->query("DELETE FROM users_sessions WHERE (LastUpdate<'$AgoDays' AND KeepLogged='1') OR (LastUpdate<'$AgoMins' AND KeepLogged='0')");
|
||||||
|
|
||||||
$DB->set_query_id($SessionQuery);
|
$DB->set_query_id($SessionQuery);
|
||||||
while(list($UserID, $SessionID) = $DB->next_record()) {
|
while (list($UserID, $SessionID) = $DB->next_record()) {
|
||||||
$Cache->begin_transaction('users_sessions_'.$UserID);
|
$Cache->begin_transaction('users_sessions_'.$UserID);
|
||||||
$Cache->delete_row($SessionID);
|
$Cache->delete_row($SessionID);
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
@ -292,7 +324,7 @@ function next_hour() {
|
|||||||
|
|
||||||
//------------- Remove expired warnings ---------------------------------//
|
//------------- Remove expired warnings ---------------------------------//
|
||||||
$DB->query("SELECT UserID FROM users_info WHERE Warned<'$sqltime'");
|
$DB->query("SELECT UserID FROM users_info WHERE Warned<'$sqltime'");
|
||||||
while(list($UserID) = $DB->next_record()) {
|
while (list($UserID) = $DB->next_record()) {
|
||||||
$Cache->begin_transaction('user_info_'.$UserID);
|
$Cache->begin_transaction('user_info_'.$UserID);
|
||||||
$Cache->update_row(false, array('Warned'=>'0000-00-00 00:00:00'));
|
$Cache->update_row(false, array('Warned'=>'0000-00-00 00:00:00'));
|
||||||
$Cache->commit_transaction(2592000);
|
$Cache->commit_transaction(2592000);
|
||||||
@ -302,28 +334,28 @@ function next_hour() {
|
|||||||
|
|
||||||
// If a user has downloaded more than 10 GiBs while on ratio watch, disable leeching privileges and send the user a message
|
// If a user has downloaded more than 10 GiBs while on ratio watch, disable leeching privileges and send the user a message
|
||||||
|
|
||||||
$DB->query("SELECT ID FROM users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$DB->query("SELECT ID
|
||||||
|
FROM users_info AS i
|
||||||
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
WHERE i.RatioWatchEnds!='0000-00-00 00:00:00'
|
WHERE i.RatioWatchEnds!='0000-00-00 00:00:00'
|
||||||
AND i.RatioWatchDownload+10*1024*1024*1024<m.Downloaded
|
AND i.RatioWatchDownload+10*1024*1024*1024<m.Downloaded
|
||||||
AND m.Enabled='1'
|
AND m.Enabled='1'
|
||||||
AND m.can_leech='1'");
|
AND m.can_leech='1'");
|
||||||
|
|
||||||
$UserIDs = $DB->collect('ID' );
|
$UserIDs = $DB->collect('ID');
|
||||||
if(count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
$Subject = 'Leeching Disabled';
|
$Subject = 'Leeching Disabled';
|
||||||
$Message = 'You have downloaded more then 10 GiB while on Ratio Watch. Your leeching privileges have been disabled. Please reread the rules and refer to this guide on how to improve your ratio https://what.cd/wiki.php?action=article&id=110';
|
$Message = 'You have downloaded more then 10 GiB while on Ratio Watch. Your leeching privileges have been disabled. Please reread the rules and refer to this guide on how to improve your ratio https://what.cd/wiki.php?action=article&id=110';
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
Misc::send_pm($UserID, 0, $Subject, $Message);
|
Misc::send_pm($UserID, 0, $Subject, $Message);
|
||||||
send_irc("PRIVMSG #reports :!leechdisabled Downloaded 10 GB+ on Ratio Watch. https://".NONSSL_SITE_URL."/user.php?id=$UserID");
|
send_irc('PRIVMSG #reports :!leechdisabled Downloaded 10 GB+ on Ratio Watch. https://'.SSL_SITE_URL."/user.php?id=$UserID");
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("UPDATE users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$DB->query("UPDATE users_info AS i
|
||||||
SET
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
m.can_leech='0',
|
SET m.can_leech='0',
|
||||||
i.AdminComment=CONCAT('$sqltime - Leech disabled by ratio watch system for downloading more than 10 GBs on ratio watch. - required ratio: ', m.RequiredRatio,'
|
i.AdminComment=CONCAT('$sqltime - Leech disabled by ratio watch system for downloading more than 10 GBs on ratio watch. - required ratio: ', m.RequiredRatio,'', i.AdminComment)
|
||||||
|
WHERE m.ID IN(".implode(',',$UserIDs).")");
|
||||||
' , i.AdminComment)
|
|
||||||
WHERE m.ID IN(".implode(',',$UserIDs).")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -334,9 +366,9 @@ function next_hour() {
|
|||||||
|
|
||||||
\*************************************************************************/
|
\*************************************************************************/
|
||||||
|
|
||||||
if(!$NoDaily && $Day != next_day() || $_GET['runday']){
|
if (!$NoDaily && $Day != next_day() || $_GET['runday']) {
|
||||||
echo "Ran daily functions\n";
|
echo "Ran daily functions\n";
|
||||||
if($Day%2 == 0) { // If we should generate the drive database (at the end)
|
if ($Day % 2 == 0) { // If we should generate the drive database (at the end)
|
||||||
$GenerateDriveDB = true;
|
$GenerateDriveDB = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,29 +409,35 @@ function next_hour() {
|
|||||||
WHERE s.NumSnatches>0;");
|
WHERE s.NumSnatches>0;");
|
||||||
|
|
||||||
$RatioRequirements = array(
|
$RatioRequirements = array(
|
||||||
array(80*1024*1024*1024, 0.60, 0.50),
|
array(80 * 1024 * 1024 * 1024, 0.60, 0.50),
|
||||||
array(60*1024*1024*1024, 0.60, 0.40),
|
array(60 * 1024 * 1024 * 1024, 0.60, 0.40),
|
||||||
array(50*1024*1024*1024, 0.60, 0.30),
|
array(50 * 1024 * 1024 * 1024, 0.60, 0.30),
|
||||||
array(40*1024*1024*1024, 0.50, 0.20),
|
array(40 * 1024 * 1024 * 1024, 0.50, 0.20),
|
||||||
array(30*1024*1024*1024, 0.40, 0.10),
|
array(30 * 1024 * 1024 * 1024, 0.40, 0.10),
|
||||||
array(20*1024*1024*1024, 0.30, 0.05),
|
array(20 * 1024 * 1024 * 1024, 0.30, 0.05),
|
||||||
array(10*1024*1024*1024, 0.20, 0.0),
|
array(10 * 1024 * 1024 * 1024, 0.20, 0.0),
|
||||||
array(5*1024*1024*1024, 0.15, 0.0)
|
array(5 * 1024 * 1024 * 1024, 0.15, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
$DB->query("UPDATE users_main SET RequiredRatio=0.60 WHERE Downloaded>100*1024*1024*1024");
|
$DB->query("UPDATE users_main SET RequiredRatio=0.60 WHERE Downloaded>100*1024*1024*1024");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$DownloadBarrier = 100*1024*1024*1024;
|
$DownloadBarrier = 100 * 1024 * 1024 * 1024;
|
||||||
foreach($RatioRequirements as $Requirement) {
|
foreach ($RatioRequirements as $Requirement) {
|
||||||
list($Download, $Ratio, $MinRatio) = $Requirement;
|
list($Download, $Ratio, $MinRatio) = $Requirement;
|
||||||
|
|
||||||
$DB->query("UPDATE users_main SET RequiredRatio=RequiredRatioWork*$Ratio WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier'");
|
$DB->query("UPDATE users_main
|
||||||
|
SET RequiredRatio=RequiredRatioWork*$Ratio
|
||||||
|
WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier'");
|
||||||
|
|
||||||
$DB->query("UPDATE users_main SET RequiredRatio=$MinRatio WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier' AND RequiredRatio<$MinRatio");
|
$DB->query("UPDATE users_main
|
||||||
|
SET RequiredRatio=$MinRatio
|
||||||
|
WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier' AND RequiredRatio<$MinRatio");
|
||||||
|
|
||||||
//$DB->query("UPDATE users_main SET RequiredRatio=$Ratio WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier' AND can_leech='0' AND Enabled='1'");
|
//$DB->query("UPDATE users_main
|
||||||
|
// SET RequiredRatio=$Ratio
|
||||||
|
// WHERE Downloaded >= '$Download' AND Downloaded < '$DownloadBarrier' AND can_leech='0' AND Enabled='1'");
|
||||||
|
|
||||||
$DownloadBarrier = $Download;
|
$DownloadBarrier = $Download;
|
||||||
}
|
}
|
||||||
@ -412,42 +450,52 @@ function next_hour() {
|
|||||||
$OnRatioWatch = array();
|
$OnRatioWatch = array();
|
||||||
|
|
||||||
// Take users off ratio watch and enable leeching
|
// Take users off ratio watch and enable leeching
|
||||||
$UserQuery = $DB->query("SELECT m.ID, torrent_pass FROM users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$UserQuery = $DB->query("
|
||||||
|
SELECT
|
||||||
|
m.ID,
|
||||||
|
torrent_pass
|
||||||
|
FROM users_info AS i
|
||||||
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
WHERE m.Uploaded/m.Downloaded >= m.RequiredRatio
|
WHERE m.Uploaded/m.Downloaded >= m.RequiredRatio
|
||||||
AND i.RatioWatchEnds!='0000-00-00 00:00:00'
|
AND i.RatioWatchEnds!='0000-00-00 00:00:00'
|
||||||
AND m.can_leech='0'
|
AND m.can_leech='0'
|
||||||
AND m.Enabled='1'");
|
AND m.Enabled='1'");
|
||||||
$OffRatioWatch = $DB->collect('ID');
|
$OffRatioWatch = $DB->collect('ID');
|
||||||
if(count($OffRatioWatch)>0) {
|
if (count($OffRatioWatch) > 0) {
|
||||||
$DB->query("UPDATE users_info AS ui
|
$DB->query("UPDATE users_info AS ui
|
||||||
JOIN users_main AS um ON um.ID = ui.UserID
|
JOIN users_main AS um ON um.ID = ui.UserID
|
||||||
SET ui.RatioWatchEnds='0000-00-00 00:00:00',
|
SET ui.RatioWatchEnds='0000-00-00 00:00:00',
|
||||||
ui.RatioWatchDownload='0',
|
ui.RatioWatchDownload='0',
|
||||||
um.can_leech='1',
|
um.can_leech='1',
|
||||||
ui.AdminComment = CONCAT('".$sqltime." - Leeching re-enabled by adequate ratio.\n\n', ui.AdminComment)
|
ui.AdminComment = CONCAT('$sqltime - Leeching re-enabled by adequate ratio.\n\n', ui.AdminComment)
|
||||||
WHERE ui.UserID IN(".implode(",", $OffRatioWatch).")");
|
WHERE ui.UserID IN(".implode(',', $OffRatioWatch).')');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($OffRatioWatch as $UserID) {
|
foreach ($OffRatioWatch as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
Misc::send_pm($UserID, 0, "You have been taken off Ratio Watch", "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
Misc::send_pm($UserID, 0, 'You have been taken off Ratio Watch', "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=https://".SSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
||||||
echo "Ratio watch off: $UserID\n";
|
echo "Ratio watch off: $UserID\n";
|
||||||
}
|
}
|
||||||
$DB->set_query_id($UserQuery);
|
$DB->set_query_id($UserQuery);
|
||||||
$Passkeys = $DB->collect('torrent_pass');
|
$Passkeys = $DB->collect('torrent_pass');
|
||||||
foreach($Passkeys as $Passkey) {
|
foreach ($Passkeys as $Passkey) {
|
||||||
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '1'));
|
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '1'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take users off ratio watch
|
// Take users off ratio watch
|
||||||
$UserQuery = $DB->query("SELECT m.ID, torrent_pass FROM users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$UserQuery = $DB->query("
|
||||||
|
SELECT
|
||||||
|
m.ID,
|
||||||
|
torrent_pass
|
||||||
|
FROM users_info AS i
|
||||||
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
WHERE m.Uploaded/m.Downloaded >= m.RequiredRatio
|
WHERE m.Uploaded/m.Downloaded >= m.RequiredRatio
|
||||||
AND i.RatioWatchEnds!='0000-00-00 00:00:00'
|
AND i.RatioWatchEnds!='0000-00-00 00:00:00'
|
||||||
AND m.Enabled='1'");
|
AND m.Enabled='1'");
|
||||||
$OffRatioWatch = $DB->collect('ID');
|
$OffRatioWatch = $DB->collect('ID');
|
||||||
if(count($OffRatioWatch)>0) {
|
if (count($OffRatioWatch) > 0) {
|
||||||
$DB->query("UPDATE users_info AS ui
|
$DB->query("UPDATE users_info AS ui
|
||||||
JOIN users_main AS um ON um.ID = ui.UserID
|
JOIN users_main AS um ON um.ID = ui.UserID
|
||||||
SET ui.RatioWatchEnds='0000-00-00 00:00:00',
|
SET ui.RatioWatchEnds='0000-00-00 00:00:00',
|
||||||
@ -456,42 +504,45 @@ function next_hour() {
|
|||||||
WHERE ui.UserID IN(".implode(",", $OffRatioWatch).")");
|
WHERE ui.UserID IN(".implode(",", $OffRatioWatch).")");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($OffRatioWatch as $UserID) {
|
foreach ($OffRatioWatch as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
$Cache->update_row(false, array('RatioWatchEnds'=>'0000-00-00 00:00:00','RatioWatchDownload'=>'0','CanLeech'=>1));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
Misc::send_pm($UserID, 0, "You have been taken off Ratio Watch", "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
Misc::send_pm($UserID, 0, "You have been taken off Ratio Watch", "Congratulations! Feel free to begin downloading again.\n To ensure that you do not get put on ratio watch again, please read the rules located [url=https://".SSL_SITE_URL."/rules.php?p=ratio]here[/url].\n");
|
||||||
echo "Ratio watch off: $UserID\n";
|
echo "Ratio watch off: $UserID\n";
|
||||||
}
|
}
|
||||||
$DB->set_query_id($UserQuery);
|
$DB->set_query_id($UserQuery);
|
||||||
$Passkeys = $DB->collect('torrent_pass');
|
$Passkeys = $DB->collect('torrent_pass');
|
||||||
foreach($Passkeys as $Passkey) {
|
foreach ($Passkeys as $Passkey) {
|
||||||
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '1'));
|
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '1'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Put user on ratio watch if he doesn't meet the standards
|
// Put user on ratio watch if he doesn't meet the standards
|
||||||
sleep(10);
|
sleep(10);
|
||||||
$DB->query("SELECT m.ID, m.Downloaded FROM users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$DB->query("SELECT m.ID,
|
||||||
|
m.Downloaded
|
||||||
|
FROM users_info AS i
|
||||||
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
WHERE m.Uploaded/m.Downloaded < m.RequiredRatio
|
WHERE m.Uploaded/m.Downloaded < m.RequiredRatio
|
||||||
AND i.RatioWatchEnds='0000-00-00 00:00:00'
|
AND i.RatioWatchEnds='0000-00-00 00:00:00'
|
||||||
AND m.Enabled='1'
|
AND m.Enabled='1'
|
||||||
AND m.can_leech='1'");
|
AND m.can_leech='1'");
|
||||||
$OnRatioWatch = $DB->collect('ID');
|
$OnRatioWatch = $DB->collect('ID');
|
||||||
|
|
||||||
if(count($OnRatioWatch)>0) {
|
if (count($OnRatioWatch)>0) {
|
||||||
$DB->query("UPDATE users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$DB->query("UPDATE users_info AS i
|
||||||
SET i.RatioWatchEnds='".time_plus(60*60*24*14)."',
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
|
SET i.RatioWatchEnds='".time_plus(60 * 60 * 24 * 14)."',
|
||||||
i.RatioWatchTimes = i.RatioWatchTimes+1,
|
i.RatioWatchTimes = i.RatioWatchTimes+1,
|
||||||
i.RatioWatchDownload = m.Downloaded
|
i.RatioWatchDownload = m.Downloaded
|
||||||
WHERE m.ID IN(".implode(",", $OnRatioWatch).")");
|
WHERE m.ID IN(".implode(",", $OnRatioWatch).")");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($OnRatioWatch as $UserID) {
|
foreach ($OnRatioWatch as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('RatioWatchEnds'=>time_plus(60*60*24*14),'RatioWatchDownload'=>0));
|
$Cache->update_row(false, array('RatioWatchEnds'=>time_plus(60 * 60 * 24 * 14),'RatioWatchDownload'=>0));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
Misc::send_pm($UserID, 0, "You have been put on Ratio Watch", "This happens when your ratio falls below the requirements we have outlined in the rules located [url=http://".NONSSL_SITE_URL."/rules.php?p=ratio]here[/url].\n For information about ratio watch, click the link above.");
|
Misc::send_pm($UserID, 0, 'You have been put on Ratio Watch', "This happens when your ratio falls below the requirements we have outlined in the rules located [url=https://".SSL_SITE_URL."/rules.php?p=ratio]here[/url].\n For information about ratio watch, click the link above.");
|
||||||
echo "Ratio watch on: $UserID\n";
|
echo "Ratio watch on: $UserID\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -499,7 +550,11 @@ function next_hour() {
|
|||||||
|
|
||||||
//------------- Rescore 0.95 logs of disabled users
|
//------------- Rescore 0.95 logs of disabled users
|
||||||
|
|
||||||
$LogQuery = $DB->query("SELECT DISTINCT t.ID FROM torrents AS t JOIN users_main AS um ON t.UserID = um.ID JOIN torrents_logs_new AS tl ON tl.TorrentID = t.ID WHERE um.Enabled = '2' and t.HasLog = '1' and LogScore = 100 and Log LIKE 'EAC extraction logfile from%'");
|
$LogQuery = $DB->query("SELECT DISTINCT t.ID
|
||||||
|
FROM torrents AS t
|
||||||
|
JOIN users_main AS um ON t.UserID = um.ID
|
||||||
|
JOIN torrents_logs_new AS tl ON tl.TorrentID = t.ID
|
||||||
|
WHERE um.Enabled = '2' and t.HasLog = '1' and LogScore = 100 and Log LIKE 'EAC extraction logfile from%'");
|
||||||
$Details = array();
|
$Details = array();
|
||||||
$Details[] = "Ripped with EAC v0.95, -1 point [1]";
|
$Details[] = "Ripped with EAC v0.95, -1 point [1]";
|
||||||
$Details = serialize($Details);
|
$Details = serialize($Details);
|
||||||
@ -513,82 +568,85 @@ function next_hour() {
|
|||||||
//------------- Disable downloading ability of users on ratio watch
|
//------------- Disable downloading ability of users on ratio watch
|
||||||
|
|
||||||
|
|
||||||
$UserQuery = $DB->query("SELECT ID, torrent_pass FROM users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$UserQuery = $DB->query("SELECT ID, torrent_pass
|
||||||
|
FROM users_info AS i
|
||||||
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
WHERE i.RatioWatchEnds!='0000-00-00 00:00:00'
|
WHERE i.RatioWatchEnds!='0000-00-00 00:00:00'
|
||||||
AND i.RatioWatchEnds<'$sqltime'
|
AND i.RatioWatchEnds<'$sqltime'
|
||||||
AND m.Enabled='1'
|
AND m.Enabled='1'
|
||||||
AND m.can_leech!='0'");
|
AND m.can_leech!='0'");
|
||||||
|
|
||||||
$UserIDs = $DB->collect('ID');
|
$UserIDs = $DB->collect('ID');
|
||||||
if(count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
$DB->query("UPDATE users_info AS i JOIN users_main AS m ON m.ID=i.UserID
|
$DB->query("UPDATE users_info AS i
|
||||||
SET
|
JOIN users_main AS m ON m.ID=i.UserID
|
||||||
m.can_leech='0',
|
SET m.can_leech='0',
|
||||||
i.AdminComment=CONCAT('$sqltime - Leeching ability disabled by ratio watch system - required ratio: ', m.RequiredRatio,'
|
i.AdminComment=CONCAT('$sqltime - Leeching ability disabled by ratio watch system - required ratio: ', m.RequiredRatio,'', i.AdminComment)
|
||||||
|
|
||||||
' , i.AdminComment)
|
|
||||||
WHERE m.ID IN(".implode(',',$UserIDs).")");
|
WHERE m.ID IN(".implode(',',$UserIDs).")");
|
||||||
|
|
||||||
|
|
||||||
$DB->query("DELETE FROM users_torrent_history WHERE UserID IN (".implode(',',$UserIDs).")");
|
$DB->query("DELETE FROM users_torrent_history WHERE UserID IN (".implode(',',$UserIDs).")");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('RatioWatchDownload'=>0, 'CanLeech'=>0));
|
$Cache->update_row(false, array('RatioWatchDownload'=>0, 'CanLeech'=>0));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
Misc::send_pm($UserID, 0, "Your downloading rights have been disabled", "As you did not raise your ratio in time, your downloading rights have been revoked. You will not be able to download any torrents until your ratio is above your new required ratio.");
|
Misc::send_pm($UserID, 0, 'Your downloading rights have been disabled', "As you did not raise your ratio in time, your downloading rights have been revoked. You will not be able to download any torrents until your ratio is above your new required ratio.");
|
||||||
echo "Ratio watch disabled: $UserID\n";
|
echo "Ratio watch disabled: $UserID\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->set_query_id($UserQuery);
|
$DB->set_query_id($UserQuery);
|
||||||
$Passkeys = $DB->collect('torrent_pass');
|
$Passkeys = $DB->collect('torrent_pass');
|
||||||
foreach($Passkeys as $Passkey) {
|
foreach ($Passkeys as $Passkey) {
|
||||||
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '0'));
|
Tracker::update_tracker('update_user', array('passkey' => $Passkey, 'can_leech' => '0'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------- Disable inactive user accounts --------------------------//
|
//------------- Disable inactive user accounts --------------------------//
|
||||||
sleep(5);
|
sleep(5);
|
||||||
// Send email
|
// Send email
|
||||||
$DB->query("SELECT um.Username, um.Email FROM users_info AS ui JOIN users_main AS um ON um.ID=ui.UserID
|
$DB->query("SELECT um.Username, um.Email
|
||||||
|
FROM users_info AS ui
|
||||||
|
JOIN users_main AS um ON um.ID=ui.UserID
|
||||||
LEFT JOIN users_levels AS ul ON ul.UserID = um.ID AND ul.PermissionID = '".CELEB."'
|
LEFT JOIN users_levels AS ul ON ul.UserID = um.ID AND ul.PermissionID = '".CELEB."'
|
||||||
WHERE um.PermissionID IN ('".USER."', '".MEMBER ."')
|
WHERE um.PermissionID IN ('".USER."', '".MEMBER ."')
|
||||||
AND um.LastAccess<'".time_minus(3600*24*110, true)."'
|
AND um.LastAccess<'".time_minus(3600 * 24 * 110, true)."'
|
||||||
AND um.LastAccess>'".time_minus(3600*24*111, true)."'
|
AND um.LastAccess>'".time_minus(3600 * 24 * 111, true)."'
|
||||||
AND um.LastAccess!='0000-00-00 00:00:00'
|
AND um.LastAccess!='0000-00-00 00:00:00'
|
||||||
AND ui.Donor='0'
|
AND ui.Donor='0'
|
||||||
AND um.Enabled!='2'
|
AND um.Enabled!='2'
|
||||||
AND ul.UserID IS NULL
|
AND ul.UserID IS NULL
|
||||||
GROUP BY um.ID");
|
GROUP BY um.ID");
|
||||||
while(list($Username, $Email) = $DB->next_record()) {
|
while (list($Username, $Email) = $DB->next_record()) {
|
||||||
$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at http://".NONSSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
|
$Body = "Hi $Username, \n\nIt has been almost 4 months since you used your account at http://".NONSSL_SITE_URL.". This is an automated email to inform you that your account will be disabled in 10 days if you do not sign in. ";
|
||||||
Misc::send_email($Email, 'Your '.SITE_NAME.' account is about to be disabled', $Body);
|
Misc::send_email($Email, 'Your '.SITE_NAME.' account is about to be disabled', $Body);
|
||||||
}
|
}
|
||||||
$DB->query("SELECT um.ID FROM users_info AS ui JOIN users_main AS um ON um.ID=ui.UserID
|
$DB->query("SELECT um.ID
|
||||||
|
FROM users_info AS ui
|
||||||
|
JOIN users_main AS um ON um.ID=ui.UserID
|
||||||
LEFT JOIN users_levels AS ul ON ul.UserID = um.ID AND ul.PermissionID = '".CELEB."'
|
LEFT JOIN users_levels AS ul ON ul.UserID = um.ID AND ul.PermissionID = '".CELEB."'
|
||||||
WHERE um.PermissionID IN ('".USER."', '".MEMBER ."')
|
WHERE um.PermissionID IN ('".USER."', '".MEMBER ."')
|
||||||
AND um.LastAccess<'".time_minus(3600*24*30*4)."'
|
AND um.LastAccess<'".time_minus(3600 * 24 * 30 * 4)."'
|
||||||
AND um.LastAccess!='0000-00-00 00:00:00'
|
AND um.LastAccess!='0000-00-00 00:00:00'
|
||||||
AND ui.Donor='0'
|
AND ui.Donor='0'
|
||||||
AND um.Enabled!='2'
|
AND um.Enabled!='2'
|
||||||
AND ul.UserID IS NULL
|
AND ul.UserID IS NULL
|
||||||
GROUP BY um.ID");
|
GROUP BY um.ID");
|
||||||
|
|
||||||
if($DB->record_count() > 0) {
|
if ($DB->record_count() > 0) {
|
||||||
Tools::disable_users($DB->collect('ID'), "Disabled for inactivity.", 3);
|
Tools::disable_users($DB->collect('ID'), 'Disabled for inactivity.', 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------- Disable unconfirmed users ------------------------------//
|
//------------- Disable unconfirmed users ------------------------------//
|
||||||
sleep(10);
|
sleep(10);
|
||||||
$DB->query("UPDATE users_info AS ui JOIN users_main AS um ON um.ID=ui.UserID
|
$DB->query("UPDATE users_info AS ui
|
||||||
|
JOIN users_main AS um ON um.ID=ui.UserID
|
||||||
SET um.Enabled='2',
|
SET um.Enabled='2',
|
||||||
ui.BanDate='$sqltime',
|
ui.BanDate='$sqltime',
|
||||||
ui.BanReason='3',
|
ui.BanReason='3',
|
||||||
ui.AdminComment=CONCAT('$sqltime - Disabled for inactivity (never logged in)
|
ui.AdminComment=CONCAT('$sqltime - Disabled for inactivity (never logged in)', ui.AdminComment)
|
||||||
|
|
||||||
', ui.AdminComment)
|
|
||||||
WHERE um.LastAccess='0000-00-00 00:00:00'
|
WHERE um.LastAccess='0000-00-00 00:00:00'
|
||||||
AND ui.JoinDate<'".time_minus(60*60*24*7)."'
|
AND ui.JoinDate<'".time_minus(60 * 60 * 24 * 7)."'
|
||||||
AND um.Enabled!='2'
|
AND um.Enabled!='2'
|
||||||
");
|
");
|
||||||
$Cache->decrement('stats_user_count',$DB->affected_rows());
|
$Cache->decrement('stats_user_count',$DB->affected_rows());
|
||||||
@ -597,26 +655,42 @@ function next_hour() {
|
|||||||
|
|
||||||
//------------- Demote users --------------------------------------------//
|
//------------- Demote users --------------------------------------------//
|
||||||
sleep(10);
|
sleep(10);
|
||||||
$DB->query('SELECT um.ID FROM users_main AS um WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded/Downloaded < 0.95 OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded < 25*1024*1024*1024');
|
$DB->query('SELECT um.ID
|
||||||
|
FROM users_main AS um
|
||||||
|
WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded/Downloaded < 0.95
|
||||||
|
OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded < 25*1024*1024*1024');
|
||||||
|
|
||||||
echo "demoted 1\n";
|
echo "demoted 1\n";
|
||||||
|
|
||||||
while(list($UserID) = $DB->next_record()) {
|
while (list($UserID) = $DB->next_record()) {
|
||||||
$Cache->begin_transaction('user_info_'.$UserID);
|
$Cache->begin_transaction('user_info_'.$UserID);
|
||||||
$Cache->update_row(false, array('PermissionID'=>MEMBER));
|
$Cache->update_row(false, array('PermissionID'=>MEMBER));
|
||||||
$Cache->commit_transaction(2592000);
|
$Cache->commit_transaction(2592000);
|
||||||
}
|
}
|
||||||
$DB->query('UPDATE users_main SET PermissionID='.MEMBER.' WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded/Downloaded < 0.95 OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded < 25*1024*1024*1024');
|
$DB->query('UPDATE users_main
|
||||||
|
SET PermissionID='.MEMBER.'
|
||||||
|
WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded/Downloaded < 0.95
|
||||||
|
OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded < 25*1024*1024*1024');
|
||||||
echo "demoted 2\n";
|
echo "demoted 2\n";
|
||||||
|
|
||||||
$DB->query('SELECT um.ID FROM users_main AS um WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded/Downloaded < 0.65');
|
$DB->query('SELECT um.ID
|
||||||
|
FROM users_main AS um
|
||||||
|
WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded/Downloaded < 0.65');
|
||||||
echo "demoted 3\n";
|
echo "demoted 3\n";
|
||||||
while(list($UserID) = $DB->next_record()) {
|
while (list($UserID) = $DB->next_record()) {
|
||||||
$Cache->begin_transaction('user_info_'.$UserID);
|
$Cache->begin_transaction('user_info_'.$UserID);
|
||||||
$Cache->update_row(false, array('PermissionID'=>USER));
|
$Cache->update_row(false, array('PermissionID'=>USER));
|
||||||
$Cache->commit_transaction(2592000);
|
$Cache->commit_transaction(2592000);
|
||||||
}
|
}
|
||||||
$DB->query('UPDATE users_main SET PermissionID='.USER.' WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.') AND Uploaded/Downloaded < 0.65');
|
$DB->query('UPDATE users_main
|
||||||
|
SET PermissionID='.USER.'
|
||||||
|
WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.')
|
||||||
|
AND Uploaded/Downloaded < 0.65');
|
||||||
echo "demoted 4\n";
|
echo "demoted 4\n";
|
||||||
|
|
||||||
//------------- Lock old threads ----------------------------------------//
|
//------------- Lock old threads ----------------------------------------//
|
||||||
@ -629,18 +703,18 @@ function next_hour() {
|
|||||||
AND f.AutoLock = '1'");
|
AND f.AutoLock = '1'");
|
||||||
$IDs = $DB->collect('ID');
|
$IDs = $DB->collect('ID');
|
||||||
|
|
||||||
if(count($IDs) > 0) {
|
if (count($IDs) > 0) {
|
||||||
$LockIDs = implode(',', $IDs);
|
$LockIDs = implode(',', $IDs);
|
||||||
$DB->query("UPDATE forums_topics SET IsLocked='1' WHERE ID IN($LockIDs)");
|
$DB->query("UPDATE forums_topics SET IsLocked='1' WHERE ID IN($LockIDs)");
|
||||||
sleep(2);
|
sleep(2);
|
||||||
$DB->query("DELETE FROM forums_last_read_topics WHERE TopicID IN($LockIDs)");
|
$DB->query("DELETE FROM forums_last_read_topics WHERE TopicID IN($LockIDs)");
|
||||||
|
|
||||||
foreach($IDs as $ID) {
|
foreach ($IDs as $ID) {
|
||||||
$Cache->begin_transaction('thread_'.$ID.'_info');
|
$Cache->begin_transaction('thread_'.$ID.'_info');
|
||||||
$Cache->update_row(false, array('IsLocked'=>'1'));
|
$Cache->update_row(false, array('IsLocked'=>'1'));
|
||||||
$Cache->commit_transaction(3600*24*30);
|
$Cache->commit_transaction(3600 * 24 * 30);
|
||||||
$Cache->expire_value('thread_'.$TopicID.'_catalogue_0',3600*24*30);
|
$Cache->expire_value('thread_'.$TopicID.'_catalogue_0',3600 * 24 * 30);
|
||||||
$Cache->expire_value('thread_'.$TopicID.'_info',3600*24*30);
|
$Cache->expire_value('thread_'.$TopicID.'_info',3600 * 24 * 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "Old threads locked\n";
|
echo "Old threads locked\n";
|
||||||
@ -670,12 +744,12 @@ function next_hour() {
|
|||||||
FROM torrents AS t
|
FROM torrents AS t
|
||||||
JOIN torrents_group AS tg ON tg.ID = t.GroupID
|
JOIN torrents_group AS tg ON tg.ID = t.GroupID
|
||||||
LEFT JOIN artists_group AS ag ON ag.ArtistID = tg.ArtistID
|
LEFT JOIN artists_group AS ag ON ag.ArtistID = tg.ArtistID
|
||||||
WHERE t.last_action < '".time_minus(3600*24*28)."'
|
WHERE t.last_action < '".time_minus(3600 * 24 * 28)."'
|
||||||
AND t.last_action != 0
|
AND t.last_action != 0
|
||||||
OR t.Time < '".time_minus(3600*24*2)."'
|
OR t.Time < '".time_minus(3600 * 24 * 2)."'
|
||||||
AND t.last_action = 0");
|
AND t.last_action = 0");
|
||||||
$TorrentIDs = $DB->to_array();
|
$TorrentIDs = $DB->to_array();
|
||||||
echo "Found ".count($TorrentIDs)." inactive torrents to be deleted.\n";
|
echo 'Found '.count($TorrentIDs)." inactive torrents to be deleted.\n";
|
||||||
|
|
||||||
$LogEntries = array();
|
$LogEntries = array();
|
||||||
|
|
||||||
@ -689,11 +763,11 @@ function next_hour() {
|
|||||||
// don't delete the torrent!
|
// don't delete the torrent!
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if($ArtistName) {
|
if ($ArtistName) {
|
||||||
$Name = $ArtistName.' - '.$Name;
|
$Name = $ArtistName.' - '.$Name;
|
||||||
}
|
}
|
||||||
if($Format && $Encoding) {
|
if ($Format && $Encoding) {
|
||||||
$Name.=' ['.(empty($Media)?'':"$Media / ").$Format.' / '.$Encoding.']';
|
$Name.= ' ['.(empty($Media) ? '' : "$Media / ").$Format.' / '.$Encoding.']';
|
||||||
}
|
}
|
||||||
Torrents::delete_torrent($ID, $GroupID);
|
Torrents::delete_torrent($ID, $GroupID);
|
||||||
$LogEntries[] = "Torrent ".$ID." (".$Name.") (".strtoupper($InfoHash).") was deleted for inactivity (unseeded)";
|
$LogEntries[] = "Torrent ".$ID." (".$Name.") (".strtoupper($InfoHash).") was deleted for inactivity (unseeded)";
|
||||||
@ -711,13 +785,13 @@ function next_hour() {
|
|||||||
}
|
}
|
||||||
echo "$i torrents deleted for inactivity.\n";
|
echo "$i torrents deleted for inactivity.\n";
|
||||||
|
|
||||||
foreach($DeleteNotes as $UserID => $MessageInfo){
|
foreach ($DeleteNotes as $UserID => $MessageInfo) {
|
||||||
$Singular = ($MessageInfo['Count'] == 1) ? true : false;
|
$Singular = ($MessageInfo['Count'] == 1) ? true : false;
|
||||||
Misc::send_pm($UserID, 0, $MessageInfo['Count'].' of your torrents '.($Singular?'has':'have').' been deleted for inactivity', ($Singular?'One':'Some').' of your uploads '.($Singular?'has':'have').' been deleted for being unseeded. Since '.($Singular?'it':'they').' didn\'t break any rules (we hope), please feel free to re-upload '.($Singular?'it':'them').".\n\nThe following torrent".($Singular?' was':'s were').' deleted:'.$MessageInfo['Msg']);
|
Misc::send_pm($UserID, 0, $MessageInfo['Count'].' of your torrents '.($Singular ? 'has' : 'have').' been deleted for inactivity', ($Singular ? 'One' : 'Some').' of your uploads '.($Singular ? 'has' : 'have').' been deleted for being unseeded. Since '.($Singular ? 'it' : 'they').' didn\'t break any rules (we hope), please feel free to re-upload '.($Singular ? 'it' : 'them').".\n\nThe following torrent".($Singular ? ' was' : 's were').' deleted:'.$MessageInfo['Msg']);
|
||||||
}
|
}
|
||||||
unset($DeleteNotes);
|
unset($DeleteNotes);
|
||||||
|
|
||||||
if(count($LogEntries) > 0) {
|
if (count($LogEntries) > 0) {
|
||||||
$Values = "('".implode("', '".$sqltime."'), ('",$LogEntries)."', '".$sqltime."')";
|
$Values = "('".implode("', '".$sqltime."'), ('",$LogEntries)."', '".$sqltime."')";
|
||||||
$DB->query('INSERT INTO log (Message, Time) VALUES '.$Values);
|
$DB->query('INSERT INTO log (Message, Time) VALUES '.$Values);
|
||||||
echo "\nDeleted $i torrents for inactivity\n";
|
echo "\nDeleted $i torrents for inactivity\n";
|
||||||
@ -726,7 +800,7 @@ function next_hour() {
|
|||||||
$DB->query("SELECT SimilarID FROM artists_similar_scores WHERE Score<=0");
|
$DB->query("SELECT SimilarID FROM artists_similar_scores WHERE Score<=0");
|
||||||
$SimilarIDs = implode(',',$DB->collect('SimilarID'));
|
$SimilarIDs = implode(',',$DB->collect('SimilarID'));
|
||||||
|
|
||||||
if($SimilarIDs) {
|
if ($SimilarIDs) {
|
||||||
$DB->query("DELETE FROM artists_similar WHERE SimilarID IN($SimilarIDs)");
|
$DB->query("DELETE FROM artists_similar WHERE SimilarID IN($SimilarIDs)");
|
||||||
$DB->query("DELETE FROM artists_similar_scores WHERE SimilarID IN($SimilarIDs)");
|
$DB->query("DELETE FROM artists_similar_scores WHERE SimilarID IN($SimilarIDs)");
|
||||||
$DB->query("DELETE FROM artists_similar_votes WHERE SimilarID IN($SimilarIDs)");
|
$DB->query("DELETE FROM artists_similar_votes WHERE SimilarID IN($SimilarIDs)");
|
||||||
@ -739,7 +813,7 @@ function next_hour() {
|
|||||||
$HistoryID = $DB->inserted_id();
|
$HistoryID = $DB->inserted_id();
|
||||||
|
|
||||||
$Top10 = $Cache->get_value('top10tor_day_10');
|
$Top10 = $Cache->get_value('top10tor_day_10');
|
||||||
if($Top10 === false) {
|
if ($Top10 === false) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
t.ID,
|
t.ID,
|
||||||
g.ID,
|
g.ID,
|
||||||
@ -763,7 +837,7 @@ function next_hour() {
|
|||||||
FROM torrents AS t
|
FROM torrents AS t
|
||||||
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID
|
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID
|
||||||
WHERE t.Seeders>0
|
WHERE t.Seeders>0
|
||||||
AND t.Time > ('".$sqltime."' - INTERVAL 1 DAY)
|
AND t.Time > ('$sqltime' - INTERVAL 1 DAY)
|
||||||
ORDER BY (t.Seeders + t.Leechers) DESC
|
ORDER BY (t.Seeders + t.Leechers) DESC
|
||||||
LIMIT 10;");
|
LIMIT 10;");
|
||||||
|
|
||||||
@ -771,7 +845,7 @@ function next_hour() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($Top10 as $Torrent) {
|
foreach ($Top10 as $Torrent) {
|
||||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
||||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
||||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Torrent;
|
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Torrent;
|
||||||
@ -780,29 +854,29 @@ function next_hour() {
|
|||||||
|
|
||||||
$Artists = Artists::get_artist($GroupID);
|
$Artists = Artists::get_artist($GroupID);
|
||||||
|
|
||||||
if(!empty($Artists)) {
|
if (!empty($Artists)) {
|
||||||
$DisplayName = Artists::display_artists($Artists, false, true);
|
$DisplayName = Artists::display_artists($Artists, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName.= $GroupName;
|
$DisplayName.= $GroupName;
|
||||||
|
|
||||||
if($GroupCategoryID==1 && $GroupYear>0) {
|
if ($GroupCategoryID == 1 && $GroupYear > 0) {
|
||||||
$DisplayName.= " [$GroupYear]";
|
$DisplayName.= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// append extra info to torrent title
|
// append extra info to torrent title
|
||||||
$ExtraInfo='';
|
$ExtraInfo='';
|
||||||
$AddExtra='';
|
$AddExtra='';
|
||||||
if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
if ($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
||||||
if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
if ($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
||||||
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
||||||
if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
if ($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
||||||
if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
if ($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
||||||
if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
if ($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
||||||
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
if ($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
||||||
if($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
if ($Year > 0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
||||||
if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
if ($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
||||||
if($ExtraInfo!='') {
|
if ($ExtraInfo != '') {
|
||||||
$ExtraInfo = "- [$ExtraInfo]";
|
$ExtraInfo = "- [$ExtraInfo]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,12 +893,12 @@ function next_hour() {
|
|||||||
|
|
||||||
// Weekly top 10 history.
|
// Weekly top 10 history.
|
||||||
// We need to haxxor it to work on a Sunday as we don't have a weekly schedule
|
// We need to haxxor it to work on a Sunday as we don't have a weekly schedule
|
||||||
if(date('w') == 0) {
|
if (date('w') == 0) {
|
||||||
$DB->query("INSERT INTO top10_history (Date, Type) VALUES ('".$sqltime."', 'Weekly')");
|
$DB->query("INSERT INTO top10_history (Date, Type) VALUES ('".$sqltime."', 'Weekly')");
|
||||||
$HistoryID = $DB->inserted_id();
|
$HistoryID = $DB->inserted_id();
|
||||||
|
|
||||||
$Top10 = $Cache->get_value('top10tor_week_10');
|
$Top10 = $Cache->get_value('top10tor_week_10');
|
||||||
if($Top10 === false) {
|
if ($Top10 === false) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
t.ID,
|
t.ID,
|
||||||
g.ID,
|
g.ID,
|
||||||
@ -856,38 +930,61 @@ function next_hour() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($Top10 as $Torrent) {
|
foreach ($Top10 as $Torrent) :
|
||||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $TorrentTags,
|
||||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
$Format, $Encoding, $Media, $Scene, $HasLog, $HasCue, $LogScore, $Year, $GroupYear,
|
||||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Torrent;
|
$RemasterTitle, $Snatched, $Seeders, $Leechers, $Data) = $Torrent;
|
||||||
|
|
||||||
$DisplayName='';
|
$DisplayName='';
|
||||||
|
|
||||||
$Artists = Artists::get_artist($GroupID);
|
$Artists = Artists::get_artist($GroupID);
|
||||||
|
|
||||||
if(!empty($Artists)) {
|
if (!empty($Artists)) {
|
||||||
$DisplayName = Artists::display_artists($Artists, false, true);
|
$DisplayName = Artists::display_artists($Artists, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName.= $GroupName;
|
$DisplayName.= $GroupName;
|
||||||
|
|
||||||
if($GroupCategoryID==1 && $GroupYear>0) {
|
if ($GroupCategoryID == 1 && $GroupYear > 0) {
|
||||||
$DisplayName.= " [$GroupYear]";
|
$DisplayName.= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// append extra info to torrent title
|
// append extra info to torrent title
|
||||||
$ExtraInfo='';
|
$ExtraInfo = '';
|
||||||
$AddExtra='';
|
$AddExtra = '';
|
||||||
if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
if ($Format) {
|
||||||
if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
$ExtraInfo.=$Format;
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Encoding) {
|
||||||
|
$ExtraInfo.=$AddExtra.$Encoding;
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
||||||
if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
if ($HasLog) {
|
||||||
if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
$ExtraInfo.=$AddExtra.'Log ('.$LogScore.'%)';
|
||||||
if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
$AddExtra = ' / ';
|
||||||
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
}
|
||||||
if($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
if ($HasCue) {
|
||||||
if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
$ExtraInfo.=$AddExtra.'Cue';
|
||||||
if($ExtraInfo!='') {
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Media) {
|
||||||
|
$ExtraInfo.=$AddExtra.$Media;
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Scene) {
|
||||||
|
$ExtraInfo.=$AddExtra.'Scene';
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Year > 0) {
|
||||||
|
$ExtraInfo.=$AddExtra.$Year;
|
||||||
|
$AddExtra = ' ';
|
||||||
|
}
|
||||||
|
if ($RemasterTitle) {
|
||||||
|
$ExtraInfo.=$AddExtra.$RemasterTitle;
|
||||||
|
}
|
||||||
|
if ($ExtraInfo != '') {
|
||||||
$ExtraInfo = "- [$ExtraInfo]";
|
$ExtraInfo = "- [$ExtraInfo]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,15 +992,16 @@ function next_hour() {
|
|||||||
|
|
||||||
$TagString = str_replace("|", " ", $TorrentTags);
|
$TagString = str_replace("|", " ", $TorrentTags);
|
||||||
|
|
||||||
$DB->query("INSERT INTO top10_history_torrents
|
$DB->query('INSERT INTO top10_history_torrents
|
||||||
(HistoryID, Rank, TorrentID, TitleString, TagString)
|
(HistoryID, Rank, TorrentID, TitleString, TagString)
|
||||||
VALUES
|
VALUES
|
||||||
(".$HistoryID.", ".$i.", ".$TorrentID.", '".db_string($TitleString)."', '".db_string($TagString)."')");
|
('.$HistoryID.", ".$i.", ".$TorrentID.", '".db_string($TitleString)."', '".db_string($TagString)."')");
|
||||||
$i++;
|
$i++;
|
||||||
}
|
endforeach;
|
||||||
|
|
||||||
// Send warnings to uploaders of torrents that will be deleted this week
|
// Send warnings to uploaders of torrents that will be deleted this week
|
||||||
$DB->query("SELECT
|
$DB->query("
|
||||||
|
SELECT
|
||||||
t.ID,
|
t.ID,
|
||||||
t.GroupID,
|
t.GroupID,
|
||||||
tg.Name,
|
tg.Name,
|
||||||
@ -931,23 +1029,25 @@ function next_hour() {
|
|||||||
if (!array_key_exists($UserID, $TorrentAlerts))
|
if (!array_key_exists($UserID, $TorrentAlerts))
|
||||||
$TorrentAlerts[$UserID] = array('Count' => 0, 'Msg' => '');
|
$TorrentAlerts[$UserID] = array('Count' => 0, 'Msg' => '');
|
||||||
$ArtistName = Artists::display_artists(Artists::get_artist($GroupID), false, false, false);
|
$ArtistName = Artists::display_artists(Artists::get_artist($GroupID), false, false, false);
|
||||||
if($ArtistName) {
|
if ($ArtistName) {
|
||||||
$Name = $ArtistName.' - '.$Name;
|
$Name = $ArtistName.' - '.$Name;
|
||||||
}
|
}
|
||||||
if($Format && $Encoding) {
|
if ($Format && $Encoding) {
|
||||||
$Name.=' ['.$Format.' / '.$Encoding.']';
|
$Name.=' ['.$Format.' / '.$Encoding.']';
|
||||||
}
|
}
|
||||||
$TorrentAlerts[$UserID]['Msg'] .= "\n[url=http://".NONSSL_SITE_URL."/torrents.php?torrentid=$ID]".$Name."[/url]";
|
$TorrentAlerts[$UserID]['Msg'] .= "\n[url=https://".SSL_SITE_URL."/torrents.php?torrentid=$ID]".$Name."[/url]";
|
||||||
$TorrentAlerts[$UserID]['Count']++;
|
$TorrentAlerts[$UserID]['Count']++;
|
||||||
}
|
}
|
||||||
foreach($TorrentAlerts as $UserID => $MessageInfo){
|
foreach ($TorrentAlerts as $UserID => $MessageInfo) {
|
||||||
Misc::send_pm($UserID, 0, 'Unseeded torrent notification', $MessageInfo['Count']." of your uploads will be deleted for inactivity soon. Unseeded torrents are deleted after 4 weeks. If you still have the files, you can seed your uploads by ensuring the torrents are in your client and that they aren't stopped. You can view the time that a torrent has been unseeded by clicking on the torrent description line and looking for the \"Last active\" time. For more information, please go [url=https://what.cd/wiki.php?action=article&id=663]here[/url].\n\nThe following torrent".($MessageInfo['Count']>1?'s':'')." will be removed for inactivity:".$MessageInfo['Msg']."\n\nIf you no longer wish to receive these notifications, please disable them in your profile settings.");
|
Misc::send_pm($UserID, 0, 'Unseeded torrent notification', $MessageInfo['Count']." of your uploads will be deleted for inactivity soon. Unseeded torrents are deleted after 4 weeks. If you still have the files, you can seed your uploads by ensuring the torrents are in your client and that they aren't stopped. You can view the time that a torrent has been unseeded by clicking on the torrent description line and looking for the \"Last active\" time. For more information, please go [url=https://what.cd/wiki.php?action=article&id=663]here[/url].\n\nThe following torrent".($MessageInfo['Count'] > 1 ? 's' : '').' will be removed for inactivity:'.$MessageInfo['Msg']."\n\nIf you no longer wish to receive these notifications, please disable them in your profile settings.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("UPDATE staff_pm_conversations
|
$DB->query("UPDATE staff_pm_conversations
|
||||||
SET Status = 'Resolved', ResolverID = '0'
|
SET Status = 'Resolved', ResolverID = '0'
|
||||||
WHERE Date < NOW() - INTERVAL 1 MONTH AND Status = 'Open' AND AssignedToUser IS NULL");
|
WHERE Date < NOW() - INTERVAL 1 MONTH
|
||||||
|
AND Status = 'Open'
|
||||||
|
AND AssignedToUser IS NULL");
|
||||||
|
|
||||||
}
|
}
|
||||||
/*************************************************************************\
|
/*************************************************************************\
|
||||||
@ -957,7 +1057,7 @@ function next_hour() {
|
|||||||
|
|
||||||
\*************************************************************************/
|
\*************************************************************************/
|
||||||
|
|
||||||
if($BiWeek != next_biweek() || $_GET['runbiweek']) {
|
if ($BiWeek != next_biweek() || $_GET['runbiweek']) {
|
||||||
echo "Ran bi-weekly functions\n";
|
echo "Ran bi-weekly functions\n";
|
||||||
|
|
||||||
//------------- Cycle auth keys -----------------------------------------//
|
//------------- Cycle auth keys -----------------------------------------//
|
||||||
@ -997,11 +1097,16 @@ function next_hour() {
|
|||||||
$DB->query("SELECT ID
|
$DB->query("SELECT ID
|
||||||
FROM users_main AS um
|
FROM users_main AS um
|
||||||
JOIN users_info AS ui on ui.UserID=um.ID
|
JOIN users_info AS ui on ui.UserID=um.ID
|
||||||
WHERE um.Enabled='1' AND ui.DisableInvites = '0'
|
WHERE um.Enabled='1'
|
||||||
AND ((um.PermissionID = ".POWER." AND um.Invites < 2) OR (um.PermissionID = ".ELITE." AND um.Invites < 4))");
|
AND ui.DisableInvites = '0'
|
||||||
|
AND ((um.PermissionID = ".POWER."
|
||||||
|
AND um.Invites < 2
|
||||||
|
) OR (um.PermissionID = ".ELITE."
|
||||||
|
AND um.Invites < 4)
|
||||||
|
)");
|
||||||
$UserIDs = $DB->collect('ID');
|
$UserIDs = $DB->collect('ID');
|
||||||
if (count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('Invites' => '+1'));
|
$Cache->update_row(false, array('Invites' => '+1'));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
@ -1010,15 +1115,16 @@ function next_hour() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$BonusReqs = array(
|
$BonusReqs = array(
|
||||||
array(0.75, 2*1024*1024*1024),
|
array(0.75, 2 * 1024 * 1024 * 1024),
|
||||||
array(2.0, 10*1024*1024*1024),
|
array(2.0, 10 * 1024 * 1024 * 1024),
|
||||||
array(3.0, 20*1024*1024*1024));
|
array(3.0, 20 * 1024 * 1024 * 1024));
|
||||||
|
|
||||||
// Since MySQL doesn't like subselecting from the target table during an update, we must create a temporary table.
|
// Since MySQL doesn't like subselecting from the target table during an update, we must create a temporary table.
|
||||||
|
|
||||||
$DB->query("CREATE TEMPORARY TABLE temp_sections_schedule_index
|
$DB->query("CREATE TEMPORARY TABLE temp_sections_schedule_index
|
||||||
SELECT SUM(Uploaded) AS Upload,SUM(Downloaded) AS Download,Inviter
|
SELECT SUM(Uploaded) AS Upload,SUM(Downloaded) AS Download,Inviter
|
||||||
FROM users_main AS um JOIN users_info AS ui ON ui.UserID=um.ID
|
FROM users_main AS um
|
||||||
|
JOIN users_info AS ui ON ui.UserID=um.ID
|
||||||
GROUP BY Inviter");
|
GROUP BY Inviter");
|
||||||
|
|
||||||
foreach ($BonusReqs as $BonusReq) {
|
foreach ($BonusReqs as $BonusReq) {
|
||||||
@ -1028,11 +1134,16 @@ function next_hour() {
|
|||||||
JOIN users_info AS ui ON ui.UserID=um.ID
|
JOIN users_info AS ui ON ui.UserID=um.ID
|
||||||
JOIN temp_sections_schedule_index AS u ON u.Inviter = um.ID
|
JOIN temp_sections_schedule_index AS u ON u.Inviter = um.ID
|
||||||
WHERE u.Upload>$Upload AND u.Upload/u.Download>$Ratio
|
WHERE u.Upload>$Upload AND u.Upload/u.Download>$Ratio
|
||||||
AND um.Enabled = '1' AND ui.DisableInvites = '0'
|
AND um.Enabled = '1'
|
||||||
AND ((um.PermissionID = ".POWER." AND um.Invites < 2) OR (um.PermissionID = ".ELITE." AND um.Invites < 4))");
|
AND ui.DisableInvites = '0'
|
||||||
|
AND ((um.PermissionID = ".POWER."
|
||||||
|
AND um.Invites < 2
|
||||||
|
) OR (um.PermissionID = ".ELITE."
|
||||||
|
AND um.Invites < 4)
|
||||||
|
)");
|
||||||
$UserIDs = $DB->collect('ID');
|
$UserIDs = $DB->collect('ID');
|
||||||
if (count($UserIDs) > 0) {
|
if (count($UserIDs) > 0) {
|
||||||
foreach($UserIDs as $UserID) {
|
foreach ($UserIDs as $UserID) {
|
||||||
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
$Cache->begin_transaction('user_info_heavy_'.$UserID);
|
||||||
$Cache->update_row(false, array('Invites' => '+1'));
|
$Cache->update_row(false, array('Invites' => '+1'));
|
||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
@ -1041,10 +1152,15 @@ function next_hour() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($BiWeek == 8) {
|
if ($BiWeek == 8) {
|
||||||
$DB->query("TRUNCATE TABLE top_snatchers;");
|
$DB->query('TRUNCATE TABLE top_snatchers;');
|
||||||
|
|
||||||
$DB->query("INSERT INTO top_snatchers (UserID) SELECT uid FROM xbt_snatched GROUP BY uid ORDER BY COUNT(uid) DESC LIMIT 100;");
|
$DB->query("INSERT INTO top_snatchers (UserID)
|
||||||
|
SELECT uid
|
||||||
|
FROM xbt_snatched
|
||||||
|
GROUP BY uid
|
||||||
|
ORDER BY COUNT(uid) DESC
|
||||||
|
LIMIT 100;");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
if ($Level == 0) {
|
if ($Level == 0) {
|
||||||
// FLS conversation, assign to staff (moderator)
|
// FLS conversation, assign to staff (moderator)
|
||||||
if(!empty($_GET['to'])) {
|
if (!empty($_GET['to'])) {
|
||||||
$Level = 0;
|
$Level = 0;
|
||||||
switch($_GET['to']) {
|
switch ($_GET['to']) {
|
||||||
case 'forum' :
|
case 'forum' :
|
||||||
$Level = 650;
|
$Level = 650;
|
||||||
break;
|
break;
|
||||||
@ -25,7 +25,10 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', Level=".$Level." WHERE ID=$ConvID");
|
$DB->query("UPDATE staff_pm_conversations
|
||||||
|
SET Status='Unanswered',
|
||||||
|
Level=$Level
|
||||||
|
WHERE ID=$ConvID");
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
} else {
|
} else {
|
||||||
error(404);
|
error(404);
|
||||||
@ -46,12 +49,16 @@
|
|||||||
|
|
||||||
if ($LevelType == 'class') {
|
if ($LevelType == 'class') {
|
||||||
// Assign to class
|
// Assign to class
|
||||||
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered', Level=$NewLevel, AssignedToUser=NULL WHERE ID=$ConvID");
|
$DB->query("UPDATE staff_pm_conversations
|
||||||
|
SET Status='Unanswered',
|
||||||
|
Level=$NewLevel,
|
||||||
|
AssignedToUser=NULL
|
||||||
|
WHERE ID=$ConvID");
|
||||||
} else {
|
} else {
|
||||||
$UserInfo = Users::user_info($NewLevel);
|
$UserInfo = Users::user_info($NewLevel);
|
||||||
$Level = $Classes[$UserInfo['PermissionID']]['Level'];
|
$Level = $Classes[$UserInfo['PermissionID']]['Level'];
|
||||||
if (!$Level) {
|
if (!$Level) {
|
||||||
error("Assign to user not found.");
|
error('Assign to user not found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign to user
|
// Assign to user
|
||||||
@ -66,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// No id
|
// No ID
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
// List common responses
|
// List common responses
|
||||||
$DB->query("SELECT ID, Message, Name FROM staff_pm_responses ORDER BY ID DESC");
|
$DB->query("SELECT ID, Message, Name FROM staff_pm_responses ORDER BY ID DESC");
|
||||||
while(list($ID, $Message, $Name) = $DB->next_record()) {
|
while (list($ID, $Message, $Name) = $DB->next_record()) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<br />
|
<br />
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
\*********************************************************************/
|
\*********************************************************************/
|
||||||
|
|
||||||
// Quick SQL injection check
|
// Quick SQL injection check
|
||||||
if(!$_GET['post'] || !is_number($_GET['post'])){
|
if (!$_GET['post'] || !is_number($_GET['post'])) {
|
||||||
error(0);
|
error(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,24 +20,28 @@
|
|||||||
$Message = "Thank for for helping to support the site. It's users like you who make all of this possible.";
|
$Message = "Thank for for helping to support the site. It's users like you who make all of this possible.";
|
||||||
|
|
||||||
if ((int)$Donor === 0) {
|
if ((int)$Donor === 0) {
|
||||||
$Msg = db_string(sqltime() . ' - Donated: http://'.NONSSL_SITE_URL."/staffpm.php?action=viewconv&id=$ConvID\n\n");
|
$Msg = db_string(sqltime() . ' - Donated: https://'.SSL_SITE_URL."/staffpm.php?action=viewconv&id=$ConvID\n\n");
|
||||||
$DB->query("UPDATE users_info
|
$DB->query("UPDATE users_info
|
||||||
SET Donor='1',
|
SET Donor='1',
|
||||||
AdminComment = CONCAT('$Msg',AdminComment)
|
AdminComment = CONCAT('$Msg',AdminComment)
|
||||||
WHERE UserID = $UserID");
|
WHERE UserID = $UserID");
|
||||||
$DB->query("UPDATE users_main SET Invites=Invites+2 WHERE ID = $UserID");
|
$DB->query("UPDATE users_main
|
||||||
|
SET Invites=Invites+2
|
||||||
|
WHERE ID = $UserID");
|
||||||
|
|
||||||
$Cache->delete_value('user_info_'.$UserID);
|
$Cache->delete_value('user_info_'.$UserID);
|
||||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
$Message .= " Enjoy your new love from us!";
|
$Message .= ' Enjoy your new love from us!';
|
||||||
} else {
|
} else {
|
||||||
$Message .= " ";
|
$Message .= ' ';
|
||||||
}
|
}
|
||||||
$DB->query("INSERT INTO staff_pm_messages (UserID, SentDate, Message, ConvID)
|
$DB->query("INSERT INTO staff_pm_messages (UserID, SentDate, Message, ConvID)
|
||||||
VALUES (".$LoggedUser['ID'].", '".sqltime()."', '".db_string($Message)."', $ConvID)");
|
VALUES (".$LoggedUser['ID'].", '".sqltime()."', '".db_string($Message)."', $ConvID)");
|
||||||
$DB->query("UPDATE staff_pm_conversations
|
$DB->query("UPDATE staff_pm_conversations
|
||||||
SET Date='".sqltime()."', Unread=true,
|
SET Date='".sqltime()."',
|
||||||
Status='Resolved', ResolverID=".$LoggedUser['ID']."
|
Unread=true,
|
||||||
|
Status='Resolved',
|
||||||
|
ResolverID=".$LoggedUser['ID']."
|
||||||
WHERE ID=$ConvID");
|
WHERE ID=$ConvID");
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
?>
|
?>
|
||||||
|
@ -6,37 +6,37 @@
|
|||||||
$UserLevel = $LoggedUser['EffectiveClass'];
|
$UserLevel = $LoggedUser['EffectiveClass'];
|
||||||
|
|
||||||
// Setup for current view mode
|
// Setup for current view mode
|
||||||
$SortStr = "IF(AssignedToUser = ".$LoggedUser['ID'].",0,1) ASC, ";
|
$SortStr = 'IF(AssignedToUser = '.$LoggedUser['ID'].',0,1) ASC, ';
|
||||||
switch ($View) {
|
switch ($View) {
|
||||||
case 'unanswered':
|
case 'unanswered':
|
||||||
$ViewString = "Unanswered";
|
$ViewString = 'Unanswered';
|
||||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
break;
|
break;
|
||||||
case 'open':
|
case 'open':
|
||||||
$ViewString = "All open";
|
$ViewString = 'All open';
|
||||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status IN ('Open', 'Unanswered')";
|
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status IN ('Open', 'Unanswered')";
|
||||||
$SortStr = '';
|
$SortStr = '';
|
||||||
break;
|
break;
|
||||||
case 'resolved':
|
case 'resolved':
|
||||||
$ViewString = "Resolved";
|
$ViewString = 'Resolved';
|
||||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Resolved'";
|
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Resolved'";
|
||||||
$SortStr = '';
|
$SortStr = '';
|
||||||
break;
|
break;
|
||||||
case 'my':
|
case 'my':
|
||||||
$ViewString = "My unanswered";
|
$ViewString = 'My unanswered';
|
||||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ($UserLevel >= 700) {
|
if ($UserLevel >= 700) {
|
||||||
$ViewString = "My unanswered";
|
$ViewString = 'My unanswered';
|
||||||
$WhereCondition = "WHERE ((Level >= ".max($Classes[MOD]['Level'],700)." AND Level <= $UserLevel) OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE ((Level >= ".max($Classes[MOD]['Level'],700)." AND Level <= $UserLevel) OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
} elseif ($UserLevel == 650) {
|
} elseif ($UserLevel == 650) {
|
||||||
// Forum Mods
|
// Forum Mods
|
||||||
$ViewString = "My Unanswered";
|
$ViewString = 'My unanswered';
|
||||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
} else {
|
} else {
|
||||||
// FLS
|
// FLS
|
||||||
$ViewString = "Unanswered";
|
$ViewString = 'Unanswered';
|
||||||
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE (Level <= $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -67,10 +67,10 @@
|
|||||||
$DB->set_query_id($StaffPMs);
|
$DB->set_query_id($StaffPMs);
|
||||||
|
|
||||||
$CurURL = Format::get_url();
|
$CurURL = Format::get_url();
|
||||||
if(empty($CurURL)) {
|
if (empty($CurURL)) {
|
||||||
$CurURL = "staffpm.php?";
|
$CurURL = 'staffpm.php?';
|
||||||
} else {
|
} else {
|
||||||
$CurURL = "staffpm.php?".$CurURL."&";
|
$CurURL = 'staffpm.php?'.$CurURL.'&';
|
||||||
}
|
}
|
||||||
$Pages=Format::get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
|
$Pages=Format::get_pages($Page,$NumResults,MESSAGES_PER_PAGE,9);
|
||||||
|
|
||||||
@ -82,8 +82,8 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h2><?=$ViewString?> Staff PMs</h2>
|
<h2><?=$ViewString?> Staff PMs</h2>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<? if ($IsStaff) {
|
<? if ($IsStaff) { ?>
|
||||||
?> <a href="staffpm.php" class="brackets">My unanswered</a>
|
<a href="staffpm.php" class="brackets">My unanswered</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<a href="staffpm.php?view=unanswered" class="brackets">All unanswered</a>
|
<a href="staffpm.php?view=unanswered" class="brackets">All unanswered</a>
|
||||||
<a href="staffpm.php?view=open" class="brackets">Open</a>
|
<a href="staffpm.php?view=open" class="brackets">Open</a>
|
||||||
@ -101,13 +101,13 @@
|
|||||||
<div class="box pad" id="inbox">
|
<div class="box pad" id="inbox">
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if ($DB->record_count() == 0) {
|
if ($DB->record_count() == 0) :
|
||||||
// No messages
|
// No messages
|
||||||
?>
|
?>
|
||||||
<h2>No messages</h2>
|
<h2>No messages</h2>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
} else {
|
else:
|
||||||
// Messages, draw table
|
// Messages, draw table
|
||||||
if ($ViewString != 'Resolved' && $IsStaff) {
|
if ($ViewString != 'Resolved' && $IsStaff) {
|
||||||
// Open multiresolve form
|
// Open multiresolve form
|
||||||
@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
// Table head
|
// Table head
|
||||||
?>
|
?>
|
||||||
<table class="message_table<?=($ViewString != 'Resolved' && $IsStaff)?' checkboxes':''?>">
|
<table class="message_table<?=($ViewString != 'Resolved' && $IsStaff) ? ' checkboxes' : '' ?>">
|
||||||
<tr class="colhead">
|
<tr class="colhead">
|
||||||
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
<? if ($ViewString != 'Resolved' && $IsStaff) { ?>
|
||||||
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
|
<td width="10"><input type="checkbox" onclick="toggleChecks('messageform',this)" /></td>
|
||||||
@ -136,7 +136,7 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
// List messages
|
// List messages
|
||||||
while(list($ID, $Subject, $UserID, $Status, $Level, $AssignedToUser, $Date, $Unread, $ResolverID) = $DB->next_record()) {
|
while (list($ID, $Subject, $UserID, $Status, $Level, $AssignedToUser, $Date, $Unread, $ResolverID) = $DB->next_record()) :
|
||||||
$Row = ($Row === 'a') ? 'b' : 'a';
|
$Row = ($Row === 'a') ? 'b' : 'a';
|
||||||
$RowClass = 'row'.$Row;
|
$RowClass = 'row'.$Row;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@
|
|||||||
// Get assigned
|
// Get assigned
|
||||||
if ($AssignedToUser == '') {
|
if ($AssignedToUser == '') {
|
||||||
// Assigned to class
|
// Assigned to class
|
||||||
$Assigned = ($Level == 0) ? "First Line Support" : $ClassLevels[$Level]['Name'];
|
$Assigned = ($Level == 0) ? 'First Line Support' : $ClassLevels[$Level]['Name'];
|
||||||
// No + on Sysops
|
// No + on Sysops
|
||||||
if ($Assigned != 'Sysop') { $Assigned .= "+"; }
|
if ($Assigned != 'Sysop') { $Assigned .= "+"; }
|
||||||
|
|
||||||
@ -180,7 +180,7 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
$DB->set_query_id($StaffPMs);
|
$DB->set_query_id($StaffPMs);
|
||||||
}
|
endwhile;
|
||||||
|
|
||||||
// Close table and multiresolve form
|
// Close table and multiresolve form
|
||||||
?>
|
?>
|
||||||
@ -190,7 +190,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
}
|
endif;
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
if ($UserID == $LoggedUser['ID'] || ($IsFLS && $Level == 0) ||
|
if ($UserID == $LoggedUser['ID'] || ($IsFLS && $Level == 0) ||
|
||||||
$AssignedToUser == $LoggedUser['ID'] || ($IsStaff && $Level <= $LoggedUser['EffectiveClass'])) {
|
$AssignedToUser == $LoggedUser['ID'] || ($IsStaff && $Level <= $LoggedUser['EffectiveClass'])) {
|
||||||
/*if($Level != 0 && $IsStaff == false) {
|
/*if ($Level != 0 && $IsStaff == false) {
|
||||||
error(403);
|
error(403);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@ -21,7 +21,7 @@
|
|||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// No id
|
// No ID
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
// Get messages
|
// Get messages
|
||||||
$StaffPMs = $DB->query("SELECT UserID, SentDate, Message, ID FROM staff_pm_messages WHERE ConvID=$ConvID");
|
$StaffPMs = $DB->query("SELECT UserID, SentDate, Message, ID FROM staff_pm_messages WHERE ConvID=$ConvID");
|
||||||
|
|
||||||
while(list($UserID, $SentDate, $Message, $MessageID) = $DB->next_record()) {
|
while (list($UserID, $SentDate, $Message, $MessageID) = $DB->next_record()) {
|
||||||
// Set user string
|
// Set user string
|
||||||
if ($UserID == $OwnerID) {
|
if ($UserID == $OwnerID) {
|
||||||
// User, use prepared string
|
// User, use prepared string
|
||||||
@ -112,7 +112,7 @@
|
|||||||
<?
|
<?
|
||||||
// List common responses
|
// List common responses
|
||||||
$DB->query("SELECT ID, Name FROM staff_pm_responses");
|
$DB->query("SELECT ID, Name FROM staff_pm_responses");
|
||||||
while(list($ID, $Name) = $DB->next_record()) {
|
while (list($ID, $Name) = $DB->next_record()) {
|
||||||
?>
|
?>
|
||||||
<option value="<?=$ID?>"><?=$Name?></option>
|
<option value="<?=$ID?>"><?=$Name?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
@ -172,7 +172,7 @@
|
|||||||
WHERE p.DisplayStaff='1'
|
WHERE p.DisplayStaff='1'
|
||||||
ORDER BY p.Level DESC, m.Username ASC"
|
ORDER BY p.Level DESC, m.Username ASC"
|
||||||
);
|
);
|
||||||
while(list($ID, $Name) = $DB->next_record()) {
|
while (list($ID, $Name) = $DB->next_record()) {
|
||||||
// Create one <option> for each staff member
|
// Create one <option> for each staff member
|
||||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||||
?>
|
?>
|
||||||
@ -192,7 +192,7 @@
|
|||||||
WHERE p.DisplayStaff!='1' AND i.SupportFor!=''
|
WHERE p.DisplayStaff!='1' AND i.SupportFor!=''
|
||||||
ORDER BY m.Username ASC
|
ORDER BY m.Username ASC
|
||||||
");
|
");
|
||||||
while(list($ID, $Name) = $DB->next_record()) {
|
while (list($ID, $Name) = $DB->next_record()) {
|
||||||
// Create one <option> for each FLS user
|
// Create one <option> for each FLS user
|
||||||
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
$Selected = ($AssignedToUser == $ID) ? ' selected="selected"' : '';
|
||||||
?>
|
?>
|
||||||
@ -229,6 +229,6 @@
|
|||||||
|
|
||||||
View::show_footer();
|
View::show_footer();
|
||||||
} else {
|
} else {
|
||||||
// No id
|
// No ID
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
$_REQUEST['action'] = $argv[1];
|
$_REQUEST['action'] = $argv[1];
|
||||||
} else {
|
} else {
|
||||||
if (empty($_REQUEST['action']) || ($_REQUEST['action'] != "public_sandbox" && $_REQUEST['action'] != "ocelot")) {
|
if (empty($_REQUEST['action']) || ($_REQUEST['action'] != 'public_sandbox' && $_REQUEST['action'] != 'ocelot')) {
|
||||||
enforce_login();
|
enforce_login();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,14 +40,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
include(SERVER_ROOT."/classes/class_validate.php");
|
include(SERVER_ROOT."/classes/class_validate.php");
|
||||||
$Val=NEW VALIDATE;
|
$Val = new VALIDATE;
|
||||||
|
|
||||||
include(SERVER_ROOT.'/classes/class_feed.php');
|
include(SERVER_ROOT.'/classes/class_feed.php');
|
||||||
$Feed = new FEED;
|
$Feed = new FEED;
|
||||||
|
|
||||||
switch ($_REQUEST['action']){
|
switch ($_REQUEST['action']){
|
||||||
case 'phpinfo':
|
case 'phpinfo':
|
||||||
if (!check_perms('site_debug')) error(403);
|
if (!check_perms('site_debug')) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
phpinfo();
|
phpinfo();
|
||||||
break;
|
break;
|
||||||
//Services
|
//Services
|
||||||
@ -124,7 +126,10 @@
|
|||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
if (is_number($_POST['newsid'])){
|
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'])."'");
|
$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');
|
$Cache->delete_value('news');
|
||||||
$Cache->delete_value('feed_news');
|
$Cache->delete_value('feed_news');
|
||||||
}
|
}
|
||||||
@ -155,7 +160,8 @@
|
|||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("INSERT INTO news (UserID, Title, Body, Time) VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')");
|
$DB->query("INSERT INTO news (UserID, Title, Body, Time)
|
||||||
|
VALUES ('$LoggedUser[ID]', '".db_string($_POST['title'])."', '".db_string($_POST['body'])."', '".sqltime()."')");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -190,7 +196,11 @@
|
|||||||
//$Val->SetFields('test',true,'number','You did not enter a valid level for this permission set.');
|
//$Val->SetFields('test',true,'number','You did not enter a valid level for this permission set.');
|
||||||
|
|
||||||
if (is_numeric($_REQUEST['id'])) {
|
if (is_numeric($_REQUEST['id'])) {
|
||||||
$DB->query("SELECT p.ID,p.Name,p.Level,p.Secondary,p.PermittedForums,p.Values,p.DisplayStaff,COUNT(u.ID) FROM permissions AS p LEFT JOIN users_main AS u ON u.PermissionID=p.ID WHERE p.ID='".db_string($_REQUEST['id'])."' GROUP BY p.ID");
|
$DB->query("SELECT p.ID, p.Name, p.Level, p.Secondary, p.PermittedForums, p.Values, p.DisplayStaff, COUNT(u.ID)
|
||||||
|
FROM permissions AS p
|
||||||
|
LEFT JOIN users_main AS u ON u.PermissionID=p.ID
|
||||||
|
WHERE p.ID='".db_string($_REQUEST['id'])."'
|
||||||
|
GROUP BY p.ID");
|
||||||
list($ID,$Name,$Level,$Secondary,$Forums,$Values,$DisplayStaff,$UserCount)=$DB->next_record(MYSQLI_NUM, array(5));
|
list($ID,$Name,$Level,$Secondary,$Forums,$Values,$DisplayStaff,$UserCount)=$DB->next_record(MYSQLI_NUM, array(5));
|
||||||
|
|
||||||
if ($Level > $LoggedUser['EffectiveClass'] || $_REQUEST['level'] > $LoggedUser['EffectiveClass']) {
|
if ($Level > $LoggedUser['EffectiveClass'] || $_REQUEST['level'] > $LoggedUser['EffectiveClass']) {
|
||||||
@ -207,7 +217,7 @@
|
|||||||
list($DupeCheck)=$DB->next_record();
|
list($DupeCheck)=$DB->next_record();
|
||||||
|
|
||||||
if ($DupeCheck) {
|
if ($DupeCheck) {
|
||||||
$Err = "There is already a permission class with that level.";
|
$Err = 'There is already a permission class with that level.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +245,8 @@
|
|||||||
'".db_string(serialize($Values))."',
|
'".db_string(serialize($Values))."',
|
||||||
'".db_string($DisplayStaff)."')");
|
'".db_string($DisplayStaff)."')");
|
||||||
} else {
|
} else {
|
||||||
$DB->query("UPDATE permissions SET Level='".db_string($Level)."',
|
$DB->query("UPDATE permissions
|
||||||
|
SET Level='".db_string($Level)."',
|
||||||
Name='".db_string($Name)."',
|
Name='".db_string($Name)."',
|
||||||
Secondary=".$Secondary.",
|
Secondary=".$Secondary.",
|
||||||
PermittedForums='".db_string($Forums)."',
|
PermittedForums='".db_string($Forums)."',
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
<?
|
<?
|
||||||
function class_list($Selected=0){
|
function class_list($Selected = 0) {
|
||||||
global $Classes;
|
global $Classes;
|
||||||
$Return = '';
|
$Return = '';
|
||||||
foreach ($Classes as $ID => $Class) {
|
foreach ($Classes as $ID => $Class) {
|
||||||
if ($Class['Secondary']) { continue; }
|
if ($Class['Secondary']) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$Name = $Class['Name'];
|
$Name = $Class['Name'];
|
||||||
$Level = $Class['Level'];
|
$Level = $Class['Level'];
|
||||||
$Return.='<option value="'.$Level.'"';
|
$Return.='<option value="'.$Level.'"';
|
||||||
if($Selected == $Level){
|
if ($Selected == $Level) {
|
||||||
$Return.=' selected="selected"';
|
$Return.=' selected="selected"';
|
||||||
}
|
}
|
||||||
$Return.='>'.Format::cut_string($Name, 20, 1).'</option>'."\n";
|
$Return.='>'.Format::cut_string($Name, 20, 1).'</option>'."\n";
|
||||||
@ -17,7 +19,9 @@ function class_list($Selected=0){
|
|||||||
return $Return;
|
return $Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_perms('admin_manage_forums')) { error(403); }
|
if (!check_perms('admin_manage_forums')) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
View::show_header('Forum Management');
|
View::show_header('Forum Management');
|
||||||
$DB->query('SELECT ID, Name FROM forums ORDER BY Sort');
|
$DB->query('SELECT ID, Name FROM forums ORDER BY Sort');
|
||||||
@ -27,7 +31,7 @@ function class_list($Selected=0){
|
|||||||
unset($ForumCats);
|
unset($ForumCats);
|
||||||
$ForumCats = $Cache->get_value('forums_categories');
|
$ForumCats = $Cache->get_value('forums_categories');
|
||||||
if ($ForumCats === false) {
|
if ($ForumCats === false) {
|
||||||
$DB->query("SELECT ID, Name FROM forums_categories");
|
$DB->query('SELECT ID, Name FROM forums_categories');
|
||||||
$ForumCats = array();
|
$ForumCats = array();
|
||||||
while (list($ID, $Name) = $DB->next_record()) {
|
while (list($ID, $Name) = $DB->next_record()) {
|
||||||
$ForumCats[$ID] = $Name;
|
$ForumCats[$ID] = $Name;
|
||||||
@ -35,7 +39,8 @@ function class_list($Selected=0){
|
|||||||
$Cache->cache_value('forums_categories', $ForumCats, 0); //Inf cache.
|
$Cache->cache_value('forums_categories', $ForumCats, 0); //Inf cache.
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query('SELECT
|
$DB->query('
|
||||||
|
SELECT
|
||||||
ID,
|
ID,
|
||||||
CategoryID,
|
CategoryID,
|
||||||
Sort,
|
Sort,
|
||||||
@ -68,7 +73,7 @@ function class_list($Selected=0){
|
|||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
$Row = 'b';
|
$Row = 'b';
|
||||||
while(list($ID, $CategoryID, $Sort, $Name, $Description, $MinClassRead, $MinClassWrite, $MinClassCreate, $AutoLock, $AutoLockWeeks) = $DB->next_record()){
|
while (list($ID, $CategoryID, $Sort, $Name, $Description, $MinClassRead, $MinClassWrite, $MinClassCreate, $AutoLock, $AutoLockWeeks) = $DB->next_record()) {
|
||||||
$Row = ($Row === 'a' ? 'b' : 'a');
|
$Row = ($Row === 'a' ? 'b' : 'a');
|
||||||
?>
|
?>
|
||||||
<tr class="row<?=$Row?>">
|
<tr class="row<?=$Row?>">
|
||||||
@ -81,7 +86,7 @@ function class_list($Selected=0){
|
|||||||
<? reset($ForumCats);
|
<? reset($ForumCats);
|
||||||
foreach ($ForumCats as $CurCat => $CatName) {
|
foreach ($ForumCats as $CurCat => $CatName) {
|
||||||
?>
|
?>
|
||||||
<option value="<?=$CurCat?>" <? if($CurCat == $CategoryID) { echo ' selected="selected"'; } ?>><?=$CatName?></option>
|
<option value="<?=$CurCat?>" <? if ($CurCat == $CategoryID) { echo ' selected="selected"'; } ?>><?=$CatName?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@ -110,7 +115,7 @@ function class_list($Selected=0){
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="autolock" <?=($AutoLock == '1')?'checked ':''?>/>
|
<input type="checkbox" name="autolock"<?=($AutoLock == '1') ? ' checked="checked"' : ''?> />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="autolockweeks" value="<?=$AutoLockWeeks?>" />
|
<input type="text" name="autolockweeks" value="<?=$AutoLockWeeks?>" />
|
||||||
@ -135,8 +140,8 @@ function class_list($Selected=0){
|
|||||||
<td>
|
<td>
|
||||||
<select name="categoryid">
|
<select name="categoryid">
|
||||||
<? reset($ForumCats);
|
<? reset($ForumCats);
|
||||||
while(list($CurCat, $CatName) = each($ForumCats)) { ?>
|
while (list($CurCat, $CatName) = each($ForumCats)) { ?>
|
||||||
<option value="<?=$CurCat?>" <? if($CurCat == $CategoryID) { echo ' selected="selected"'; } ?>><?=$CatName?></option>
|
<option value="<?=$CurCat?>"<? if ($CurCat == $CategoryID) { echo ' selected="selected"'; } ?>><?=$CatName?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@ -165,7 +170,7 @@ function class_list($Selected=0){
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="autolock" checked />
|
<input type="checkbox" name="autolock" checked="checked" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="autolockweeks" value="4" />
|
<input type="text" name="autolockweeks" value="4" />
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?
|
<?
|
||||||
//******************************************************************************//
|
//******************************************************************************//
|
||||||
//--------------- Restore all VH-recommended torrents to NL -------------------//
|
//--------------- Restore all VH-recommended torrents to NL --------------------//
|
||||||
//---- For use after resetting the FL/NL database (after sitewide freeleech) ---//
|
//---- For use after resetting the FL/NL database (after sitewide freeleech) ---//
|
||||||
authorize();
|
authorize();
|
||||||
|
|
||||||
if(!check_perms('site_manage_recommendations')){
|
if (!check_perms('site_manage_recommendations')) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("SELECT GroupID FROM torrents_recommended");
|
$DB->query('SELECT GroupID FROM torrents_recommended');
|
||||||
$ToNL = $DB->next_record();
|
$ToNL = $DB->next_record();
|
||||||
Torrents::freeleech_groups($ToNL, 2, 3);
|
Torrents::freeleech_groups($ToNL, 2, 3);
|
||||||
?>
|
?>
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
<?
|
<?
|
||||||
if (!check_perms('users_mod')) { error(403); }
|
if (!check_perms('users_mod')) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['addtokens'])) {
|
if (isset($_REQUEST['addtokens'])) {
|
||||||
authorize();
|
authorize();
|
||||||
$Tokens = $_REQUEST['numtokens'];
|
$Tokens = $_REQUEST['numtokens'];
|
||||||
|
|
||||||
if (!is_number($Tokens) || ($Tokens < 0)) { error("Please enter a valid number of tokens."); }
|
if (!is_number($Tokens) || ($Tokens < 0)) {
|
||||||
|
error('Please enter a valid number of tokens.');
|
||||||
|
}
|
||||||
$sql = "UPDATE users_main SET FLTokens = FLTokens + $Tokens WHERE Enabled = '1'";
|
$sql = "UPDATE users_main SET FLTokens = FLTokens + $Tokens WHERE Enabled = '1'";
|
||||||
if (!isset($_REQUEST['leechdisabled'])) {
|
if (!isset($_REQUEST['leechdisabled'])) {
|
||||||
$sql .= " AND can_leech = 1";
|
$sql .= " AND can_leech = 1";
|
||||||
@ -19,12 +23,14 @@
|
|||||||
while (list($UserID) = $DB->next_record()) {
|
while (list($UserID) = $DB->next_record()) {
|
||||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
}
|
}
|
||||||
$message = "<strong>$Tokens freeleech tokens added to all enabled users" . (!isset($_REQUEST['leechdisabled'])?' with enabled leeching privs':'') . '.</strong><br /><br />';
|
$message = '<strong>' . number_format($Tokens) . 'freeleech tokens added to all enabled users' . (!isset($_REQUEST['leechdisabled']) ? ' with enabled leeching privs' : '') . '.</strong><br /><br />';
|
||||||
} elseif (isset($_REQUEST['cleartokens'])) {
|
} elseif (isset($_REQUEST['cleartokens'])) {
|
||||||
authorize();
|
authorize();
|
||||||
$Tokens = $_REQUEST['numtokens'];
|
$Tokens = $_REQUEST['numtokens'];
|
||||||
|
|
||||||
if (!is_number($Tokens) || ($Tokens < 0)) { error("Please enter a valid number of tokens."); }
|
if (!is_number($Tokens) || ($Tokens < 0)) {
|
||||||
|
error('Please enter a valid number of tokens.');
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['onlydrop'])) {
|
if (isset($_REQUEST['onlydrop'])) {
|
||||||
$Where = "WHERE FLTokens > $Tokens";
|
$Where = "WHERE FLTokens > $Tokens";
|
||||||
@ -42,7 +48,7 @@
|
|||||||
$Cache->delete_value('user_info_heavy_'.$UserID);
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = "";
|
$where = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -55,26 +61,26 @@
|
|||||||
<a href="tools.php?action=tokens&showabusers=1" class="brackets">Show abusers</a>
|
<a href="tools.php?action=tokens&showabusers=1" class="brackets">Show abusers</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box pad" style="margin-left: auto; margin-right: auto; text-align:center; max-width: 40%">
|
<div class="box pad" style="margin-left: auto; margin-right: auto; text-align: center; max-width: 40%;">
|
||||||
<?=$message?>
|
<?=$message?>
|
||||||
<form class="add_form" name="fltokens" action="" method="post">
|
<form class="add_form" name="fltokens" action="" method="post">
|
||||||
<input type="hidden" name="action" value="tokens" />
|
<input type="hidden" name="action" value="tokens" />
|
||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
Tokens to add: <input type="text" name="numtokens" size="5" style="text-align: right" value="0"><br /><br />
|
Tokens to add: <input type="text" name="numtokens" size="5" style="text-align: right;" value="0" /><br /><br />
|
||||||
<label for="leechdisabled">Grant tokens to leech disabled users: </label><input type="checkbox" id="leechdisabled" name="leechdisabled" value="1"><br /><br />
|
<label for="leechdisabled">Grant tokens to leech disabled users: </label><input type="checkbox" id="leechdisabled" name="leechdisabled" value="1" /><br /><br />
|
||||||
<input type="submit" name="addtokens" value="Add tokens">
|
<input type="submit" name="addtokens" value="Add tokens" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="box pad" style="margin-left: auto; margin-right: auto; text-align:center; max-width: 40%">
|
<div class="box pad" style="margin-left: auto; margin-right: auto; text-align: center; max-width: 40%;">
|
||||||
<?=$message?>
|
<?=$message?>
|
||||||
<form class="manage_form" name="fltokens" action="" method="post">
|
<form class="manage_form" name="fltokens" action="" method="post">
|
||||||
<input type="hidden" name="action" value="tokens" />
|
<input type="hidden" name="action" value="tokens" />
|
||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
Tokens to set: <input type="text" name="numtokens" size="5" style="text-align: right" value="0"><br /><br />
|
Tokens to set: <input type="text" name="numtokens" size="5" style="text-align: right;" value="0" /><br /><br />
|
||||||
<span id="droptokens" class=""><label for="onlydrop">Only affect users with at least this many tokens: </label><input type="checkbox" id="onlydrop" name="onlydrop" value="1" onchange="$('#disabled').toggle();return true;"></span><br />
|
<span id="droptokens" class=""><label for="onlydrop">Only affect users with at least this many tokens: </label><input type="checkbox" id="onlydrop" name="onlydrop" value="1" onchange="$('#disabled').toggle();return true;" /></span><br />
|
||||||
<span id="disabled" class=""><label for="leechdisabled">Also add tokens (as needed) to leech disabled users: </label><input type="checkbox" id="leechdisabled" name="leechdisabled" value="1" onchange="$('#droptokens').toggle();return true;"></span><br /><br />
|
<span id="disabled" class=""><label for="leechdisabled">Also add tokens (as needed) to leech disabled users: </label><input type="checkbox" id="leechdisabled" name="leechdisabled" value="1" onchange="$('#droptokens').toggle();return true;" /></span><br /><br />
|
||||||
<input type="submit" name="cleartokens" value="Set token total">
|
<input type="submit" name="cleartokens" value="Set token total" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
<tr class="colhead"><td>Data</td></tr>
|
<tr class="colhead"><td>Data</td></tr>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
if (check_perms('admin_donor_log')) { ?>
|
if (check_perms('admin_donor_log')) { ?>
|
||||||
<tr><td><a href="tools.php?action=donation_log">Donation log</a></td></tr>
|
<tr><td><a href="tools.php?action=donation_log">Donation log</a></td></tr>
|
||||||
<tr><td><a href="tools.php?action=bitcoin_balance">Bitcoin donation balance</a></td></tr>
|
<tr><td><a href="tools.php?action=bitcoin_balance">Bitcoin donation balance</a></td></tr>
|
||||||
<? } if (check_perms('users_view_ips') && check_perms('users_view_email')) { ?>
|
<? } if (check_perms('users_view_ips') && check_perms('users_view_email')) { ?>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<? if (check_perms('users_mod')) { ?>
|
<? if (check_perms('users_mod')) { ?>
|
||||||
<tr><td><a href="tools.php?action=manipulate_tree">Manipulate tree</a></td></tr>
|
<tr><td><a href="tools.php?action=manipulate_tree">Manipulate tree</a></td></tr>
|
||||||
<? }
|
<? }
|
||||||
if (check_perms('admin_update_geoip')) { ?>
|
if (check_perms('admin_update_geoip')) { ?>
|
||||||
<tr><td><a href="tools.php?action=update_geoip">Update GeoIP </a></td></tr>
|
<tr><td><a href="tools.php?action=update_geoip">Update GeoIP </a></td></tr>
|
||||||
<? } if (check_perms('admin_create_users')) { ?>
|
<? } if (check_perms('admin_create_users')) { ?>
|
||||||
<tr><td><a href="tools.php?action=create_user">Create user</a></td></tr>
|
<tr><td><a href="tools.php?action=create_user">Create user</a></td></tr>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<tr><td><a href="tools.php?action=sandbox8">Sandbox (8)</a></td></tr>
|
<tr><td><a href="tools.php?action=sandbox8">Sandbox (8)</a></td></tr>
|
||||||
|
|
||||||
<tr><td><a href="schedule.php?auth=<?=$LoggedUser['AuthKey']?>">Schedule</a></td></tr>
|
<tr><td><a href="schedule.php?auth=<?=$LoggedUser['AuthKey']?>">Schedule</a></td></tr>
|
||||||
<? }?>
|
<? } ?>
|
||||||
<? if (check_perms('users_mod')) { ?>
|
<? if (check_perms('users_mod')) { ?>
|
||||||
<tr><td><strong><a href="tools.php?action=public_sandbox">Public sandbox</a></strong></td></tr>
|
<tr><td><strong><a href="tools.php?action=public_sandbox">Public sandbox</a></strong></td></tr>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<?
|
<?
|
||||||
if(!check_perms('users_mod')) { error(404); }
|
if (!check_perms('users_mod')) {
|
||||||
//if(!check_perms('site_top10_history')) { error(403); }
|
error(404);
|
||||||
|
}
|
||||||
|
// if (!check_perms('site_top10_history')) {
|
||||||
|
// error(403);
|
||||||
|
// }
|
||||||
View::show_header('Top 10 Torrents history!');
|
View::show_header('Top 10 Torrents history!');
|
||||||
?>
|
?>
|
||||||
<div class="thin">
|
<div class="thin">
|
||||||
@ -21,7 +25,7 @@
|
|||||||
<table class="layout">
|
<table class="layout">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Date:</td>
|
<td class="label">Date:</td>
|
||||||
<td><input type="text" id="date" name="date" value="<?=!empty($_GET['date']) ? display_str($_GET['date']) : 'YYYY-MM-DD'?>" onfocus="if($('#date').raw().value == 'YYYY-MM-DD') $('#date').raw().value = ''" /></td>
|
<td><input type="text" id="date" name="date" value="<?=!empty($_GET['date']) ? display_str($_GET['date']) : 'YYYY-MM-DD'?>" onfocus="if ($('#date').raw().value == 'YYYY-MM-DD') $('#date').raw().value = ''" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">Type:</td>
|
<td class="label">Type:</td>
|
||||||
@ -39,14 +43,14 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
if(!empty($_GET['date'])) {
|
if (!empty($_GET['date'])) {
|
||||||
$Date = $_GET['date'];
|
$Date = $_GET['date'];
|
||||||
$SQLTime = $Date." 00:00:00";
|
$SQLTime = $Date.' 00:00:00';
|
||||||
if(!validDate($SQLTime)) {
|
if (!validDate($SQLTime)) {
|
||||||
error('Something is wrong with the date you provided');
|
error('Something is wrong with the date you provided');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_GET['datetype']) || $_GET['datetype'] == "day") {
|
if (empty($_GET['datetype']) || $_GET['datetype'] == 'day') {
|
||||||
$Type = 'day';
|
$Type = 'day';
|
||||||
$Where = "WHERE th.Date BETWEEN '".$SQLTime."' AND '".$SQLTime."' + INTERVAL 24 HOUR AND Type='Daily'";
|
$Where = "WHERE th.Date BETWEEN '".$SQLTime."' AND '".$SQLTime."' + INTERVAL 24 HOUR AND Type='Daily'";
|
||||||
} else {
|
} else {
|
||||||
@ -55,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$Details = $Cache->get_value('top10_history_'.$SQLTime);
|
$Details = $Cache->get_value('top10_history_'.$SQLTime);
|
||||||
if($Details === false) {
|
if ($Details === false) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
tht.Rank,
|
tht.Rank,
|
||||||
tht.TitleString,
|
tht.TitleString,
|
||||||
@ -93,12 +97,12 @@
|
|||||||
<h3>Top 10 for <?=($Type == 'day' ? $Date : 'the first week after '.$Date)?></h3>
|
<h3>Top 10 for <?=($Type == 'day' ? $Date : 'the first week after '.$Date)?></h3>
|
||||||
<table class="torrent_table cats numbering border">
|
<table class="torrent_table cats numbering border">
|
||||||
<tr class="colhead">
|
<tr class="colhead">
|
||||||
<td class="center" style="width:15px;"></td>
|
<td class="center" style="width: 15px;"></td>
|
||||||
<td class="center"></td>
|
<td class="center"></td>
|
||||||
<td><strong>Name</strong></td>
|
<td><strong>Name</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
foreach ($Details as $Detail) {
|
foreach ($Details as $Detail) :
|
||||||
list($Rank, $TitleString, $TagString, $TorrentID, $GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
list($Rank, $TitleString, $TagString, $TorrentID, $GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
||||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
||||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Detail;
|
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data) = $Detail;
|
||||||
@ -106,48 +110,71 @@
|
|||||||
// highlight every other row
|
// highlight every other row
|
||||||
$Highlight = ($Rank % 2 ? 'a' : 'b');
|
$Highlight = ($Rank % 2 ? 'a' : 'b');
|
||||||
|
|
||||||
if($GroupID) {
|
if ($GroupID) :
|
||||||
//Group still exists
|
//Group still exists
|
||||||
$DisplayName='';
|
$DisplayName='';
|
||||||
|
|
||||||
$Artists = Artists::get_artist($GroupID);
|
$Artists = Artists::get_artist($GroupID);
|
||||||
|
|
||||||
if(!empty($Artists)) {
|
if (!empty($Artists)) {
|
||||||
$DisplayName = Artists::display_artists($Artists, true, true);
|
$DisplayName = Artists::display_artists($Artists, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName .= "<a href='torrents.php?id=$GroupID&torrentid=$TorrentID' title='View Torrent'>$GroupName</a>";
|
$DisplayName .= "<a href='torrents.php?id=$GroupID&torrentid=$TorrentID' title='View Torrent'>$GroupName</a>";
|
||||||
|
|
||||||
if($GroupCategoryID==1 && $GroupYear>0) {
|
if ($GroupCategoryID == 1 && $GroupYear > 0) {
|
||||||
$DisplayName.= " [$GroupYear]";
|
$DisplayName.= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
|
|
||||||
// append extra info to torrent title
|
// append extra info to torrent title
|
||||||
$ExtraInfo='';
|
$ExtraInfo = '';
|
||||||
$AddExtra='';
|
$AddExtra = '';
|
||||||
if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
if ($Format) {
|
||||||
if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
$ExtraInfo.=$Format;
|
||||||
"FLAC / Lossless / Log (100%) / Cue / CD";
|
$AddExtra = ' / ';
|
||||||
if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
}
|
||||||
if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
if ($Encoding) {
|
||||||
if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
$ExtraInfo.=$AddExtra.$Encoding;
|
||||||
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
$AddExtra = ' / ';
|
||||||
if($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
}
|
||||||
if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
//"FLAC / Lossless / Log (100%) / Cue / CD";
|
||||||
if($ExtraInfo!='') {
|
if ($HasLog) {
|
||||||
|
$ExtraInfo.=$AddExtra."Log (".$LogScore."%)";
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($HasCue) {
|
||||||
|
$ExtraInfo.=$AddExtra."Cue";
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Media) {
|
||||||
|
$ExtraInfo.=$AddExtra.$Media;
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Scene) {
|
||||||
|
$ExtraInfo.=$AddExtra.'Scene';
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Year > 0) {
|
||||||
|
$ExtraInfo.=$AddExtra.$Year;
|
||||||
|
$AddExtra = ' ';
|
||||||
|
}
|
||||||
|
if ($RemasterTitle) {
|
||||||
|
$ExtraInfo.=$AddExtra.$RemasterTitle;
|
||||||
|
}
|
||||||
|
if ($ExtraInfo != '') {
|
||||||
$ExtraInfo = "- [$ExtraInfo]";
|
$ExtraInfo = "- [$ExtraInfo]";
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName .= $ExtraInfo;
|
$DisplayName .= $ExtraInfo;
|
||||||
$TorrentTags = new Tags($TorrentTags);
|
$TorrentTags = new Tags($TorrentTags);
|
||||||
} else {
|
else:
|
||||||
$DisplayName = $TitleString." (Deleted)";
|
$DisplayName = $TitleString.' (Deleted)';
|
||||||
$TorrentTags = new Tags($TagString);
|
$TorrentTags = new Tags($TagString);
|
||||||
}
|
endif;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr class="group_torrent row<?=$Highlight?>">
|
<tr class="group_torrent row<?=$Highlight?>">
|
||||||
<td style="padding:8px;text-align:center;"><strong><?=$Rank?></strong></td>
|
<td style="padding: 8px; text-align: center;"><strong><?=$Rank?></strong></td>
|
||||||
<td class="center cats_col"><div title="<?=$TorrentTags->title()?>" class="<?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div></td>
|
<td class="center cats_col"><div title="<?=$TorrentTags->title()?>" class="<?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div></td>
|
||||||
<td>
|
<td>
|
||||||
<span><?=($GroupID ? '<a href="torrents.php?action=download&id='.$TorrentID.'&authkey='.$LoggedUser['AuthKey'].'&torrent_pass='.$LoggedUser['torrent_pass'].' title="Download" class="brackets">DL</a>' : '(Deleted)')?></span>
|
<span><?=($GroupID ? '<a href="torrents.php?action=download&id='.$TorrentID.'&authkey='.$LoggedUser['AuthKey'].'&torrent_pass='.$LoggedUser['torrent_pass'].' title="Download" class="brackets">DL</a>' : '(Deleted)')?></span>
|
||||||
@ -156,7 +183,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</table><br />
|
</table><br />
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include(SERVER_ROOT.'/sections/torrents/functions.php'); //Has get_reports($TorrentID);
|
||||||
if(empty($_GET['type']) || $_GET['type'] == 'torrents') {
|
if(empty($_GET['type']) || $_GET['type'] == 'torrents') {
|
||||||
include(SERVER_ROOT.'/sections/top10/torrents.php');
|
include(SERVER_ROOT.'/sections/top10/torrents.php');
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
// error out on invalid requests (before caching)
|
// error out on invalid requests (before caching)
|
||||||
if(isset($_GET['details'])) {
|
if (isset($_GET['details'])) {
|
||||||
if(in_array($_GET['details'], array('day','week','overall','snatched','data','seeded','month','year'))) {
|
if (in_array($_GET['details'], array('day','week','overall','snatched','data','seeded','month','year'))) {
|
||||||
$Details = $_GET['details'];
|
$Details = $_GET['details'];
|
||||||
} else {
|
} else {
|
||||||
error(404);
|
error(404);
|
||||||
@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if(check_perms('site_advanced_top10')) {
|
if (check_perms('site_advanced_top10')) {
|
||||||
?>
|
?>
|
||||||
<form class="search_form" name="torrents" action="" method="get">
|
<form class="search_form" name="torrents" action="" method="get">
|
||||||
<input type="hidden" name="advanced" value="1" />
|
<input type="hidden" name="advanced" value="1" />
|
||||||
@ -70,7 +70,7 @@
|
|||||||
<tr id="tagfilter">
|
<tr id="tagfilter">
|
||||||
<td class="label">Tags (comma-separated):</td>
|
<td class="label">Tags (comma-separated):</td>
|
||||||
<td class="ft_taglist">
|
<td class="ft_taglist">
|
||||||
<input type="text" name="tags" size="75" value="<? if(!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />
|
<input type="text" name="tags" size="75" value="<? if (!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />
|
||||||
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall']!='any'?' checked="checked"':'')?> /><label for="rdoAll"> All</label>
|
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall']!='any'?' checked="checked"':'')?> /><label for="rdoAll"> All</label>
|
||||||
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall']=='any'?' checked="checked"':'')?> /><label for="rdoAny"> Any</label>
|
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall']=='any'?' checked="checked"':'')?> /><label for="rdoAny"> Any</label>
|
||||||
</td>
|
</td>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
<select name="format" style="width:auto;" class="ft_format">
|
<select name="format" style="width:auto;" class="ft_format">
|
||||||
<option value="">Any</option>
|
<option value="">Any</option>
|
||||||
<? foreach ($Formats as $FormatName) { ?>
|
<? foreach ($Formats as $FormatName) { ?>
|
||||||
<option value="<?=display_str($FormatName)?>"<? if(isset($_GET['format']) && $FormatName==$_GET['format']) { ?> selected="selected"<? } ?>><?=display_str($FormatName)?></option>
|
<option value="<?=display_str($FormatName)?>"<? if (isset($_GET['format']) && $FormatName==$_GET['format']) { ?> selected="selected"<? } ?>><?=display_str($FormatName)?></option>
|
||||||
<? } ?> </select>
|
<? } ?> </select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -98,7 +98,7 @@
|
|||||||
// default setting to have them shown
|
// default setting to have them shown
|
||||||
$DisableFreeTorrentTop10 = (isset($LoggedUser['DisableFreeTorrentTop10']) ? $LoggedUser['DisableFreeTorrentTop10'] : 0);
|
$DisableFreeTorrentTop10 = (isset($LoggedUser['DisableFreeTorrentTop10']) ? $LoggedUser['DisableFreeTorrentTop10'] : 0);
|
||||||
// did they just toggle it?
|
// did they just toggle it?
|
||||||
if(isset($_GET['freeleech'])) {
|
if (isset($_GET['freeleech'])) {
|
||||||
// what did they choose?
|
// what did they choose?
|
||||||
$NewPref = ($_GET['freeleech'] == 'hide') ? 1 : 0;
|
$NewPref = ($_GET['freeleech'] == 'hide') ? 1 : 0;
|
||||||
|
|
||||||
@ -161,7 +161,7 @@
|
|||||||
FROM torrents AS t
|
FROM torrents AS t
|
||||||
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID ";
|
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID ";
|
||||||
|
|
||||||
if($Details=='all' || $Details=='day') {
|
if ($Details=='all' || $Details=='day') {
|
||||||
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum);
|
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsActiveLastDay === false) {
|
if ($TopTorrentsActiveLastDay === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -182,7 +182,7 @@
|
|||||||
}
|
}
|
||||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
||||||
}
|
}
|
||||||
if($Details=='all' || $Details=='week') {
|
if ($Details=='all' || $Details=='week') {
|
||||||
$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum);
|
$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsActiveLastWeek === false) {
|
if ($TopTorrentsActiveLastWeek === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -204,7 +204,7 @@
|
|||||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details=='all' || $Details=='month') {
|
if ($Details=='all' || $Details=='month') {
|
||||||
$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum);
|
$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsActiveLastMonth === false) {
|
if ($TopTorrentsActiveLastMonth === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -225,7 +225,7 @@
|
|||||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Month', 'month', $TopTorrentsActiveLastMonth, $Limit);
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Month', 'month', $TopTorrentsActiveLastMonth, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details=='all' || $Details=='year') {
|
if ($Details=='all' || $Details=='year') {
|
||||||
$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum);
|
$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsActiveLastYear === false) {
|
if ($TopTorrentsActiveLastYear === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -251,7 +251,7 @@
|
|||||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Year', 'year', $TopTorrentsActiveLastYear, $Limit);
|
generate_torrent_table('Most Active Torrents Uploaded in the Past Year', 'year', $TopTorrentsActiveLastYear, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($Details=='all' || $Details=='overall') {
|
if ($Details=='all' || $Details=='overall') {
|
||||||
$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum);
|
$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsActiveAllTime === false) {
|
if ($TopTorrentsActiveAllTime === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -276,7 +276,7 @@
|
|||||||
generate_torrent_table('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
|
generate_torrent_table('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($Details=='all' || $Details=='snatched') && !$Filtered) {
|
if (($Details=='all' || $Details=='snatched') && !$Filtered) {
|
||||||
$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum);
|
$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsSnatched === false) {
|
if ($TopTorrentsSnatched === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -296,7 +296,7 @@
|
|||||||
generate_torrent_table('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
|
generate_torrent_table('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($Details=='all' || $Details=='data') && !$Filtered) {
|
if (($Details=='all' || $Details=='data') && !$Filtered) {
|
||||||
$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum);
|
$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsTransferred === false) {
|
if ($TopTorrentsTransferred === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -320,7 +320,7 @@
|
|||||||
generate_torrent_table('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
|
generate_torrent_table('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($Details=='all' || $Details=='seeded') && !$Filtered) {
|
if (($Details=='all' || $Details=='seeded') && !$Filtered) {
|
||||||
$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum);
|
$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum);
|
||||||
if ($TopTorrentsSeeded === false) {
|
if ($TopTorrentsSeeded === false) {
|
||||||
if ($Cache->get_query_lock('top10')) {
|
if ($Cache->get_query_lock('top10')) {
|
||||||
@ -350,7 +350,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
|||||||
global $LoggedUser,$Categories,$ReleaseTypes;
|
global $LoggedUser,$Categories,$ReleaseTypes;
|
||||||
?>
|
?>
|
||||||
<h3>Top <?=$Limit.' '.$Caption?>
|
<h3>Top <?=$Limit.' '.$Caption?>
|
||||||
<? if(empty($_GET['advanced'])){ ?>
|
<? if (empty($_GET['advanced'])){ ?>
|
||||||
<small class="top10_quantity_links">
|
<small class="top10_quantity_links">
|
||||||
<?
|
<?
|
||||||
switch($Limit) {
|
switch($Limit) {
|
||||||
@ -415,7 +415,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
|||||||
}
|
}
|
||||||
$Artists = Artists::get_artists($GroupIDs);
|
$Artists = Artists::get_artists($GroupIDs);
|
||||||
|
|
||||||
foreach ($Details as $Detail) {
|
foreach ($Details as $Detail) :
|
||||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$WikiImage,$TagsList,
|
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$WikiImage,$TagsList,
|
||||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
||||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail;
|
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail;
|
||||||
@ -428,41 +428,48 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
|||||||
$Highlight = ($Rank % 2 ? 'a' : 'b');
|
$Highlight = ($Rank % 2 ? 'a' : 'b');
|
||||||
|
|
||||||
// generate torrent's title
|
// generate torrent's title
|
||||||
$DisplayName='';
|
$DisplayName = '';
|
||||||
|
|
||||||
|
|
||||||
if(!empty($Artists[$GroupID])) {
|
if (!empty($Artists[$GroupID])) {
|
||||||
$DisplayName = Artists::display_artists($Artists[$GroupID], true, true);
|
$DisplayName = Artists::display_artists($Artists[$GroupID], true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName.= "<a href=\"torrents.php?id=$GroupID&torrentid=$TorrentID\" title=\"View Torrent\" dir=\"ltr\">$GroupName</a>";
|
$DisplayName.= "<a href=\"torrents.php?id=$GroupID&torrentid=$TorrentID\" title=\"View Torrent\" dir=\"ltr\">$GroupName</a>";
|
||||||
|
|
||||||
if($GroupCategoryID==1 && $GroupYear>0) {
|
if ($GroupCategoryID == 1 && $GroupYear > 0) {
|
||||||
$DisplayName.= " [$GroupYear]";
|
$DisplayName.= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
if($GroupCategoryID==1 && $ReleaseType > 0) {
|
if ($GroupCategoryID == 1 && $ReleaseType > 0) {
|
||||||
$DisplayName.= ' ['.$ReleaseTypes[$ReleaseType].']';
|
$DisplayName.= ' ['.$ReleaseTypes[$ReleaseType].']';
|
||||||
}
|
}
|
||||||
|
|
||||||
// append extra info to torrent title
|
// append extra info to torrent title
|
||||||
$ExtraInfo='';
|
$ExtraInfo='';
|
||||||
$AddExtra='';
|
$AddExtra='';
|
||||||
if($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
if ($Format) { $ExtraInfo.=$Format; $AddExtra=' / '; }
|
||||||
if($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
if ($Encoding) { $ExtraInfo.=$AddExtra.$Encoding; $AddExtra=' / '; }
|
||||||
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
// "FLAC / Lossless / Log (100%) / Cue / CD";
|
||||||
if($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
if ($HasLog) { $ExtraInfo.=$AddExtra."Log (".$LogScore."%)"; $AddExtra=' / '; }
|
||||||
if($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
if ($HasCue) { $ExtraInfo.=$AddExtra."Cue"; $AddExtra=' / '; }
|
||||||
if($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
if ($Media) { $ExtraInfo.=$AddExtra.$Media; $AddExtra=' / '; }
|
||||||
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
if ($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
||||||
if($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
if ($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
||||||
if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
if ($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
||||||
if($IsSnatched) { if($GroupCategoryID == 1) { $ExtraInfo .= ' / '; } $ExtraInfo.= Format::torrent_label('Snatched!'); }
|
if ($IsSnatched) { if ($GroupCategoryID == 1) { $ExtraInfo .= ' / '; } $ExtraInfo.= Format::torrent_label('Snatched!'); }
|
||||||
if($ExtraInfo!='') {
|
if ($ExtraInfo!='') {
|
||||||
$ExtraInfo = "- [$ExtraInfo]";
|
$ExtraInfo = "- [$ExtraInfo]";
|
||||||
}
|
}
|
||||||
|
|
||||||
$TorrentTags = new Tags($TagsList);
|
$TorrentTags = new Tags($TagsList);
|
||||||
|
|
||||||
|
//Get report info, use the cache if available, if not, add to it.
|
||||||
|
$Reported = false;
|
||||||
|
$Reports = get_reports($TorrentID);
|
||||||
|
if (count($Reports) > 0) {
|
||||||
|
$Reported = true;
|
||||||
|
}
|
||||||
|
|
||||||
// print row
|
// print row
|
||||||
?>
|
?>
|
||||||
<tr class="torrent row<?=$Highlight . ($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '')?>">
|
<tr class="torrent row<?=$Highlight . ($IsBookmarked ? ' bookmarked' : '') . ($IsSnatched ? ' snatched_torrent' : '')?>">
|
||||||
@ -476,12 +483,12 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
|||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
<div class="group_info clear">
|
<div class="group_info clear">
|
||||||
|
|
||||||
<span>[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a> ]</span>
|
<span><a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets">DL</a></span>
|
||||||
|
|
||||||
<strong><?=$DisplayName?></strong> <?=$ExtraInfo?>
|
<strong><?=$DisplayName?></strong> <?=$ExtraInfo?><?if($Reported){?> - <strong class="torrent_label tl_reported" title="Reported">Reported</strong><?}?>
|
||||||
<span class="bookmark" style="float:right;">
|
<span class="bookmark" style="float: right;">
|
||||||
<?
|
<?
|
||||||
if($IsBookmarked) {
|
if ($IsBookmarked) {
|
||||||
?>
|
?>
|
||||||
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
|
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
@ -492,15 +499,15 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align:right" class="nobr"><?=Format::get_size($Size)?></td>
|
<td style="text-align: right;" class="nobr"><?=Format::get_size($Size)?></td>
|
||||||
<td style="text-align:right" class="nobr"><?=Format::get_size($Data)?></td>
|
<td style="text-align: right;" class="nobr"><?=Format::get_size($Data)?></td>
|
||||||
<td style="text-align:right"><?=number_format((double) $Snatched)?></td>
|
<td style="text-align: right;"><?=number_format((double) $Snatched)?></td>
|
||||||
<td style="text-align:right"><?=number_format((double) $Seeders)?></td>
|
<td style="text-align: right;"><?=number_format((double) $Seeders)?></td>
|
||||||
<td style="text-align:right"><?=number_format((double) $Leechers)?></td>
|
<td style="text-align: right;"><?=number_format((double) $Leechers)?></td>
|
||||||
<td style="text-align:right"><?=number_format($Seeders+$Leechers)?></td>
|
<td style="text-align: right;"><?=number_format($Seeders + $Leechers)?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</table><br />
|
</table><br />
|
||||||
<?
|
<?
|
||||||
|
@ -5,15 +5,15 @@
|
|||||||
|
|
||||||
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
|
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
|
||||||
|
|
||||||
if(!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
||||||
$Details = 'all';
|
$Details = 'all';
|
||||||
$Limit = 25;
|
$Limit = 25;
|
||||||
|
|
||||||
if($_GET['tags']) {
|
if ($_GET['tags']) {
|
||||||
$Tags = explode(',', str_replace(".","_",trim($_GET['tags'])));
|
$Tags = explode(',', str_replace(".","_",trim($_GET['tags'])));
|
||||||
foreach ($Tags as $Tag) {
|
foreach ($Tags as $Tag) {
|
||||||
$Tag = preg_replace('/[^a-z0-9_]/', '', $Tag);
|
$Tag = preg_replace('/[^a-z0-9_]/', '', $Tag);
|
||||||
if($Tag != '') {
|
if ($Tag != '') {
|
||||||
$Where[]="g.TagList REGEXP '[[:<:]]".db_string($Tag)."[[:>:]]'";
|
$Where[]="g.TagList REGEXP '[[:<:]]".db_string($Tag)."[[:>:]]'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,13 +45,13 @@
|
|||||||
// Unlike the other top 10s, this query just gets some raw stats
|
// Unlike the other top 10s, this query just gets some raw stats
|
||||||
// We'll need to do some fancy-pants stuff to translate it into
|
// We'll need to do some fancy-pants stuff to translate it into
|
||||||
// BPCI scores before getting the torrent data
|
// BPCI scores before getting the torrent data
|
||||||
$Query = "SELECT v.GroupID, v.Ups, v.Total, v.Score
|
$Query = 'SELECT v.GroupID, v.Ups, v.Total, v.Score
|
||||||
FROM torrents_votes AS v";
|
FROM torrents_votes AS v';
|
||||||
if (!empty($Where)) {
|
if (!empty($Where)) {
|
||||||
$Query .= " JOIN torrents_group AS g ON g.ID = v.GroupID
|
$Query .= " JOIN torrents_group AS g ON g.ID = v.GroupID
|
||||||
WHERE $Where AND ";
|
WHERE $Where AND ";
|
||||||
} else {
|
} else {
|
||||||
$Query .= " WHERE ";
|
$Query .= ' WHERE ';
|
||||||
}
|
}
|
||||||
$Query .= "Score > 0 ORDER BY Score DESC LIMIT $Limit";
|
$Query .= "Score > 0 ORDER BY Score DESC LIMIT $Limit";
|
||||||
|
|
||||||
@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
if(check_perms('site_advanced_top10')) { ?>
|
if (check_perms('site_advanced_top10')) { ?>
|
||||||
<form class="search_form" name="votes" action="" method="get">
|
<form class="search_form" name="votes" action="" method="get">
|
||||||
<input type="hidden" name="advanced" value="1" />
|
<input type="hidden" name="advanced" value="1" />
|
||||||
<input type="hidden" name="type" value="votes" />
|
<input type="hidden" name="type" value="votes" />
|
||||||
@ -102,17 +102,17 @@
|
|||||||
<tr id="tagfilter">
|
<tr id="tagfilter">
|
||||||
<td class="label">Tags (comma-separated):</td>
|
<td class="label">Tags (comma-separated):</td>
|
||||||
<td class="ft_taglist">
|
<td class="ft_taglist">
|
||||||
<input type="text" name="tags" size="75" value="<? if(!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />
|
<input type="text" name="tags" size="75" value="<? if (!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />
|
||||||
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall']!='any'?' checked="checked"':'')?> /><label for="rdoAll"> All</label>
|
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall'] != 'any' ? ' checked="checked"' : '')?> /><label for="rdoAll"> All</label>
|
||||||
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall']=='any'?' checked="checked"':'')?> /><label for="rdoAny"> Any</label>
|
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall'] == 'any' ? ' checked="checked"' : '')?> /><label for="rdoAny"> Any</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="yearfilter">
|
<tr id="yearfilter">
|
||||||
<td class="label">Year:</td>
|
<td class="label">Year:</td>
|
||||||
<td class="ft_year">
|
<td class="ft_year">
|
||||||
<input type="text" name="year1" size="4" value="<? if(!empty($_GET['year1'])) { echo display_str($_GET['year1']);} ?>" />
|
<input type="text" name="year1" size="4" value="<? if (!empty($_GET['year1'])) { echo display_str($_GET['year1']);} ?>" />
|
||||||
to
|
to
|
||||||
<input type="text" name="year2" size="4" value="<? if(!empty($_GET['year2'])) { echo display_str($_GET['year2']);} ?>" />
|
<input type="text" name="year2" size="4" value="<? if (!empty($_GET['year2'])) { echo display_str($_GET['year2']);} ?>" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -129,7 +129,7 @@
|
|||||||
?>
|
?>
|
||||||
<h3>Top <?=$Limit.' '.$Caption?>
|
<h3>Top <?=$Limit.' '.$Caption?>
|
||||||
<?
|
<?
|
||||||
if(empty($_GET['advanced'])){ ?>
|
if (empty($_GET['advanced'])) { ?>
|
||||||
<small class="top10_quantity_links">
|
<small class="top10_quantity_links">
|
||||||
<?
|
<?
|
||||||
switch($Limit) {
|
switch($Limit) {
|
||||||
@ -137,12 +137,12 @@
|
|||||||
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
|
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
|
||||||
- <span class="brackets">Top 100</span>
|
- <span class="brackets">Top 100</span>
|
||||||
- <a href="top10.php?type=votes&limit=250" class="brackets">Top 250</a>
|
- <a href="top10.php?type=votes&limit=250" class="brackets">Top 250</a>
|
||||||
<? break;
|
<? break;
|
||||||
case 250: ?>
|
case 250: ?>
|
||||||
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
|
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
|
||||||
- <a href="top10.php?type=votes&limit=100" class="brackets">Top 100</a>
|
- <a href="top10.php?type=votes&limit=100" class="brackets">Top 100</a>
|
||||||
- <span class="brackets">Top 250</span>
|
- <span class="brackets">Top 250</span>
|
||||||
<? break;
|
<? break;
|
||||||
default: ?>
|
default: ?>
|
||||||
- <span class="brackets">Top 25</span>
|
- <span class="brackets">Top 25</span>
|
||||||
- <a href="top10.php?type=votes&limit=100" class="brackets">Top 100</a>
|
- <a href="top10.php?type=votes&limit=100" class="brackets">Top 100</a>
|
||||||
@ -177,17 +177,21 @@
|
|||||||
unset($ExtendedArtists[2]);
|
unset($ExtendedArtists[2]);
|
||||||
unset($ExtendedArtists[3]);
|
unset($ExtendedArtists[3]);
|
||||||
$DisplayName .= Artists::display_artists($ExtendedArtists);
|
$DisplayName .= Artists::display_artists($ExtendedArtists);
|
||||||
} elseif(count($GroupArtists)>0) {
|
} elseif (count($GroupArtists) > 0) {
|
||||||
$DisplayName .= Artists::display_artists(array('1'=>$GroupArtists));
|
$DisplayName .= Artists::display_artists(array('1'=>$GroupArtists));
|
||||||
}
|
}
|
||||||
|
|
||||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
||||||
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
|
if ($GroupYear > 0) {
|
||||||
if($GroupVanityHouse) { $DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]'; }
|
$DisplayName = $DisplayName. " [$GroupYear]";
|
||||||
|
}
|
||||||
|
if ($GroupVanityHouse) {
|
||||||
|
$DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]';
|
||||||
|
}
|
||||||
// Start an output buffer, so we can store this output in $TorrentTable
|
// Start an output buffer, so we can store this output in $TorrentTable
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
if(count($Torrents) > 1 || $GroupCategoryID == 1) {
|
if (count($Torrents) > 1 || $GroupCategoryID == 1) :
|
||||||
// Grouped torrents
|
// Grouped torrents
|
||||||
$GroupSnatched = false;
|
$GroupSnatched = false;
|
||||||
foreach ($Torrents as &$Torrent) {
|
foreach ($Torrents as &$Torrent) {
|
||||||
@ -216,16 +220,16 @@
|
|||||||
<div class="group_info clear">
|
<div class="group_info clear">
|
||||||
|
|
||||||
<strong><?=$DisplayName?></strong> <!--<?Votes::vote_link($GroupID,$UserVotes[$GroupID]['Type']);?>-->
|
<strong><?=$DisplayName?></strong> <!--<?Votes::vote_link($GroupID,$UserVotes[$GroupID]['Type']);?>-->
|
||||||
<? if($IsBookmarked) { ?>
|
<? if ($IsBookmarked) { ?>
|
||||||
<span class="bookmark" style="float:right;"><a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a></span>
|
<span class="bookmark" style="float: right;"><a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a></span>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<span class="bookmark" style="float:right;"><a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets add_bookmark" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a></span>
|
<span class="bookmark" style="float: right;"><a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets add_bookmark" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a></span>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<div class="tags"><?=$TorrentTags->format()?></div>
|
<div class="tags"><?=$TorrentTags->format()?></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="4" class="votes_info_td"><strong><?=number_format($Ups)?></strong> upvotes out of <strong><?=number_format($Total)?></strong> total (<span title="Score: <?=number_format($Score*100,4)?>">Score: <?=number_format($Score*100)?></span>).</td>
|
<td colspan="4" class="votes_info_td"><strong><?=number_format($Ups)?></strong> upvotes out of <strong><?=number_format($Total)?></strong> total (<span title="Score: <?=number_format($Score * 100,4)?>">Score: <?=number_format($Score * 100)?></span>).</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
$LastRemasterYear = '-';
|
$LastRemasterYear = '-';
|
||||||
@ -237,13 +241,19 @@
|
|||||||
$EditionID = 0;
|
$EditionID = 0;
|
||||||
unset($FirstUnknown);
|
unset($FirstUnknown);
|
||||||
|
|
||||||
foreach ($Torrents as $TorrentID => $Torrent) {
|
foreach ($Torrents as $TorrentID => $Torrent) :
|
||||||
|
//Get report info, use the cache if available, if not, add to it.
|
||||||
|
$Reported = false;
|
||||||
|
$Reports = get_reports($TorrentID);
|
||||||
|
if (count($Reports) > 0) {
|
||||||
|
$Reported = true;
|
||||||
|
}
|
||||||
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
|
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
|
||||||
$FirstUnknown = !isset($FirstUnknown);
|
$FirstUnknown = !isset($FirstUnknown);
|
||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
|
|
||||||
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
if ($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||||
$EditionID++;
|
$EditionID++;
|
||||||
?>
|
?>
|
||||||
@ -267,7 +277,7 @@
|
|||||||
<? } ?>
|
<? } ?>
|
||||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||||
</span>
|
</span>
|
||||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
|
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?><?if($Reported){?> / <strong class="torrent_label tl_reported" title="Reported">Reported</strong><?}?></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
|
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
|
||||||
<td><?=number_format($Torrent['Snatched'])?></td>
|
<td><?=number_format($Torrent['Snatched'])?></td>
|
||||||
@ -275,15 +285,15 @@
|
|||||||
<td><?=number_format($Torrent['Leechers'])?></td>
|
<td><?=number_format($Torrent['Leechers'])?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
endforeach;
|
||||||
} else {
|
else:
|
||||||
// Viewing a type that does not require grouping
|
// Viewing a type that does not require grouping
|
||||||
|
|
||||||
list($TorrentID, $Torrent) = each($Torrents);
|
list($TorrentID, $Torrent) = each($Torrents);
|
||||||
$Torrent['IsSnatched'] = Torrents::has_snatched($TorrentID);
|
$Torrent['IsSnatched'] = Torrents::has_snatched($TorrentID);
|
||||||
|
|
||||||
$DisplayName = $Number .' - <a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
$DisplayName = $Number .' - <a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
||||||
if($Torrent['IsSnatched']) {
|
if ($Torrent['IsSnatched']) {
|
||||||
$DisplayName .= ' ' . Format::torrent_label('Snatched!');
|
$DisplayName .= ' ' . Format::torrent_label('Snatched!');
|
||||||
}
|
}
|
||||||
if ($Torrent['FreeTorrent'] == '1') {
|
if ($Torrent['FreeTorrent'] == '1') {
|
||||||
@ -291,7 +301,7 @@
|
|||||||
} elseif ($Torrent['FreeTorrent'] == '2') {
|
} elseif ($Torrent['FreeTorrent'] == '2') {
|
||||||
$DisplayName .= ' ' . Format::torrent_label('Neutral leech!');
|
$DisplayName .= ' ' . Format::torrent_label('Neutral leech!');
|
||||||
} elseif (Torrents::has_token($TorrentID)) {
|
} elseif (Torrents::has_token($TorrentID)) {
|
||||||
$DisplayName .= ' ' . Format::torrent_label('Personal Freeleech!');
|
$DisplayName .= ' ' . Format::torrent_label('Personal freeleech!');
|
||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
?>
|
?>
|
||||||
@ -314,7 +324,7 @@
|
|||||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a>
|
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a>
|
||||||
<? if($IsBookmarked) { ?>
|
<? if ($IsBookmarked) { ?>
|
||||||
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
|
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a>
|
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a>
|
||||||
@ -330,8 +340,8 @@
|
|||||||
<td<?=($Torrent['Seeders']==0)?' class="r00"':''?>><?=number_format($Torrent['Seeders'])?></td>
|
<td<?=($Torrent['Seeders']==0)?' class="r00"':''?>><?=number_format($Torrent['Seeders'])?></td>
|
||||||
<td><?=number_format($Torrent['Leechers'])?></td>
|
<td><?=number_format($Torrent['Leechers'])?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
}
|
endif;
|
||||||
$TorrentTable.=ob_get_clean();
|
$TorrentTable.=ob_get_clean();
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -346,7 +356,7 @@
|
|||||||
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" /></td>
|
<td class="sign"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
if($TorrentList === false) { ?>
|
if ($TorrentList === false) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="center">Server is busy processing another top list request. Please try again in a minute.</td>
|
<td colspan="7" class="center">Server is busy processing another top list request. Please try again in a minute.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -537,8 +537,8 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
|
|
||||||
$HideFilter = isset($LoggedUser['ShowTorFilter']) && $LoggedUser['ShowTorFilter'] == 0;
|
$HideFilter = isset($LoggedUser['ShowTorFilter']) && $LoggedUser['ShowTorFilter'] == 0;
|
||||||
// This is kinda ugly, but the enormous if paragraph was really hard to read
|
// This is kinda ugly, but the enormous if paragraph was really hard to read
|
||||||
$AdvancedSearch = !empty($_GET['action']) && $_GET['action'] == "advanced";
|
$AdvancedSearch = !empty($_GET['action']) && $_GET['action'] == 'advanced';
|
||||||
$AdvancedSearch |= !empty($LoggedUser['SearchType']) && (empty($_GET['action']) || $_GET['action'] == "advanced");
|
$AdvancedSearch |= !empty($LoggedUser['SearchType']) && (empty($_GET['action']) || $_GET['action'] == 'advanced');
|
||||||
$AdvancedSearch &= check_perms('site_advanced_search');
|
$AdvancedSearch &= check_perms('site_advanced_search');
|
||||||
if ($AdvancedSearch) {
|
if ($AdvancedSearch) {
|
||||||
$Action = 'action=advanced';
|
$Action = 'action=advanced';
|
||||||
@ -647,24 +647,24 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<select id="bitrate" name="encoding" class="ft_bitrate fti_advanced">
|
<select id="bitrate" name="encoding" class="ft_bitrate fti_advanced">
|
||||||
<option value="">Bitrate</option>
|
<option value="">Bitrate</option>
|
||||||
<? foreach ($Bitrates as $BitrateName) { ?>
|
<? foreach ($Bitrates as $BitrateName) { ?>
|
||||||
<option value="<?=display_str($BitrateName); ?>" <?Format::selected('encoding', $BitrateName)?>><?=display_str($BitrateName); ?></option>
|
<option value="<?=display_str($BitrateName); ?>"<?Format::selected('encoding', $BitrateName)?>><?=display_str($BitrateName); ?></option>
|
||||||
<? } ?> </select>
|
<? } ?> </select>
|
||||||
|
|
||||||
<select name="format" class="ft_format fti_advanced">
|
<select name="format" class="ft_format fti_advanced">
|
||||||
<option value="">Format</option>
|
<option value="">Format</option>
|
||||||
<? foreach ($Formats as $FormatName) { ?>
|
<? foreach ($Formats as $FormatName) { ?>
|
||||||
<option value="<?=display_str($FormatName); ?>" <?Format::selected('format', $FormatName)?>><?=display_str($FormatName); ?></option>
|
<option value="<?=display_str($FormatName); ?>"<?Format::selected('format', $FormatName)?>><?=display_str($FormatName); ?></option>
|
||||||
<? } ?> </select>
|
<? } ?> </select>
|
||||||
<select name="media" class="ft_media fti_advanced">
|
<select name="media" class="ft_media fti_advanced">
|
||||||
<option value="">Media</option>
|
<option value="">Media</option>
|
||||||
<? foreach ($Media as $MediaName) { ?>
|
<? foreach ($Media as $MediaName) { ?>
|
||||||
<option value="<?=display_str($MediaName); ?>" <?Format::selected('media',$MediaName)?>><?=display_str($MediaName); ?></option>
|
<option value="<?=display_str($MediaName); ?>"<?Format::selected('media',$MediaName)?>><?=display_str($MediaName); ?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
<select name="releasetype" class="ft_releasetype fti_advanced">
|
<select name="releasetype" class="ft_releasetype fti_advanced">
|
||||||
<option value="">Release type</option>
|
<option value="">Release type</option>
|
||||||
<? foreach ($ReleaseTypes as $ID=>$Type) { ?>
|
<? foreach ($ReleaseTypes as $ID=>$Type) { ?>
|
||||||
<option value="<?=display_str($ID); ?>" <?Format::selected('releasetype',$ID)?>><?=display_str($Type); ?></option>
|
<option value="<?=display_str($ID); ?>"<?Format::selected('releasetype',$ID)?>><?=display_str($Type); ?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
@ -674,32 +674,32 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<td class="nobr ft_misc" colspan="3">
|
<td class="nobr ft_misc" colspan="3">
|
||||||
<select name="haslog" class="ft_haslog fti_advanced">
|
<select name="haslog" class="ft_haslog fti_advanced">
|
||||||
<option value="">Has Log</option>
|
<option value="">Has Log</option>
|
||||||
<option value="1" <?Format::selected('haslog','1')?>>Yes</option>
|
<option value="1"<?Format::selected('haslog','1')?>>Yes</option>
|
||||||
<option value="0" <?Format::selected('haslog','0')?>>No</option>
|
<option value="0"<?Format::selected('haslog','0')?>>No</option>
|
||||||
<option value="100" <?Format::selected('haslog','100')?>>100% only</option>
|
<option value="100"<?Format::selected('haslog','100')?>>100% only</option>
|
||||||
<option value="-1" <?Format::selected('haslog','-1')?>><100%/Unscored</option>
|
<option value="-1"<?Format::selected('haslog','-1')?>><100%/Unscored</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="hascue" class="ft_hascue fti_advanced">
|
<select name="hascue" class="ft_hascue fti_advanced">
|
||||||
<option value="">Has Cue</option>
|
<option value="">Has Cue</option>
|
||||||
<option value="1" <?Format::selected('hascue',1)?>>Yes</option>
|
<option value="1"<?Format::selected('hascue',1)?>>Yes</option>
|
||||||
<option value="0" <?Format::selected('hascue',0)?>>No</option>
|
<option value="0"<?Format::selected('hascue',0)?>>No</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="scene" class="ft_scene fti_advanced">
|
<select name="scene" class="ft_scene fti_advanced">
|
||||||
<option value="">Scene</option>
|
<option value="">Scene</option>
|
||||||
<option value="1" <?Format::selected('scene',1)?>>Yes</option>
|
<option value="1"<?Format::selected('scene',1)?>>Yes</option>
|
||||||
<option value="0" <?Format::selected('scene',0)?>>No</option>
|
<option value="0"<?Format::selected('scene',0)?>>No</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="vanityhouse" class="ft_vanityhouse fti_advanced">
|
<select name="vanityhouse" class="ft_vanityhouse fti_advanced">
|
||||||
<option value="">Vanity House</option>
|
<option value="">Vanity House</option>
|
||||||
<option value="1" <?Format::selected('vanityhouse',1)?>>Yes</option>
|
<option value="1"<?Format::selected('vanityhouse',1)?>>Yes</option>
|
||||||
<option value="0" <?Format::selected('vanityhouse',0)?>>No</option>
|
<option value="0"<?Format::selected('vanityhouse',0)?>>No</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="freetorrent" class="ft_freetorrent fti_advanced">
|
<select name="freetorrent" class="ft_freetorrent fti_advanced">
|
||||||
<option value="">Leech Status</option>
|
<option value="">Leech Status</option>
|
||||||
<option value="1" <?Format::selected('freetorrent',1)?>>Freeleech</option>
|
<option value="1"<?Format::selected('freetorrent',1)?>>Freeleech</option>
|
||||||
<option value="2" <?Format::selected('freetorrent',2)?>>Neutral Leech</option>
|
<option value="2"<?Format::selected('freetorrent',2)?>>Neutral Leech</option>
|
||||||
<option value="3" <?Format::selected('freetorrent',3)?>>Either</option>
|
<option value="3"<?Format::selected('freetorrent',3)?>>Either</option>
|
||||||
<option value="0" <?Format::selected('freetorrent',0)?>>Normal</option>
|
<option value="0"<?Format::selected('freetorrent',0)?>>Normal</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -713,13 +713,13 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<td class="label">Tags (comma-separated):</td>
|
<td class="label">Tags (comma-separated):</td>
|
||||||
<td colspan="3" class="ft_taglist">
|
<td colspan="3" class="ft_taglist">
|
||||||
<input type="text" size="40" id="tags" name="taglist" class="inputtext smaller" title="Use !tag to exclude tag" value="<?=str_replace('_','.',Format::form('taglist', true))?>" />
|
<input type="text" size="40" id="tags" name="taglist" class="inputtext smaller" title="Use !tag to exclude tag" value="<?=str_replace('_','.',Format::form('taglist', true))?>" />
|
||||||
<input type="radio" name="tags_type" id="tags_type0" value="0" <?Format::selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>
|
<input type="radio" name="tags_type" id="tags_type0" value="0"<?Format::selected('tags_type',0,'checked')?> /><label for="tags_type0"> Any</label>
|
||||||
<input type="radio" name="tags_type" id="tags_type1" value="1" <?Format::selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
|
<input type="radio" name="tags_type" id="tags_type1" value="1"<?Format::selected('tags_type',1,'checked')?> /><label for="tags_type1"> All</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="order">
|
<tr id="order">
|
||||||
<td class="label">Order by:</td>
|
<td class="label">Order by:</td>
|
||||||
<td colspan="3" colspan="3" class="ft_order">
|
<td colspan="3" class="ft_order">
|
||||||
<select name="order_by" style="width:auto;" class="ft_order_by">
|
<select name="order_by" style="width:auto;" class="ft_order_by">
|
||||||
<option value="time"<?Format::selected('order_by','time')?>>Time added</option>
|
<option value="time"<?Format::selected('order_by','time')?>>Time added</option>
|
||||||
<option value="year"<?Format::selected('order_by','year')?>>Year</option>
|
<option value="year"<?Format::selected('order_by','year')?>>Year</option>
|
||||||
@ -731,7 +731,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
</select>
|
</select>
|
||||||
<select name="order_way" class="ft_order_way">
|
<select name="order_way" class="ft_order_way">
|
||||||
<option value="desc"<?Format::selected('order_way','desc')?>>Descending</option>
|
<option value="desc"<?Format::selected('order_way','desc')?>>Descending</option>
|
||||||
<option value="asc" <?Format::selected('order_way','asc')?>>Ascending</option>
|
<option value="asc"<?Format::selected('order_way','asc')?>>Ascending</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -740,16 +740,16 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<label for="group_results">Group by release:</label>
|
<label for="group_results">Group by release:</label>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="3" class="ft_group_results">
|
<td colspan="3" class="ft_group_results">
|
||||||
<input type="checkbox" value="1" name="group_results" id="group_results" <?Format::selected('group_results',1,'checked')?> />
|
<input type="checkbox" value="1" name="group_results" id="group_results"<?Format::selected('group_results',1,'checked')?> />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table class="layout cat_list ft_cat_list">
|
<table class="layout cat_list ft_cat_list">
|
||||||
<?
|
<?
|
||||||
$x=0;
|
$x = 0;
|
||||||
reset($Categories);
|
reset($Categories);
|
||||||
foreach ($Categories as $CatKey => $CatName) {
|
foreach ($Categories as $CatKey => $CatName) {
|
||||||
if ($x%7==0) {
|
if ($x % 7 == 0) {
|
||||||
if ($x > 0) {
|
if ($x > 0) {
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
@ -760,8 +760,8 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
$x++;
|
$x++;
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="filter_cat[<?=($CatKey+1)?>]" id="cat_<?=($CatKey+1)?>" value="1" <? if (isset($_GET['filter_cat'][$CatKey+1])) { ?>checked="checked" <? } ?>/>
|
<input type="checkbox" name="filter_cat[<?=($CatKey + 1) ?>]" id="cat_<?=($CatKey + 1) ?>" value="1"<? if (isset($_GET['filter_cat'][$CatKey + 1])) { ?> checked="checked" <? } ?>/>
|
||||||
<label for="cat_<?=($CatKey+1)?>"><?=$CatName?></label>
|
<label for="cat_<?=($CatKey + 1) ?>"><?=$CatName?></label>
|
||||||
</td>
|
</td>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
@ -775,7 +775,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
if (!$GenreTags) {
|
if (!$GenreTags) {
|
||||||
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
|
$DB->query('SELECT Name FROM tags WHERE TagType=\'genre\' ORDER BY Name');
|
||||||
$GenreTags = $DB->collect('Name');
|
$GenreTags = $DB->collect('Name');
|
||||||
$Cache->cache_value('genre_tags', $GenreTags, 3600*6);
|
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = 0;
|
$x = 0;
|
||||||
@ -784,41 +784,41 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<td width="12.5%"><a href="#" onclick="add_tag('<?=$Tag?>');return false;"><?=$Tag?></a></td>
|
<td width="12.5%"><a href="#" onclick="add_tag('<?=$Tag?>');return false;"><?=$Tag?></a></td>
|
||||||
<?
|
<?
|
||||||
$x++;
|
$x++;
|
||||||
if ($x%7==0) {
|
if ($x % 7 == 0) {
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($x%7!=0) { // Padding
|
if ($x % 7 != 0) { // Padding
|
||||||
?>
|
?>
|
||||||
<td colspan="<?=7-($x%7)?>"> </td>
|
<td colspan="<?=7 - ($x % 7) ?>"> </td>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table class="layout cat_list" width="100%">
|
<table class="layout cat_list" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label">
|
<td class="label">
|
||||||
<a class="brackets" href="#" onclick="$('#taglist').toggle(); if (this.innerHTML=='View tags'){this.innerHTML='Hide tags';} else {this.innerHTML='View tags';}; return false;"><?=(empty($LoggedUser['ShowTags'])) ? 'View tags' : 'Hide tags'?></a>
|
<a class="brackets" href="#" onclick="$('#taglist').toggle(); if (this.innerHTML=='View tags') {this.innerHTML='Hide tags';} else {this.innerHTML='View tags';}; return false;"><?=(empty($LoggedUser['ShowTags'])) ? 'View tags' : 'Hide tags'?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="submit ft_submit">
|
<div class="submit ft_submit">
|
||||||
<span style="float:left;"><?=number_format($TorrentCount)?> Results</span>
|
<span style="float: left;"><?=number_format($TorrentCount)?> Results</span>
|
||||||
<input type="submit" value="Filter Torrents" />
|
<input type="submit" value="Filter torrents" />
|
||||||
<input type="hidden" name="action" id="ft_type" value="<?=$AdvancedSearch ? 'advanced' : 'basic'?>" />
|
<input type="hidden" name="action" id="ft_type" value="<?=$AdvancedSearch ? 'advanced' : 'basic'?>" />
|
||||||
<input type="hidden" name="searchsubmit" value="1" />
|
<input type="hidden" name="searchsubmit" value="1" />
|
||||||
<input type="button" value="Reset" onclick="location.href='torrents.php<? if (isset($_GET['action']) && $_GET['action']=="advanced") { ?>?action=advanced<? } ?>'" />
|
<input type="button" value="Reset" onclick="location.href='torrents.php<? if (isset($_GET['action']) && $_GET['action'] == 'advanced') { ?>?action=advanced<? } ?>'" />
|
||||||
|
|
||||||
<? if ($Filtered) { ?>
|
<? if ($Filtered) { ?>
|
||||||
<input type="submit" name="setdefault" value="Make Default" />
|
<input type="submit" name="setdefault" value="Make default" />
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($LoggedUser['DefaultSearch'])) {
|
if (!empty($LoggedUser['DefaultSearch'])) {
|
||||||
?>
|
?>
|
||||||
<input type="submit" name="cleardefault" value="Clear Default" />
|
<input type="submit" name="cleardefault" value="Clear default" />
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -847,20 +847,20 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<div class="box pad" align="center">
|
<div class="box pad" align="center">
|
||||||
<h2>Your search did not match anything.</h2>
|
<h2>Your search did not match anything.</h2>
|
||||||
<p>Make sure all names are spelled correctly, or try making your search less specific.</p>
|
<p>Make sure all names are spelled correctly, or try making your search less specific.</p>
|
||||||
<p>You might like (Beta): <? while (list($Tag)=$DB->next_record()) { ?><a href="torrents.php?taglist=<?=$Tag?>"><?=$Tag?></a> <? } ?></p>
|
<p>You might like (beta): <? while (list($Tag) = $DB->next_record()) { ?><a href="torrents.php?taglist=<?=$Tag?>"><?=$Tag?></a><? } ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
View::show_footer();die();
|
View::show_footer();die();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($TorrentCount < ($Page-1)*TORRENTS_PER_PAGE+1) {
|
if ($TorrentCount < ($Page - 1) * TORRENTS_PER_PAGE + 1) {
|
||||||
$LastPage = ceil($TorrentCount/TORRENTS_PER_PAGE);
|
$LastPage = ceil($TorrentCount / TORRENTS_PER_PAGE);
|
||||||
$Pages = Format::get_pages(0, $TorrentCount, TORRENTS_PER_PAGE);
|
$Pages = Format::get_pages(0, $TorrentCount, TORRENTS_PER_PAGE);
|
||||||
?>
|
?>
|
||||||
<div class="box pad" align="center">
|
<div class="box pad" align="center">
|
||||||
<h2>The requested page contains no matches.</h2>
|
<h2>The requested page contains no matches.</h2>
|
||||||
<p>You are requesting page <?=$Page?>, but the search returned only <?=$LastPage?> pages.</p>
|
<p>You are requesting page <?=$Page?>, but the search returned only <?=number_format($LastPage) ?> pages.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="linkbox">Go to page <?=$Pages?></div>
|
<div class="linkbox">Go to page <?=$Pages?></div>
|
||||||
</div>
|
</div>
|
||||||
@ -937,7 +937,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
// These torrents are in a group
|
// These torrents are in a group
|
||||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
||||||
if ($GroupYear > 0) {
|
if ($GroupYear > 0) {
|
||||||
$DisplayName .= " [".$GroupYear."]";
|
$DisplayName .= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
if ($GroupVanityHouse) {
|
if ($GroupVanityHouse) {
|
||||||
$DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]';
|
$DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]';
|
||||||
@ -998,12 +998,19 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Get report info for each torrent, use the cache if available, if not, add to it.
|
||||||
|
$Reported = false;
|
||||||
|
$Reports = get_reports($TorrentID);
|
||||||
|
if (count($Reports) > 0) {
|
||||||
|
$Reported = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($Data['Remastered'] && !$Data['RemasterYear']) {
|
if ($Data['Remastered'] && !$Data['RemasterYear']) {
|
||||||
$FirstUnknown = !isset($FirstUnknown);
|
$FirstUnknown = !isset($FirstUnknown);
|
||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
|
|
||||||
if (isset($GroupedCategories[$CategoryID-1])
|
if (isset($GroupedCategories[$CategoryID - 1])
|
||||||
&& ($Data['RemasterTitle'] != $LastRemasterTitle
|
&& ($Data['RemasterTitle'] != $LastRemasterTitle
|
||||||
|| $Data['RemasterYear'] != $LastRemasterYear
|
|| $Data['RemasterYear'] != $LastRemasterYear
|
||||||
|| $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel
|
|| $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel
|
||||||
@ -1024,7 +1031,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
$LastRemasterCatalogueNumber = $Data['RemasterCatalogueNumber'];
|
$LastRemasterCatalogueNumber = $Data['RemasterCatalogueNumber'];
|
||||||
$LastMedia = $Data['Media'];
|
$LastMedia = $Data['Media'];
|
||||||
?>
|
?>
|
||||||
<tr class="group_torrent groupid_<?=$GroupID?> edition_<?=$EditionID?><?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping']==1 ? ' hidden' : '')?>">
|
<tr class="group_torrent groupid_<?=$GroupID?> edition_<?=$EditionID?><?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1 ? ' hidden' : '')?>">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<span>
|
<span>
|
||||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download"><?=$Data['HasFile'] ? 'DL' : 'Missing'?></a>
|
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download"><?=$Data['HasFile'] ? 'DL' : 'Missing'?></a>
|
||||||
@ -1033,13 +1040,13 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<? } ?>
|
<? } ?>
|
||||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||||
</span>
|
</span>
|
||||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Data)?></a>
|
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Data)?><?if($Reported){?> / <strong class="torrent_label tl_reported" title="Reported">Reported</strong><?}?></a>
|
||||||
</td>
|
</td>
|
||||||
<td><?=$Data['FileCount']?></td>
|
<td><?=$Data['FileCount']?></td>
|
||||||
<td class="nobr"><?=time_diff($Data['Time'], 1)?></td>
|
<td class="nobr"><?=time_diff($Data['Time'], 1)?></td>
|
||||||
<td class="nobr"><?=Format::get_size($Data['Size'])?></td>
|
<td class="nobr"><?=Format::get_size($Data['Size'])?></td>
|
||||||
<td><?=number_format($Data['Snatched'])?></td>
|
<td><?=number_format($Data['Snatched'])?></td>
|
||||||
<td<?=($Data['Seeders']==0)?' class="r00"':''?>><?=number_format($Data['Seeders'])?></td>
|
<td<?=($Data['Seeders'] == 0) ? ' class="r00"' : ''?>><?=number_format($Data['Seeders'])?></td>
|
||||||
<td><?=number_format($Data['Leechers'])?></td>
|
<td><?=number_format($Data['Leechers'])?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
@ -1049,9 +1056,9 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
|
|
||||||
list($TorrentID, $Data) = each($Torrents);
|
list($TorrentID, $Data) = each($Torrents);
|
||||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'&torrentid='.$TorrentID.'#torrent'.$TorrentID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'&torrentid='.$TorrentID.'#torrent'.$TorrentID.'" title="View Torrent" dir="ltr">'.$GroupName.'</a>';
|
||||||
if (isset($GroupedCategories[$CategoryID-1])) {
|
if (isset($GroupedCategories[$CategoryID - 1])) {
|
||||||
if ($GroupYear) {
|
if ($GroupYear) {
|
||||||
$DisplayName .= " [".$GroupYear."]";
|
$DisplayName .= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
if ($CategoryID == 1 && $ReleaseType > 0) {
|
if ($CategoryID == 1 && $ReleaseType > 0) {
|
||||||
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
|
$DisplayName .= ' ['.$ReleaseTypes[$ReleaseType].']';
|
||||||
@ -1094,7 +1101,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<td class="nobr"><?=time_diff($Data['Time'],1)?></td>
|
<td class="nobr"><?=time_diff($Data['Time'],1)?></td>
|
||||||
<td class="nobr"><?=Format::get_size($Data['Size'])?></td>
|
<td class="nobr"><?=Format::get_size($Data['Size'])?></td>
|
||||||
<td><?=number_format($Data['Snatched'])?></td>
|
<td><?=number_format($Data['Snatched'])?></td>
|
||||||
<td<?=($Data['Seeders']==0)?' class="r00"':''?>><?=number_format($Data['Seeders'])?></td>
|
<td<?=($Data['Seeders'] == 0) ? ' class="r00"' : ''?>><?=number_format($Data['Seeders'])?></td>
|
||||||
<td><?=number_format($Data['Leechers'])?></td>
|
<td><?=number_format($Data['Leechers'])?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
|
@ -30,9 +30,9 @@ function compare($X, $Y) {
|
|||||||
$GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
|
$GroupTime, $GroupVanityHouse, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
|
||||||
$TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($TorrentDetails);
|
$TagPositiveVotes, $TagNegativeVotes, $GroupFlags) = array_values($TorrentDetails);
|
||||||
|
|
||||||
$DisplayName=$GroupName;
|
$DisplayName = $GroupName;
|
||||||
$AltName=$GroupName; // Goes in the alt text of the image
|
$AltName = $GroupName; // Goes in the alt text of the image
|
||||||
$Title=$GroupName; // goes in <title>
|
$Title = $GroupName; // goes in <title>
|
||||||
$WikiBody = $Text->full_format($WikiBody);
|
$WikiBody = $Text->full_format($WikiBody);
|
||||||
|
|
||||||
$Artists = Artists::get_artist($GroupID);
|
$Artists = Artists::get_artist($GroupID);
|
||||||
@ -44,11 +44,11 @@ function compare($X, $Y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($GroupYear > 0) {
|
if ($GroupYear > 0) {
|
||||||
$DisplayName.=' ['.$GroupYear.']';
|
$DisplayName.= " [$GroupYear]";
|
||||||
$AltName.=' ['.$GroupYear.']';
|
$AltName.= " [$GroupYear]";
|
||||||
$Title.= ' ['.$GroupYear.']';
|
$Title.= " [$GroupYear]";
|
||||||
}
|
}
|
||||||
if ($GroupVanityHouse){
|
if ($GroupVanityHouse) {
|
||||||
$DisplayName.=' [Vanity House]';
|
$DisplayName.=' [Vanity House]';
|
||||||
$AltName.=' [Vanity House]';
|
$AltName.=' [Vanity House]';
|
||||||
}
|
}
|
||||||
@ -59,17 +59,17 @@ function compare($X, $Y) {
|
|||||||
|
|
||||||
$Tags = array();
|
$Tags = array();
|
||||||
if ($TorrentTags != '') {
|
if ($TorrentTags != '') {
|
||||||
$TorrentTags=explode('|',$TorrentTags);
|
$TorrentTags = explode('|',$TorrentTags);
|
||||||
$TorrentTagIDs=explode('|',$TorrentTagIDs);
|
$TorrentTagIDs = explode('|',$TorrentTagIDs);
|
||||||
$TorrentTagUserIDs=explode('|',$TorrentTagUserIDs);
|
$TorrentTagUserIDs = explode('|',$TorrentTagUserIDs);
|
||||||
$TagPositiveVotes=explode('|',$TagPositiveVotes);
|
$TagPositiveVotes = explode('|',$TagPositiveVotes);
|
||||||
$TagNegativeVotes=explode('|',$TagNegativeVotes);
|
$TagNegativeVotes = explode('|',$TagNegativeVotes);
|
||||||
|
|
||||||
foreach ($TorrentTags as $TagKey => $TagName) {
|
foreach ($TorrentTags as $TagKey => $TagName) {
|
||||||
$Tags[$TagKey]['name'] = $TagName;
|
$Tags[$TagKey]['name'] = $TagName;
|
||||||
$Tags[$TagKey]['score'] = ($TagPositiveVotes[$TagKey] - $TagNegativeVotes[$TagKey]);
|
$Tags[$TagKey]['score'] = ($TagPositiveVotes[$TagKey] - $TagNegativeVotes[$TagKey]);
|
||||||
$Tags[$TagKey]['id']=$TorrentTagIDs[$TagKey];
|
$Tags[$TagKey]['id'] = $TorrentTagIDs[$TagKey];
|
||||||
$Tags[$TagKey]['userid']=$TorrentTagUserIDs[$TagKey];
|
$Tags[$TagKey]['userid'] = $TorrentTagUserIDs[$TagKey];
|
||||||
}
|
}
|
||||||
uasort($Tags, 'compare');
|
uasort($Tags, 'compare');
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ function compare($X, $Y) {
|
|||||||
<? } ?>
|
<? } ?>
|
||||||
<a href="torrents.php?action=history&groupid=<?=$GroupID?>" class="brackets">View history</a>
|
<a href="torrents.php?action=history&groupid=<?=$GroupID?>" class="brackets">View history</a>
|
||||||
<? if ($RevisionID && check_perms('site_edit_wiki')) { ?>
|
<? if ($RevisionID && check_perms('site_edit_wiki')) { ?>
|
||||||
<a href="/torrents.php?action=revert&groupid=<?=$GroupID ?>&revisionid=<?=$RevisionID ?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
|
<a href="torrents.php?action=revert&groupid=<?=$GroupID ?>&revisionid=<?=$RevisionID ?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
|
||||||
<? }
|
<? }
|
||||||
if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
|
if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
|
||||||
?>
|
?>
|
||||||
@ -118,7 +118,7 @@ function compare($X, $Y) {
|
|||||||
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
|
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
|
||||||
<div class="head"><strong>Cover</strong></div>
|
<div class="head"><strong>Cover</strong></div>
|
||||||
<?
|
<?
|
||||||
if ($WikiImage != "") {
|
if ($WikiImage != '') {
|
||||||
$WikiImageThumb = ImageTools::wiki_image($WikiImage);
|
$WikiImageThumb = ImageTools::wiki_image($WikiImage);
|
||||||
if (check_perms('site_proxy_images')) {
|
if (check_perms('site_proxy_images')) {
|
||||||
$WikiImage = ImageTools::proxy_url($WikiImage);
|
$WikiImage = ImageTools::proxy_url($WikiImage);
|
||||||
@ -128,18 +128,18 @@ function compare($X, $Y) {
|
|||||||
<?
|
<?
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$GroupCategoryID-1]?>" alt="<?=$Categories[$GroupCategoryID-1]?>" title="<?=$Categories[$GroupCategoryID-1]?>" width="220" height="220" border="0" /></p>
|
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$GroupCategoryID - 1]?>" alt="<?=$Categories[$GroupCategoryID - 1]?>" title="<?=$Categories[$GroupCategoryID - 1]?>" width="220" height="220" border="0" /></p>
|
||||||
<?
|
<?
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
if ($Categories[$GroupCategoryID-1] == 'Music') {
|
if ($Categories[$GroupCategoryID - 1] == 'Music') {
|
||||||
$ShownWith = false;
|
$ShownWith = false;
|
||||||
?>
|
?>
|
||||||
<div class="box box_artists">
|
<div class="box box_artists">
|
||||||
<div class="head"><strong>Artists</strong>
|
<div class="head"><strong>Artists</strong>
|
||||||
<?=(check_perms('torrents_edit')) ? '<span style="float:right;" class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets">Edit</a></span>' : ''?>
|
<?=(check_perms('torrents_edit')) ? '<span style="float: right;" class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets">Edit</a></span>' : ''?>
|
||||||
</div>
|
</div>
|
||||||
<ul class="stats nobullet" id="artist_list">
|
<ul class="stats nobullet" id="artist_list">
|
||||||
<? if (!empty($Artists[4]) && count($Artists[4]) > 0) {
|
<? if (!empty($Artists[4]) && count($Artists[4]) > 0) {
|
||||||
|
@ -176,3 +176,302 @@ function get_group_requests($GroupID) {
|
|||||||
$Requests = Requests::get_requests($Requests);
|
$Requests = Requests::get_requests($Requests);
|
||||||
return $Requests['matches'];
|
return $Requests['matches'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Used to get reports info on a unison cache in both browsing pages and torrent pages.
|
||||||
|
function get_reports($TorrentID){
|
||||||
|
global $Cache, $DB;
|
||||||
|
$Reports = $Cache->get_value('reports_torrent_' . $TorrentID);
|
||||||
|
if ($Reports === false) {
|
||||||
|
$DB->query("SELECT r.ID,
|
||||||
|
r.ReporterID,
|
||||||
|
r.Type,
|
||||||
|
r.UserComment,
|
||||||
|
r.ReportedTime
|
||||||
|
FROM reportsv2 AS r
|
||||||
|
WHERE TorrentID = $TorrentID
|
||||||
|
AND Type != 'edited'
|
||||||
|
AND Status != 'Resolved'");
|
||||||
|
$Reports = $DB->to_array();
|
||||||
|
$Cache->cache_value('reports_torrent_' . $TorrentID, $Reports, 0);
|
||||||
|
}
|
||||||
|
return $Reports;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Used by both sections/torrents/details.php and sections/reportsv2/report.php
|
||||||
|
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Text, $Username, $ReportedTimes) {
|
||||||
|
|
||||||
|
function filelist($Str) {
|
||||||
|
return "</td><td>" . Format::get_size($Str[1]) . "</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$LastRemasterYear = '-';
|
||||||
|
$LastRemasterTitle = '';
|
||||||
|
$LastRemasterRecordLabel = '';
|
||||||
|
$LastRemasterCatalogueNumber = '';
|
||||||
|
|
||||||
|
$EditionID = 0;
|
||||||
|
foreach ($TorrentList as $Torrent) {
|
||||||
|
//t.ID, t.Media, t.Format, t.Encoding, t.Remastered, t.RemasterYear,
|
||||||
|
//t.RemasterTitle, t.RemasterRecordLabel, t.RemasterCatalogueNumber, t.Scene,
|
||||||
|
//t.HasLog, t.HasCue, t.LogScore, t.FileCount, t.Size, t.Seeders, t.Leechers,
|
||||||
|
//t.Snatched, t.FreeTorrent, t.Time, t.Description, t.FileList,
|
||||||
|
//t.FilePath, t.UserID, t.last_action, HEX(t.info_hash), (bad tags), (bad folders), (bad filenames),
|
||||||
|
//(cassette approved), (lossy master approved), (lossy web approved), t.LastReseedRequest,
|
||||||
|
//LogInDB, (has file), Torrents::torrent_properties()
|
||||||
|
list($TorrentID, $Media, $Format, $Encoding, $Remastered, $RemasterYear,
|
||||||
|
$RemasterTitle, $RemasterRecordLabel, $RemasterCatalogueNumber, $Scene,
|
||||||
|
$HasLog, $HasCue, $LogScore, $FileCount, $Size, $Seeders, $Leechers,
|
||||||
|
$Snatched, $FreeTorrent, $TorrentTime, $Description, $FileList,
|
||||||
|
$FilePath, $UserID, $LastActive, $InfoHash, $BadTags, $BadFolders, $BadFiles,
|
||||||
|
$CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest,
|
||||||
|
$LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent);
|
||||||
|
|
||||||
|
if ($Remastered && !$RemasterYear) {
|
||||||
|
$FirstUnknown = !isset($FirstUnknown);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Reported = false;
|
||||||
|
unset($ReportedTimes);
|
||||||
|
$Reports = $Cache->get_value('reports_torrent_' . $TorrentID);
|
||||||
|
if ($Reports === false) {
|
||||||
|
$DB->query("SELECT r.ID,
|
||||||
|
r.ReporterID,
|
||||||
|
r.Type,
|
||||||
|
r.UserComment,
|
||||||
|
r.ReportedTime
|
||||||
|
FROM reportsv2 AS r
|
||||||
|
WHERE TorrentID = $TorrentID
|
||||||
|
AND Type != 'edited'
|
||||||
|
AND Status != 'Resolved'");
|
||||||
|
$Reports = $DB->to_array();
|
||||||
|
$Cache->cache_value('reports_torrent_' . $TorrentID, $Reports, 0);
|
||||||
|
}
|
||||||
|
if (count($Reports) > 0) {
|
||||||
|
$Reported = true;
|
||||||
|
include(SERVER_ROOT . '/sections/reportsv2/array.php');
|
||||||
|
$ReportInfo = '<table><tr class="colhead_dark" style="font-weight: bold;"><td>This torrent has ' . count($Reports) . ' active ' . (count($Reports) > 1 ? "reports" : "report") . ':</td></tr>';
|
||||||
|
|
||||||
|
foreach ($Reports as $Report) {
|
||||||
|
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;
|
||||||
|
|
||||||
|
$Reporter = Users::user_info($ReporterID);
|
||||||
|
$ReporterName = $Reporter['Username'];
|
||||||
|
|
||||||
|
if (array_key_exists($ReportType, $Types[$GroupCategoryID])) {
|
||||||
|
$ReportType = $Types[$GroupCategoryID][$ReportType];
|
||||||
|
} else if (array_key_exists($ReportType, $Types['master'])) {
|
||||||
|
$ReportType = $Types['master'][$ReportType];
|
||||||
|
} else {
|
||||||
|
//There was a type but it wasn't an option!
|
||||||
|
$ReportType = $Types['master']['other'];
|
||||||
|
}
|
||||||
|
$ReportInfo .= "<tr><td>" . (check_perms('admin_reports') ? "<a href='user.php?id=$ReporterID'>$ReporterName</a> <a href='reportsv2.php?view=report&id=$ReportID'>reported it</a> " : "Someone reported it ") . time_diff($ReportedTime, 2, true, true) . " for the reason '" . $ReportType['title'] . "':";
|
||||||
|
$ReportInfo .= "<blockquote>" . $Text->full_format($ReportReason) . "</blockquote></td></tr>";
|
||||||
|
}
|
||||||
|
$ReportInfo .= "</table>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear)));
|
||||||
|
|
||||||
|
$RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&torrentid=' . $TorrentID . '" class="brackets">Regenerate</a>' : '';
|
||||||
|
$FileTable = '
|
||||||
|
<table class="filelist_table">
|
||||||
|
<tr class="colhead_dark"><td>
|
||||||
|
<div class="filelist_title" style="float: left;">File Name' . $RegenLink . '</div>
|
||||||
|
<div class="filelist_path" style="float: right;">' . ($FilePath ? "/$FilePath/" : '') . '</div>
|
||||||
|
</td><td>
|
||||||
|
<strong>Size</strong>
|
||||||
|
</td></tr>';
|
||||||
|
if (substr($FileList, -3) == '}}}') { // Old style
|
||||||
|
$FileListSplit = explode('|||', $FileList);
|
||||||
|
foreach ($FileListSplit as $File) {
|
||||||
|
$NameEnd = strrpos($File, '{{{');
|
||||||
|
$Name = substr($File, 0, $NameEnd);
|
||||||
|
if ($Spaces = strspn($Name, ' ')) {
|
||||||
|
$Name = str_replace(' ', ' ', substr($Name, 0, $Spaces)) . substr($Name, $Spaces);
|
||||||
|
}
|
||||||
|
$FileSize = substr($File, $NameEnd + 3, -3);
|
||||||
|
$FileTable .= sprintf("\n<tr><td>%s</td><td>%s</td></tr>", $Name, Format::get_size($FileSize));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$FileListSplit = explode("\n", $FileList);
|
||||||
|
foreach ($FileListSplit as $File) {
|
||||||
|
$FileInfo = Torrents::filelist_get_file($File);
|
||||||
|
$FileTable .= sprintf("\n<tr><td>%s</td><td>%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$FileTable .= '
|
||||||
|
</table>';
|
||||||
|
|
||||||
|
$ExtraInfo = ''; // String that contains information on the torrent (e.g. format and encoding)
|
||||||
|
$AddExtra = ''; // Separator between torrent properties
|
||||||
|
|
||||||
|
$TorrentUploader = $Username; // Save this for "Uploaded by:" below
|
||||||
|
// similar to Torrents::torrent_info()
|
||||||
|
if ($Format) {
|
||||||
|
$ExtraInfo.=display_str($Format);
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Encoding) {
|
||||||
|
$ExtraInfo.=$AddExtra . display_str($Encoding);
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($HasLog) {
|
||||||
|
$ExtraInfo.=$AddExtra . 'Log';
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($HasLog && $LogInDB) {
|
||||||
|
$ExtraInfo.=' (' . (int) $LogScore . '%)';
|
||||||
|
}
|
||||||
|
if ($HasCue) {
|
||||||
|
$ExtraInfo.=$AddExtra . 'Cue';
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Scene) {
|
||||||
|
$ExtraInfo.=$AddExtra . 'Scene';
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!$ExtraInfo) {
|
||||||
|
$ExtraInfo = $GroupName;
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($IsSnatched) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Snatched!');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($FreeTorrent == '1') {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Freeleech!');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($FreeTorrent == '2') {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Neutral Leech!');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($PersonalFL) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Personal Freeleech!');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if ($Reported) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Reported');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($BadTags)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Bad Tags');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($BadFolders)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Bad Folders');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($CassetteApproved)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Cassette Approved');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($LossymasterApproved)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Lossy Master Approved');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($LossywebApproved)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Lossy WEB Approved');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
if (!empty($BadFiles)) {
|
||||||
|
$ExtraInfo.=$AddExtra . Format::torrent_label('Bad File Names');
|
||||||
|
$AddExtra = ' / ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($GroupCategoryID == 1
|
||||||
|
&& ($RemasterTitle != $LastRemasterTitle
|
||||||
|
|| $RemasterYear != $LastRemasterYear
|
||||||
|
|| $RemasterRecordLabel != $LastRemasterRecordLabel
|
||||||
|
|| $RemasterCatalogueNumber != $LastRemasterCatalogueNumber
|
||||||
|
|| $FirstUnknown
|
||||||
|
|| $Media != $LastMedia)) {
|
||||||
|
|
||||||
|
$EditionID++;
|
||||||
|
?>
|
||||||
|
<tr class="releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition group_torrent">
|
||||||
|
<td colspan="5" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?= $GroupID ?>, <?= $EditionID ?>, this, event)" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?= Torrents::edition_string($Torrent, $TorrentDetails) ?></strong></td>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
$LastRemasterTitle = $RemasterTitle;
|
||||||
|
$LastRemasterYear = $RemasterYear;
|
||||||
|
$LastRemasterRecordLabel = $RemasterRecordLabel;
|
||||||
|
$LastRemasterCatalogueNumber = $RemasterCatalogueNumber;
|
||||||
|
$LastMedia = $Media;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<tr class="torrent_row releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition_<?= $EditionID ?> group_torrent<?= $IsSnatched ? ' snatched_torrent' : '' ?>" style="font-weight: normal;" id="torrent<?= $TorrentID ?>">
|
||||||
|
<td>
|
||||||
|
<span>[ <a href="torrents.php?action=download&id=<?= $TorrentID ?>&authkey=<?= $LoggedUser['AuthKey'] ?>&torrent_pass=<?= $LoggedUser['torrent_pass'] ?>" title="Download"><?= $HasFile ? 'DL' : 'Missing' ?></a>
|
||||||
|
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||||
|
| <a href="torrents.php?action=download&id=<?= $TorrentID ?>&authkey=<?= $LoggedUser['AuthKey'] ?>&torrent_pass=<?= $LoggedUser['torrent_pass'] ?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||||
|
<? } ?>
|
||||||
|
| <a href="reportsv2.php?action=report&id=<?= $TorrentID ?>" title="Report">RP</a>
|
||||||
|
<? if ($CanEdit) { ?>
|
||||||
|
| <a href="torrents.php?action=edit&id=<?= $TorrentID ?>" title="Edit">ED</a>
|
||||||
|
<? } ?>
|
||||||
|
<? if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
|
||||||
|
| <a href="torrents.php?action=delete&torrentid=<?= $TorrentID ?>" title="Remove">RM</a>
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
| <a href="torrents.php?torrentid=<?= $TorrentID ?>" title="Permalink">PL</a>
|
||||||
|
]</span>
|
||||||
|
» <a href="#" onclick="$('#torrent_<?= $TorrentID ?>').toggle(); return false;"><?= $ExtraInfo; ?></a>
|
||||||
|
</td>
|
||||||
|
<td class="nobr"><?= Format::get_size($Size) ?></td>
|
||||||
|
<td><?= number_format($Snatched) ?></td>
|
||||||
|
<td><?= number_format($Seeders) ?></td>
|
||||||
|
<td><?= number_format($Leechers) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="releases_<?= $ReleaseType ?> groupid_<?= $GroupID ?> edition_<?= $EditionID ?> torrentdetails pad <? if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<? } ?>" id="torrent_<?= $TorrentID; ?>">
|
||||||
|
<td colspan="5">
|
||||||
|
<blockquote>
|
||||||
|
Uploaded by <?= Users::format_username($UserID, false, false, false) ?> <?= time_diff($TorrentTime); ?>
|
||||||
|
<? if ($Seeders == 0) { ?>
|
||||||
|
<? if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) { ?>
|
||||||
|
<br /><strong>Last active: <?= time_diff($LastActive); ?></strong>
|
||||||
|
<? } else { ?>
|
||||||
|
<br />Last active: <?= time_diff($LastActive); ?>
|
||||||
|
<? } ?>
|
||||||
|
<? if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) { ?>
|
||||||
|
<br /><a href="torrents.php?action=reseed&torrentid=<?= $TorrentID ?>&groupid=<?= $GroupID ?>" class="brackets">Request re-seed</a>
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
</blockquote>
|
||||||
|
<? if (check_perms('site_moderate_requests')) { ?>
|
||||||
|
<div class="linkbox">
|
||||||
|
<a href="torrents.php?action=masspm&id=<?= $GroupID ?>&torrentid=<?= $TorrentID ?>" class="brackets">Mass PM snatchers</a>
|
||||||
|
</div>
|
||||||
|
<? } ?>
|
||||||
|
<div class="linkbox">
|
||||||
|
<a href="#" class="brackets" onclick="show_peers('<?= $TorrentID ?>', 0);return false;">View peer list</a>
|
||||||
|
<? if (check_perms('site_view_torrent_snatchlist')) { ?>
|
||||||
|
<a href="#" class="brackets" onclick="show_downloads('<?= $TorrentID ?>', 0);return false;" title="View the list of users that have clicked the "DL" button.">View download list</a>
|
||||||
|
<a href="#" class="brackets" onclick="show_snatches('<?= $TorrentID ?>', 0);return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
|
||||||
|
<? } ?>
|
||||||
|
<a href="#" class="brackets" onclick="show_files('<?= $TorrentID ?>');return false;">View file list</a>
|
||||||
|
<? if ($Reported) { ?>
|
||||||
|
<a href="#" class="brackets" onclick="show_reported('<?= $TorrentID ?>');return false;">View report information</a>
|
||||||
|
<? } ?>
|
||||||
|
</div>
|
||||||
|
<div id="peers_<?= $TorrentID ?>" class="hidden"></div>
|
||||||
|
<div id="downloads_<?= $TorrentID ?>" class="hidden"></div>
|
||||||
|
<div id="snatches_<?= $TorrentID ?>" class="hidden"></div>
|
||||||
|
<div id="files_<?= $TorrentID ?>" class="hidden"><?= $FileTable ?></div>
|
||||||
|
<? if ($Reported) { ?>
|
||||||
|
<div id="reported_<?= $TorrentID ?>" class="hidden"><?= $ReportInfo ?></div>
|
||||||
|
<? } ?>
|
||||||
|
<?
|
||||||
|
if (!empty($Description)) {
|
||||||
|
echo '<blockquote>' . $Text->full_format($Description) . '</blockquote>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -17,21 +17,21 @@
|
|||||||
if ($UserInfo['Class'] > $LoggedUser['Class']) {
|
if ($UserInfo['Class'] > $LoggedUser['Class']) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
$URL = "https://" . SSL_SITE_URL . "/torrents.php?id=$GroupID&postid=$PostID#post$PostID";
|
$URL = 'https://' . SSL_SITE_URL . "/torrents.php?id=$GroupID&postid=$PostID#post$PostID";
|
||||||
if ($Length != 'verbal') {
|
if ($Length != 'verbal') {
|
||||||
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
$Time = ((int) $Length) * (7 * 24 * 60 * 60);
|
||||||
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
Tools::warn_user($UserID, $Time, "$URL - " . $Reason);
|
||||||
$Subject = "You have received a warning";
|
$Subject = 'You have received a warning';
|
||||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||||
$WarnTime = time_plus($Time);
|
$WarnTime = time_plus($Time);
|
||||||
$AdminComment = date("Y-m-d") . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
$AdminComment = date('Y-m-d') . ' - Warned until ' . $WarnTime . ' by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||||
} else {
|
} else {
|
||||||
$Subject = "You have received a verbal warning";
|
$Subject = 'You have received a verbal warning';
|
||||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||||
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||||
}
|
}
|
||||||
$DB->query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment)
|
$DB->query("INSERT INTO users_warnings_forums (UserID, Comment)
|
||||||
. "')
|
VALUES('$UserID', '" . db_string($AdminComment) . "')
|
||||||
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
|
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
|
||||||
Tools::update_user_notes($UserID, $AdminComment);
|
Tools::update_user_notes($UserID, $AdminComment);
|
||||||
Misc::send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
|
Misc::send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
|
||||||
@ -46,12 +46,14 @@
|
|||||||
WHERE tc.ID='$PostID'");
|
WHERE tc.ID='$PostID'");
|
||||||
list($OldBody, $AuthorID, $GroupID, $AddedTime) = $DB->next_record();
|
list($OldBody, $AuthorID, $GroupID, $AddedTime) = $DB->next_record();
|
||||||
|
|
||||||
$DB->query("SELECT ceil(COUNT(ID) / " . TORRENT_COMMENTS_PER_PAGE . ") AS Page FROM torrents_comments WHERE GroupID = $GroupID AND ID <= $PostID");
|
$DB->query("SELECT ceil(COUNT(ID) / " . TORRENT_COMMENTS_PER_PAGE . ") AS Page
|
||||||
|
FROM torrents_comments
|
||||||
|
WHERE GroupID = $GroupID AND ID <= $PostID");
|
||||||
list($Page) = $DB->next_record();
|
list($Page) = $DB->next_record();
|
||||||
|
|
||||||
// Perform the update
|
// Perform the update
|
||||||
$DB->query("UPDATE torrents_comments SET
|
$DB->query("UPDATE torrents_comments
|
||||||
Body = '" . db_string($Body) . "',
|
SET Body = '" . db_string($Body) . "',
|
||||||
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
||||||
EditedTime = '" . sqltime() . "'
|
EditedTime = '" . sqltime() . "'
|
||||||
WHERE ID='$PostID'");
|
WHERE ID='$PostID'");
|
||||||
@ -65,8 +67,7 @@
|
|||||||
$Cache->commit_transaction(0);
|
$Cache->commit_transaction(0);
|
||||||
|
|
||||||
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||||
VALUES ('torrents', " . db_string($_POST['postid']) . ", " . db_string($LoggedUser['ID']) . ", '" . sqltime() . "', '" . db_string($OldBody)
|
VALUES ('torrents', " . db_string($_POST['postid']) . ", " . db_string($LoggedUser['ID']) . ", '" . sqltime() . "', '" . db_string($OldBody) . "')");
|
||||||
. "')");
|
|
||||||
|
|
||||||
header("Location: torrents.php?id=$GroupID&postid=$PostID#post$PostID");
|
header("Location: torrents.php?id=$GroupID&postid=$PostID#post$PostID");
|
||||||
?>
|
?>
|
||||||
|
@ -4,19 +4,19 @@
|
|||||||
$Rankings = Votes::get_ranking($GroupID, $GroupYear);
|
$Rankings = Votes::get_ranking($GroupID, $GroupYear);
|
||||||
$LIs = '';
|
$LIs = '';
|
||||||
// Display information for the return categories of get_ranking()
|
// Display information for the return categories of get_ranking()
|
||||||
$GroupDecade = $GroupYear-($GroupYear%10);
|
$GroupDecade = $GroupYear - ($GroupYear % 10);
|
||||||
$names = array('overall'=>'<a href="top10.php?type=votes">overall</a>',
|
$names = array('overall'=>'<a href="top10.php?type=votes">overall</a>',
|
||||||
'decade'=>check_perms('site_advanced_top10') ? 'for the <a href="top10.php?advanced=1&type=votes&year1='.$GroupDecade.'&year2='.($GroupDecade+9).'">'.$GroupDecade.'s</a>' : 'for the '.$GroupDecade.'s',
|
'decade'=>check_perms('site_advanced_top10') ? 'for the <a href="top10.php?advanced=1&type=votes&year1='.$GroupDecade.'&year2='.($GroupDecade+9).'">'.$GroupDecade.'s</a>' : 'for the '.$GroupDecade.'s',
|
||||||
'year'=>check_perms('site_advanced_top10') ? 'for <a href="top10.php?advanced=1&type=votes&year1='.$GroupYear.'&year2=">'.$GroupYear.'</a>' : "for $GroupYear");
|
'year'=>check_perms('site_advanced_top10') ? 'for <a href="top10.php?advanced=1&type=votes&year1='.$GroupYear.'&year2=">'.$GroupYear.'</a>' : "for $GroupYear");
|
||||||
|
|
||||||
foreach ($names as $key => $text) {
|
foreach ($names as $key => $text) {
|
||||||
if ($Rank = $Rankings[$key]) {
|
if ($Rank = $Rankings[$key]) {
|
||||||
if ($Rank <= 10) {
|
if ($Rank <= 10) {
|
||||||
$Class = "vr_top_10";
|
$Class = 'vr_top_10';
|
||||||
} elseif ($Rank <= 25) {
|
} elseif ($Rank <= 25) {
|
||||||
$Class = "vr_top_25";
|
$Class = 'vr_top_25';
|
||||||
} elseif ($Rank <= 50) {
|
} elseif ($Rank <= 50) {
|
||||||
$Class = "vr_top_50";
|
$Class = 'vr_top_50';
|
||||||
}
|
}
|
||||||
|
|
||||||
$LIs .= '<li id="vote_rank_'.$key.'" class="'.$Class.'">No. '.$Rank.' '.$text.'</li>';
|
$LIs .= '<li id="vote_rank_'.$key.'" class="'.$Class.'">No. '.$Rank.' '.$text.'</li>';
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
// These stats used to be all together in one UNION'd query
|
// These stats used to be all together in one UNION'd query
|
||||||
// But we broke them up because they had a habit of locking each other to death.
|
// But we broke them up because they had a habit of locking each other to death.
|
||||||
// They all run really quickly anyways.
|
// They all run really quickly anyways.
|
||||||
$DB->query("SELECT COUNT(x.uid), COUNT(DISTINCT x.fid) FROM xbt_snatched AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID'");
|
$DB->query("SELECT COUNT(x.uid), COUNT(DISTINCT x.fid)
|
||||||
|
FROM xbt_snatched AS x
|
||||||
|
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||||
|
WHERE x.uid='$UserID'");
|
||||||
list($Snatched, $UniqueSnatched) = $DB->next_record();
|
list($Snatched, $UniqueSnatched) = $DB->next_record();
|
||||||
|
|
||||||
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE AuthorID='$UserID'");
|
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE AuthorID='$UserID'");
|
||||||
@ -17,51 +20,65 @@
|
|||||||
$DB->query("SELECT COUNT(ID) FROM collages WHERE Deleted='0' AND UserID='$UserID'");
|
$DB->query("SELECT COUNT(ID) FROM collages WHERE Deleted='0' AND UserID='$UserID'");
|
||||||
list($NumCollages) = $DB->next_record();
|
list($NumCollages) = $DB->next_record();
|
||||||
|
|
||||||
$DB->query("SELECT COUNT(DISTINCT CollageID) FROM collages_torrents AS ct JOIN collages ON CollageID = ID WHERE Deleted='0' AND ct.UserID='$UserID'");
|
$DB->query("SELECT COUNT(DISTINCT CollageID)
|
||||||
|
FROM collages_torrents AS ct
|
||||||
|
JOIN collages ON CollageID = ID
|
||||||
|
WHERE Deleted='0' AND ct.UserID='$UserID'");
|
||||||
list($NumCollageContribs) = $DB->next_record();
|
list($NumCollageContribs) = $DB->next_record();
|
||||||
|
|
||||||
$DB->query("SELECT COUNT(DISTINCT GroupID) FROM torrents WHERE UserID = '$UserID'");
|
$DB->query("SELECT COUNT(DISTINCT GroupID) FROM torrents WHERE UserID = '$UserID'");
|
||||||
list($UniqueGroups) = $DB->next_record();
|
list($UniqueGroups) = $DB->next_record();
|
||||||
|
|
||||||
$DB->query("SELECT COUNT(ID) FROM torrents WHERE ((LogScore = 100 AND Format = 'FLAC') OR (Media = 'Vinyl' AND Format = 'FLAC') OR (Media = 'WEB' AND Format = 'FLAC') OR (Media = 'DVD' AND Format = 'FLAC') OR (Media = 'Soundboard' AND Format = 'FLAC') OR (Media = 'Cassette' AND Format = 'FLAC') OR (Media = 'SACD' AND Format = 'FLAC') OR (Media = 'Blu-ray' AND Format = 'FLAC') OR (Media = 'DAT' AND Format = 'FLAC')) AND UserID = '$UserID'");
|
$DB->query("SELECT COUNT(ID)
|
||||||
|
FROM torrents
|
||||||
|
WHERE ((LogScore = 100 AND Format = 'FLAC')
|
||||||
|
OR (Media = 'Vinyl' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'WEB' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'DVD' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'Soundboard' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'Cassette' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'SACD' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'Blu-ray' AND Format = 'FLAC')
|
||||||
|
OR (Media = 'DAT' AND Format = 'FLAC'))
|
||||||
|
AND UserID = '$UserID'");
|
||||||
list($PerfectFLACs) = $DB->next_record();
|
list($PerfectFLACs) = $DB->next_record();
|
||||||
?>
|
?>
|
||||||
<div class="box box_info box_userinfo_community">
|
<div class="box box_info box_userinfo_community">
|
||||||
<div class="head colhead_dark">Community</div>
|
<div class="head colhead_dark">Community</div>
|
||||||
<ul class="stats nobullet">
|
<ul class="stats nobullet">
|
||||||
<li>Forum posts: <?=number_format($ForumPosts)?> <a href="userhistory.php?action=posts&userid=<?=$UserID?>" class="brackets" title="View">View</a></li>
|
<li>Forum posts: <?=number_format($ForumPosts)?> <a href="userhistory.php?action=posts&userid=<?=$UserID?>" class="brackets" title="View">View</a></li>
|
||||||
<? if (($Override=check_paranoia_here('torrentcomments+'))) { ?>
|
<? if (($Override = check_paranoia_here('torrentcomments+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Torrent comments: <?=number_format($NumComments)?>
|
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Torrent comments: <?=number_format($NumComments)?>
|
||||||
<? if ($Override=check_paranoia_here('torrentcomments')) { ?>
|
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
|
||||||
<a href="comments.php?id=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="comments.php?id=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Artist comments: <?=number_format($NumArtistComments)?>
|
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Artist comments: <?=number_format($NumArtistComments)?>
|
||||||
<? if ($Override=check_paranoia_here('torrentcomments')) { ?>
|
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
|
||||||
<a href="comments.php?id=<?=$UserID?>&action=artists" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="comments.php?id=<?=$UserID?>&action=artists" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Request comments: <?=number_format($NumRequestComments)?>
|
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Request comments: <?=number_format($NumRequestComments)?>
|
||||||
<? if ($Override=check_paranoia_here('torrentcomments')) { ?>
|
<? if ($Override = check_paranoia_here('torrentcomments')) { ?>
|
||||||
<a href="comments.php?id=<?=$UserID?>&action=requests" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="comments.php?id=<?=$UserID?>&action=requests" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('collages+'))) { ?>
|
if (($Override = check_paranoia_here('collages+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Collages started: <?=number_format($NumCollages)?>
|
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Collages started: <?=number_format($NumCollages)?>
|
||||||
<? if (($Override=check_paranoia_here('collages'))) { ?>
|
<? if (($Override = check_paranoia_here('collages'))) { ?>
|
||||||
<a href="collages.php?userid=<?=$UserID?>" class="brackets<?= ($Override===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="collages.php?userid=<?=$UserID?>" class="brackets<?= ($Override===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('collagecontribs+'))) { ?>
|
if (($Override = check_paranoia_here('collagecontribs+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
|
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Collages contributed to: <? echo number_format($NumCollageContribs); ?>
|
||||||
<? if (($Override=check_paranoia_here('collagecontribs'))) { ?>
|
<? if (($Override = check_paranoia_here('collagecontribs'))) { ?>
|
||||||
<a href="collages.php?userid=<?=$UserID?>&contrib=1" class="brackets<?= ($Override===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="collages.php?userid=<?=$UserID?>&contrib=1" class="brackets<?= ($Override===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<?
|
|
||||||
//Let's see if we can view requests because of reasons
|
//Let's see if we can view requests because of reasons
|
||||||
$ViewAll = check_paranoia_here('requestsfilled_list');
|
$ViewAll = check_paranoia_here('requestsfilled_list');
|
||||||
$ViewCount = check_paranoia_here('requestsfilled_count');
|
$ViewCount = check_paranoia_here('requestsfilled_count');
|
||||||
@ -75,12 +92,12 @@
|
|||||||
<li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?></li>
|
<li>Requests filled: <?=number_format($RequestsFilled)?> for <?=Format::get_size($TotalBounty)?></li>
|
||||||
<? } elseif ($ViewAll) { ?>
|
<? } elseif ($ViewAll) { ?>
|
||||||
<li>
|
<li>
|
||||||
<span<?= ($ViewCount===2) ? ' class="paranoia_override"' : ''?>>Requests filled: <?=number_format($RequestsFilled)?></span>
|
<span<?= ($ViewCount === 2) ? ' class="paranoia_override"' : ''?>>Requests filled: <?=number_format($RequestsFilled)?></span>
|
||||||
<span<?= ($ViewBounty===2) ? ' class="paranoia_override"' : ''?>> for <?=Format::get_size($TotalBounty) ?></span>
|
<span<?= ($ViewBounty === 2) ? ' class="paranoia_override"' : ''?>> for <?=Format::get_size($TotalBounty) ?></span>
|
||||||
<a href="requests.php?type=filled&userid=<?=$UserID?>" class="brackets<?= ($ViewAll===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="requests.php?type=filled&userid=<?=$UserID?>" class="brackets<?= ($ViewAll === 2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<?
|
|
||||||
//Let's see if we can view requests because of reasons
|
//Let's see if we can view requests because of reasons
|
||||||
$ViewAll = check_paranoia_here('requestsvoted_list');
|
$ViewAll = check_paranoia_here('requestsvoted_list');
|
||||||
$ViewCount = check_paranoia_here('requestsvoted_count');
|
$ViewCount = check_paranoia_here('requestsvoted_count');
|
||||||
@ -94,86 +111,93 @@
|
|||||||
<li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?></li>
|
<li>Requests voted: <?=number_format($RequestsVoted)?> for <?=Format::get_size($TotalSpent)?></li>
|
||||||
<? } elseif ($ViewAll) { ?>
|
<? } elseif ($ViewAll) { ?>
|
||||||
<li>
|
<li>
|
||||||
<span<?= ($ViewCount===2) ? ' class="paranoia_override"' : ''?>>Requests voted: <?=number_format($RequestsVoted)?></span>
|
<span<?= ($ViewCount === 2) ? ' class="paranoia_override"' : ''?>>Requests voted: <?=number_format($RequestsVoted)?></span>
|
||||||
<span<?= ($ViewBounty===2) ? ' class="paranoia_override"' : ''?>> for <?=Format::get_size($TotalSpent)?></span>
|
<span<?= ($ViewBounty === 2) ? ' class="paranoia_override"' : ''?>> for <?=Format::get_size($TotalSpent)?></span>
|
||||||
<a href="requests.php?type=voted&userid=<?=$UserID?>" class="brackets<?= ($ViewAll===2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="requests.php?type=voted&userid=<?=$UserID?>" class="brackets<?= ($ViewAll === 2) ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('uploads+'))) { ?>
|
if (($Override = check_paranoia_here('uploads+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Uploaded: <?=number_format($Uploads)?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Uploaded: <?=number_format($Uploads)?>
|
||||||
<? if (($Override=check_paranoia_here('uploads'))) { ?>
|
<? if (($Override = check_paranoia_here('uploads'))) { ?>
|
||||||
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? if (check_perms('zip_downloader')) { ?>
|
<? if (check_perms('zip_downloader')) { ?>
|
||||||
<a href="torrents.php?action=redownload&type=uploads&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="Download">Download</a>
|
<a href="torrents.php?action=redownload&type=uploads&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="Download">Download</a>
|
||||||
<? }
|
<? }
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('uniquegroups+'))) { ?>
|
if (($Override = check_paranoia_here('uniquegroups+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Unique groups: <? echo number_format($UniqueGroups); ?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Unique groups: <? echo number_format($UniqueGroups); ?>
|
||||||
<? if (($Override=check_paranoia_here('uniquegroups'))) { ?>
|
<? if (($Override = check_paranoia_here('uniquegroups'))) { ?>
|
||||||
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>&filter=uniquegroup" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>&filter=uniquegroup" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('perfectflacs+'))) { ?>
|
if (($Override = check_paranoia_here('perfectflacs+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>"Perfect" FLACs: <? echo number_format($PerfectFLACs); ?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>"Perfect" FLACs: <? echo number_format($PerfectFLACs); ?>
|
||||||
<? if (($Override=check_paranoia_here('perfectflacs'))) { ?>
|
<? if (($Override = check_paranoia_here('perfectflacs'))) { ?>
|
||||||
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>&filter=perfectflac" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="torrents.php?type=uploaded&userid=<?=$UserID?>&filter=perfectflac" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) {
|
if (check_paranoia_here('seeding+') || check_paranoia_here('leeching+')) {
|
||||||
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(x.uid) FROM xbt_files_users AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID' AND x.active=1 GROUP BY Type");
|
$DB->query("SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(x.uid)
|
||||||
|
FROM xbt_files_users AS x
|
||||||
|
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||||
|
WHERE x.uid='$UserID' AND x.active=1
|
||||||
|
GROUP BY Type");
|
||||||
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
|
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
|
||||||
$Seeding = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0;
|
$Seeding = isset($PeerCount['Seeding'][1]) ? $PeerCount['Seeding'][1] : 0;
|
||||||
$Leeching = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0;
|
$Leeching = isset($PeerCount['Leeching'][1]) ? $PeerCount['Leeching'][1] : 0;
|
||||||
} ?>
|
} ?>
|
||||||
<? if (($Override=check_paranoia_here('seeding+'))) { ?>
|
<? if (($Override = check_paranoia_here('seeding+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Seeding: <?=number_format($Seeding)?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Seeding: <?=number_format($Seeding)?>
|
||||||
<? if (($AOverride=check_paranoia_here('seeding'))) {
|
<? if (($AOverride = check_paranoia_here('seeding'))) {
|
||||||
echo ((($Override=check_paranoia_here('snatched')) && $UniqueSnatched > 0 )
|
echo ((($Override = check_paranoia_here('snatched')) && $UniqueSnatched > 0 )
|
||||||
? '<span'.($Override===2 ? ' class="paranoia_override"' : '').'> (' . 100*min(1,round($Seeding/$UniqueSnatched,2)).'%)</span>' : ''); ?>
|
? '<span'.($Override === 2 ? ' class="paranoia_override"' : '').'> (' . 100 * min(1,round($Seeding / $UniqueSnatched,2)).'%)</span>' : ''); ?>
|
||||||
<a href="torrents.php?type=seeding&userid=<?=$UserID?>" class="brackets<?= $AOverride===2 ? ' paranoia_override' :'' ?>" title="View">View</a>
|
<a href="torrents.php?type=seeding&userid=<?=$UserID?>" class="brackets<?= $AOverride === 2 ? ' paranoia_override' :'' ?>" title="View">View</a>
|
||||||
<? if (check_perms('zip_downloader')) { ?>
|
<? if (check_perms('zip_downloader')) { ?>
|
||||||
<a href="torrents.php?action=redownload&type=seeding&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets" title="Download">Download</a>
|
<a href="torrents.php?action=redownload&type=seeding&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected; be sure to check the size of all torrents before redownloading.');" class="brackets" title="Download">Download</a>
|
||||||
<? }
|
<? }
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('leeching+'))) { ?>
|
if (($Override = check_paranoia_here('leeching+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Leeching: <? echo number_format($Leeching); ?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Leeching: <? echo number_format($Leeching); ?>
|
||||||
<? if (($Override=check_paranoia_here('leeching'))) { ?>
|
<? if (($Override = check_paranoia_here('leeching'))) { ?>
|
||||||
<a href="torrents.php?type=leeching&userid=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="torrents.php?type=leeching&userid=<?=$UserID?>" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? }
|
<? }
|
||||||
echo ($DisableLeech == 0 && check_perms('users_view_ips')) ? ' <strong>(Disabled)</strong>' : ''
|
echo ($DisableLeech == 0 && check_perms('users_view_ips')) ? ' <strong>(Disabled)</strong>' : ''
|
||||||
?>
|
?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('snatched+'))) { ?>
|
if (($Override = check_paranoia_here('snatched+'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Snatched: <?=number_format($Snatched)?>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Snatched: <?=number_format($Snatched)?>
|
||||||
<? if (($Override=check_perms('site_view_torrent_snatchlist', $Class))) { ?>
|
<? if (($Override = check_perms('site_view_torrent_snatchlist', $Class))) { ?>
|
||||||
(<?= $Override === 2 ? '<span class="paranoia_override">'.number_format($UniqueSnatched).'</span>' : number_format($UniqueSnatched) ?>)
|
(<?= $Override === 2 ? '<span class="paranoia_override">'.number_format($UniqueSnatched).'</span>' : number_format($UniqueSnatched) ?>)
|
||||||
<? } ?>
|
<? }
|
||||||
<? } ?>
|
}
|
||||||
<? if (($Override=check_paranoia_here('snatched'))) { ?>
|
if (($Override = check_paranoia_here('snatched'))) { ?>
|
||||||
<a href="torrents.php?type=snatched&userid=<?=$UserID?>" class="brackets<?= $Override===2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
<a href="torrents.php?type=snatched&userid=<?=$UserID?>" class="brackets<?= $Override === 2 ? ' paranoia_override' : '' ?>" title="View">View</a>
|
||||||
<? if (check_perms('zip_downloader')) { ?>
|
<? if (check_perms('zip_downloader')) { ?>
|
||||||
<a href="torrents.php?action=redownload&type=snatches&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected, be sure to check the size of all torrents before redownloading.');" class="brackets" title="Download">Download</a>
|
<a href="torrents.php?action=redownload&type=snatches&userid=<?=$UserID?>" onclick="return confirm('If you no longer have the content, your ratio WILL be affected, be sure to check the size of all torrents before redownloading.');" class="brackets" title="Download">Download</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_perms('site_view_torrent_snatchlist', $Class))) {
|
if (($Override = check_perms('site_view_torrent_snatchlist', $Class))) {
|
||||||
$DB->query("SELECT COUNT(ud.UserID), COUNT(DISTINCT ud.TorrentID) FROM users_downloads AS ud INNER JOIN torrents AS t ON t.ID=ud.TorrentID WHERE ud.UserID='$UserID'");
|
$DB->query("SELECT COUNT(ud.UserID), COUNT(DISTINCT ud.TorrentID)
|
||||||
|
FROM users_downloads AS ud
|
||||||
|
INNER JOIN torrents AS t ON t.ID=ud.TorrentID
|
||||||
|
WHERE ud.UserID='$UserID'");
|
||||||
list($NumDownloads, $UniqueDownloads) = $DB->next_record();
|
list($NumDownloads, $UniqueDownloads) = $DB->next_record();
|
||||||
?>
|
?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Downloaded: <?=number_format($NumDownloads)?> (<?=number_format($UniqueDownloads)?>)
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Downloaded: <?=number_format($NumDownloads)?> (<?=number_format($UniqueDownloads)?>)
|
||||||
<a href="torrents.php?type=downloaded&userid=<?=$UserID?>" class="brackets" title="View">View</a>
|
<a href="torrents.php?type=downloaded&userid=<?=$UserID?>" class="brackets" title="View">View</a>
|
||||||
</li>
|
</li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('invitedcount'))) {
|
if (($Override=check_paranoia_here('invitedcount'))) {
|
||||||
$DB->query("SELECT COUNT(UserID) FROM users_info WHERE Inviter='$UserID'");
|
$DB->query("SELECT COUNT(UserID) FROM users_info WHERE Inviter='$UserID'");
|
||||||
list($Invited) = $DB->next_record();
|
list($Invited) = $DB->next_record();
|
||||||
?>
|
?>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
$UserID = $_REQUEST['userid'];
|
$UserID = $_REQUEST['userid'];
|
||||||
if(!is_number($UserID)){
|
if (!is_number($UserID)) {
|
||||||
error(404);
|
error(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,12 +26,12 @@
|
|||||||
list($Username,$Email,$IRCKey,$Paranoia,$Info,$Avatar,$Country,$StyleID,$StyleURL,$SiteOptions,$UnseededAlerts,$Class)=$DB->next_record(MYSQLI_NUM, array(3,9));
|
list($Username,$Email,$IRCKey,$Paranoia,$Info,$Avatar,$Country,$StyleID,$StyleURL,$SiteOptions,$UnseededAlerts,$Class)=$DB->next_record(MYSQLI_NUM, array(3,9));
|
||||||
|
|
||||||
|
|
||||||
if($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
|
if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Class)) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Paranoia = unserialize($Paranoia);
|
$Paranoia = unserialize($Paranoia);
|
||||||
if(!is_array($Paranoia)) {
|
if (!is_array($Paranoia)) {
|
||||||
$Paranoia = array();
|
$Paranoia = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +62,7 @@ function checked($Checked) {
|
|||||||
|
|
||||||
|
|
||||||
$DB->query("SELECT username FROM lastfm_users WHERE ID = '$UserID'");
|
$DB->query("SELECT username FROM lastfm_users WHERE ID = '$UserID'");
|
||||||
$LastFMUsername = "";
|
$LastFMUsername = '';
|
||||||
list($LastFMUsername) = $DB->next_record();
|
list($LastFMUsername) = $DB->next_record();
|
||||||
|
|
||||||
echo $Val->GenerateJS('userform');
|
echo $Val->GenerateJS('userform');
|
||||||
@ -88,7 +87,7 @@ function checked($Checked) {
|
|||||||
<td class="label"><strong>Stylesheet</strong></td>
|
<td class="label"><strong>Stylesheet</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="stylesheet" id="stylesheet">
|
<select name="stylesheet" id="stylesheet">
|
||||||
<? foreach($Stylesheets as $Style) { ?>
|
<? foreach ($Stylesheets as $Style) { ?>
|
||||||
<option value="<?=$Style['ID']?>"<? if ($Style['ID'] == $StyleID) { ?> selected="selected"<? } ?>><?=$Style['ProperName']?></option>
|
<option value="<?=$Style['ID']?>"<? if ($Style['ID'] == $StyleID) { ?> selected="selected"<? } ?>><?=$Style['ProperName']?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
@ -242,19 +241,19 @@ function checked($Checked) {
|
|||||||
<td class="label"><strong>Avatars</strong></td>
|
<td class="label"><strong>Avatars</strong></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="disableavatars" id="disableavatars" onclick="ToggleIdenticons();">
|
<select name="disableavatars" id="disableavatars" onclick="ToggleIdenticons();">
|
||||||
<option value="1"<? if($SiteOptions['DisableAvatars'] == 1) { ?> selected="selected"<? } ?>>Disable avatars</option>
|
<option value="1"<? if ($SiteOptions['DisableAvatars'] == 1) { ?> selected="selected"<? } ?>>Disable avatars</option>
|
||||||
<option value="0"<? if($SiteOptions['DisableAvatars'] == 0) { ?> selected="selected"<? } ?>>Show avatars</option>
|
<option value="0"<? if ($SiteOptions['DisableAvatars'] == 0) { ?> selected="selected"<? } ?>>Show avatars</option>
|
||||||
<option value="2"<? if($SiteOptions['DisableAvatars'] == 2) { ?> selected="selected"<? } ?>>Show avatars or:</option>
|
<option value="2"<? if ($SiteOptions['DisableAvatars'] == 2) { ?> selected="selected"<? } ?>>Show avatars or:</option>
|
||||||
<option value="3"<? if($SiteOptions['DisableAvatars'] == 3) { ?> selected="selected"<? } ?>>Replace all avatars with:</option>
|
<option value="3"<? if ($SiteOptions['DisableAvatars'] == 3) { ?> selected="selected"<? } ?>>Replace all avatars with:</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="identicons" id="identicons">
|
<select name="identicons" id="identicons">
|
||||||
<option value="0"<? if($SiteOptions['Identicons'] == 0) { ?> selected="selected"<? } ?>>Identicon</option>
|
<option value="0"<? if ($SiteOptions['Identicons'] == 0) { ?> selected="selected"<? } ?>>Identicon</option>
|
||||||
<option value="1"<? if($SiteOptions['Identicons'] == 1) { ?> selected="selected"<? } ?>>MonsterID</option>
|
<option value="1"<? if ($SiteOptions['Identicons'] == 1) { ?> selected="selected"<? } ?>>MonsterID</option>
|
||||||
<option value="2"<? if($SiteOptions['Identicons'] == 2) { ?> selected="selected"<? } ?>>Wavatar</option>
|
<option value="2"<? if ($SiteOptions['Identicons'] == 2) { ?> selected="selected"<? } ?>>Wavatar</option>
|
||||||
<option value="3"<? if($SiteOptions['Identicons'] == 3) { ?> selected="selected"<? } ?>>Retro</option>
|
<option value="3"<? if ($SiteOptions['Identicons'] == 3) { ?> selected="selected"<? } ?>>Retro</option>
|
||||||
<option value="4"<? if($SiteOptions['Identicons'] == 4) { ?> selected="selected"<? } ?>>Robots 1</option>
|
<option value="4"<? if ($SiteOptions['Identicons'] == 4) { ?> selected="selected"<? } ?>>Robots 1</option>
|
||||||
<option value="5"<? if($SiteOptions['Identicons'] == 5) { ?> selected="selected"<? } ?>>Robots 2</option>
|
<option value="5"<? if ($SiteOptions['Identicons'] == 5) { ?> selected="selected"<? } ?>>Robots 2</option>
|
||||||
<option value="6"<? if($SiteOptions['Identicons'] == 6) { ?> selected="selected"<? } ?>>Robots 3</option>
|
<option value="6"<? if ($SiteOptions['Identicons'] == 6) { ?> selected="selected"<? } ?>>Robots 3</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
include(SERVER_ROOT."/classes/class_validate.php");
|
include(SERVER_ROOT."/classes/class_validate.php");
|
||||||
$Val=NEW VALIDATE;
|
$Val=NEW VALIDATE;
|
||||||
|
|
||||||
if(empty($_REQUEST['action'])) { $_REQUEST['action']=''; }
|
if (empty($_REQUEST['action'])) {
|
||||||
|
$_REQUEST['action'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
case 'notify':
|
case 'notify':
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?
|
<?
|
||||||
if(isset($_GET['userid']) && check_perms('users_view_invites')){
|
if (isset($_GET['userid']) && check_perms('users_view_invites')) {
|
||||||
if(!is_number($_GET['userid'])){ error(403); }
|
if (!is_number($_GET['userid'])) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
$UserID=$_GET['userid'];
|
$UserID=$_GET['userid'];
|
||||||
$Sneaky = true;
|
$Sneaky = true;
|
||||||
} else {
|
} else {
|
||||||
if(!$UserCount = $Cache->get_value('stats_user_count')){
|
if (!$UserCount = $Cache->get_value('stats_user_count')) {
|
||||||
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
|
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
|
||||||
list($UserCount) = $DB->next_record();
|
list($UserCount) = $DB->next_record();
|
||||||
$Cache->cache_value('stats_user_count', $UserCount, 0);
|
$Cache->cache_value('stats_user_count', $UserCount, 0);
|
||||||
@ -22,16 +24,16 @@
|
|||||||
$DB->query("SELECT InviteKey, Email, Expires FROM invites WHERE InviterID='$UserID' ORDER BY Expires");
|
$DB->query("SELECT InviteKey, Email, Expires FROM invites WHERE InviterID='$UserID' ORDER BY Expires");
|
||||||
$Pending = $DB->to_array();
|
$Pending = $DB->to_array();
|
||||||
|
|
||||||
$OrderWays = array("username", "email", "joined", "lastseen", "uploaded", "downloaded", "ratio");
|
$OrderWays = array('username', 'email', 'joined', 'lastseen', 'uploaded', 'downloaded', 'ratio');
|
||||||
|
|
||||||
if(empty($_GET['order'])) {
|
if (empty($_GET['order'])) {
|
||||||
$CurrentOrder = "id";
|
$CurrentOrder = 'id';
|
||||||
$CurrentSort = "asc";
|
$CurrentSort = 'asc';
|
||||||
$NewSort = "desc";
|
$NewSort = 'desc';
|
||||||
} else {
|
} else {
|
||||||
if(in_array($_GET['order'], $OrderWays)) {
|
if (in_array($_GET['order'], $OrderWays)) {
|
||||||
$CurrentOrder = $_GET['order'];
|
$CurrentOrder = $_GET['order'];
|
||||||
if($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
if ($_GET['sort'] == 'asc' || $_GET['sort'] == 'desc') {
|
||||||
$CurrentSort = $_GET['sort'];
|
$CurrentSort = $_GET['sort'];
|
||||||
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
$NewSort = ($_GET['sort'] == 'asc' ? 'desc' : 'asc');
|
||||||
} else {
|
} else {
|
||||||
@ -91,7 +93,7 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h2><?=Users::format_username($UserID, false, false, false)?> > Invites</h2>
|
<h2><?=Users::format_username($UserID, false, false, false)?> > Invites</h2>
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<a href="user.php?action=invitetree<? if($Sneaky){ echo '&userid='.$UserID; }?>" class="brackets">Invite tree</a>
|
<a href="user.php?action=invitetree<? if ($Sneaky) { echo '&userid='.$UserID; } ?>" class="brackets">Invite tree</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? if ($UserCount >= USER_LIMIT && !check_perms('site_can_invite_always')) { ?>
|
<? if ($UserCount >= USER_LIMIT && !check_perms('site_can_invite_always')) { ?>
|
||||||
@ -112,13 +114,13 @@
|
|||||||
$DB->query("SELECT can_leech FROM users_main WHERE ID = ".$UserID);
|
$DB->query("SELECT can_leech FROM users_main WHERE ID = ".$UserID);
|
||||||
list($CanLeech) = $DB->next_record();
|
list($CanLeech) = $DB->next_record();
|
||||||
|
|
||||||
if(!$Sneaky
|
if (!$Sneaky
|
||||||
&& !$LoggedUser['RatioWatch']
|
&& !$LoggedUser['RatioWatch']
|
||||||
&& $CanLeech
|
&& $CanLeech
|
||||||
&& empty($LoggedUser['DisableInvites'])
|
&& empty($LoggedUser['DisableInvites'])
|
||||||
&& ($LoggedUser['Invites']>0 || check_perms('site_send_unlimited_invites'))
|
&& ($LoggedUser['Invites'] > 0 || check_perms('site_send_unlimited_invites'))
|
||||||
&& ($UserCount <= USER_LIMIT || USER_LIMIT == 0 || check_perms('site_can_invite_always'))
|
&& ($UserCount <= USER_LIMIT || USER_LIMIT == 0 || check_perms('site_can_invite_always'))
|
||||||
){ ?>
|
) { ?>
|
||||||
<div class="box pad">
|
<div class="box pad">
|
||||||
<p>Please note that the selling, trading or public giving away of our invitations, or responding to public requests, is strictly forbidden, and may result in you and your entire invite tree being banned. This includes offering to give away our invitations on any forum which is not a class-restricted forum on another private tracker.</p>
|
<p>Please note that the selling, trading or public giving away of our invitations, or responding to public requests, is strictly forbidden, and may result in you and your entire invite tree being banned. This includes offering to give away our invitations on any forum which is not a class-restricted forum on another private tracker.</p>
|
||||||
<p>Remember that you are responsible for ALL invitees, and your account and/or privileges may be disabled due to your invitees' actions. You should know the person you're inviting. If you aren't familiar enough with the user to trust them, we suggest not inviting them.</p>
|
<p>Remember that you are responsible for ALL invitees, and your account and/or privileges may be disabled due to your invitees' actions. You should know the person you're inviting. If you aren't familiar enough with the user to trust them, we suggest not inviting them.</p>
|
||||||
@ -141,7 +143,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
} elseif (!empty($LoggedUser['DisableInvites'])) {?>
|
} elseif (!empty($LoggedUser['DisableInvites'])) { ?>
|
||||||
<div class="box pad" style="text-align: center">
|
<div class="box pad" style="text-align: center">
|
||||||
<strong class="important_text">Your invites have been disabled. Please read <a href="wiki.php?action=article&id=310">this article</a> for more information.</strong>
|
<strong class="important_text">Your invites have been disabled. Please read <a href="wiki.php?action=article&id=310">this article</a> for more information.</strong>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?
|
<?
|
||||||
if(isset($_GET['userid']) && check_perms('users_view_invites')){
|
if (isset($_GET['userid']) && check_perms('users_view_invites')) {
|
||||||
if(!is_number($_GET['userid'])){ error(403); }
|
if (!is_number($_GET['userid'])) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
$UserID=$_GET['userid'];
|
$UserID = $_GET['userid'];
|
||||||
$Sneaky = true;
|
$Sneaky = true;
|
||||||
} else {
|
} else {
|
||||||
if(!$UserCount = $Cache->get_value('stats_user_count')){
|
if (!$UserCount = $Cache->get_value('stats_user_count')) {
|
||||||
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
|
$DB->query("SELECT COUNT(ID) FROM users_main WHERE Enabled='1'");
|
||||||
list($UserCount) = $DB->next_record();
|
list($UserCount) = $DB->next_record();
|
||||||
$Cache->cache_value('stats_user_count', $UserCount, 0);
|
$Cache->cache_value('stats_user_count', $UserCount, 0);
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
<div class="head colhead_dark">Last.fm</div>
|
<div class="head colhead_dark">Last.fm</div>
|
||||||
<ul class="stats nobullet">
|
<ul class="stats nobullet">
|
||||||
<li>
|
<li>
|
||||||
Username: <a id="lastfm_username" href="<?= $LastFMInfo['user']['url'] ?>" target="_blank" title="<?= $LastFMInfo['user']['name'] ?> on Last.fm: <?= $LastFMInfo['user']['playcount'] ?> plays, <?= $LastFMInfo['user']['playlists'] ?> playlists."><?= $LastFMInfo['user']['name'] ?></a>
|
Username: <a id="lastfm_username" href="<?= $LastFMInfo['user']['url'] ?>" target="_blank" title="<?= $LastFMInfo['user']['name'] ?> on Last.fm: <?= number_format($LastFMInfo['user']['playcount']) ?> plays, <?= number_format($LastFMInfo['user']['playlists']) ?> playlists."><?= $LastFMInfo['user']['name'] ?></a>
|
||||||
</li>
|
</li>
|
||||||
<div id="lastfm_stats" <? if ($OwnProfile == true): ?>data-uid="<?= $OwnProfile ?>"<? endif; ?>>
|
<div id="lastfm_stats"<? if ($OwnProfile == true): ?> data-uid="<?= $OwnProfile ?>"<? endif; ?>>
|
||||||
</div>
|
</div>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" id="lastfm_expand" onclick="return false" class="brackets">Show more info</a>
|
<a href="#" id="lastfm_expand" onclick="return false" class="brackets">Show more info</a>
|
||||||
<?
|
<?
|
||||||
//Append the reload stats button only if allowed on the current user page.
|
//Append the reload stats button only if allowed on the current user page.
|
||||||
$Response = $Cache->get_value('lastfm_clear_cache_' . $LoggedUser . '_' . $_GET['id']);
|
$Response = $Cache->get_value('lastfm_clear_cache_' . $LoggedUser . '_' . $_GET['id']);
|
||||||
if (empty($Response)) :
|
if (empty($Response)) :
|
||||||
@ -24,8 +24,9 @@
|
|||||||
<span id="lastfm_reload_container">
|
<span id="lastfm_reload_container">
|
||||||
<a href="#" id="lastfm_reload" onclick="return false" class="brackets">Reload stats</a>
|
<a href="#" id="lastfm_reload" onclick="return false" class="brackets">Reload stats</a>
|
||||||
</span>
|
</span>
|
||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<? } ?>
|
<?
|
||||||
|
} ?>
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?
|
<?
|
||||||
authorize();
|
authorize();
|
||||||
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
|
include(SERVER_ROOT.'/sections/user/linkedfunctions.php');
|
||||||
|
|
||||||
if (!check_perms('users_mod')) {
|
if (!check_perms('users_mod')) {
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$UserID = $_REQUEST['userid'];
|
$UserID = $_REQUEST['userid'];
|
||||||
|
|
||||||
switch ($_REQUEST['dupeaction']) {
|
switch ($_REQUEST['dupeaction']) {
|
||||||
case 'remove':
|
case 'remove':
|
||||||
unlink_user($_REQUEST['removeid']);
|
unlink_user($_REQUEST['removeid']);
|
||||||
break;
|
break;
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
echo '\o/';
|
echo '\o/';
|
||||||
header("Location: user.php?id=$UserID");
|
header("Location: user.php?id=$UserID");
|
||||||
?>
|
?>
|
@ -2,14 +2,16 @@
|
|||||||
|
|
||||||
|
|
||||||
//TODO: restrict to viewing bellow class, username in h2
|
//TODO: restrict to viewing bellow class, username in h2
|
||||||
if(isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
|
if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
|
||||||
if(!is_number($_GET['userid'])) { error(404); }
|
if (!is_number($_GET['userid'])) {
|
||||||
|
error(404);
|
||||||
|
}
|
||||||
$UserID = $_GET['userid'];
|
$UserID = $_GET['userid'];
|
||||||
} else {
|
} else {
|
||||||
$UserID = $LoggedUser['ID'];
|
$UserID = $LoggedUser['ID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['all'])) {
|
if (isset($_POST['all'])) {
|
||||||
authorize();
|
authorize();
|
||||||
|
|
||||||
$DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID<>'$SessionID'");
|
$DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID<>'$SessionID'");
|
||||||
@ -24,7 +26,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$UserSessions = $Cache->get_value('users_sessions_'.$UserID);
|
$UserSessions = $Cache->get_value('users_sessions_'.$UserID);
|
||||||
if(!is_array($UserSessions)) {
|
if (!is_array($UserSessions)) {
|
||||||
$DB->query("SELECT
|
$DB->query("SELECT
|
||||||
SessionID,
|
SessionID,
|
||||||
Browser,
|
Browser,
|
||||||
@ -64,7 +66,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
$Row = 'a';
|
$Row = 'a';
|
||||||
foreach($UserSessions as $Session) {
|
foreach ($UserSessions as $Session) {
|
||||||
list($ThisSessionID,$Browser,$OperatingSystem,$IP,$LastUpdate) = array_values($Session);
|
list($ThisSessionID,$Browser,$OperatingSystem,$IP,$LastUpdate) = array_values($Session);
|
||||||
$Row = ($Row == 'a') ? 'b' : 'a';
|
$Row = ($Row == 'a') ? 'b' : 'a';
|
||||||
?>
|
?>
|
||||||
@ -78,7 +80,7 @@
|
|||||||
<input type="hidden" name="action" value="sessions" />
|
<input type="hidden" name="action" value="sessions" />
|
||||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||||
<input type="hidden" name="session" value="<?=$ThisSessionID?>" />
|
<input type="hidden" name="session" value="<?=$ThisSessionID?>" />
|
||||||
<input type="submit" value="<?=(($ThisSessionID == $SessionID)?'Current" disabled="disabled':'Log out')?>" />
|
<input type="submit" value="<?=(($ThisSessionID == $SessionID) ? 'Current" disabled="disabled' : 'Log out') ?>" />
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -175,7 +175,9 @@
|
|||||||
$EditSummary = array();
|
$EditSummary = array();
|
||||||
|
|
||||||
if ($_POST['ResetRatioWatch'] && check_perms('users_edit_reset_keys')) {
|
if ($_POST['ResetRatioWatch'] && check_perms('users_edit_reset_keys')) {
|
||||||
$DB->query("UPDATE users_info SET RatioWatchEnds='0000-00-00 00:00:00', RatioWatchDownload='0', RatioWatchTimes='0' WHERE UserID='$UserID'");
|
$DB->query("UPDATE users_info
|
||||||
|
SET RatioWatchEnds='0000-00-00 00:00:00', RatioWatchDownload='0', RatioWatchTimes='0'
|
||||||
|
WHERE UserID='$UserID'");
|
||||||
$EditSummary[] = 'RatioWatch history reset';
|
$EditSummary[] = 'RatioWatch history reset';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,9 +193,11 @@
|
|||||||
if ($_POST['ResetEmailHistory'] && check_perms('users_edit_reset_keys')) {
|
if ($_POST['ResetEmailHistory'] && check_perms('users_edit_reset_keys')) {
|
||||||
$DB->query("DELETE FROM users_history_emails WHERE UserID='$UserID'");
|
$DB->query("DELETE FROM users_history_emails WHERE UserID='$UserID'");
|
||||||
if ($_POST['ResetIPHistory']) {
|
if ($_POST['ResetIPHistory']) {
|
||||||
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP) VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','127.0.0.1')");
|
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP)
|
||||||
|
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','127.0.0.1')");
|
||||||
} else {
|
} else {
|
||||||
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP) VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','".$Cur['IP']."')");
|
$DB->query("INSERT INTO users_history_emails (UserID, Email, Time, IP)
|
||||||
|
VALUES ('$UserID','$Username@".SITE_URL."','0000-00-00 00:00:00','".$Cur['IP']."')");
|
||||||
}
|
}
|
||||||
$DB->query("UPDATE users_main SET Email='$Username@".SITE_URL."' WHERE ID='$UserID'");
|
$DB->query("UPDATE users_main SET Email='$Username@".SITE_URL."' WHERE ID='$UserID'");
|
||||||
$EditSummary[] = 'Email history cleared';
|
$EditSummary[] = 'Email history cleared';
|
||||||
@ -230,18 +234,24 @@
|
|||||||
|
|
||||||
if ($Logs095 !== 0) {
|
if ($Logs095 !== 0) {
|
||||||
$TargetScore = $Logs095 === 100 ? 99 : 100;
|
$TargetScore = $Logs095 === 100 ? 99 : 100;
|
||||||
$Logs = $DB->query("SELECT DISTINCT TorrentID FROM torrents_logs_new JOIN torrents ON ID = TorrentID WHERE Log LIKE 'EAC extraction logfile%' AND UserID = ".$UserID." AND Score = ".$TargetScore." AND (Adjusted = '0' OR Adjusted = '')");
|
$Logs = $DB->query("SELECT DISTINCT TorrentID
|
||||||
|
FROM torrents_logs_new
|
||||||
|
JOIN torrents ON ID = TorrentID
|
||||||
|
WHERE Log LIKE 'EAC extraction logfile%'
|
||||||
|
AND UserID = $UserID
|
||||||
|
AND Score = $TargetScore
|
||||||
|
AND (Adjusted = '0' OR Adjusted = '')");
|
||||||
while (list($TorrentID) = $DB->next_record()) {
|
while (list($TorrentID) = $DB->next_record()) {
|
||||||
$Results = array();
|
$Results = array();
|
||||||
if ($Logs095 === 100) {
|
if ($Logs095 === 100) {
|
||||||
$Details = "";
|
$Details = '';
|
||||||
} else {
|
} else {
|
||||||
$Results[] = "The original uploader has chosen to allow this log to be deducted one point for using EAC v0.95., -1 point [1]";
|
$Results[] = 'The original uploader has chosen to allow this log to be deducted one point for using EAC v0.95., -1 point [1]';
|
||||||
$Details = db_string(serialize($Results));
|
$Details = db_string(serialize($Results));
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->query("UPDATE torrents SET LogScore = ".$Logs095." WHERE ID = ".$TorrentID);
|
$DB->query("UPDATE torrents SET LogScore = $Logs095 WHERE ID = $TorrentID");
|
||||||
$DB->query("UPDATE torrents_logs_new SET Score = ".$Logs095.", Details = '".$Details."' WHERE TorrentID = ".$TorrentID);
|
$DB->query("UPDATE torrents_logs_new SET Score = $Logs095, Details = '$Details' WHERE TorrentID = $TorrentID");
|
||||||
$DB->set_query_id($Logs);
|
$DB->set_query_id($Logs);
|
||||||
}
|
}
|
||||||
$EditSummary[] = 'EAC v0.95 logs rescored to '.$Logs095;
|
$EditSummary[] = 'EAC v0.95 logs rescored to '.$Logs095;
|
||||||
@ -252,9 +262,9 @@
|
|||||||
// Start building SQL query and edit summary
|
// Start building SQL query and edit summary
|
||||||
if ($Classes[$Class]['Level'] != $Cur['Class'] && (
|
if ($Classes[$Class]['Level'] != $Cur['Class'] && (
|
||||||
($Classes[$Class]['Level'] < $LoggedUser['Class'] && check_perms('users_promote_below', $Cur['Class']))
|
($Classes[$Class]['Level'] < $LoggedUser['Class'] && check_perms('users_promote_below', $Cur['Class']))
|
||||||
|| ($Classes[$Class]['Level'] <= $LoggedUser['Class'] && check_perms('users_promote_to', $Cur['Class']-1)))) {
|
|| ($Classes[$Class]['Level'] <= $LoggedUser['Class'] && check_perms('users_promote_to', $Cur['Class'] - 1)))) {
|
||||||
$UpdateSet[] = "PermissionID='$Class'";
|
$UpdateSet[] = "PermissionID='$Class'";
|
||||||
$EditSummary[] = "class changed to ".Users::make_class_string($Class);
|
$EditSummary[] = 'class changed to '.Users::make_class_string($Class);
|
||||||
$LightUpdates['PermissionID'] = $Class;
|
$LightUpdates['PermissionID'] = $Class;
|
||||||
$DeleteKeys = true;
|
$DeleteKeys = true;
|
||||||
|
|
||||||
@ -267,12 +277,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Username != $Cur['Username'] && check_perms('users_edit_usernames', $Cur['Class']-1)) {
|
if ($Username != $Cur['Username'] && check_perms('users_edit_usernames', $Cur['Class'] - 1)) {
|
||||||
$DB->query("SELECT ID FROM users_main WHERE Username = '".$Username."'");
|
$DB->query("SELECT ID FROM users_main WHERE Username = '".$Username."'");
|
||||||
if ($DB->next_record() > 0) {
|
if ($DB->next_record() > 0) {
|
||||||
list($UsedUsernameID) = $DB->next_record();
|
list($UsedUsernameID) = $DB->next_record();
|
||||||
error("Username already in use by <a href='user.php?id=".$UsedUsernameID."'>".$Username."</a>");
|
error('Username already in use by <a href="user.php?id='.$UsedUsernameID."\">$Username</a>");
|
||||||
header("Location: user.php?id=".$UserID);
|
header('Location: user.php?id='.$UserID);
|
||||||
die();
|
die();
|
||||||
} else {
|
} else {
|
||||||
$UpdateSet[] = "Username='".$Username."'";
|
$UpdateSet[] = "Username='".$Username."'";
|
||||||
@ -296,7 +306,7 @@
|
|||||||
|
|
||||||
if ($Donor != $Cur['Donor'] && check_perms('users_give_donor')) {
|
if ($Donor != $Cur['Donor'] && check_perms('users_give_donor')) {
|
||||||
$UpdateSet[] = "Donor='$Donor'";
|
$UpdateSet[] = "Donor='$Donor'";
|
||||||
$EditSummary[] = "donor status changed";
|
$EditSummary[] = 'donor status changed';
|
||||||
$LightUpdates['Donor'] = $Donor;
|
$LightUpdates['Donor'] = $Donor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +319,7 @@
|
|||||||
foreach ($DroppedClasses as $PermID) {
|
foreach ($DroppedClasses as $PermID) {
|
||||||
$ClassChanges[] = $Classes[$PermID]['Name'];
|
$ClassChanges[] = $Classes[$PermID]['Name'];
|
||||||
}
|
}
|
||||||
$EditSummary[] = "Secondary classes dropped: ".implode(', ',$ClassChanges);
|
$EditSummary[] = 'Secondary classes dropped: '.implode(', ',$ClassChanges);
|
||||||
$DB->query("DELETE FROM users_levels WHERE UserID = '$UserID' AND PermissionID IN (".implode(',',$DroppedClasses).")");
|
$DB->query("DELETE FROM users_levels WHERE UserID = '$UserID' AND PermissionID IN (".implode(',',$DroppedClasses).")");
|
||||||
if (count($SecondaryClasses) > 0) {
|
if (count($SecondaryClasses) > 0) {
|
||||||
$LightUpdates['ExtraClasses'] = array_fill_keys($SecondaryClasses, 1);
|
$LightUpdates['ExtraClasses'] = array_fill_keys($SecondaryClasses, 1);
|
||||||
|
@ -223,25 +223,25 @@ function check_paranoia_here($Setting) {
|
|||||||
<ul class="stats nobullet">
|
<ul class="stats nobullet">
|
||||||
<li>Joined: <?=$JoinedDate?></li>
|
<li>Joined: <?=$JoinedDate?></li>
|
||||||
<? if (($Override = check_paranoia_here('lastseen'))) { ?>
|
<? if (($Override = check_paranoia_here('lastseen'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Last seen: <?=$LastAccess?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Last seen: <?=$LastAccess?></li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('uploaded'))) { ?>
|
if (($Override=check_paranoia_here('uploaded'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?> title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?> title="<?=Format::get_size($Uploaded, 5)?>">Uploaded: <?=Format::get_size($Uploaded)?></li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('downloaded'))) { ?>
|
if (($Override=check_paranoia_here('downloaded'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?> title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?> title="<?=Format::get_size($Downloaded, 5)?>">Downloaded: <?=Format::get_size($Downloaded)?></li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('ratio'))) { ?>
|
if (($Override=check_paranoia_here('ratio'))) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Ratio: <?=Format::get_ratio_html($Uploaded, $Downloaded)?></li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if (($Override=check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
|
if (($Override=check_paranoia_here('requiredratio')) && isset($RequiredRatio)) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Required ratio: <?=number_format((double)$RequiredRatio, 2)?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Required ratio: <?=number_format((double)$RequiredRatio, 2)?></li>
|
||||||
<? } ?>
|
<? }
|
||||||
<? if ($OwnProfile || ($Override=check_paranoia_here(false)) || check_perms('users_mod')) { ?>
|
if ($OwnProfile || ($Override=check_paranoia_here(false)) || check_perms('users_mod')) { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>><a href="userhistory.php?action=token_history&userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>><a href="userhistory.php?action=token_history&userid=<?=$UserID?>">Tokens</a>: <?=number_format($FLTokens)?></li>
|
||||||
<? }
|
<? }
|
||||||
if (($OwnProfile || check_perms('users_mod')) && $Warned!='0000-00-00 00:00:00') { ?>
|
if (($OwnProfile || check_perms('users_mod')) && $Warned!='0000-00-00 00:00:00') { ?>
|
||||||
<li<?= $Override===2 ? ' class="paranoia_override"' : ''?>>Warning expires: <?= date('Y-m-d H:i', strtotime($Warned)) ?></li>
|
<li<?= $Override === 2 ? ' class="paranoia_override"' : ''?>>Warning expires: <?= date('Y-m-d H:i', strtotime($Warned)) ?></li>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -252,7 +252,12 @@ function check_paranoia_here($Setting) {
|
|||||||
include(SERVER_ROOT.'/sections/user/lastfm.php');
|
include(SERVER_ROOT.'/sections/user/lastfm.php');
|
||||||
|
|
||||||
if (check_paranoia_here('requestsfilled_count') || check_paranoia_here('requestsfilled_bounty')) {
|
if (check_paranoia_here('requestsfilled_count') || check_paranoia_here('requestsfilled_bounty')) {
|
||||||
$DB->query("SELECT COUNT(DISTINCT r.ID), SUM(rv.Bounty) FROM requests AS r LEFT JOIN requests_votes AS rv ON r.ID=rv.RequestID WHERE r.FillerID = ".$UserID);
|
$DB->query("SELECT
|
||||||
|
COUNT(DISTINCT r.ID),
|
||||||
|
SUM(rv.Bounty)
|
||||||
|
FROM requests AS r
|
||||||
|
LEFT JOIN requests_votes AS rv ON r.ID=rv.RequestID
|
||||||
|
WHERE r.FillerID = ".$UserID);
|
||||||
list($RequestsFilled, $TotalBounty) = $DB->next_record();
|
list($RequestsFilled, $TotalBounty) = $DB->next_record();
|
||||||
} else {
|
} else {
|
||||||
$RequestsFilled = $TotalBounty = 0;
|
$RequestsFilled = $TotalBounty = 0;
|
||||||
@ -485,17 +490,17 @@ function check_paranoia_here($Setting) {
|
|||||||
<? } ?>
|
<? } ?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<span style="float:left;">Profile<? if ($CustomTitle) {?> - </span>
|
<span style="float: left;">Profile<? if ($CustomTitle) {?> - </span>
|
||||||
<span class="user_title"><? echo html_entity_decode($DisplayCustomTitle); } ?></span>
|
<span class="user_title"><? echo html_entity_decode($DisplayCustomTitle); } ?></span>
|
||||||
<span style="float:right;"><?=!empty($Badges)?"$Badges ":''?><a href="#" onclick="$('#profilediv').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Hide</a></span>
|
<span style="float: right;"><?=!empty($Badges)?"$Badges ":''?><a href="#" onclick="$('#profilediv').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets">Hide</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="pad" id="profilediv">
|
<div class="pad" id="profilediv">
|
||||||
<? if (!$Info) { ?>
|
<? if (!$Info) { ?>
|
||||||
This profile is currently empty.
|
This profile is currently empty.
|
||||||
<?
|
<?
|
||||||
} else {
|
} else {
|
||||||
echo $Text->full_format($Info);
|
echo $Text->full_format($Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -1104,19 +1109,19 @@ function check_paranoia_here($Setting) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="label">Disable:</td>
|
<td class="label">Disable:</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="DisablePosting" id="DisablePosting"<? if ($DisablePosting==1) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
|
<input type="checkbox" name="DisablePosting" id="DisablePosting"<? if ($DisablePosting == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePosting">Posting</label>
|
||||||
<? if (check_perms('users_disable_any')) { ?> |
|
<? if (check_perms('users_disable_any')) { ?> |
|
||||||
<input type="checkbox" name="DisableAvatar" id="DisableAvatar"<? if ($DisableAvatar==1) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
|
<input type="checkbox" name="DisableAvatar" id="DisableAvatar"<? if ($DisableAvatar == 1) { ?> checked="checked"<? } ?> /> <label for="DisableAvatar">Avatar</label> |
|
||||||
<input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites==1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label> |
|
<input type="checkbox" name="DisableInvites" id="DisableInvites"<? if ($DisableInvites == 1) { ?> checked="checked"<? } ?> /> <label for="DisableInvites">Invites</label> |
|
||||||
<input type="checkbox" name="DisableForums" id="DisableForums"<? if ($DisableForums==1) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
|
<input type="checkbox" name="DisableForums" id="DisableForums"<? if ($DisableForums == 1) { ?> checked="checked"<? } ?> /> <label for="DisableForums">Forums</label> |
|
||||||
<input type="checkbox" name="DisableTagging" id="DisableTagging"<? if ($DisableTagging==1) { ?> checked="checked"<? } ?> /> <label for="DisableTagging" title="This only disables a user's ability to delete tags.">Tagging</label> |
|
<input type="checkbox" name="DisableTagging" id="DisableTagging"<? if ($DisableTagging == 1) { ?> checked="checked"<? } ?> /> <label for="DisableTagging" title="This only disables a user's ability to delete tags.">Tagging</label> |
|
||||||
<input type="checkbox" name="DisableRequests" id="DisableRequests"<? if ($DisableRequests==1) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label>
|
<input type="checkbox" name="DisableRequests" id="DisableRequests"<? if ($DisableRequests == 1) { ?> checked="checked"<? } ?> /> <label for="DisableRequests">Requests</label>
|
||||||
<br />
|
<br />
|
||||||
<input type="checkbox" name="DisableUpload" id="DisableUpload"<? if ($DisableUpload==1) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Upload</label> |
|
<input type="checkbox" name="DisableUpload" id="DisableUpload"<? if ($DisableUpload == 1) { ?> checked="checked"<? } ?> /> <label for="DisableUpload">Upload</label> |
|
||||||
<input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki==1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
|
<input type="checkbox" name="DisableWiki" id="DisableWiki"<? if ($DisableWiki == 1) { ?> checked="checked"<? } ?> /> <label for="DisableWiki">Wiki</label> |
|
||||||
<input type="checkbox" name="DisableLeech" id="DisableLeech"<? if ($DisableLeech==0) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
|
<input type="checkbox" name="DisableLeech" id="DisableLeech"<? if ($DisableLeech == 0) { ?> checked="checked"<? } ?> /> <label for="DisableLeech">Leech</label> |
|
||||||
<input type="checkbox" name="DisablePM" id="DisablePM"<? if ($DisablePM==1) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
|
<input type="checkbox" name="DisablePM" id="DisablePM"<? if ($DisablePM == 1) { ?> checked="checked"<? } ?> /> <label for="DisablePM">PM</label> |
|
||||||
<input type="checkbox" name="DisableIRC" id="DisableIRC"<? if ($DisableIRC==1) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label>
|
<input type="checkbox" name="DisableIRC" id="DisableIRC"<? if ($DisableIRC == 1) { ?> checked="checked"<? } ?> /> <label for="DisableIRC">IRC</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
/*
|
/*
|
||||||
User collage subscription page
|
User collage subscription page
|
||||||
*/
|
*/
|
||||||
if(!check_perms('site_collages_subscribe')) { error(403); }
|
if (!check_perms('site_collages_subscribe')) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
include(SERVER_ROOT.'/classes/class_text.php'); // Text formatting class
|
||||||
$Text = new TEXT;
|
$Text = new TEXT;
|
||||||
@ -40,11 +42,11 @@
|
|||||||
?>
|
?>
|
||||||
<div class="thin">
|
<div class="thin">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2>Subscribed collages<?=($ShowAll?'':' with new additions')?></h2>
|
<h2>Subscribed collages<?=($ShowAll ? '' : ' with new additions')?></h2>
|
||||||
|
|
||||||
<div class="linkbox">
|
<div class="linkbox">
|
||||||
<?
|
<?
|
||||||
if($ShowAll) {
|
if ($ShowAll) {
|
||||||
?>
|
?>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<a href="userhistory.php?action=subscribed_collages&showall=0" class="brackets">Only display collages with new additions</a>
|
<a href="userhistory.php?action=subscribed_collages&showall=0" class="brackets">Only display collages with new additions</a>
|
||||||
@ -60,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
if(!$NumResults) {
|
if (!$NumResults) {
|
||||||
?>
|
?>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
No subscribed collages<?=($ShowAll ? '' : ' with new additions')?>
|
No subscribed collages<?=($ShowAll ? '' : ' with new additions')?>
|
||||||
@ -85,7 +87,7 @@
|
|||||||
//$Artists = Artists::get_artists($GroupID);
|
//$Artists = Artists::get_artists($GroupID);
|
||||||
|
|
||||||
$GroupIDs = $DB->collect('GroupID');
|
$GroupIDs = $DB->collect('GroupID');
|
||||||
if(count($GroupIDs)>0) {
|
if (count($GroupIDs) > 0) {
|
||||||
$TorrentList = Torrents::get_groups($GroupIDs);
|
$TorrentList = Torrents::get_groups($GroupIDs);
|
||||||
$TorrentList = $TorrentList['matches'];
|
$TorrentList = $TorrentList['matches'];
|
||||||
} else {
|
} else {
|
||||||
@ -110,18 +112,22 @@
|
|||||||
unset($ExtendedArtists[2]);
|
unset($ExtendedArtists[2]);
|
||||||
unset($ExtendedArtists[3]);
|
unset($ExtendedArtists[3]);
|
||||||
$DisplayName .= Artists::display_artists($ExtendedArtists);
|
$DisplayName .= Artists::display_artists($ExtendedArtists);
|
||||||
} elseif(count($Artists)>0) {
|
} elseif (count($Artists) > 0) {
|
||||||
$DisplayName .= Artists::display_artists(array('1'=>$Artists));
|
$DisplayName .= Artists::display_artists(array('1'=>$Artists));
|
||||||
}
|
}
|
||||||
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||||
if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';}
|
if ($GroupYear > 0) {
|
||||||
if($GroupVanityHouse) { $DisplayName .= ' [<abbr title="This is a vanity house release">VH</abbr>]'; }
|
$DisplayName = $DisplayName. " [$GroupYear]";
|
||||||
|
}
|
||||||
|
if ($GroupVanityHouse) {
|
||||||
|
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
|
||||||
|
}
|
||||||
|
|
||||||
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
|
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
|
||||||
|
|
||||||
// Start an output buffer, so we can store this output in $TorrentTable
|
// Start an output buffer, so we can store this output in $TorrentTable
|
||||||
ob_start();
|
ob_start();
|
||||||
if(count($Torrents)>1 || $GroupCategoryID==1) {
|
if (count($Torrents) > 1 || $GroupCategoryID == 1) {
|
||||||
?>
|
?>
|
||||||
<tr class="group discog<?=$SnatchedGroupClass?>" id="group_<?=$CollageID?><?=$GroupID?>">
|
<tr class="group discog<?=$SnatchedGroupClass?>" id="group_<?=$CollageID?><?=$GroupID?>">
|
||||||
<td class="center">
|
<td class="center">
|
||||||
@ -158,7 +164,7 @@
|
|||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
|
|
||||||
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
if ($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||||
$EditionID++;
|
$EditionID++;
|
||||||
?>
|
?>
|
||||||
@ -194,10 +200,10 @@
|
|||||||
|
|
||||||
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||||
|
|
||||||
if($Torrent['IsSnatched']) {
|
if ($Torrent['IsSnatched']) {
|
||||||
$DisplayName .=' ' . Format::torrent_label('Snatched!');
|
$DisplayName .=' ' . Format::torrent_label('Snatched!');
|
||||||
}
|
}
|
||||||
if(!empty($Torrent['FreeTorrent'])) {
|
if (!empty($Torrent['FreeTorrent'])) {
|
||||||
$DisplayName .=' ' . Format::torrent_label('Freeleech!');
|
$DisplayName .=' ' . Format::torrent_label('Freeleech!');
|
||||||
}
|
}
|
||||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||||
@ -260,7 +266,7 @@
|
|||||||
</table>
|
</table>
|
||||||
<? } // foreach() ?>
|
<? } // foreach() ?>
|
||||||
<?
|
<?
|
||||||
} // else -- if(empty($NumResults)) ?>
|
} // else -- if (empty($NumResults)) ?>
|
||||||
</div>
|
</div>
|
||||||
<?
|
<?
|
||||||
|
|
||||||
|
@ -113,30 +113,30 @@ input {
|
|||||||
input[type="submit"], input[type="reset"], input[type="button"], button {
|
input[type="submit"], input[type="reset"], input[type="button"], button {
|
||||||
font-family: Arial, Sans-Serif;
|
font-family: Arial, Sans-Serif;
|
||||||
line-height: 13px !important;
|
line-height: 13px !important;
|
||||||
font-size:12pt;
|
font-size: 12pt;
|
||||||
-moz-border-radius:5px 5px 5px 5px;
|
-moz-border-radius: 5px 5px 5px 5px;
|
||||||
-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25);
|
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||||
-webkit-border-radius:5px 5px 5px 5px;
|
-webkit-border-radius: 5px 5px 5px 5px;
|
||||||
-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25);
|
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||||
background: #8E2FA4 url("images/overlay-button.png") repeat-x scroll 0 0;
|
background: #8E2FA4 url("images/overlay-button.png") repeat-x scroll 0 0;
|
||||||
border: 0 none;
|
border: 0 none;
|
||||||
border-bottom:1px solid rgba(0, 0, 0, 0.25);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
|
||||||
color:#FFF;
|
color: #FFF;
|
||||||
cursor:pointer;
|
cursor: pointer;
|
||||||
font-size:13px;
|
font-size: 13px;
|
||||||
font-weight:bold;
|
font-weight: bold;
|
||||||
line-height:1;
|
line-height: 1;
|
||||||
overflow:visible;
|
overflow: visible;
|
||||||
padding: 3px 15px;
|
padding: 3px 15px;
|
||||||
position:relative;
|
position: relative;
|
||||||
text-decoration:none;
|
text-decoration: none;
|
||||||
text-shadow:0 -1px 1px rgba(0, 0, 0, 0.25);
|
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
|
||||||
width:auto;
|
width: auto;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
/* [type="button"]:hover,input[type="submit']:hover,input[type="reset"] input:hover {*/
|
/* [type="button"]:hover,input[type="submit']:hover,input[type="reset"] input:hover {*/
|
||||||
input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover, button:hover {
|
input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover, button:hover {
|
||||||
background-color:#6e257f;
|
background-color: #6e257f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -587,15 +587,15 @@ ul#userinfo_stats li {
|
|||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
}
|
}
|
||||||
/* artists */
|
/* artists */
|
||||||
#searchbars ul li + li form input {left: 160px; width: 65px;}
|
#searchbars ul li + li form input { left: 160px; width: 65px; }
|
||||||
/* requests */
|
/* requests */
|
||||||
#searchbars ul li + li + li form input { left: 252px; width: 80px;}
|
#searchbars ul li + li + li form input { left: 252px; width: 80px; }
|
||||||
/* forums */
|
/* forums */
|
||||||
#searchbars ul li + li + li + li form input { left: 360px; width: 70px;}
|
#searchbars ul li + li + li + li form input { left: 360px; width: 70px; }
|
||||||
/* log */
|
/* log */
|
||||||
#searchbars ul li + li + li + li + li form input { left: 475px; width: 50px;}
|
#searchbars ul li + li + li + li + li form input { left: 475px; width: 50px; }
|
||||||
/* users */
|
/* users */
|
||||||
#searchbars ul li + li + li + li + li + li form input { left: 570px; width: 60px;}
|
#searchbars ul li + li + li + li + li + li form input { left: 570px; width: 60px; }
|
||||||
#searchbars ul li form {
|
#searchbars ul li form {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
@ -617,15 +617,15 @@ ul#userinfo_stats li {
|
|||||||
background: transparent url("images/hey-you-guys-T.png") no-repeat scroll 0;
|
background: transparent url("images/hey-you-guys-T.png") no-repeat scroll 0;
|
||||||
}
|
}
|
||||||
/* artists */
|
/* artists */
|
||||||
#searchbars ul li + li form input:focus { background-image: url("images/hey-you-guys-A.png");}
|
#searchbars ul li + li form input:focus {background-image: url("images/hey-you-guys-A.png");}
|
||||||
/* requests */
|
/* requests */
|
||||||
#searchbars ul li + li + li form input:focus { background-image: url("images/hey-you-guys-R.png");}
|
#searchbars ul li + li + li form input:focus {background-image: url("images/hey-you-guys-R.png");}
|
||||||
/* forums */
|
/* forums */
|
||||||
#searchbars ul li + li + li + li form input:focus { background-image: url("images/hey-you-guys-F.png");}
|
#searchbars ul li + li + li + li form input:focus {background-image: url("images/hey-you-guys-F.png");}
|
||||||
/* log */
|
/* log */
|
||||||
#searchbars ul li + li + li + li + li form input:focus { background-image: url("images/hey-you-guys-L.png");}
|
#searchbars ul li + li + li + li + li form input:focus {background-image: url("images/hey-you-guys-L.png");}
|
||||||
/* users */
|
/* users */
|
||||||
#searchbars ul li + li + li + li + li + li form input:focus { background-image: url("images/hey-you-guys-U.png");}
|
#searchbars ul li + li + li + li + li + li form input:focus {background-image: url("images/hey-you-guys-U.png");}
|
||||||
|
|
||||||
/* artist autocomplete */
|
/* artist autocomplete */
|
||||||
ul#artistcomplete {
|
ul#artistcomplete {
|
||||||
@ -787,8 +787,8 @@ body#torrents .filter_torrents {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
width: 75%;
|
width: 75%;
|
||||||
margin: 0 auto 40px;
|
margin: 0 auto 40px;
|
||||||
-moz-box-shadow:0 3px 10px #01A9D3, 0 -1px 5px #01A9D3;
|
-moz-box-shadow: 0 3px 10px #01A9D3, 0 -1px 5px #01A9D3;
|
||||||
-webkit-box-shadow:0 3px 10px #01A9D3, 0 -1px 5px #01A9D3;
|
-webkit-box-shadow: 0 3px 10px #01A9D3, 0 -1px 5px #01A9D3;
|
||||||
background: #222;
|
background: #222;
|
||||||
font-size: 85%;
|
font-size: 85%;
|
||||||
}
|
}
|
||||||
@ -1037,7 +1037,7 @@ body#requests #content .main_column tr td {
|
|||||||
}
|
}
|
||||||
body#requests #content .main_column tr td.label {
|
body#requests #content .main_column tr td.label {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-weight:bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
body#requests #content .main_column tr td {
|
body#requests #content .main_column tr td {
|
||||||
border: 1px dotted #555;
|
border: 1px dotted #555;
|
||||||
@ -1327,9 +1327,9 @@ body#forums .poll li.graph {
|
|||||||
.poll span.right_poll {
|
.poll span.right_poll {
|
||||||
background-color: #01a9d3;
|
background-color: #01a9d3;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
display:block;
|
display: block;
|
||||||
height:13px;
|
height: 13px;
|
||||||
float:left
|
float: left;
|
||||||
}
|
}
|
||||||
.poll span.left_poll,
|
.poll span.left_poll,
|
||||||
.poll span.right_poll {
|
.poll span.right_poll {
|
||||||
|
@ -750,9 +750,9 @@ ul .invitetree {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: black;
|
background-color: black;
|
||||||
z-index:1001;
|
z-index: 1001;
|
||||||
-moz-opacity: 0.8;
|
-moz-opacity: 0.8;
|
||||||
opacity:.80;
|
opacity: .80;
|
||||||
filter: alpha(opacity=80);
|
filter: alpha(opacity=80);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,7 +764,7 @@ ul .invitetree {
|
|||||||
width: 90%;
|
width: 90%;
|
||||||
height: 90%;
|
height: 90%;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
z-index:1002;
|
z-index: 1002;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ ul.thin li {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#searchbars ul li ul li {
|
#searchbars ul li ul li {
|
||||||
margin: 0
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
.last_read {width: 15px; height: 15px; background: url(images/go_last_read.png) no-repeat center center; margin-left: 5px;}
|
.last_read {width: 15px; height: 15px; background: url(images/go_last_read.png) no-repeat center center; margin-left: 5px;}
|
||||||
.last_read a { border: none; width: 100%; height: 100%; display: block; }
|
.last_read a { border: none; width: 100%; height: 100%; display: block; }
|
||||||
.last_read a:hover { border: none; }
|
.last_read a:hover { border: none; }
|
||||||
strong.quoteheader {color: #666}
|
strong.quoteheader {color: #666;}
|
||||||
|
|
||||||
ul.collage_images {
|
ul.collage_images {
|
||||||
width: 650px !important;
|
width: 650px !important;
|
||||||
@ -27,8 +27,8 @@ ul.collage_images img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tr.torrent .bookmark > a:before { content:""; }
|
tr.torrent .bookmark > a:before { content: ""; }
|
||||||
tr.torrent .bookmark > a:after { content:""; }
|
tr.torrent .bookmark > a:after { content: ""; }
|
||||||
|
|
||||||
.navigation_list li {
|
.navigation_list li {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
@ -765,8 +765,8 @@ ul.collage_images img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tr.torrent .bookmark > a:before { content:""; }
|
tr.torrent .bookmark > a:before { content: ""; }
|
||||||
tr.torrent .bookmark > a:after { content:""; }
|
tr.torrent .bookmark > a:after { content: ""; }
|
||||||
|
|
||||||
.navigation_list li {
|
.navigation_list li {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
Loading…
Reference in New Issue
Block a user