mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
0a565870d9
commit
b055e9c6f1
@ -70,7 +70,7 @@ function make_utf8($Str) {
|
||||
$Encoding = 'UTF-8';
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = mb_detect_encoding($Str,'UTF-8, ISO-8859-1');
|
||||
$Encoding = mb_detect_encoding($Str, 'UTF-8, ISO-8859-1');
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = 'ISO-8859-1';
|
||||
@ -78,7 +78,7 @@ function make_utf8($Str) {
|
||||
if ($Encoding == 'UTF-8') {
|
||||
return $Str;
|
||||
} else {
|
||||
return @mb_convert_encoding($Str,'UTF-8',$Encoding);
|
||||
return @mb_convert_encoding($Str, 'UTF-8', $Encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -108,9 +108,9 @@ function display_array($Array, $DontEscape = array()) {
|
||||
|
||||
function make_secret($Length = 32) {
|
||||
$Secret = '';
|
||||
$Chars='abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for($i=0; $i<$Length; $i++) {
|
||||
$Rand = mt_rand(0, strlen($Chars)-1);
|
||||
$Chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
||||
for ($i = 0; $i < $Length; $i++) {
|
||||
$Rand = mt_rand(0, strlen($Chars) - 1);
|
||||
$Secret .= substr($Chars, $Rand, 1);
|
||||
}
|
||||
return str_shuffle($Secret);
|
||||
|
@ -97,7 +97,7 @@ public function replace_value($Key, $Value, $Duration=2592000) {
|
||||
}
|
||||
|
||||
public function get_value($Key, $NoCache=false) {
|
||||
if(!$this->InternalCache) {
|
||||
if (!$this->InternalCache) {
|
||||
$NoCache = true;
|
||||
}
|
||||
$StartTime=microtime(true);
|
||||
|
@ -456,7 +456,7 @@ public function constant_table($Constants=false) {
|
||||
|
||||
public function cache_table($CacheKeys=false) {
|
||||
global $Cache;
|
||||
$Header = 'Cache Keys';
|
||||
$Header = 'Cache keys';
|
||||
if (!is_array($CacheKeys)) {
|
||||
$CacheKeys = $this->get_cache_keys();
|
||||
$Header .= ' ('.number_format($this->get_cache_time(), 5).' ms)';
|
||||
|
@ -63,4 +63,4 @@ public static function quote_notify($Body, $PostID, $Page, $PageID) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,13 @@ class ImageTools {
|
||||
* Store processed links to avoid repetition
|
||||
* @var array 'URL' => 'Parsed URL'
|
||||
*/
|
||||
static private $Storage = array();
|
||||
private static $Storage = array();
|
||||
|
||||
/**
|
||||
* We use true as an extra property to make the domain an array key
|
||||
* @var array $Hosts Array of image hosts
|
||||
*/
|
||||
static private $Hosts = array(
|
||||
private static $Hosts = array(
|
||||
'whatimg.com' => true,
|
||||
'imgur.com' => true
|
||||
);
|
||||
@ -24,7 +24,7 @@ class ImageTools {
|
||||
* Blacklisted sites
|
||||
* @var array $Blacklist Array of blacklisted hosts
|
||||
*/
|
||||
static private $Blacklist = array(
|
||||
private static $Blacklist = array(
|
||||
'tinypic.com'
|
||||
);
|
||||
|
||||
@ -32,7 +32,7 @@ class ImageTools {
|
||||
* Array of image hosts that provide thumbnailing
|
||||
* @var array $Thumbs
|
||||
*/
|
||||
static private $Thumbs = array(
|
||||
private static $Thumbs = array(
|
||||
'i.imgur.com' => true,
|
||||
'whatimg.com' => true
|
||||
);
|
||||
@ -41,7 +41,7 @@ class ImageTools {
|
||||
* Array of extensions
|
||||
* @var array $Extensions
|
||||
*/
|
||||
static private $Extensions = array(
|
||||
private static $Extensions = array(
|
||||
'jpg' => true,
|
||||
'jpeg' => true,
|
||||
'png' => true,
|
||||
@ -78,7 +78,7 @@ public static function blacklisted($Url) {
|
||||
* @param string $Url Link to an image
|
||||
* @return string|false Matched host or false
|
||||
*/
|
||||
public static function thumbnailable($Url) {
|
||||
private static function thumbnailable($Url) {
|
||||
$ParsedUrl = parse_url($Url);
|
||||
return !empty(self::$Thumbs[$ParsedUrl['host']]);
|
||||
}
|
||||
@ -88,7 +88,7 @@ public static function thumbnailable($Url) {
|
||||
* @param string $Ext Extension to check
|
||||
* @return boolean
|
||||
*/
|
||||
public static function valid_extension($Ext) {
|
||||
private static function valid_extension($Ext) {
|
||||
// return @self::$Extensions[$Ext] === true;
|
||||
return !empty(self::$Extensions[$Ext]) && self::$Extensions[$Ext] === true;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public static function valid_extension($Ext) {
|
||||
* @param type $Link
|
||||
* @param type $Processed
|
||||
*/
|
||||
public static function store($Link, $Processed) {
|
||||
private static function store($Link, $Processed) {
|
||||
self::$Storage[$Link] = $Processed;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ public static function store($Link, $Processed) {
|
||||
* @param type $Link
|
||||
* @return boolean|string Returns false if no match
|
||||
*/
|
||||
public static function get_stored($Link) {
|
||||
private static function get_stored($Link) {
|
||||
if (isset(self::$Storage[$Link])) {
|
||||
return self::$Storage[$Link];
|
||||
}
|
||||
@ -115,79 +115,34 @@ public static function get_stored($Link) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns link into thumbnail (if possible) or default group image (if missing)
|
||||
* Automatically applies proxy when appropriate
|
||||
*
|
||||
* @global array $CategoryIcons
|
||||
* @param string $Link Link to an image
|
||||
* @param int $Groupid The torrent's group ID for a default image
|
||||
* @param boolean $Thumb Thumbnail image
|
||||
* @return string Link to image
|
||||
* Checks if URL points to a whatimg thumbnail.
|
||||
*/
|
||||
public static function wiki_image($Link, $GroupID = 0, $Thumb = true) {
|
||||
global $CategoryIcons;
|
||||
|
||||
if ($Link && $Thumb) {
|
||||
$Thumb = self::thumbnail($Link);
|
||||
if (check_perms('site_proxy_images')) {
|
||||
return self::proxy_url($Thumb);
|
||||
}
|
||||
return $Thumb;
|
||||
}
|
||||
|
||||
return STATIC_SERVER . 'common/noartwork/' . $CategoryIcons[$GroupID];
|
||||
private static function has_whatimg_thumb($Url) {
|
||||
return (strpos($Url, '_thumb') !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
* The main function called to get a thumbnail link.
|
||||
* Use wiki_image() instead of this method for more advanced options
|
||||
*
|
||||
* @param string $Link Image link
|
||||
* @return string Image link
|
||||
* Cleans up imgur URL if it already has a modifier attached to the end of it.
|
||||
*/
|
||||
public static function thumbnail($Link) {
|
||||
if (($Found = self::get_stored($Link))) {
|
||||
return $Found;
|
||||
}
|
||||
return self::process_thumbnail($Link);
|
||||
private static function clean_imgur_url($Url) {
|
||||
$Extension = pathinfo($Url, PATHINFO_EXTENSION);
|
||||
$Full = preg_replace('/\.[^.]*$/', '', $Url);
|
||||
$Base = substr($Full, 0, strrpos($Full, '/'));
|
||||
$Path = substr($Full, strrpos($Full, '/') + 1);
|
||||
if (strlen($Path) == 6) {
|
||||
$Last = $Path[strlen($Path) - 1];
|
||||
if ($Last == 'm' || $Last == 'l' || $Last == 's' || $Last == 'h' || $Last == 'b') {
|
||||
$Path = substr($Path, 0, -1);
|
||||
}
|
||||
}
|
||||
return $Base . '/' . $Path . '.' . $Extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Matches a hosts that thumbnails and stores link
|
||||
* @param string $Link Image link
|
||||
* @return string Thumbnail link or Image link
|
||||
* Replaces the extension.
|
||||
*/
|
||||
static private function process_thumbnail($Link) {
|
||||
$Thumb = $Link;
|
||||
$Extension = pathinfo($Link, PATHINFO_EXTENSION);
|
||||
|
||||
if (self::thumbnailable($Link) && self::valid_extension($Extension)) {
|
||||
if (contains('whatimg', $Link) && !has_whatimg_thumb($Link)) {
|
||||
$Thumb = replace_extension($Link, '_thumb.' . $Extension);
|
||||
} elseif (contains('imgur', $Link)) {
|
||||
$Thumb = replace_extension(clean_imgur_url($Link), 'm.' . $Extension);
|
||||
}
|
||||
}
|
||||
self::store($Link, $Thumb);
|
||||
return $Thumb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an HTML thumbnail
|
||||
* @param type $Source
|
||||
* @param type $Category
|
||||
* @param type $Size
|
||||
*/
|
||||
public static function cover_thumb($Source, $Category = 0, $Size = 90, $Title = 'Cover') {
|
||||
$Img = self::wiki_image($Source, $Category);
|
||||
if (!$Source) {
|
||||
$Source = $Img;
|
||||
} elseif (check_perms('site_proxy_images')) {
|
||||
$Source = self::proxy_url($Source);
|
||||
}
|
||||
?>
|
||||
<img src="<?=$Img?>" width="<?=$Size?>" height="<?=$Size?>" alt="<?=$Title?>" onclick="lightbox.init('<?=$Source?>', <?=$Size?>)" />
|
||||
<?
|
||||
private static function replace_extension($String, $Extension) {
|
||||
return preg_replace('/\.[^.]*$/', $Extension, $String);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,48 +152,70 @@ public static function cover_thumb($Source, $Category = 0, $Size = 90, $Title =
|
||||
*/
|
||||
public static function proxy_url($Url) {
|
||||
global $SSL;
|
||||
return ($SSL ? 'https' : 'http') . '://' . SITE_URL
|
||||
. '/image.php?i=' . urlencode($Url);
|
||||
return ($SSL ? 'https' : 'http') . '://' . SITE_URL . '/image.php?c=1&i=' . urlencode($Url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This non-class determines the thumbnail equivalent of an image's URL after being passed the original
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the extension.
|
||||
*/
|
||||
function replace_extension($String, $Extension) {
|
||||
return preg_replace('/\.[^.]*$/', $Extension, $String);
|
||||
}
|
||||
|
||||
function contains($Substring, $String) {
|
||||
return strpos($String, $Substring) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if URL points to a whatimg thumbnail.
|
||||
*/
|
||||
function has_whatimg_thumb($Url) {
|
||||
return contains("_thumb", $Url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up imgur URL if it already has a modifier attached to the end of it.
|
||||
*/
|
||||
function clean_imgur_url($Url) {
|
||||
$Extension = pathinfo($Url, PATHINFO_EXTENSION);
|
||||
$Full = preg_replace('/\.[^.]*$/', '', $Url);
|
||||
$Base = substr($Full, 0, strrpos($Full, '/'));
|
||||
$Path = substr($Full, strrpos($Full, '/') + 1);
|
||||
if (strlen($Path) == 6) {
|
||||
$Last = $Path[strlen($Path) - 1];
|
||||
if ($Last == 'm' || $Last == 'l' || $Last == 's' || $Last == 'h' || $Last == 'b') {
|
||||
$Path = substr($Path, 0, -1);
|
||||
/**
|
||||
* Determine the image URL. This takes care of the image proxy and thumbnailing.
|
||||
* @param string $Url
|
||||
* @param bool $Thumb
|
||||
* @return string
|
||||
*/
|
||||
public static function process($Url, $Thumb = false) {
|
||||
global $LoggedUser;
|
||||
if (empty($Url)) {
|
||||
return '';
|
||||
}
|
||||
if (($Found = self::get_stored($Url . ($Thumb ? '_thumb' : '')))) {
|
||||
return $Found;
|
||||
}
|
||||
|
||||
$ProcessedUrl = $Url;
|
||||
if ($Thumb) {
|
||||
$Extension = pathinfo($Url, PATHINFO_EXTENSION);
|
||||
if (self::thumbnailable($Url) && self::valid_extension($Extension)) {
|
||||
if (strpos($Url, 'whatimg') !== false && !self::has_whatimg_thumb($Url)) {
|
||||
$ProcessedUrl = self::replace_extension($Url, '_thumb.' . $Extension);
|
||||
} elseif (strpos($Url, 'imgur') !== false) {
|
||||
$ProcessedUrl = self::replace_extension(self::clean_imgur_url($Url), 'm.' . $Extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($LoggedUser['Permissions'])) {
|
||||
/*
|
||||
* We only want to apply the proxy and store the processed URL if the
|
||||
* permissions were loaded before. This is necessary because self::process
|
||||
* is used in Users::user_info which is called in script_start.php before
|
||||
* the permissions are loaded, causing the own avatar to always load without
|
||||
* proxy later on.
|
||||
*/
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$ProcessedUrl = self::proxy_url($ProcessedUrl);
|
||||
}
|
||||
|
||||
self::store($Url . ($Thumb ? '_thumb' : ''), $ProcessedUrl);
|
||||
}
|
||||
return $ProcessedUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cover art thumbnail in browse, on artist pages etc.
|
||||
* @global array $CategoryIcons
|
||||
* @param string $Url
|
||||
* @param int $CategoryID
|
||||
*/
|
||||
public static function cover_thumb($Url, $CategoryID) {
|
||||
global $CategoryIcons;
|
||||
if ($Url) {
|
||||
$Src = self::process($Url, true);
|
||||
$Lightbox = self::process($Url);
|
||||
} else {
|
||||
$Src = STATIC_SERVER . 'common/noartwork/' . $CategoryIcons[$CategoryID - 1];
|
||||
$Lightbox = $Src;
|
||||
}
|
||||
?>
|
||||
<img src="<?=$Src?>" width="90" height="90" alt="Cover" onclick="lightbox.init('<?=$Lightbox?>', 90)" />
|
||||
<?
|
||||
}
|
||||
return $Base . '/' . $Path . '.' . $Extension;
|
||||
}
|
||||
|
@ -50,51 +50,54 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
|
||||
if ($Property == false) {
|
||||
return false;
|
||||
}
|
||||
if(!is_array($Paranoia)) {
|
||||
if (!is_array($Paranoia)) {
|
||||
$Paranoia = unserialize($Paranoia);
|
||||
}
|
||||
if(!is_array($Paranoia)) {
|
||||
if (!is_array($Paranoia)) {
|
||||
$Paranoia = array();
|
||||
}
|
||||
if(is_array($Property)) {
|
||||
if (is_array($Property)) {
|
||||
$all = true;
|
||||
foreach ($Property as $P) { $all = $all && check_paranoia($P, $Paranoia, $UserClass, $UserID); }
|
||||
foreach ($Property as $P) {
|
||||
$all = $all && check_paranoia($P, $Paranoia, $UserClass, $UserID);
|
||||
}
|
||||
return $all;
|
||||
} else {
|
||||
if(($UserID !== false) && ($LoggedUser['ID'] == $UserID)) {
|
||||
if (($UserID !== false) && ($LoggedUser['ID'] == $UserID)) {
|
||||
return PARANOIA_ALLOWED;
|
||||
}
|
||||
|
||||
$May = !in_array($Property, $Paranoia) && !in_array($Property . '+', $Paranoia);
|
||||
if($May)
|
||||
if ($May)
|
||||
return PARANOIA_ALLOWED;
|
||||
|
||||
if(check_perms('users_override_paranoia', $UserClass))
|
||||
if (check_perms('users_override_paranoia', $UserClass)) {
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
}
|
||||
$Override=false;
|
||||
switch ($Property) {
|
||||
case 'downloaded':
|
||||
case 'ratio':
|
||||
case 'uploaded':
|
||||
case 'lastseen':
|
||||
if(check_perms('users_mod', $UserClass))
|
||||
if (check_perms('users_mod', $UserClass))
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
break;
|
||||
case 'snatched': case 'snatched+':
|
||||
if(check_perms('users_view_torrents_snatchlist', $UserClass))
|
||||
if (check_perms('users_view_torrents_snatchlist', $UserClass))
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
break;
|
||||
case 'uploads': case 'uploads+':
|
||||
case 'seeding': case 'seeding+':
|
||||
case 'leeching': case 'leeching+':
|
||||
if(check_perms('users_view_seedleech', $UserClass))
|
||||
if (check_perms('users_view_seedleech', $UserClass))
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
break;
|
||||
case 'invitedcount':
|
||||
if(check_perms('users_view_invites', $UserClass))
|
||||
if (check_perms('users_view_invites', $UserClass))
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?
|
||||
//Require base class
|
||||
if(!extension_loaded('sphinx')) {
|
||||
if (!extension_loaded('sphinx')) {
|
||||
require(SERVER_ROOT.'/classes/sphinxapi.php');
|
||||
}
|
||||
|
||||
@ -51,17 +51,17 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
$QueryEndTime=microtime(true);
|
||||
|
||||
$Filters = array();
|
||||
foreach($this->Filters as $Name => $Values) {
|
||||
foreach($Values as $Value) {
|
||||
foreach ($this->Filters as $Name => $Values) {
|
||||
foreach ($Values as $Value) {
|
||||
$Filters[] = $Name." - ".$Value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->Queries[]=array('Params: '.$Query.' Filters: '.implode(", ", $Filters).' Indicies: '.$this->Index,($QueryEndTime-$QueryStartTime)*1000);
|
||||
$this->Time+=($QueryEndTime-$QueryStartTime)*1000;
|
||||
$this->Queries[] = array('Params: '.$Query.' Filters: '.implode(", ", $Filters).' Indicies: '.$this->Index,($QueryEndTime-$QueryStartTime) * 1000);
|
||||
$this->Time += ($QueryEndTime-$QueryStartTime) * 1000;
|
||||
|
||||
if($Result === false) {
|
||||
if($this->_connerror && !$Cache->get_value('sphinx_crash_reported')) {
|
||||
if ($Result === false) {
|
||||
if ($this->_connerror && !$Cache->get_value('sphinx_crash_reported')) {
|
||||
send_irc('PRIVMSG '.ADMIN_CHAN.' :!dev Connection to searchd failed');
|
||||
$Cache->cache_value('sphinx_crash_reported', 1, 3600);
|
||||
}
|
||||
@ -71,7 +71,7 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
$this->TotalResults = $Result['total_found'];
|
||||
$this->SearchTime = $Result['time'];
|
||||
|
||||
if(empty($Result['matches'])) {
|
||||
if (empty($Result['matches'])) {
|
||||
return false;
|
||||
}
|
||||
$Matches = $Result['matches'];
|
||||
@ -82,49 +82,49 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
|
||||
$NotFound = array();
|
||||
$Skip = array();
|
||||
if(!empty($ReturnData)) {
|
||||
if (!empty($ReturnData)) {
|
||||
$AllFields = false;
|
||||
} else {
|
||||
$AllFields = true;
|
||||
}
|
||||
|
||||
foreach($MatchIDs as $Match) {
|
||||
foreach ($MatchIDs as $Match) {
|
||||
$Matches[$Match] = $Matches[$Match]['attrs'];
|
||||
if(!empty($CachePrefix)) {
|
||||
if (!empty($CachePrefix)) {
|
||||
$Data = $Cache->get_value($CachePrefix.'_'.$Match);
|
||||
if($Data == false) {
|
||||
$NotFound[]=$Match;
|
||||
if ($Data == false) {
|
||||
$NotFound[] = $Match;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$NotFound[]=$Match;
|
||||
$NotFound[] = $Match;
|
||||
}
|
||||
if(!$AllFields) {
|
||||
if (!$AllFields) {
|
||||
// Populate list of fields to unset (faster than picking out the ones we need). Should only be run once, on the first cache key
|
||||
if(empty($Skip)) {
|
||||
foreach(array_keys($Data) as $Key) {
|
||||
if(!in_array($Key, $ReturnData)) {
|
||||
$Skip[]=$Key;
|
||||
if (empty($Skip)) {
|
||||
foreach (array_keys($Data) as $Key) {
|
||||
if (!in_array($Key, $ReturnData)) {
|
||||
$Skip[] = $Key;
|
||||
}
|
||||
}
|
||||
if(empty($Skip)) {
|
||||
if (empty($Skip)) {
|
||||
$AllFields = true;
|
||||
}
|
||||
}
|
||||
foreach($Skip as $Key) {
|
||||
foreach ($Skip as $Key) {
|
||||
unset($Data[$Key]);
|
||||
}
|
||||
reset($Skip);
|
||||
}
|
||||
if(!empty($Data)) {
|
||||
if (!empty($Data)) {
|
||||
$Matches[$Match] = array_merge($Matches[$Match], $Data);
|
||||
}
|
||||
}
|
||||
|
||||
if($SQL!='') {
|
||||
if(!empty($NotFound)) {
|
||||
if ($SQL != '') {
|
||||
if (!empty($NotFound)) {
|
||||
$DB->query(str_replace('%ids', implode(',',$NotFound), $SQL));
|
||||
while($Data = $DB->next_record(MYSQLI_ASSOC)) {
|
||||
while ($Data = $DB->next_record(MYSQLI_ASSOC)) {
|
||||
$Matches[$Data[$IDColumn]] = array_merge($Matches[$Data[$IDColumn]], $Data);
|
||||
$Cache->cache_value($CachePrefix.'_'.$Data[$IDColumn], $Data, $CacheLength);
|
||||
}
|
||||
@ -148,8 +148,8 @@ function set_index($Index) {
|
||||
}
|
||||
|
||||
function set_filter($Name, $Vals, $Exclude=false) {
|
||||
foreach($Vals as $Val) {
|
||||
if($Exclude) {
|
||||
foreach ($Vals as $Val) {
|
||||
if ($Exclude) {
|
||||
$this->Filters[$Name][] = "!$Val";
|
||||
} else {
|
||||
$this->Filters[$Name][] = $Val;
|
||||
|
@ -38,7 +38,7 @@ public function __construct($Server, $Port, $Socket) {
|
||||
* @return identification string
|
||||
*/
|
||||
private function get_ident($Server, $Port, $Socket) {
|
||||
if($Socket) {
|
||||
if ($Socket) {
|
||||
return $Socket;
|
||||
} else {
|
||||
return "$Server:$Port";
|
||||
@ -55,7 +55,7 @@ private function get_ident($Server, $Port, $Socket) {
|
||||
*/
|
||||
public static function init_connection($Server, $Port, $Socket) {
|
||||
$Ident = self::get_ident($Server, $Port, $Socket);
|
||||
if(!isset(self::$Connections[$Ident])) {
|
||||
if (!isset(self::$Connections[$Ident])) {
|
||||
self::$Connections[$Ident] = new Sphinxql($Server, $Port, $Socket);
|
||||
}
|
||||
return self::$Connections[$Ident];
|
||||
@ -65,11 +65,11 @@ public static function init_connection($Server, $Port, $Socket) {
|
||||
* Connect the Sphinxql object to the Sphinx server
|
||||
*/
|
||||
public function connect() {
|
||||
if(!$this->Connected) {
|
||||
if (!$this->Connected) {
|
||||
global $Debug;
|
||||
$Debug->set_flag('Connecting to Sphinx server '.$this->Ident);
|
||||
parent::__construct($this->Server, '', '', '', $this->Port, $this->Socket);
|
||||
if($this->connect_error) {
|
||||
if ($this->connect_error) {
|
||||
$Errno = $this->connect_errno;
|
||||
$Error = $this->connect_error;
|
||||
$this->error("Connection failed. ".strval($Errno)." (".strval($Error).")");
|
||||
@ -90,10 +90,10 @@ public function error($Msg, $Halt = false) {
|
||||
global $Debug;
|
||||
$ErrorMsg = 'SphinxQL ('.$this->Ident.'): '.strval($Msg);
|
||||
$Debug->analysis('SphinxQL Error', $ErrorMsg, 3600*24);
|
||||
if($Halt === true && (DEBUG_MODE || check_perms('site_debug'))) {
|
||||
if ($Halt === true && (DEBUG_MODE || check_perms('site_debug'))) {
|
||||
echo '<pre>'.display_str($ErrorMsg).'</pre>';
|
||||
die();
|
||||
} elseif($Halt === true) {
|
||||
} elseif ($Halt === true) {
|
||||
error('-1');
|
||||
}
|
||||
}
|
||||
|
@ -56,26 +56,26 @@ public function from($Indexes) {
|
||||
* @return current Sphinxql query object
|
||||
*/
|
||||
public function where($Attribute, $Values, $Exclude = false) {
|
||||
if(empty($Attribute) && empty($Values)) {
|
||||
if (empty($Attribute) && empty($Values)) {
|
||||
return false;
|
||||
}
|
||||
$Filters = array();
|
||||
if(is_array($Values)) {
|
||||
foreach($Values as $Value) {
|
||||
if(!is_number($Value)) {
|
||||
if (is_array($Values)) {
|
||||
foreach ($Values as $Value) {
|
||||
if (!is_number($Value)) {
|
||||
$this->error("Filters require numeric values");
|
||||
}
|
||||
}
|
||||
if($Exclude) {
|
||||
if ($Exclude) {
|
||||
$Filters[] = "$Attribute NOT IN (".implode(",", $Values).")";
|
||||
} else {
|
||||
$Filters[] = "$Attribute IN (".implode(",", $Values).")";
|
||||
}
|
||||
} else {
|
||||
if(!is_number($Values)) {
|
||||
if (!is_number($Values)) {
|
||||
$this->error("Filters require numeric values");
|
||||
}
|
||||
if($Exclude) {
|
||||
if ($Exclude) {
|
||||
$Filters[] = "$Attribute != $Values";
|
||||
} else {
|
||||
$Filters[] = "$Attribute = $Values";
|
||||
@ -93,7 +93,7 @@ public function where($Attribute, $Values, $Exclude = false) {
|
||||
* @return current Sphinxql query object
|
||||
*/
|
||||
public function where_between($Attribute, $Values) {
|
||||
if(empty($Attribute) || empty($Values) || count($Values) != 2 || !is_number($Values[0]) || !is_number($Values[1])) {
|
||||
if (empty($Attribute) || empty($Values) || count($Values) != 2 || !is_number($Values[0]) || !is_number($Values[1])) {
|
||||
$this->error("Filter range requires array of two numerical boundaries as values.");
|
||||
}
|
||||
$this->Filters[] = "$Attribute BETWEEN $Values[0] AND $Values[1]";
|
||||
@ -109,7 +109,7 @@ public function where_between($Attribute, $Values) {
|
||||
* @return current Sphinxql query object
|
||||
*/
|
||||
public function where_match($Expr, $Field = '*', $Escape = true) {
|
||||
if(empty($Expr)) {
|
||||
if (empty($Expr)) {
|
||||
return $this;
|
||||
}
|
||||
if ($Field !== false) {
|
||||
@ -216,29 +216,29 @@ private function build_options() {
|
||||
* Combine the query conditions into a valid Sphinx query segment
|
||||
*/
|
||||
private function build_query() {
|
||||
if(!$this->Indexes) {
|
||||
if (!$this->Indexes) {
|
||||
$this->error('Index name is required.');
|
||||
}
|
||||
$this->QueryString = "SELECT $this->Select\nFROM $this->Indexes";
|
||||
if(!empty($this->Expressions)) {
|
||||
if (!empty($this->Expressions)) {
|
||||
$this->Filters['expr'] = "MATCH('".implode(" ", $this->Expressions)."')";
|
||||
}
|
||||
if(!empty($this->Filters)) {
|
||||
if (!empty($this->Filters)) {
|
||||
$this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters);
|
||||
}
|
||||
if(!empty($this->GroupBy)) {
|
||||
if (!empty($this->GroupBy)) {
|
||||
$this->QueryString .= "\nGROUP BY $this->GroupBy";
|
||||
}
|
||||
if(!empty($this->SortGroupBy)) {
|
||||
if (!empty($this->SortGroupBy)) {
|
||||
$this->QueryString .= "\nWITHIN GROUP ORDER BY $this->SortGroupBy";
|
||||
}
|
||||
if(!empty($this->SortBy)) {
|
||||
if (!empty($this->SortBy)) {
|
||||
$this->QueryString .= "\nORDER BY ".implode(", ", $this->SortBy);
|
||||
}
|
||||
if(!empty($this->Limits)) {
|
||||
if (!empty($this->Limits)) {
|
||||
$this->QueryString .= "\nLIMIT $this->Limits";
|
||||
}
|
||||
if(!empty($this->Options)) {
|
||||
if (!empty($this->Options)) {
|
||||
$Options = $this->build_options();
|
||||
$this->QueryString .= "\nOPTION $Options";
|
||||
}
|
||||
@ -279,12 +279,12 @@ public function raw_query($Query, $GetMeta = true) {
|
||||
* @return Sphinxql result object
|
||||
*/
|
||||
private function send_query($GetMeta) {
|
||||
if(!$this->QueryString) {
|
||||
if (!$this->QueryString) {
|
||||
return false;
|
||||
}
|
||||
$this->Sphinxql->connect();
|
||||
$Result = $this->Sphinxql->query($this->QueryString);
|
||||
if($Result === false) {
|
||||
if ($Result === false) {
|
||||
$Errno = $this->Sphinxql->errno;
|
||||
$Error = $this->Sphinxql->error;
|
||||
$this->error("Query returned error $Errno ($Error).\n$this->QueryString");
|
||||
|
@ -39,7 +39,7 @@ public function __call($Name, $Arguments) {
|
||||
*/
|
||||
public function collect($Key) {
|
||||
$Return = array();
|
||||
while($Row = $this->fetch_array()) {
|
||||
while ($Row = $this->fetch_array()) {
|
||||
$Return[] = $Row[$Key];
|
||||
}
|
||||
$this->data_seek(0);
|
||||
@ -55,8 +55,8 @@ public function collect($Key) {
|
||||
*/
|
||||
public function to_array($Key, $ResultType = MYSQLI_ASSOC) {
|
||||
$Return = array();
|
||||
while($Row = $this->fetch_array($ResultType)) {
|
||||
if($Key !== false) {
|
||||
while ($Row = $this->fetch_array($ResultType)) {
|
||||
if ($Key !== false) {
|
||||
$Return[$Row[$Key]] = $Row;
|
||||
} else {
|
||||
$Return[] = $Row;
|
||||
@ -75,7 +75,7 @@ public function to_array($Key, $ResultType = MYSQLI_ASSOC) {
|
||||
*/
|
||||
public function to_pair($Key1, $Key2) {
|
||||
$Return = array();
|
||||
while($Row = $this->fetch_array()) {
|
||||
while ($Row = $this->fetch_array()) {
|
||||
$Return[$Row[$Key1]] = $Row[$Key2];
|
||||
}
|
||||
$this->data_seek(0);
|
||||
@ -89,11 +89,11 @@ public function to_pair($Key1, $Key2) {
|
||||
* @return array with meta data
|
||||
*/
|
||||
public function get_meta($Keys = false) {
|
||||
if($Keys !== false) {
|
||||
if(is_array($Keys)) {
|
||||
if ($Keys !== false) {
|
||||
if (is_array($Keys)) {
|
||||
$Return = array();
|
||||
foreach($Keys as $Key) {
|
||||
if(!isset($this->Meta[$Key])) {
|
||||
foreach ($Keys as $Key) {
|
||||
if (!isset($this->Meta[$Key])) {
|
||||
continue;
|
||||
}
|
||||
$Return[$Key] = $this->Meta[$Key];
|
||||
@ -114,11 +114,11 @@ public function get_meta($Keys = false) {
|
||||
* @return array with result information
|
||||
*/
|
||||
public function get_result_info($Keys = false) {
|
||||
if($Keys !== false) {
|
||||
if(is_array($Keys)) {
|
||||
if ($Keys !== false) {
|
||||
if (is_array($Keys)) {
|
||||
$Return = array();
|
||||
foreach($Keys as $Key) {
|
||||
if(!isset($this->Result->$Key)) {
|
||||
foreach ($Keys as $Key) {
|
||||
if (!isset($this->Result->$Key)) {
|
||||
continue;
|
||||
}
|
||||
$Return[$Key] = $this->Result->$Key;
|
||||
|
@ -6,15 +6,15 @@
|
||||
// $TPL->get();
|
||||
|
||||
class TEMPLATE {
|
||||
var $file='';
|
||||
var $vars=array();
|
||||
var $file = '';
|
||||
var $vars = array();
|
||||
|
||||
function open($file) {
|
||||
$this->file=file($file);
|
||||
$this->file = file($file);
|
||||
}
|
||||
|
||||
function set($name,$var,$ifnone='<span style="font-style: italic;">-None-</span>') {
|
||||
if ($name!='') {
|
||||
if ($name != '') {
|
||||
$this->vars[$name][0]=$var;
|
||||
$this->vars[$name][1]=$ifnone;
|
||||
}
|
||||
@ -22,24 +22,28 @@ function set($name,$var,$ifnone='<span style="font-style: italic;">-None-</span>
|
||||
|
||||
function show() {
|
||||
$TMPVAR='';
|
||||
for($i=0; $i<sizeof($this->file); $i++) {
|
||||
for ($i=0; $i<sizeof($this->file); $i++) {
|
||||
$TMPVAR=$this->file[$i];
|
||||
foreach($this->vars as $k=>$v) {
|
||||
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; }
|
||||
$TMPVAR=str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
foreach ($this->vars as $k=>$v) {
|
||||
if ($v[1] != '' && $v[0] == '') {
|
||||
$v[0] = $v[1];
|
||||
}
|
||||
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
}
|
||||
print $TMPVAR;
|
||||
}
|
||||
}
|
||||
|
||||
function get() {
|
||||
$RESULT='';
|
||||
$TMPVAR='';
|
||||
for($i=0; $i<sizeof($this->file); $i++) {
|
||||
$RESULT = '';
|
||||
$TMPVAR = '';
|
||||
for ($i = 0; $i < sizeof($this->file); $i++) {
|
||||
$TMPVAR=$this->file[$i];
|
||||
foreach($this->vars as $k=>$v) {
|
||||
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; }
|
||||
$TMPVAR=str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
foreach ($this->vars as $k=>$v) {
|
||||
if ($v[1] != '' && $v[0] == '') {
|
||||
$v[0] = $v[1];
|
||||
}
|
||||
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
}
|
||||
$RESULT.=$TMPVAR;
|
||||
}
|
||||
@ -47,33 +51,32 @@ function get() {
|
||||
}
|
||||
|
||||
function str_align($len,$str,$align,$fill) {
|
||||
$strlen=strlen($str);
|
||||
if ($strlen>$len) {
|
||||
$strlen = strlen($str);
|
||||
if ($strlen > $len) {
|
||||
return substr($str, 0, $len);
|
||||
|
||||
} elseif (($strlen==0)||($len==0)) {
|
||||
} elseif (($strlen == 0) || ($len == 0)) {
|
||||
return '';
|
||||
|
||||
} else {
|
||||
if (($align=='l')||($align=='left')) {
|
||||
$result=$str.str_repeat($fill,($len-$strlen));
|
||||
if (($align == 'l') || ($align == 'left')) {
|
||||
$result = $str.str_repeat($fill,($len - $strlen));
|
||||
|
||||
} elseif (($align=='r')||($align=='right')) {
|
||||
$result=str_repeat($fill,($len-$strlen)).$str;
|
||||
} elseif (($align == 'r') || ($align == 'right')) {
|
||||
$result = str_repeat($fill,($len - $strlen)).$str;
|
||||
|
||||
} elseif (($align=='c')||($align=='center')) {
|
||||
$snm=intval(($len-$strlen)/2);
|
||||
if (($strlen+($snm*2))==$len) {
|
||||
$result=str_repeat($fill,$snm).$str;
|
||||
} elseif (($align == 'c') || ($align == 'center')) {
|
||||
$snm = intval(($len - $strlen) / 2);
|
||||
if (($strlen + ($snm * 2)) == $len) {
|
||||
$result = str_repeat($fill,$snm).$str;
|
||||
|
||||
} else {
|
||||
$result=str_repeat($fill,$snm+1).$str;
|
||||
$result = str_repeat($fill,$snm + 1).$str;
|
||||
|
||||
}
|
||||
|
||||
$result.=str_repeat($fill,$snm);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ private function to_html ($Array) {
|
||||
}
|
||||
}
|
||||
$Str.='<blockquote>'.$this->to_html($Block['Val']).'</blockquote>';
|
||||
if($this->InQuotes == $this->NestsBeforeHide) { //Close quote the deeply nested quote [hide].
|
||||
if ($this->InQuotes == $this->NestsBeforeHide) { //Close quote the deeply nested quote [hide].
|
||||
$Str.='</blockquote><br />'; // Ensure new line after quote train hiding
|
||||
}
|
||||
$this->NoImg--;
|
||||
@ -772,10 +772,8 @@ private function to_html ($Array) {
|
||||
$LocalURL = $this->local_url($Block['Val']);
|
||||
if ($LocalURL) {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$LocalURL.'" />';
|
||||
} elseif (check_perms('site_proxy_images')) {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -543,11 +543,7 @@ function to_html($Array) {
|
||||
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
|
||||
$Str.='[img]'.$Block['Val'].'[/img]';
|
||||
} else {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
}
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -286,8 +286,8 @@ function parse($Str) {
|
||||
$i = $CloseTag; // 5d) Move the pointer past the end of the [/close] tag.
|
||||
} else {
|
||||
//5b) If it's a normal tag, it may have versions of itself nested inside
|
||||
$CloseTag = $i-1;
|
||||
$InTagPos = $i-1;
|
||||
$CloseTag = $i - 1;
|
||||
$InTagPos = $i - 1;
|
||||
$NumInOpens = 0;
|
||||
$NumInCloses = -1;
|
||||
|
||||
@ -318,7 +318,7 @@ function parse($Str) {
|
||||
$NumInOpens++;
|
||||
}
|
||||
|
||||
} while($NumInOpens>$NumInCloses);
|
||||
} while ($NumInOpens > $NumInCloses);
|
||||
|
||||
|
||||
// Find the internal block inside the tag
|
||||
@ -504,11 +504,7 @@ function to_html($Array) {
|
||||
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
|
||||
$Str.='[img]'.$Block['Val'].'[/img]';
|
||||
} else {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
}
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3,8 +3,7 @@
|
||||
* This super class is used to manage the ammount of textareas there are and to
|
||||
* generate the required JavaScript that enables the previews to work.
|
||||
*/
|
||||
class TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
class TEXTAREA_PREVIEW_SUPER {
|
||||
/**
|
||||
* @static
|
||||
* @var int $Textareas Total number of textareas created
|
||||
@ -37,11 +36,13 @@ class TEXTAREA_PREVIEW_SUPER
|
||||
* @example <pre><?php TEXT_PREVIEW::JavaScript(); ?></pre>
|
||||
* @return void
|
||||
*/
|
||||
static public function JavaScript ($all = true)
|
||||
{
|
||||
if (self::$Textareas === 0) return;
|
||||
if (self::$Exectuted === false && $all)
|
||||
static public function JavaScript ($all = true) {
|
||||
if (self::$Textareas === 0) {
|
||||
return;
|
||||
}
|
||||
if (self::$Exectuted === false && $all) {
|
||||
View::parse('generic/textarea/script.phtml');
|
||||
}
|
||||
|
||||
self::$Exectuted = true;
|
||||
self::iterator();
|
||||
@ -55,10 +56,9 @@ static public function JavaScript ($all = true)
|
||||
* @static
|
||||
* @return void
|
||||
*/
|
||||
static private function iterator ()
|
||||
{
|
||||
static private function iterator () {
|
||||
$script = array();
|
||||
for($i = 0; $i < self::$Textareas; $i++) {
|
||||
for ($i = 0; $i < self::$Textareas; $i++) {
|
||||
if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
|
||||
$a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
|
||||
} else {
|
||||
@ -66,9 +66,9 @@ static private function iterator ()
|
||||
}
|
||||
$script[] = sprintf('[%s]', $a);
|
||||
}
|
||||
if (!empty($script))
|
||||
View::parse('generic/textarea/script_factory.phtml',
|
||||
array('script' => join(', ', $script)));
|
||||
if (!empty($script)) {
|
||||
View::parse('generic/textarea/script_factory.phtml', array('script' => join(', ', $script)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,8 +111,7 @@ static private function iterator ()
|
||||
* </div>
|
||||
* </pre>
|
||||
*/
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER {
|
||||
/**
|
||||
* @var int Unique ID
|
||||
*/
|
||||
@ -157,14 +156,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
|
||||
parent::$Textareas += 1;
|
||||
array_push(parent::$_ID, $ID);
|
||||
|
||||
if (empty($ID)) $ID = 'quickpost_' . $this->id;
|
||||
if (empty($ID)) {
|
||||
$ID = 'quickpost_' . $this->id;
|
||||
}
|
||||
|
||||
if (!empty($ExtraAttributes))
|
||||
if (!empty($ExtraAttributes)) {
|
||||
$Attributes = ' ' . implode(' ', $ExtraAttributes);
|
||||
else
|
||||
} else {
|
||||
$Attributes = '';
|
||||
}
|
||||
|
||||
if ($Preview === true) $this->preview();
|
||||
if ($Preview === true) {
|
||||
$this->preview();
|
||||
}
|
||||
|
||||
$this->buffer = View::parse('generic/textarea/textarea.phtml', array(
|
||||
'ID' => $ID,
|
||||
@ -176,17 +180,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
|
||||
'Attributes' => &$Attributes
|
||||
), $Buffer);
|
||||
|
||||
if ($Buttons === true) $this->buttons();
|
||||
if ($Buttons === true) {
|
||||
$this->buttons();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the divs required for previewing the AJAX content
|
||||
* Will only output once
|
||||
*/
|
||||
public function preview ()
|
||||
{
|
||||
if (!$this->preview)
|
||||
public function preview () {
|
||||
if (!$this->preview) {
|
||||
View::parse('generic/textarea/preview.phtml', array('ID' => $this->id));
|
||||
}
|
||||
$this->preview = true;
|
||||
}
|
||||
|
||||
@ -194,16 +200,14 @@ public function preview ()
|
||||
* Outputs the preview and edit buttons
|
||||
* Can be called many times to place buttons in different areas
|
||||
*/
|
||||
public function buttons ()
|
||||
{
|
||||
public function buttons () {
|
||||
View::parse('generic/textarea/buttons.phtml', array('ID' => $this->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the textarea's numeric ID.
|
||||
*/
|
||||
public function getID ()
|
||||
{
|
||||
public function getID () {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
@ -211,8 +215,7 @@ public function getID ()
|
||||
* Returns textarea string when buffer is enabled in the constructor
|
||||
* @return string
|
||||
*/
|
||||
public function getBuffer ()
|
||||
{
|
||||
public function getBuffer () {
|
||||
return $this->buffer;
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ function time_diff($TimeStamp, $Levels=2, $Span=true, $Lowercase=false) {
|
||||
if ($Return != '') {
|
||||
$Return.=' and ';
|
||||
}
|
||||
if ($Minutes>1) {
|
||||
if ($Minutes > 1) {
|
||||
$Return.=$Minutes.' mins';
|
||||
} else {
|
||||
$Return.=$Minutes.' min';
|
||||
|
@ -172,7 +172,7 @@ public static function disable_users($UserIDs, $AdminComment, $BanReason = 1) {
|
||||
$Cache->delete_value('user_stats_'.$UserID);
|
||||
|
||||
$DB->query("SELECT SessionID FROM users_sessions WHERE UserID='$UserID' AND Active = 1");
|
||||
while(list($SessionID) = $DB->next_record()) {
|
||||
while (list($SessionID) = $DB->next_record()) {
|
||||
$Cache->delete_value('session_'.$UserID.'_'.$SessionID);
|
||||
}
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
|
@ -81,7 +81,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
||||
g.ID, g.Name, g.Year, g.RecordLabel, g.CatalogueNumber, g.TagList, g.ReleaseType, g.VanityHouse, g.WikiImage, g.CategoryID
|
||||
FROM torrents_group AS g WHERE g.ID IN ($IDs)");
|
||||
|
||||
while($Group = $DB->next_record(MYSQLI_ASSOC, true)) {
|
||||
while ($Group = $DB->next_record(MYSQLI_ASSOC, true)) {
|
||||
unset($NotFound[$Group['ID']]);
|
||||
$Found[$Group['ID']] = $Group;
|
||||
$Found[$Group['ID']]['Torrents'] = array();
|
||||
@ -104,7 +104,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
||||
WHERE GroupID IN($IDs)
|
||||
ORDER BY GroupID, Remastered, (RemasterYear <> 0) DESC, RemasterYear, RemasterTitle,
|
||||
RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding, ID");
|
||||
while($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) {
|
||||
while ($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) {
|
||||
$Found[$Torrent['GroupID']]['Torrents'][$Torrent['ID']] = $Torrent;
|
||||
}
|
||||
|
||||
@ -262,7 +262,7 @@ public static function delete_torrent($ID, $GroupID=0, $OcelotReason=-1) {
|
||||
|
||||
// Torrent notifications
|
||||
$DB->query("SELECT UserID FROM users_notify_torrents WHERE TorrentID='$ID'");
|
||||
while(list($UserID) = $DB->next_record()) {
|
||||
while (list($UserID) = $DB->next_record()) {
|
||||
$Cache->delete_value('notifications_new_'.$UserID);
|
||||
}
|
||||
$DB->query("DELETE FROM users_notify_torrents WHERE TorrentID='$ID'");
|
||||
|
@ -23,7 +23,7 @@ function update_tracker($Action, $Updates, $ToIRC = false) {
|
||||
}
|
||||
$Path = TRACKER_SECRET.$Get;
|
||||
|
||||
$Return = "";
|
||||
$Return = '';
|
||||
$Attempts = 0;
|
||||
while ($Return != "success" && $Attempts < 3) {
|
||||
|
||||
@ -52,7 +52,7 @@ function update_tracker($Action, $Updates, $ToIRC = false) {
|
||||
} while (!feof($File) && !Misc::ends_with($ResHeader, "\r\n\r\n"));
|
||||
|
||||
$Response = '';
|
||||
while($Line = fgets($File)) {
|
||||
while ($Line = fgets($File)) {
|
||||
$Response .= $Line;
|
||||
}
|
||||
|
||||
|
@ -104,9 +104,7 @@ public static function user_info($UserID) {
|
||||
}
|
||||
|
||||
// Image proxy
|
||||
if (check_perms('site_proxy_images') && !empty($UserInfo['Avatar'])) {
|
||||
$UserInfo['Avatar'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&avatar='.$UserID.'&i='.urlencode($UserInfo['Avatar']);
|
||||
}
|
||||
$UserInfo['Avatar'] = ImageTools::process($UserInfo['Avatar']);
|
||||
return $UserInfo;
|
||||
}
|
||||
|
||||
@ -397,12 +395,12 @@ public static function gen_crypt_salt() {
|
||||
$Numchars = strlen($Chars) - 1;
|
||||
if ($Handle = @fopen('/dev/urandom', 'r')) {
|
||||
$Bytes = fread($Handle, 22);
|
||||
for($i = 0; $i < 21; $i++) {
|
||||
for ($i = 0; $i < 21; $i++) {
|
||||
$Salt .= $Chars[ord($Bytes[$i]) & $Numchars];
|
||||
}
|
||||
$Salt[$i] = $Chars[(ord($Bytes[$i]) & 3) << 4];
|
||||
} else {
|
||||
for($i = 0; $i < 21; $i++) {
|
||||
for ($i = 0; $i < 21; $i++) {
|
||||
$Salt .= $Chars[mt_rand(0, $Numchars)];
|
||||
}
|
||||
$Salt[$i] = $Chars[mt_rand(0, 3) << 4];
|
||||
@ -481,7 +479,7 @@ public static function format_username($UserID, $Badges = false, $IsWarned = tru
|
||||
if (check_perms('site_proxy_images') && !empty($UserInfo['Title'])) {
|
||||
$UserInfo['Title'] = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
|
||||
function($Matches) {
|
||||
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
|
||||
return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
|
||||
},
|
||||
$UserInfo['Title']);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
/*------------------------------------------------------*/
|
||||
/********************************************************/
|
||||
require 'config.php'; //The config contains all site wide configuration information
|
||||
|
||||
//Deal with dumbasses
|
||||
if (isset($_REQUEST['info_hash']) && isset($_REQUEST['peer_id'])) { die('d14:failure reason40:Invalid .torrent, try downloading again.e'); }
|
||||
|
||||
@ -435,8 +434,6 @@ function authorize($Ajax = false) {
|
||||
$Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php');
|
||||
if (!preg_match('/^[a-z0-9]+$/i', $Document)) { error(404); }
|
||||
|
||||
|
||||
|
||||
require(SERVER_ROOT.'/sections/'.$Document.'/index.php');
|
||||
$Debug->set_flag('completed module execution');
|
||||
|
||||
|
@ -229,7 +229,7 @@
|
||||
$Cache->cache_value('news_latest_id', $CurrentNews, 0);
|
||||
}
|
||||
if ($MyNews < $CurrentNews) {
|
||||
$Alerts[] = '<a href="index.php">'.'New announcement!'.'</a>';
|
||||
$Alerts[] = '<a href="index.php">New announcement!</a>';
|
||||
}
|
||||
|
||||
// Blog
|
||||
@ -245,7 +245,7 @@
|
||||
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0);
|
||||
}
|
||||
if ($MyBlog < $CurrentBlog) {
|
||||
$Alerts[] = '<a href="blog.php">'.'New blog post!'.'</a>';
|
||||
$Alerts[] = '<a href="blog.php">New blog post!</a>';
|
||||
}
|
||||
|
||||
// Staff blog
|
||||
@ -270,7 +270,7 @@
|
||||
$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600);
|
||||
}
|
||||
if ($SBlogReadTime < $LatestSBlogTime) {
|
||||
$Alerts[] = '<a href="staffblog.php">'.'New staff blog post!'.'</a>';
|
||||
$Alerts[] = '<a href="staffblog.php">New staff blog post!</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@
|
||||
}
|
||||
|
||||
if ($NewStaffPMs > 0) {
|
||||
$Alerts[] = '<a href="staffpm.php">'.'You have '.$NewStaffPMs.(($NewStaffPMs > 1) ? ' new staff messages' : ' new staff message').'</a>';
|
||||
$Alerts[] = '<a href="staffpm.php">You have '.$NewStaffPMs.(($NewStaffPMs > 1) ? ' new staff messages' : ' new staff message').'</a>';
|
||||
}
|
||||
|
||||
//Inbox
|
||||
@ -295,13 +295,13 @@
|
||||
}
|
||||
|
||||
if ($NewMessages > 0) {
|
||||
$Alerts[] = '<a href="inbox.php">'.'You have '.$NewMessages.(($NewMessages > 1) ? ' new messages' : ' new message').'</a>';
|
||||
$Alerts[] = '<a href="inbox.php">You have '.$NewMessages.(($NewMessages > 1) ? ' new messages' : ' new message').'</a>';
|
||||
}
|
||||
|
||||
if ($LoggedUser['RatioWatch']) {
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">'.'Ratio Watch'.'</a>: '.'You have '.time_diff($LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: You have '.time_diff($LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
||||
} elseif ($LoggedUser['CanLeech'] != 1) {
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">'.'Ratio Watch'.'</a>: '.'Your downloading privileges are disabled until you meet your required ratio.';
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: Your downloading privileges are disabled until you meet your required ratio.';
|
||||
}
|
||||
|
||||
if (check_perms('site_torrents_notify')) {
|
||||
@ -316,7 +316,7 @@
|
||||
$Cache->cache_value('notifications_new_'.$LoggedUser['ID'], $NewNotifications, 0);
|
||||
}
|
||||
if ($NewNotifications > 0) {
|
||||
$Alerts[] = '<a href="torrents.php?action=notify">'.'You have '.$NewNotifications.(($NewNotifications > 1) ? ' new torrent notifications' : ' new torrent notification').'</a>';
|
||||
$Alerts[] = '<a href="torrents.php?action=notify">You have '.$NewNotifications.(($NewNotifications > 1) ? ' new torrent notifications' : ' new torrent notification').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,11 +333,11 @@
|
||||
$Cache->cache_value('collage_subs_user_new_'.$LoggedUser['ID'], $NewCollages, 0);
|
||||
}
|
||||
if ($NewCollages > 0) {
|
||||
$Alerts[] = '<a href="userhistory.php?action=subscribed_collages">'.'You have '.$NewCollages.(($NewCollages > 1) ? ' new collage updates' : ' new collage update').'</a>';
|
||||
$Alerts[] = '<a href="userhistory.php?action=subscribed_collages">You have '.$NewCollages.(($NewCollages > 1) ? ' new collage updates' : ' new collage update').'</a>';
|
||||
}
|
||||
}
|
||||
if (check_perms('users_mod')) {
|
||||
$ModBar[] = '<a href="tools.php">'.'Toolbox'.'</a>';
|
||||
$ModBar[] = '<a href="tools.php">Toolbox</a>';
|
||||
}
|
||||
if (check_perms('users_mod') || $LoggedUser['PermissionID'] == FORUM_MOD) {
|
||||
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
@ -387,7 +387,7 @@
|
||||
}
|
||||
|
||||
if ($NumUpdateReports > 0) {
|
||||
$ModBar[] = '<a href="reports.php">'.'Request update reports'.'</a>';
|
||||
$ModBar[] = '<a href="reports.php">Request update reports</a>';
|
||||
}
|
||||
} elseif (check_perms('site_moderate_forums')) {
|
||||
$NumForumReports = $Cache->get_value('num_forum_reports');
|
||||
|
@ -1510,7 +1510,7 @@ CREATE TABLE `users_sessions` (
|
||||
`SessionID` char(32) NOT NULL,
|
||||
`KeepLogged` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`Browser` varchar(40) DEFAULT NULL,
|
||||
`OperatingSystem` varchar(8) DEFAULT NULL,
|
||||
`OperatingSystem` varchar(13) DEFAULT NULL,
|
||||
`IP` varchar(15) NOT NULL,
|
||||
`LastUpdate` datetime NOT NULL,
|
||||
`Active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
|
@ -24,7 +24,7 @@
|
||||
case 'artists':
|
||||
?>
|
||||
<Url type="text/html" method="get" template="http<?=($SSL?'s':'')?>://<?=SITE_URL?>/artist.php?artistname={searchTerms}"></Url>
|
||||
<Url type="application/x-suggestions+json" template="http<?=($SSL?'s':'')?>://<?=SITE_URL?>/artist.php?action=autocomplete&name={searchTerms}"/>
|
||||
<Url type="application/x-suggestions+json" template="http<?=($SSL?'s':'')?>://<?=SITE_URL?>/artist.php?action=autocomplete&name={searchTerms}" />
|
||||
<moz:SearchForm>http<?=($SSL?'s':'')?>://<?=SITE_URL?>/torrents.php?action=advanced</moz:SearchForm>
|
||||
<?
|
||||
break;
|
||||
|
@ -22,6 +22,7 @@
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.CategoryID,
|
||||
g.wikiImage,
|
||||
g.TagList,
|
||||
t.Format,
|
||||
t.Encoding,
|
||||
@ -54,7 +55,7 @@
|
||||
ORDER BY (t.Seeders + t.Leechers) DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastDay = $DB->to_array();
|
||||
$TopTorrentsActiveLastDay = $DB->to_array(); // TODO: MYSQLI_NUM to avoid duplicate data in the cache (does that break something with generate_torrent_json?)
|
||||
$Cache->cache_value('top10tor_day_'.$Limit.$WhereSum,$TopTorrentsActiveLastDay,3600*2);
|
||||
}
|
||||
$OuterResults[] = generate_torrent_json('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
||||
@ -144,7 +145,7 @@ function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
|
||||
global $LoggedUser,$Categories;
|
||||
$results = array();
|
||||
foreach ($Details as $Detail) {
|
||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$WikiImage,$TorrentTags,
|
||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail;
|
||||
|
||||
|
@ -54,10 +54,6 @@ function error_out($reason = '') {
|
||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||
}
|
||||
|
||||
if (check_perms('site_proxy_images') && !empty($Avatar)) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
}
|
||||
|
||||
if ($LoggedUser['CustomForums']) {
|
||||
unset($LoggedUser['CustomForums']['']);
|
||||
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
|
||||
|
@ -387,7 +387,7 @@ function compare($X, $Y) {
|
||||
<td colspan="5" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -527,15 +527,11 @@ function compare($X, $Y) {
|
||||
</div>
|
||||
<? /* Misc::display_recommend($ArtistID, "artist"); */ ?>
|
||||
<div class="sidebar">
|
||||
<? if ($Image) {
|
||||
$WikiImage = $Image;
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
} ?>
|
||||
<? if ($Image) { ?>
|
||||
<div class="box box_image">
|
||||
<div class="head"><strong><?=$Name?></strong></div>
|
||||
<div style="text-align: center; padding: 10px 0px;">
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=$WikiImage?>',220);" />
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" />
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
|
@ -51,7 +51,7 @@
|
||||
if ($ThreadID && is_number($ThreadID)) {
|
||||
$DB->query("SELECT ForumID FROM forums_topics WHERE ID=".$ThreadID);
|
||||
if ($DB->record_count() < 1) {
|
||||
error("No such thread exists!");
|
||||
error('No such thread exists!');
|
||||
header('Location: blog.php');
|
||||
}
|
||||
} else {
|
||||
|
@ -210,11 +210,8 @@ function compare($X, $Y){
|
||||
<li class="image_group_<?=$GroupID?>">
|
||||
<a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
|
||||
<? if($WikiImage) {
|
||||
if(check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
}
|
||||
?>
|
||||
<img src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="117" />
|
||||
<img src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="117" />
|
||||
<? } else { ?>
|
||||
<div style="width:107px;padding:5px"><?=$DisplayName?></div>
|
||||
<? } ?>
|
||||
|
@ -285,11 +285,8 @@ function compare($X, $Y){
|
||||
<li class="image_group_<?=$GroupID?>">
|
||||
<a href="torrents.php?id=<?=$GroupID?>">
|
||||
<? if ($WikiImage) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
}
|
||||
?>
|
||||
<img src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="118" />
|
||||
<img src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="118" />
|
||||
<? } else { ?>
|
||||
<span style="width: 107px; padding: 5px;"><?=$DisplayName?></span>
|
||||
<? } ?>
|
||||
|
@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
// Start printing
|
||||
View::show_header('Forums > '. $Forums[$ForumID]['Name']);
|
||||
View::show_header('Forums > '. $Forums[$ForumID]['Name']);
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > <?=$ForumName?></h2>
|
||||
|
@ -58,11 +58,11 @@
|
||||
<h3><?=$ForumCats[$CategoryID]?></h3>
|
||||
<table class="forum_index">
|
||||
<tr class="colhead">
|
||||
<td style="width:2%;"></td>
|
||||
<td style="width:25%;">Forum</td>
|
||||
<td style="width: 2%;"></td>
|
||||
<td style="width: 25%;">Forum</td>
|
||||
<td>Last post</td>
|
||||
<td style="width:7%;">Topics</td>
|
||||
<td style="width:7%;">Posts</td>
|
||||
<td style="width: 7%;">Topics</td>
|
||||
<td style="width: 7%;">Posts</td>
|
||||
</tr>
|
||||
<?
|
||||
$OpenTable = true;
|
||||
@ -87,7 +87,7 @@
|
||||
</td>
|
||||
<? if ($NumPosts == 0) { ?>
|
||||
<td colspan="3">
|
||||
There are no topics here<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&forumid='.$ForumID.'">'.'create one'.'</a>' : ''?>.
|
||||
There are no topics here.<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&forumid='.$ForumID.'">Create one!</a>' : '' ?>.
|
||||
</td>
|
||||
<? } else { ?>
|
||||
<td>
|
||||
|
@ -22,7 +22,7 @@
|
||||
if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) {
|
||||
error(403);
|
||||
}
|
||||
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
|
||||
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > <a href="forums.php?action=viewforum&forumid=<?=$ForumID?>"><?=$Forum['Name']?></a> > <span id="newthreadtitle">New Topic</span></h2>
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?
|
||||
|
||||
if(!isset($_POST['topicid']) || !is_number($_POST['topicid'])) { error(0,true); }
|
||||
if (!isset($_POST['topicid']) || !is_number($_POST['topicid'])) {
|
||||
error(0,true);
|
||||
}
|
||||
$TopicID = $_POST['topicid'];
|
||||
|
||||
if (!empty($_POST['large'])) {
|
||||
@ -9,7 +11,7 @@
|
||||
$Size = 140;
|
||||
}
|
||||
|
||||
if(!$ThreadInfo = $Cache->get_value('thread_'.$TopicID.'_info')) {
|
||||
if (!$ThreadInfo = $Cache->get_value('thread_'.$TopicID.'_info')) {
|
||||
$DB->query("SELECT
|
||||
t.Title,
|
||||
t.ForumID,
|
||||
@ -23,7 +25,9 @@
|
||||
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
||||
WHERE t.ID = '$TopicID'
|
||||
GROUP BY fp.TopicID");
|
||||
if($DB->record_count()==0) { die(); }
|
||||
if ($DB->record_count() == 0) {
|
||||
die();
|
||||
}
|
||||
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC);
|
||||
if (!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
|
||||
$Cache->cache_value('thread_'.$TopicID.'_info', $ThreadInfo, 0);
|
||||
@ -77,7 +81,7 @@
|
||||
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
|
||||
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
|
||||
<? } ?>
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br /><br />
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br /><br />
|
||||
<input type="button" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" />
|
||||
</form>
|
||||
<?
|
||||
@ -104,20 +108,20 @@
|
||||
?>
|
||||
<ul class="poll nobullet">
|
||||
<?
|
||||
if($ForumID != STAFF_FORUM) {
|
||||
if ($ForumID != STAFF_FORUM) {
|
||||
for ($i = 1, $il = count($Answers); $i <= $il; $i++) {
|
||||
if (!empty($Votes[$i]) && $TotalVotes > 0) {
|
||||
$Ratio = $Votes[$i]/$MaxVotes;
|
||||
$Percent = $Votes[$i]/$TotalVotes;
|
||||
$Ratio = $Votes[$i] / $MaxVotes;
|
||||
$Percent = $Votes[$i] / $TotalVotes;
|
||||
} else {
|
||||
$Ratio=0;
|
||||
$Percent=0;
|
||||
$Ratio = 0;
|
||||
$Percent = 0;
|
||||
}
|
||||
?>
|
||||
<li><?=display_str($Answers[$i])?> (<?=number_format($Percent*100,2)?>%)</li>
|
||||
<li><?=display_str($Answers[$i])?> (<?=number_format($Percent * 100,2)?>%)</li>
|
||||
<li class="graph">
|
||||
<span class="left_poll"></span>
|
||||
<span class="center_poll" style="width:<?=round($Ratio*$Size)?>px;"></span>
|
||||
<span class="center_poll" style="width: <?=round($Ratio * $Size)?>px;"></span>
|
||||
<span class="right_poll"></span>
|
||||
</li>
|
||||
<? }
|
||||
@ -131,10 +135,10 @@
|
||||
GROUP BY fpv.Vote");
|
||||
|
||||
$StaffVotes = $DB->to_array();
|
||||
foreach($StaffVotes as $StaffVote) {
|
||||
foreach ($StaffVotes as $StaffVote) {
|
||||
list($StaffString, $StaffVoted) = $StaffVote;
|
||||
?>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$TopicID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? "Blank" : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$TopicID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? 'Blank' : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li>
|
||||
<?
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@
|
||||
}
|
||||
|
||||
// Let's hope we got some results - start printing out the content.
|
||||
View::show_header('Forums'.' > '.'Search', 'bbcode');
|
||||
View::show_header('Forums > Search', 'bbcode');
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > Search<?=$Title?></h2>
|
||||
@ -271,14 +271,14 @@
|
||||
list($Results) = $DB->next_record();
|
||||
$DB->set_query_id($Records);
|
||||
|
||||
$Pages=Format::get_pages($Page,$Results,POSTS_PER_PAGE,9);
|
||||
$Pages = Format::get_pages($Page, $Results, POSTS_PER_PAGE, 9);
|
||||
echo $Pages;
|
||||
?>
|
||||
</div>
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="forum_list border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td>Forum</td>
|
||||
<td><?=(!empty($ThreadID))?'Post Begins':'Topic'?></td>
|
||||
<td><?=(!empty($ThreadID)) ? 'Post begins' : 'Topic' ?></td>
|
||||
<td>Time</td>
|
||||
</tr>
|
||||
<? if ($DB->record_count() == 0) { ?>
|
||||
|
@ -54,13 +54,13 @@
|
||||
// Make sure they aren't trying to edit posts they shouldn't
|
||||
// We use die() here instead of error() because whatever we spit out is displayed to the user in the box where his forum post is
|
||||
if(!check_forumperm($ForumID, 'Write') || ($IsLocked && !check_perms('site_moderate_forums'))) {
|
||||
error('Either the thread is locked, or you lack the permission to edit this post.',true);
|
||||
error('Either the thread is locked, or you lack the permission to edit this post.', true);
|
||||
}
|
||||
if($UserID != $AuthorID && !check_perms('site_moderate_forums')) {
|
||||
error(403,true);
|
||||
}
|
||||
if($LoggedUser['DisablePosting']) {
|
||||
error('Your posting rights have been removed.',true);
|
||||
error('Your posting rights have been removed.', true);
|
||||
}
|
||||
if($DB->record_count()==0) {
|
||||
error(404,true);
|
||||
|
@ -246,29 +246,29 @@
|
||||
<? if ($UserResponse !== null || $Closed || $ThreadInfo['IsLocked'] || !check_forumperm($ForumID)) { ?>
|
||||
<ul class="poll nobullet">
|
||||
<?
|
||||
if(!$RevealVoters) {
|
||||
foreach($Answers as $i => $Answer) {
|
||||
if (!$RevealVoters) {
|
||||
foreach ($Answers as $i => $Answer) {
|
||||
if (!empty($Votes[$i]) && $TotalVotes > 0) {
|
||||
$Ratio = $Votes[$i]/$MaxVotes;
|
||||
$Percent = $Votes[$i]/$TotalVotes;
|
||||
$Ratio = $Votes[$i] / $MaxVotes;
|
||||
$Percent = $Votes[$i] / $TotalVotes;
|
||||
} else {
|
||||
$Ratio=0;
|
||||
$Percent=0;
|
||||
$Ratio = 0;
|
||||
$Percent = 0;
|
||||
}
|
||||
?>
|
||||
<li><?=display_str($Answer)?> (<?=number_format($Percent*100,2)?>%)</li>
|
||||
<li><?=display_str($Answer)?> (<?=number_format($Percent * 100,2)?>%)</li>
|
||||
<li class="graph">
|
||||
<span class="left_poll"></span>
|
||||
<span class="center_poll" style="width:<?=round($Ratio*750)?>px;"></span>
|
||||
<span class="center_poll" style="width: <?=round($Ratio * 750)?>px;"></span>
|
||||
<span class="right_poll"></span>
|
||||
</li>
|
||||
<? }
|
||||
if ($Votes[0] > 0) {
|
||||
?>
|
||||
<li>(Blank) (<?=number_format((float)($Votes[0]/$TotalVotes*100),2)?>%)</li>
|
||||
<li>(Blank) (<?=number_format((float)($Votes[0] / $TotalVotes * 100),2)?>%)</li>
|
||||
<li class="graph">
|
||||
<span class="left_poll"></span>
|
||||
<span class="center_poll" style="width:<?=round(($Votes[0]/$MaxVotes)*750)?>px;"></span>
|
||||
<span class="center_poll" style="width: <?=round(($Votes[0] / $MaxVotes) * 750)?>px;"></span>
|
||||
<span class="right_poll"></span>
|
||||
</li>
|
||||
<? } ?>
|
||||
@ -309,20 +309,20 @@
|
||||
foreach($Answers as $i => $Answer) {
|
||||
?>
|
||||
<li>
|
||||
<a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>"><?=display_str($Answer == '' ? "Blank" : $Answer)?></a>
|
||||
- <?=$StaffVotes[$i]?> (<?=number_format(((float) $Votes[$i]/$TotalVotes)*100, 2)?>%)
|
||||
<a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>"><?=display_str($Answer == '' ? 'Blank' : $Answer)?></a>
|
||||
- <?=$StaffVotes[$i]?> (<?=number_format(((float) $Votes[$i] / $TotalVotes) * 100, 2)?>%)
|
||||
<a href="forums.php?action=delete_poll_option&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>" class="brackets">X</a>
|
||||
</li>
|
||||
<? } ?>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=0">Blank</a> - <?=$StaffVotes[0]?> (<?=number_format(((float) $Votes[0]/$TotalVotes)*100, 2)?>%)</li>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=0">Blank</a> - <?=$StaffVotes[0]?> (<?=number_format(((float) $Votes[0] / $TotalVotes) * 100, 2)?>%)</li>
|
||||
</ul>
|
||||
<?
|
||||
if($ForumID == STAFF_FORUM) {
|
||||
if ($ForumID == STAFF_FORUM) {
|
||||
?>
|
||||
<br />
|
||||
<strong>Votes:</strong> <?=number_format($TotalVotes)?> / <?=$StaffCount ?>
|
||||
<br />
|
||||
<strong>Missing Votes:</strong> <?=implode(", ", $StaffNames)?>
|
||||
<strong>Missing votes:</strong> <?=implode(", ", $StaffNames)?>
|
||||
<br /><br />
|
||||
<?
|
||||
}
|
||||
@ -349,7 +349,7 @@
|
||||
<? } ?>
|
||||
<li>
|
||||
<br />
|
||||
<input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br />
|
||||
<input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br />
|
||||
</li>
|
||||
</ul>
|
||||
<? if($ForumID == STAFF_FORUM) { ?>
|
||||
@ -524,13 +524,13 @@
|
||||
<tr>
|
||||
<td class="label">Sticky</td>
|
||||
<td>
|
||||
<input type="checkbox" name="sticky"<? if($ThreadInfo['IsSticky']) { echo ' checked="checked"'; } ?> tabindex="2" />
|
||||
<input type="checkbox" name="sticky"<? if ($ThreadInfo['IsSticky']) { echo ' checked="checked"'; } ?> tabindex="2" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Locked</td>
|
||||
<td>
|
||||
<input type="checkbox" name="locked"<? if($ThreadInfo['IsLocked']) { echo ' checked="checked"'; } ?> tabindex="2" />
|
||||
<input type="checkbox" name="locked"<? if ($ThreadInfo['IsLocked']) { echo ' checked="checked"'; } ?> tabindex="2" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -93,11 +93,8 @@
|
||||
<td width="50px" valign="top">
|
||||
<?
|
||||
if (empty($HeavyInfo['DisableAvatars'])) {
|
||||
if (!empty($Avatar)) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
} ?>
|
||||
<img src="<?=$Avatar?>" alt="<?=$Username?>'s avatar" width="50px" />
|
||||
if (!empty($Avatar)) { ?>
|
||||
<img src="<?=ImageTools::process($Avatar)?>" alt="<?=$Username?>'s avatar" width="50px" />
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" />
|
||||
<? }
|
||||
|
@ -16,10 +16,6 @@
|
||||
}
|
||||
if (is_number($FeaturedAlbum['GroupID'])) {
|
||||
$Artists = Artists::get_artist($FeaturedAlbum['GroupID']);
|
||||
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$FeaturedAlbum['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($FeaturedAlbum['WikiImage']);
|
||||
}
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head colhead_dark"><strong>Featured Album</strong></div>
|
||||
@ -28,7 +24,7 @@
|
||||
</div>
|
||||
<div class="center">
|
||||
<a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>" title="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>">
|
||||
<img src="<?=ImageTools::thumbnail($FeaturedAlbum['WikiImage'])?>" alt="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" />
|
||||
<img src="<?=ImageTools::process($FeaturedAlbum['WikiImage'], true)?>" alt="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="center pad">
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?
|
||||
include(SERVER_ROOT.'/classes/class_text.php');
|
||||
|
||||
$Text = new TEXT(true);
|
||||
|
||||
if (!$News = $Cache->get_value('news')) {
|
||||
@ -294,7 +293,7 @@
|
||||
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' ['.'Closed'.']'; } ?></strong></div>
|
||||
<div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' [Closed]'; } ?></strong></div>
|
||||
<div class="pad">
|
||||
<p><strong><?=display_str($Question)?></strong></p>
|
||||
<? if ($UserResponse !== null || $Closed) { ?>
|
||||
@ -327,7 +326,7 @@
|
||||
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
|
||||
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
|
||||
<? } ?>
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br /><br />
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br /><br />
|
||||
<input type="button" onclick="ajax.post('index.php','poll',function(response) {$('#poll_container').raw().innerHTML = response});" value="Vote" />
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,22 +1,22 @@
|
||||
<? View::show_header('Login'); ?>
|
||||
<span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
|
||||
<noscript><span class="warning">You appear to have javascript disabled.</span><br /><br /></noscript>
|
||||
<noscript><span class="warning">You appear to have JavaScript disabled.</span><br /><br /></noscript>
|
||||
<?
|
||||
if(strtotime($BannedUntil)<time() && !$BanID) {
|
||||
if (strtotime($BannedUntil) < time() && !$BanID) {
|
||||
?>
|
||||
<form class="auth_form" name="login" id="loginform" method="post" action="login.php">
|
||||
<?
|
||||
|
||||
if(!empty($BannedUntil) && $BannedUntil != '0000-00-00 00:00:00') {
|
||||
if (!empty($BannedUntil) && $BannedUntil != '0000-00-00 00:00:00') {
|
||||
$DB->query("UPDATE login_attempts SET BannedUntil='0000-00-00 00:00:00', Attempts='0' WHERE ID='".db_string($AttemptID)."'");
|
||||
$Attempts = 0;
|
||||
}
|
||||
if(isset($Err)) {
|
||||
if (isset($Err)) {
|
||||
?>
|
||||
<span class="warning"><?=$Err?><br /><br /></span>
|
||||
<? } ?>
|
||||
<? if ($Attempts > 0) { ?>
|
||||
You have <span class="info"><?=(6-$Attempts)?></span> attempts remaining.<br /><br />
|
||||
You have <span class="info"><?=(6 - $Attempts)?></span> attempts remaining.<br /><br />
|
||||
<strong>WARNING:</strong> You will be banned for 6 hours after your login attempts run out!<br /><br />
|
||||
<? } ?>
|
||||
<table class="layout">
|
||||
@ -31,7 +31,7 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="checkbox" id="keeplogged" name="keeplogged" value="1"<? if(isset($_REQUEST['keeplogged']) && $_REQUEST['keeplogged']) { ?> checked="checked"<? } ?> />
|
||||
<input type="checkbox" id="keeplogged" name="keeplogged" value="1"<? if (isset($_REQUEST['keeplogged']) && $_REQUEST['keeplogged']) { ?> checked="checked"<? } ?> />
|
||||
<label for="keeplogged">Remember me</label>
|
||||
</td>
|
||||
<td><input type="submit" name="login" value="Login" class="submit" /></td>
|
||||
@ -40,9 +40,9 @@
|
||||
</form>
|
||||
<?
|
||||
} else {
|
||||
if($BanID) {
|
||||
if ($BanID) {
|
||||
?>
|
||||
<span class="warning">Your IP is banned indefinitely.</span>
|
||||
<span class="warning">Your IP address is banned indefinitely.</span>
|
||||
<? } else { ?>
|
||||
<span class="warning">You are banned from logging in for another <?=time_diff($BannedUntil)?>.</span>
|
||||
<?
|
||||
|
@ -3,11 +3,11 @@
|
||||
echo $Validate->GenerateJS('recoverform');
|
||||
?>
|
||||
<form class="auth_form" name="recovery" id="recoverform" method="post" action="" onsubmit="return formVal();">
|
||||
<div style="width:320px;">
|
||||
<div style="width: 320px;">
|
||||
<span class="titletext">Reset your password - Step 1</span><br /><br />
|
||||
<?
|
||||
if(empty($Sent) || (!empty($Sent) && $Sent!=1)) {
|
||||
if(!empty($Err)) {
|
||||
if (empty($Sent) || (!empty($Sent) && $Sent != 1)) {
|
||||
if (!empty($Err)) {
|
||||
?>
|
||||
<strong class="important_text"><?=$Err ?></strong><br /><br />
|
||||
<? } ?>
|
||||
@ -21,9 +21,11 @@
|
||||
<td colspan="2" align="right"><input type="submit" name="reset" value="Reset!" class="submit" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } else { ?>
|
||||
<?
|
||||
} else { ?>
|
||||
An email has been sent to you; please follow the directions in that email to reset your password.
|
||||
<? } ?>
|
||||
<?
|
||||
} ?>
|
||||
</div>
|
||||
</form>
|
||||
<?
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?
|
||||
View::show_header('Registration Closed');
|
||||
?>
|
||||
<div style="width:500px;">
|
||||
<div style="width: 500px;">
|
||||
<strong>Sorry, the site is currently invite only.</strong>
|
||||
</div>
|
||||
<?
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?
|
||||
View::show_header('Register');
|
||||
?>
|
||||
<div style="width:500px;">
|
||||
<div style="width: 500px;">
|
||||
<form class="auth_form" name="invite" method="get" action="register.php">
|
||||
Please enter your invite code into the box below.<br /><br />
|
||||
<table class="layout" cellpadding="2" cellspacing="1" border="0" align="center">
|
||||
|
@ -48,7 +48,7 @@
|
||||
list($UserCount)=$DB->next_record();
|
||||
|
||||
if ($UserCount) {
|
||||
$Err = "There is already someone registered with that username.";
|
||||
$Err = 'There is already someone registered with that username.';
|
||||
$_REQUEST['username']='';
|
||||
}
|
||||
|
||||
|
@ -5,21 +5,21 @@
|
||||
<script src="<?=STATIC_SERVER?>functions/jquery.js" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_SERVER?>functions/password_validate.js" type="text/javascript"></script>
|
||||
<form class="create_form" name="user" id="registerform" method="post" action="" onsubmit="return formVal();">
|
||||
<div style="width:500px;">
|
||||
<div style="width: 500px;">
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<?
|
||||
|
||||
if(empty($Sent)) {
|
||||
if(!empty($_REQUEST['invite'])) {
|
||||
if (empty($Sent)) {
|
||||
if (!empty($_REQUEST['invite'])) {
|
||||
echo '<input type="hidden" name="invite" value="'.display_str($_REQUEST['invite']).'" />'."\n";
|
||||
}
|
||||
if(!empty($Err)) {
|
||||
if (!empty($Err)) {
|
||||
?>
|
||||
<strong class="important_text"><?=$Err?></strong><br /><br />
|
||||
<? } ?>
|
||||
<table class="layout" cellpadding="2" cellspacing="1" border="0" align="center">
|
||||
<tr valign="top">
|
||||
<td align="right" style="width:100px;">Username </td>
|
||||
<td align="right" style="width: 100px;">Username </td>
|
||||
<td align="left">
|
||||
<input type="text" name="username" id="username" class="inputtext" value="<?=(!empty($_REQUEST['username']) ? display_str($_REQUEST['username']) : '')?>" />
|
||||
<p>Use common sense when choosing your username. Offensive usernames will not be tolerated. <strong>Do not choose a username that can be associated with your real name.</strong> If you do so, we will not be changing it for you.</p>
|
||||
@ -61,7 +61,9 @@
|
||||
<? } else { ?>
|
||||
An email has been sent to the address that you provided. After you confirm your email address, you will be able to log into your account.
|
||||
|
||||
<? if($NewInstall) { echo "Since this is a new installation, you can log in directly without having to confirm your account."; }
|
||||
<? if ($NewInstall) {
|
||||
echo "Since this is a new installation, you can log in directly without having to confirm your account.";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -316,9 +316,8 @@
|
||||
<?
|
||||
$Images = explode(" ", $Images);
|
||||
foreach ($Images as $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="<?=ImageTools::process($Image)?>" alt="Relevant image" />
|
||||
<?
|
||||
} ?>
|
||||
</td>
|
||||
|
@ -474,9 +474,8 @@
|
||||
<?
|
||||
$Images = explode(' ', $Images);
|
||||
foreach ($Images as $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="<?=ImageTools::process($Image)?>" alt="Relevant image" />
|
||||
<?
|
||||
} ?>
|
||||
</td>
|
||||
|
@ -6,16 +6,16 @@
|
||||
|
||||
// Minimum and default amount of upload to remove from the user when they vote.
|
||||
// Also change in static/functions/requests.js
|
||||
$MinimumVote = 20*1024*1024;
|
||||
$MinimumVote = 20 * 1024 * 1024;
|
||||
|
||||
if(!empty($LoggedUser['DisableRequests'])) {
|
||||
if (!empty($LoggedUser['DisableRequests'])) {
|
||||
error('Your request privileges have been removed.');
|
||||
}
|
||||
|
||||
if(!isset($_REQUEST['action'])) {
|
||||
if (!isset($_REQUEST['action'])) {
|
||||
include(SERVER_ROOT.'/sections/requests/requests.php');
|
||||
} else {
|
||||
switch($_REQUEST['action']){
|
||||
switch($_REQUEST['action']) {
|
||||
case 'new':
|
||||
case 'edit':
|
||||
include(SERVER_ROOT.'/sections/requests/new_edit.php');
|
||||
@ -48,15 +48,17 @@
|
||||
authorize();
|
||||
|
||||
enforce_login();
|
||||
if (!isset($_POST['requestid']) || !is_number($_POST['requestid']) || $_POST['body']==='' || !isset($_POST['body'])) {
|
||||
if (!isset($_POST['requestid']) || !is_number($_POST['requestid']) || $_POST['body'] === '' || !isset($_POST['body'])) {
|
||||
error(0);
|
||||
}
|
||||
if($LoggedUser['DisablePosting']) {
|
||||
if ($LoggedUser['DisablePosting']) {
|
||||
error('Your posting rights have been removed.');
|
||||
}
|
||||
|
||||
$RequestID = $_POST['requestid'];
|
||||
if(!$RequestID) { error(404); }
|
||||
if (!$RequestID) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
$DB->query("SELECT CEIL((SELECT COUNT(ID)+1 FROM requests_comments AS rc WHERE rc.RequestID='".$RequestID."')/".TORRENT_COMMENTS_PER_PAGE.") AS Pages");
|
||||
list($Pages) = $DB->next_record();
|
||||
@ -85,7 +87,9 @@
|
||||
|
||||
case 'get_post':
|
||||
enforce_login();
|
||||
if (!$_GET['post'] || !is_number($_GET['post'])) { error(0); }
|
||||
if (!$_GET['post'] || !is_number($_GET['post'])) {
|
||||
error(0);
|
||||
}
|
||||
$DB->query("SELECT Body FROM requests_comments WHERE ID='".db_string($_GET['post'])."'");
|
||||
list($Body) = $DB->next_record(MYSQLI_NUM);
|
||||
|
||||
@ -100,7 +104,9 @@
|
||||
$Text = new TEXT;
|
||||
|
||||
// Quick SQL injection check
|
||||
if(!$_POST['post'] || !is_number($_POST['post'])) { error(0); }
|
||||
if (!$_POST['post'] || !is_number($_POST['post'])) {
|
||||
error(0);
|
||||
}
|
||||
|
||||
// Mainly
|
||||
$DB->query("SELECT
|
||||
@ -115,8 +121,12 @@
|
||||
$DB->query("SELECT ceil(COUNT(ID) / ".POSTS_PER_PAGE.") AS Page FROM requests_comments WHERE RequestID = $RequestID AND ID <= $_POST[post]");
|
||||
list($Page) = $DB->next_record();
|
||||
|
||||
if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); }
|
||||
if ($DB->record_count()==0) { error(404); }
|
||||
if ($LoggedUser['ID'] != $AuthorID && !check_perms('site_moderate_forums')) {
|
||||
error(404);
|
||||
}
|
||||
if ($DB->record_count() == 0) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE requests_comments SET
|
||||
@ -152,10 +162,14 @@
|
||||
authorize();
|
||||
|
||||
// Quick SQL injection check
|
||||
if (!$_GET['postid'] || !is_number($_GET['postid'])) { error(0); }
|
||||
if (!$_GET['postid'] || !is_number($_GET['postid'])) {
|
||||
error(0);
|
||||
}
|
||||
|
||||
// Make sure they are moderators
|
||||
if (!check_perms('site_moderate_forums')) { error(403); }
|
||||
if (!check_perms('site_moderate_forums')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
// Get topicid, forumid, number of pages
|
||||
$DB->query("SELECT DISTINCT
|
||||
|
@ -146,7 +146,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<select id="categories" name="type" onchange="Categories()">
|
||||
<? foreach(Misc::display_array($Categories) as $Cat){ ?>
|
||||
<? foreach (Misc::display_array($Categories) as $Cat) { ?>
|
||||
<option value="<?=$Cat?>"<?=(!empty($CategoryName) && ($CategoryName == $Cat) ? ' selected="selected"' : '')?>><?=$Cat?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
@ -160,8 +160,8 @@
|
||||
|
||||
if (!empty($ArtistForm)) {
|
||||
$First = true;
|
||||
foreach($ArtistForm as $Importance => $ArtistNames) {
|
||||
foreach($ArtistNames as $Artist) {
|
||||
foreach ($ArtistForm as $Importance => $ArtistNames) {
|
||||
foreach ($ArtistNames as $Artist) {
|
||||
?>
|
||||
<input type="text" id="artist" name="artists[]" size="45" value="<?=display_str($Artist['name']) ?>" />
|
||||
<select id="importance" name="importance[]" >
|
||||
@ -245,7 +245,7 @@
|
||||
?>
|
||||
<select id="genre_tags" name="genre_tags" onchange="add_tag();return false;" >
|
||||
<option>---</option>
|
||||
<? foreach (Misc::display_array($GenreTags) as $Genre){ ?>
|
||||
<? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
|
||||
<option value="<?=$Genre ?>"><?=$Genre ?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
|
@ -127,12 +127,10 @@
|
||||
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
|
||||
<div class="head"><strong>Cover</strong></div>
|
||||
<?
|
||||
if (!empty($Image)) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Image);
|
||||
}
|
||||
if (!empty($Image)) {
|
||||
$Image = ImageTools::process($Image, true);
|
||||
?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::thumbnail($Image)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=$Image?>',220);" /></p>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=$Image?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=$Image?>',220);" /></p>
|
||||
<? } else { ?>
|
||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID-1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
|
||||
<? } ?>
|
||||
|
@ -15,12 +15,12 @@
|
||||
<p>Client rules are how we maintain the integrity of our swarms. This allows us to filter out disruptive and dishonest clients that may hurt the performance of either the tracker or individual peers.</p>
|
||||
<table cellpadding="5" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td style="width:150px;"><strong>Allowed Client</strong></td>
|
||||
<!-- td style="width:400px;"><strong>Additional Notes</strong></td> -->
|
||||
<td style="width: 150px;"><strong>Allowed Client</strong></td>
|
||||
<!-- td style="width: 400px;"><strong>Additional Notes</strong></td> -->
|
||||
</tr>
|
||||
<?
|
||||
$Row = 'a';
|
||||
foreach($WhitelistedClients as $Client) {
|
||||
foreach ($WhitelistedClients as $Client) {
|
||||
//list($ClientName,$Notes) = $Client;
|
||||
list($ClientName) = $Client;
|
||||
$Row = ($Row == 'a') ? 'b' : 'a';
|
||||
|
@ -40,52 +40,52 @@
|
||||
<td>Required Ratio (0% seeded)</td>
|
||||
<td>Required Ratio (100% seeded)</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] < 5 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>0-5 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] < 5 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>0–5 GB</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 5 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 10 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>5-10 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 5 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 10 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>5–10 GB</td>
|
||||
<td>0.15</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 10 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 20 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>10-20 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 10 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 20 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>10–20 GB</td>
|
||||
<td>0.20</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 20 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 30 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>20-30 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 20 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 30 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>20–30 GB</td>
|
||||
<td>0.30</td>
|
||||
<td>0.05</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 30 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 40 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>30-40 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 30 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 40 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>30–40 GB</td>
|
||||
<td>0.40</td>
|
||||
<td>0.10</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 40 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 50 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>40-50 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 40 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 50 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>40–50 GB</td>
|
||||
<td>0.50</td>
|
||||
<td>0.20</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 50 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 60 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>50-60 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 50 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 60 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>50–60 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.30</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 60 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 80 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>60-80 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 60 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 80 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>60–80 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.40</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 80 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 100 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<td>80-100 GB</td>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 80 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 100 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>80–100 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.50</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 100 * 1024 * 1024 * 1024) ? 'a' : 'b'?>">
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 100 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>100+ GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.60</td>
|
||||
@ -101,15 +101,15 @@
|
||||
bracket. The maximum and minimum required ratios are also referred to as the <strong>0% seeded</strong> and <strong>100% seeded</strong> required ratios, respectively.
|
||||
</li>
|
||||
<li><strong>2: Determine the actual required ratio.</strong> Your actual required ratio will be a number that falls between the maximum and minimum required ratio values determined in the
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1-seeding/snatched]. Formatted
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1 − (seeding / snatched)]. Formatted
|
||||
differently, the calculation performed by the system looks like this:
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div style="text-align:center"><img style="vertical-align: middle" src="static/blank.gif"
|
||||
onload="if (this.src.substr(this.src.length-9,this.src.length) == 'blank.gif') { this.src = 'http://chart.apis.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&chco=' + hexify(getComputedStyle(this.parentNode,null).color); }"/>
|
||||
<div style="text-align: center;"><img style="vertical-align: middle;" src="static/blank.gif"
|
||||
onload="if (this.src.substr(this.src.length-9,this.src.length) == 'blank.gif') { this.src = 'http://chart.apis.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&chco=' + hexify(getComputedStyle(this.parentNode,null).color); }" />
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
@ -144,11 +144,11 @@
|
||||
<br />
|
||||
<strong>Required Ratio Example:</strong><br />
|
||||
<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 minimum required ratio (100% seeded) is 0.05.
|
||||
<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.
|
||||
</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:
|
||||
0.3 * [1 - (45/90)] = 0.15.
|
||||
<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:
|
||||
<samp>0.3 * [1 − (45 / 90)] = 0.15</samp>
|
||||
</li>
|
||||
<li>The resulting required ratio is 0.15, which falls between the maximum required ratio of 0.30 and the minimum required ratio of 0.05 for his amount downloaded bracket.</li>
|
||||
<li>If Rippy's on-site required ratio was listed as a value greater than the calculated value, this would be because he hadn't seeded those 45 torrents for a 72 hour period in the
|
||||
|
@ -18,7 +18,7 @@
|
||||
<li>This is a torrent site which promotes sharing amongst the community. If you are not willing to give back to the community what you take from it, this site is not for you. In other words, we expect you to have an acceptable share ratio. If you download a torrent, please, seed the copy you have until there are sufficient people seeding the torrent data before you stop.</li>
|
||||
<li>Do not browse the site using proxies or Tor. The site will automatically alert us. This includes VPNs with dynamic IP addresses.</li>
|
||||
<li>Asking for invites to any site is not allowed anywhere on What.CD or our IRC network. Invites may be offered in the Invites forum, and nowhere else.</li>
|
||||
<li>Trading and selling invites is strictly prohibited, as is offering them in public - this includes on any forum which is not a class-restricted section on an invitation-only torrent site.</li>
|
||||
<li>Trading and selling invites is strictly prohibited, as is offering them in public - this includes on any forum which is not a class-restricted section on an invitation-only torrent site. Responding to public requests for invites may also jeopardize your account and those whom you invite from a public request.</li>
|
||||
<li>Trading, selling, sharing, or giving away your account is prohibited. If you no longer want your account, send a staff PM requesting that it be disabled.</li>
|
||||
<li>You're completely responsible for the people you invite. If your invitees are caught cheating or trading/selling invites, not only will they be banned, so will you. Be careful who you invite. Invites are a precious commodity.</li>
|
||||
<li>Be careful when sharing an IP address or a computer with a friend if they have (or have had) an account. From then on your accounts will be inherently linked and if one of you violates the rules, both accounts will be disabled along with any other accounts linked by IP address. This rule applies to logging into the site.</li>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?
|
||||
enforce_login();
|
||||
|
||||
if(!check_perms('users_mod')) {
|
||||
if (!check_perms('users_mod')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
require(SERVER_ROOT.'/classes/class_text.php');
|
||||
$Text = new TEXT;
|
||||
|
||||
if(check_perms('admin_manage_blog')) {
|
||||
if(!empty($_REQUEST['action'])) {
|
||||
switch($_REQUEST['action']) {
|
||||
if (check_perms('admin_manage_blog')) {
|
||||
if (!empty($_REQUEST['action'])) {
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'takeeditblog':
|
||||
authorize();
|
||||
if (empty($_POST['title'])) {
|
||||
error("Please enter a title.");
|
||||
}
|
||||
if(is_number($_POST['blogid'])) {
|
||||
if (is_number($_POST['blogid'])) {
|
||||
$DB->query("UPDATE staff_blog SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."' WHERE ID='".db_string($_POST['blogid'])."'");
|
||||
$Cache->delete_value('staff_blog');
|
||||
$Cache->delete_value('staff_feed_blog');
|
||||
@ -28,14 +28,14 @@
|
||||
header('Location: staffblog.php');
|
||||
break;
|
||||
case 'editblog':
|
||||
if(is_number($_GET['id'])){
|
||||
if (is_number($_GET['id'])) {
|
||||
$BlogID = $_GET['id'];
|
||||
$DB->query("SELECT Title, Body FROM staff_blog WHERE ID=$BlogID");
|
||||
list($Title, $Body, $ThreadID) = $DB->next_record();
|
||||
}
|
||||
break;
|
||||
case 'deleteblog':
|
||||
if(is_number($_GET['id'])){
|
||||
if (is_number($_GET['id'])) {
|
||||
authorize();
|
||||
$DB->query("DELETE FROM staff_blog WHERE ID='".db_string($_GET['id'])."'");
|
||||
$Cache->delete_value('staff_blog');
|
||||
@ -67,21 +67,21 @@
|
||||
<div class="box thin">
|
||||
<div class="head">
|
||||
<?=((empty($_GET['action'])) ? 'Create a staff blog post' : 'Edit staff blog post')?>
|
||||
<span style="float:right;">
|
||||
<a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='(Hide)'?'(Show)':'(Hide)'); return false;"><?=($_REQUEST['action']!='editblog')?'(Show)':'(Hide)'?></a>
|
||||
<span style="float: right;">
|
||||
<a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="bracket"><?=($_REQUEST['action'] != 'editblog') ? 'Show' : 'Hide' ?></a>
|
||||
</span>
|
||||
</div>
|
||||
<form class="<?=((empty($_GET['action'])) ? 'create_form' : 'edit_form')?>" name="blog_post" action="staffblog.php" method="post">
|
||||
<div id="postform" class="pad<?=($_REQUEST['action']!='editblog')?' hidden':''?>">
|
||||
<div id="postform" class="pad<?=($_REQUEST['action'] != 'editblog') ? ' hidden' : '' ?>">
|
||||
<input type="hidden" name="action" value="<?=((empty($_GET['action'])) ? 'takenewblog' : 'takeeditblog')?>" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<? if(!empty($_GET['action']) && $_GET['action'] == 'editblog'){?>
|
||||
<? if (!empty($_GET['action']) && $_GET['action'] == 'editblog') { ?>
|
||||
<input type="hidden" name="blogid" value="<?=$BlogID; ?>" />
|
||||
<? }?>
|
||||
<? } ?>
|
||||
<h3>Title</h3>
|
||||
<input type="text" name="title" size="95" <? if(!empty($Title)) { echo 'value="'.display_str($Title).'"'; } ?> /><br />
|
||||
<input type="text" name="title" size="95"<? if (!empty($Title)) { echo ' value="'.display_str($Title).'"'; } ?> /><br />
|
||||
<h3>Body</h3>
|
||||
<textarea name="body" cols="95" rows="15"><? if(!empty($Body)) { echo display_str($Body); } ?></textarea> <br />
|
||||
<textarea name="body" cols="95" rows="15"><? if (!empty($Body)) { echo display_str($Body); } ?></textarea> <br />
|
||||
<br /><br />
|
||||
<div class="center">
|
||||
<input type="submit" value="<?=((!isset($_GET['action'])) ? 'Create blog post' : 'Edit blog post') ?>" />
|
||||
@ -117,10 +117,10 @@
|
||||
<div id="blog<?=$BlogID?>" class="box">
|
||||
<div class="head">
|
||||
<strong><?=$Title?></strong> - posted <?=time_diff($BlogTime);?> by <?=$Author?>
|
||||
<? if(check_perms('admin_manage_blog')) { ?>
|
||||
<? if (check_perms('admin_manage_blog')) { ?>
|
||||
- <a href="staffblog.php?action=editblog&id=<?=$BlogID?>" class="brackets">Edit</a>
|
||||
<a href="staffblog.php?action=deleteblog&id=<?=$BlogID?>&auth=<?=$LoggedUser['AuthKey']?>" onclick="return confirm('Do you want to delete this?')" class="brackets">Delete</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div class="pad">
|
||||
<?=$Text->full_format($Body)?>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?
|
||||
enforce_login();
|
||||
if(!isset($_REQUEST['action'])) {
|
||||
if (!isset($_REQUEST['action'])) {
|
||||
error(404);
|
||||
} else {
|
||||
switch($_REQUEST['action']){
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'users':
|
||||
include(SERVER_ROOT.'/sections/stats/users.php');
|
||||
break;
|
||||
|
@ -7,45 +7,45 @@
|
||||
$DB->query("SELECT DATE_FORMAT(Time,'%b \'%y') AS Month, COUNT(ID) FROM torrents GROUP BY Month ORDER BY Time DESC LIMIT 1, 12");
|
||||
$TimelineNet = array_reverse($DB->to_array());
|
||||
|
||||
foreach($TimelineIn as $Month) {
|
||||
foreach ($TimelineIn as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
if ($Amount > $Max) {
|
||||
$Max = $Amount;
|
||||
}
|
||||
}
|
||||
foreach($TimelineOut as $Month) {
|
||||
foreach ($TimelineOut as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
if ($Amount > $Max) {
|
||||
$Max = $Amount;
|
||||
}
|
||||
}
|
||||
foreach($TimelineNet as $Month) {
|
||||
foreach ($TimelineNet as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
if ($Amount > $Max) {
|
||||
$Max = $Amount;
|
||||
}
|
||||
}
|
||||
foreach($TimelineIn as $Month) {
|
||||
foreach ($TimelineIn as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
$Labels[] = $Label;
|
||||
$InFlow[] = number_format(($Amount/$Max)*100,4);
|
||||
$InFlow[] = number_format(($Amount / $Max) * 100, 4);
|
||||
}
|
||||
foreach($TimelineOut as $Month) {
|
||||
foreach ($TimelineOut as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
$OutFlow[] = number_format(($Amount/$Max)*100,4);
|
||||
$OutFlow[] = number_format(($Amount / $Max) * 100, 4);
|
||||
}
|
||||
foreach($TimelineNet as $Month) {
|
||||
foreach ($TimelineNet as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
$NetFlow[] = number_format(($Amount/$Max)*100,4);
|
||||
$NetFlow[] = number_format(($Amount / $Max) * 100, 4);
|
||||
}
|
||||
$Cache->cache_value('torrents_timeline',array($Labels,$InFlow,$OutFlow,$NetFlow,$Max),mktime(0,0,0,date('n')+1,2)); //Tested: fine for dec -> jan
|
||||
$Cache->cache_value('torrents_timeline',array($Labels,$InFlow,$OutFlow,$NetFlow,$Max),mktime(0,0,0,date('n') + 1,2)); //Tested: fine for dec -> jan
|
||||
}
|
||||
|
||||
include_once(SERVER_ROOT.'/classes/class_charts.php');
|
||||
$DB->query("SELECT tg.CategoryID, COUNT(t.ID) AS Torrents FROM torrents AS t JOIN torrents_group AS tg ON tg.ID=t.GroupID GROUP BY tg.CategoryID ORDER BY Torrents DESC");
|
||||
$Groups = $DB->to_array();
|
||||
$Pie = new PIE_CHART(750,400,array('Other'=>1,'Percentage'=>1));
|
||||
foreach($Groups as $Group) {
|
||||
foreach ($Groups as $Group) {
|
||||
list($CategoryID, $Torrents) = $Group;
|
||||
$CategoryName = $Categories[$CategoryID - 1];
|
||||
$Pie->add($CategoryName,$Torrents);
|
||||
|
@ -3,26 +3,26 @@
|
||||
include_once(SERVER_ROOT.'/classes/class_charts.php');
|
||||
$DB->query('SELECT Code, Users FROM users_geodistribution');
|
||||
$Data = $DB->to_array();
|
||||
$Count = $DB->record_count()-1;
|
||||
$Count = $DB->record_count() - 1;
|
||||
|
||||
if($Count<30) {
|
||||
if ($Count < 30) {
|
||||
$CountryMinThreshold = $Count;
|
||||
} else {
|
||||
$CountryMinThreshold = 30;
|
||||
}
|
||||
|
||||
$CountryMax = ceil(log(Max(1,$Data[0][1]))/log(2))+1;
|
||||
$CountryMin = floor(log(Max(1,$Data[$CountryMinThreshold][1]))/log(2));
|
||||
$CountryMax = ceil(log(Max(1, $Data[0][1])) / log(2)) + 1;
|
||||
$CountryMin = floor(log(Max(1, $Data[$CountryMinThreshold][1])) / log(2));
|
||||
|
||||
$CountryRegions = array('RS' => array('RS-KM')); // Count Kosovo as Serbia as it doesn't have a TLD
|
||||
foreach ($Data as $Key => $Item) {
|
||||
list($Country,$UserCount) = $Item;
|
||||
$Countries[] = $Country;
|
||||
$CountryUsers[] = number_format((((log($UserCount)/log(2))-$CountryMin)/($CountryMax-$CountryMin))*100,2);
|
||||
$Rank[] = round((1-($Key/$Count))*100);
|
||||
$CountryUsers[] = number_format((((log($UserCount) / log(2)) - $CountryMin) / ($CountryMax - $CountryMin)) * 100, 2);
|
||||
$Rank[] = round((1 - ($Key / $Count)) * 100);
|
||||
|
||||
if(isset($CountryRegions[$Country])) {
|
||||
foreach($CountryRegions[$Country] as $Region) {
|
||||
if (isset($CountryRegions[$Country])) {
|
||||
foreach ($CountryRegions[$Country] as $Region) {
|
||||
$Countries[] = $Region;
|
||||
$Rank[] = end($Rank);
|
||||
}
|
||||
@ -30,20 +30,20 @@
|
||||
}
|
||||
reset($Rank);
|
||||
|
||||
for ($i=$CountryMin;$i<=$CountryMax;$i++) {
|
||||
$LogIncrements[] = Format::human_format(pow(2,$i));
|
||||
for ($i = $CountryMin; $i <= $CountryMax; $i++) {
|
||||
$LogIncrements[] = Format::human_format(pow(2, $i));
|
||||
}
|
||||
$Cache->cache_value('geodistribution',array($Countries,$Rank,$CountryUsers,$CountryMax,$CountryMin,$LogIncrements),0);
|
||||
$Cache->cache_value('geodistribution',array($Countries, $Rank, $CountryUsers, $CountryMax, $CountryMin, $LogIncrements), 0);
|
||||
}
|
||||
|
||||
if(!$ClassDistribution = $Cache->get_value('class_distribution')) {
|
||||
if (!$ClassDistribution = $Cache->get_value('class_distribution')) {
|
||||
include_once(SERVER_ROOT.'/classes/class_charts.php');
|
||||
$DB->query("SELECT p.Name, COUNT(m.ID) AS Users FROM users_main AS m JOIN permissions AS p ON m.PermissionID=p.ID WHERE m.Enabled='1' GROUP BY p.Name ORDER BY Users DESC");
|
||||
$ClassSizes = $DB->to_array();
|
||||
$Pie = new PIE_CHART(750,400,array('Other'=>1,'Percentage'=>1));
|
||||
foreach($ClassSizes as $ClassSize) {
|
||||
list($Label,$Users) = $ClassSize;
|
||||
$Pie->add($Label,$Users);
|
||||
foreach ($ClassSizes as $ClassSize) {
|
||||
list($Label, $Users) = $ClassSize;
|
||||
$Pie->add($Label, $Users);
|
||||
}
|
||||
$Pie->transparent();
|
||||
$Pie->color('FF33CC');
|
||||
@ -51,7 +51,7 @@
|
||||
$ClassDistribution = $Pie->url();
|
||||
$Cache->cache_value('class_distribution',$ClassDistribution,3600*24*14);
|
||||
}
|
||||
if(!$PlatformDistribution = $Cache->get_value('platform_distribution')) {
|
||||
if (!$PlatformDistribution = $Cache->get_value('platform_distribution')) {
|
||||
include_once(SERVER_ROOT.'/classes/class_charts.php');
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
$Platforms = $DB->to_array();
|
||||
$Pie = new PIE_CHART(750,400,array('Other'=>1,'Percentage'=>1));
|
||||
foreach($Platforms as $Platform) {
|
||||
foreach ($Platforms as $Platform) {
|
||||
list($Label,$Users) = $Platform;
|
||||
$Pie->add($Label,$Users);
|
||||
}
|
||||
@ -67,10 +67,10 @@
|
||||
$Pie->color('8A00B8');
|
||||
$Pie->generate();
|
||||
$PlatformDistribution = $Pie->url();
|
||||
$Cache->cache_value('platform_distribution',$PlatformDistribution,3600*24*14);
|
||||
$Cache->cache_value('platform_distribution',$PlatformDistribution,3600 * 24 * 14);
|
||||
}
|
||||
|
||||
if(!$BrowserDistribution = $Cache->get_value('browser_distribution')) {
|
||||
if (!$BrowserDistribution = $Cache->get_value('browser_distribution')) {
|
||||
include_once(SERVER_ROOT.'/classes/class_charts.php');
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
|
||||
$Browsers = $DB->to_array();
|
||||
$Pie = new PIE_CHART(750,400,array('Other'=>1,'Percentage'=>1));
|
||||
foreach($Browsers as $Browser) {
|
||||
foreach ($Browsers as $Browser) {
|
||||
list($Label,$Users) = $Browser;
|
||||
$Pie->add($Label,$Users);
|
||||
}
|
||||
@ -86,7 +86,7 @@
|
||||
$Pie->color('008AB8');
|
||||
$Pie->generate();
|
||||
$BrowserDistribution = $Pie->url();
|
||||
$Cache->cache_value('browser_distribution',$BrowserDistribution,3600*24*14);
|
||||
$Cache->cache_value('browser_distribution',$BrowserDistribution,3600 * 24 * 14);
|
||||
}
|
||||
|
||||
|
||||
@ -96,13 +96,13 @@
|
||||
$TimelineIn = array_reverse($DB->to_array());
|
||||
$DB->query("SELECT DATE_FORMAT(BanDate,'%b \\'%y') AS Month, COUNT(UserID) FROM users_info GROUP BY Month ORDER BY BanDate DESC LIMIT 1, 12");
|
||||
$TimelineOut = array_reverse($DB->to_array());
|
||||
foreach($TimelineIn as $Month) {
|
||||
foreach ($TimelineIn as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
if ($Amount > $Max) {
|
||||
$Max = $Amount;
|
||||
}
|
||||
}
|
||||
foreach($TimelineOut as $Month) {
|
||||
foreach ($TimelineOut as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
if ($Amount > $Max) {
|
||||
$Max = $Amount;
|
||||
@ -110,16 +110,16 @@
|
||||
}
|
||||
|
||||
$Labels = array();
|
||||
foreach($TimelineIn as $Month) {
|
||||
foreach ($TimelineIn as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
$Labels[] = $Label;
|
||||
$InFlow[] = number_format(($Amount/$Max)*100,4);
|
||||
$InFlow[] = number_format(($Amount / $Max) * 100, 4);
|
||||
}
|
||||
foreach($TimelineOut as $Month) {
|
||||
foreach ($TimelineOut as $Month) {
|
||||
list($Label,$Amount) = $Month;
|
||||
$OutFlow[] = number_format(($Amount/$Max)*100,4);
|
||||
$OutFlow[] = number_format(($Amount / $Max) * 100, 4);
|
||||
}
|
||||
$Cache->cache_value('users_timeline',array($Labels,$InFlow,$OutFlow,$Max),mktime(0,0,0,date('n')+1,2)); //Tested: fine for dec -> jan
|
||||
$Cache->cache_value('users_timeline',array($Labels,$InFlow,$OutFlow,$Max),mktime(0,0,0,date('n') + 1, 2)); //Tested: fine for dec -> jan
|
||||
}
|
||||
//End timeline generation
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?
|
||||
if(!check_perms('admin_donor_log')) { error(403); }
|
||||
if (!check_perms('admin_donor_log')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
include(SERVER_ROOT.'/sections/donate/config.php');
|
||||
|
||||
@ -15,7 +17,7 @@
|
||||
d.Email,
|
||||
d.Time
|
||||
FROM donations AS d ";
|
||||
if(!empty($_GET['search'])) {
|
||||
if (!empty($_GET['search'])) {
|
||||
$sql .= "WHERE d.Email LIKE '%".db_string($_GET['search'])."%' ";
|
||||
}
|
||||
$sql .= "ORDER BY d.Time DESC LIMIT $Limit";
|
||||
@ -30,7 +32,7 @@
|
||||
$DB->query("SELECT DATE_FORMAT(Time,'%b \'%y') AS Month, SUM(Amount) FROM donations GROUP BY Month ORDER BY Time DESC LIMIT 1, 18");
|
||||
$Timeline = array_reverse($DB->to_array());
|
||||
$Area = new AREA_GRAPH(880,160,array('Break'=>1));
|
||||
foreach($Timeline as $Entry) {
|
||||
foreach ($Timeline as $Entry) {
|
||||
list($Label,$Amount) = $Entry;
|
||||
$Area->add($Label,$Amount);
|
||||
}
|
||||
@ -40,7 +42,7 @@
|
||||
$Area->lines(2);
|
||||
$Area->generate();
|
||||
$DonationTimeline = $Area->url();
|
||||
$Cache->cache_value('donation_timeline',$DonationTimeline,mktime(0,0,0,date('n')+1,2));
|
||||
$Cache->cache_value('donation_timeline',$DonationTimeline,mktime(0,0,0,date('n') + 1, 2));
|
||||
}
|
||||
|
||||
View::show_header('Donation log');
|
||||
@ -69,7 +71,7 @@
|
||||
<br />
|
||||
<div class="linkbox">
|
||||
<?
|
||||
$Pages=Format::get_pages($Page,$Results,DONATIONS_PER_PAGE,11) ;
|
||||
$Pages = Format::get_pages($Page, $Results, DONATIONS_PER_PAGE, 11);
|
||||
echo $Pages;
|
||||
?>
|
||||
</div>
|
||||
@ -81,7 +83,7 @@
|
||||
<td>Time</td>
|
||||
</tr>
|
||||
<?
|
||||
foreach($Donations as $Donation) {
|
||||
foreach ($Donations as $Donation) {
|
||||
list($UserID, $Amount, $Currency, $Email, $DonationTime) = $Donation;
|
||||
?>
|
||||
<tr>
|
||||
|
@ -506,7 +506,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -214,7 +214,7 @@
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -314,7 +314,7 @@
|
||||
<td class="nobr big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -1001,7 +1001,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td colspan="2" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID'] - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID']) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -1122,7 +1122,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -119,12 +119,8 @@ function compare($X, $Y) {
|
||||
<div class="head"><strong>Cover</strong></div>
|
||||
<?
|
||||
if ($WikiImage != '') {
|
||||
$WikiImageThumb = ImageTools::wiki_image($WikiImage);
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = ImageTools::proxy_url($WikiImage);
|
||||
}
|
||||
?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=$WikiImageThumb?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=$WikiImage?>',220);" /></p>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=ImageTools::process($WikiImage)?>',220);" /></p>
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
|
@ -256,7 +256,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -25,14 +25,14 @@
|
||||
$Type = $Categories[$TypeID-1];
|
||||
$TorrentID = (int)$_POST['torrentid'];
|
||||
$Properties['Remastered'] = (isset($_POST['remaster']))? 1 : 0;
|
||||
if($Properties['Remastered']) {
|
||||
if ($Properties['Remastered']) {
|
||||
$Properties['UnknownRelease'] = (isset($_POST['unknown'])) ? 1 : 0;
|
||||
$Properties['RemasterYear'] = $_POST['remaster_year'];
|
||||
$Properties['RemasterTitle'] = $_POST['remaster_title'];
|
||||
$Properties['RemasterRecordLabel'] = $_POST['remaster_record_label'];
|
||||
$Properties['RemasterCatalogueNumber'] = $_POST['remaster_catalogue_number'];
|
||||
}
|
||||
if(!$Properties['Remastered']) {
|
||||
if (!$Properties['Remastered']) {
|
||||
$Properties['UnknownRelease'] = 0;
|
||||
$Properties['RemasterYear'] = '';
|
||||
$Properties['RemasterTitle'] = '';
|
||||
@ -57,21 +57,21 @@
|
||||
$Properties['Trumpable'] = (isset($_POST['make_trumpable'])) ? 1 : 0;
|
||||
$Properties['TorrentDescription'] = $_POST['release_desc'];
|
||||
$Properties['Name'] = $_POST['title'];
|
||||
if($_POST['album_desc']) {
|
||||
if ($_POST['album_desc']) {
|
||||
$Properties['GroupDescription'] = $_POST['album_desc'];
|
||||
}
|
||||
if(check_perms('torrents_freeleech')) {
|
||||
if (check_perms('torrents_freeleech')) {
|
||||
$Free = (int)$_POST['freeleech'];
|
||||
if(!in_array($Free, array(0,1,2))) {
|
||||
if (!in_array($Free, array(0,1,2))) {
|
||||
error(404);
|
||||
}
|
||||
$Properties['FreeLeech'] = $Free;
|
||||
|
||||
if($Free == 0) {
|
||||
if ($Free == 0) {
|
||||
$FreeType = 0;
|
||||
} else {
|
||||
$FreeType = (int)$_POST['freeleechtype'];
|
||||
if(!in_array($Free, array(0,1,2,3))) {
|
||||
if (!in_array($Free, array(0,1,2,3))) {
|
||||
error(404);
|
||||
}
|
||||
}
|
||||
@ -82,22 +82,22 @@
|
||||
//--------------- Validate data in edit form -----------------------------------//
|
||||
|
||||
$DB->query('SELECT UserID, Remastered, RemasterYear, FreeTorrent FROM torrents WHERE ID='.$TorrentID);
|
||||
if($DB->record_count() == 0) {
|
||||
if ($DB->record_count() == 0) {
|
||||
error(404);
|
||||
}
|
||||
list($UserID, $Remastered, $RemasterYear, $CurFreeLeech) = $DB->next_record(MYSQLI_BOTH, false);
|
||||
|
||||
if($LoggedUser['ID']!=$UserID && !check_perms('torrents_edit')) {
|
||||
if ($LoggedUser['ID'] != $UserID && !check_perms('torrents_edit')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
if($Remastered == '1' && !$RemasterYear && !check_perms('edit_unknowns')) {
|
||||
if ($Remastered == '1' && !$RemasterYear && !check_perms('edit_unknowns')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
if($Properties['UnknownRelease'] && !($Remastered == '1' && !$RemasterYear) && !check_perms('edit_unknowns')) {
|
||||
if ($Properties['UnknownRelease'] && !($Remastered == '1' && !$RemasterYear) && !check_perms('edit_unknowns')) {
|
||||
//It's Unknown now, and it wasn't before
|
||||
if($LoggedUser['ID'] != $UserID) {
|
||||
if ($LoggedUser['ID'] != $UserID) {
|
||||
//Hax
|
||||
die();
|
||||
}
|
||||
@ -106,7 +106,7 @@
|
||||
$Validate->SetFields('type','1','number','Not a valid type.',array('maxlength'=>count($Categories), 'minlength'=>1));
|
||||
switch ($Type) {
|
||||
case 'Music':
|
||||
if(!empty($Properties['Remastered']) && !$Properties['UnknownRelease']){
|
||||
if (!empty($Properties['Remastered']) && !$Properties['UnknownRelease']) {
|
||||
$Validate->SetFields('remaster_year', '1', 'number', 'Year of remaster/re-issue must be entered.');
|
||||
} else {
|
||||
$Validate->SetFields('remaster_year', '0','number', 'Invalid remaster year.');
|
||||
@ -142,11 +142,13 @@
|
||||
|
||||
|
||||
// Handle 'other' bitrates
|
||||
if($Properties['Encoding'] == 'Other') {
|
||||
if ($Properties['Encoding'] == 'Other') {
|
||||
$Validate->SetFields('other_bitrate',
|
||||
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||
$enc = trim($_POST['other_bitrate']);
|
||||
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
||||
if (isset($_POST['vbr'])) {
|
||||
$enc.=' (VBR)';
|
||||
}
|
||||
|
||||
$Properties['Encoding'] = $enc;
|
||||
$Properties['Bitrate'] = $enc;
|
||||
@ -179,11 +181,13 @@
|
||||
|
||||
|
||||
// Handle 'other' bitrates
|
||||
if($Properties['Encoding'] == 'Other') {
|
||||
if ($Properties['Encoding'] == 'Other') {
|
||||
$Validate->SetFields('other_bitrate',
|
||||
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||
$enc = trim($_POST['other_bitrate']);
|
||||
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
||||
if (isset($_POST['vbr'])) {
|
||||
$enc.=' (VBR)';
|
||||
}
|
||||
|
||||
$Properties['Encoding'] = $enc;
|
||||
$Properties['Bitrate'] = $enc;
|
||||
@ -209,9 +213,9 @@
|
||||
|
||||
$Err = $Validate->ValidateForm($_POST); // Validate the form
|
||||
|
||||
if($Properties['Remastered'] && !$Properties['RemasterYear']) {
|
||||
if ($Properties['Remastered'] && !$Properties['RemasterYear']) {
|
||||
//Unknown Edit!
|
||||
if($LoggedUser['ID'] == $UserID || check_perms('edit_unknowns')) {
|
||||
if ($LoggedUser['ID'] == $UserID || check_perms('edit_unknowns')) {
|
||||
//Fine!
|
||||
} else {
|
||||
$Err = "You may not edit somebody else's upload to unknown release.";
|
||||
@ -226,8 +230,8 @@
|
||||
}
|
||||
ImageTools::blacklisted($Properties['Image']);
|
||||
|
||||
if($Err){ // Show the upload form, with the data the user entered
|
||||
if(check_perms('site_debug')) {
|
||||
if ($Err) { // Show the upload form, with the data the user entered
|
||||
if (check_perms('site_debug')) {
|
||||
die($Err);
|
||||
}
|
||||
error($Err);
|
||||
@ -240,8 +244,8 @@
|
||||
// Shorten and escape $Properties for database input
|
||||
$T = array();
|
||||
foreach ($Properties as $Key => $Value) {
|
||||
$T[$Key]="'".db_string(trim($Value))."'";
|
||||
if(!$T[$Key]){
|
||||
$T[$Key] = "'".db_string(trim($Value))."'";
|
||||
if (!$T[$Key]) {
|
||||
$T[$Key] = NULL;
|
||||
}
|
||||
}
|
||||
@ -286,13 +290,13 @@
|
||||
Scene=$T[Scene],
|
||||
Description=$T[TorrentDescription],";
|
||||
|
||||
if(check_perms('torrents_freeleech')) {
|
||||
if (check_perms('torrents_freeleech')) {
|
||||
$SQL .= "FreeTorrent=$T[FreeLeech],";
|
||||
$SQL .= "FreeLeechType=$T[FreeLeechType],";
|
||||
}
|
||||
|
||||
if(check_perms('users_mod')) {
|
||||
if($T[Format] != "'FLAC'") {
|
||||
if (check_perms('users_mod')) {
|
||||
if ($T[Format] != "'FLAC'") {
|
||||
$SQL .= "
|
||||
HasLog='0',
|
||||
HasCue='0',
|
||||
@ -381,7 +385,7 @@
|
||||
";
|
||||
$DB->query($SQL);
|
||||
|
||||
if(check_perms('torrents_freeleech') && $Properties['FreeLeech'] != $CurFreeLeech) {
|
||||
if (check_perms('torrents_freeleech') && $Properties['FreeLeech'] != $CurFreeLeech) {
|
||||
Torrents::freeleech_torrents($TorrentID, $Properties['FreeLeech'], $Properties['FreeLeechType']);
|
||||
}
|
||||
|
||||
@ -389,8 +393,8 @@
|
||||
list($GroupID, $Time) = $DB->next_record();
|
||||
|
||||
// Competition
|
||||
if(strtotime($Time)>1241352173) {
|
||||
if($_POST['log_score'] == '100') {
|
||||
if (strtotime($Time)>1241352173) {
|
||||
if ($_POST['log_score'] == '100') {
|
||||
$DB->query("INSERT IGNORE into users_points (GroupID, UserID, Points) VALUES ('$GroupID', '$UserID', '1')");
|
||||
}
|
||||
}
|
||||
|
@ -492,7 +492,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -811,9 +811,9 @@
|
||||
foreach ($ArtistsUnescaped as $Importance => $Artists) {
|
||||
foreach ($Artists as $Artist) {
|
||||
if ($Importance == 1 || $Importance == 4 || $Importance == 5 || $Importance == 6) {
|
||||
$ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']))."|%'";
|
||||
$ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']), true)."|%'";
|
||||
} else {
|
||||
$GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']))."|%'";
|
||||
$GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']), true)."|%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,8 +166,10 @@ function user_dupes_table($UserID) {
|
||||
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" />
|
||||
<div class="box">
|
||||
<div class="head"><?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="l_a_box">
|
||||
<div class="head">
|
||||
<a href="#l_a_box"><strong>↑</strong></a> <?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<table width="100%" class="layout hidden linkedaccounts">
|
||||
<?=$DupeCount?'<tr>':''?>
|
||||
<?
|
||||
|
@ -13,7 +13,7 @@
|
||||
if (!$Name) {
|
||||
error(404);
|
||||
}
|
||||
if (isset($_GET['format']) && $_GET['format'] === "data"){
|
||||
if (isset($_GET['format']) && $_GET['format'] === "data") {
|
||||
global $Cache;
|
||||
$ImageData = $Cache->get_value("cssgallery_".$Name);
|
||||
if(!empty($ImageData)){
|
||||
@ -26,19 +26,19 @@
|
||||
} else {
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" style="overflow:hidden !important; margin: 0 !important; padding: 0 !important;">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" style="overflow: hidden !important; margin: 0 !important; padding: 0 !important;">
|
||||
<head>
|
||||
<title>Stylesheet Gallery</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1;IE=edge" />
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1; IE=edge" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="<? echo STATIC_SERVER; ?>styles/global.css?v=<?=filemtime(STATIC_SERVER.'styles/global.css')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<? echo STATIC_SERVER; ?>styles/<?= $Name ?>/style.css?v=<?=filemtime(STATIC_SERVER.'styles/'.$Name.'/style.css')?>" title="<?= $Name ?>" rel="stylesheet" type="text/css" media="screen" />
|
||||
<? if (isset($_GET['save']) && $_GET['save']==="true" && check_perms('admin_clear_cache')) { ?>
|
||||
<? if (isset($_GET['save']) && $_GET['save'] === 'true' && check_perms('admin_clear_cache')) { ?>
|
||||
<script src="<? echo STATIC_SERVER; ?>functions/jquery.js?v=<?=filemtime(STATIC_SERVER.'functions/jquery.js')?>"></script>
|
||||
<script src="<? echo STATIC_SERVER; ?>functions/stylesheetgallery.js?v=<?=filemtime(STATIC_SERVER.'functions/stylesheetgallery.js')?>"></script>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</head>
|
||||
<body id="user" style="overflow:hidden !important; margin: 0 !important; padding: 0 !important; position: absolute !important;" stylesheet="<?= $Name ?>">
|
||||
<body id="user" style="overflow: hidden !important; margin: 0 !important; padding: 0 !important; position: absolute !important;" stylesheet="<?= $Name ?>">
|
||||
<div id="wrapper">
|
||||
<h1 class="hidden">Gazelle</h1>
|
||||
<div id="header">
|
||||
@ -110,39 +110,38 @@
|
||||
<span class="hidden">Artist: </span>
|
||||
<form class="search_form" name="artists" action="" method="get">
|
||||
<script type="text/javascript" src="static/functions/autocomplete.js?v=1362029969"></script>
|
||||
<input id="artistsearch" value="Artists" type="text" name="artistname" size="17"/>
|
||||
<input id="artistsearch" value="Artists" type="text" name="artistname" size="17" />
|
||||
<ul id="artistcomplete" style="visibility: hidden;"><li/></ul>
|
||||
</form>
|
||||
</li>
|
||||
<li id="searchbar_requests">
|
||||
<span class="hidden">Requests: </span>
|
||||
<form class="search_form" name="requests" action="" method="get">
|
||||
<input id="requestssearch" value="Requests" type="text" name="search" size="17"/>
|
||||
<input id="requestssearch" value="Requests" type="text" name="search" size="17" />
|
||||
</form>
|
||||
</li>
|
||||
<li id="searchbar_forums">
|
||||
<span class="hidden">Forums: </span>
|
||||
<form class="search_form" name="forums" action="" method="get">
|
||||
<input value="search" type="hidden" name="action" />
|
||||
<input id="forumssearch" value="Forums" type="text" name="search" size="17"/>
|
||||
<input id="forumssearch" value="Forums" type="text" name="search" size="17" />
|
||||
</form>
|
||||
</li>
|
||||
<li id="searchbar_log">
|
||||
<span class="hidden">Log: </span>
|
||||
<form class="search_form" name="log" action="" method="get">
|
||||
<input id="logsearch" value="Log" type="text" name="search" size="17"/>
|
||||
<input id="logsearch" value="Log" type="text" name="search" size="17" />
|
||||
</form>
|
||||
</li>
|
||||
<li id="searchbar_users">
|
||||
<span class="hidden">Users: </span>
|
||||
<form class="search_form" name="users" action="" method="get">
|
||||
<input type="hidden" name="action" value="search" />
|
||||
<input id="userssearch" value="Users" type="text" name="search" size="20"/>
|
||||
<input id="userssearch" value="Users" type="text" name="search" size="20" />
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="thin">
|
||||
@ -152,11 +151,11 @@
|
||||
<table class="forum_index">
|
||||
<tbody>
|
||||
<tr class="colhead">
|
||||
<td style="width:2%;"></td>
|
||||
<td style="width:25%;">Forum</td>
|
||||
<td style="width: 2%;"></td>
|
||||
<td style="width: 25%;">Forum</td>
|
||||
<td>Last post</td>
|
||||
<td style="width:7%;">Topics</td>
|
||||
<td style="width:7%;">Posts</td>
|
||||
<td style="width: 7%;">Topics</td>
|
||||
<td style="width: 7%;">Posts</td>
|
||||
</tr>
|
||||
<tr class="rowb">
|
||||
<td title="Unread" class="unread"></td>
|
||||
@ -166,13 +165,13 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="New Site Announcements" href="#">New Site Announcements</a>
|
||||
</span>
|
||||
<span title="Jump to last read" class="last_read" style="float: left;">
|
||||
<a href="#"></a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Rippy</a> <span title="Aug 14 1992, 18:35" class="time">Just now</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Rippy</a> <span title="Aug 14 1992, 18:35" class="time">Just now</span></span>
|
||||
</td>
|
||||
<td>385</td>
|
||||
<td>95,197</td>
|
||||
@ -181,14 +180,14 @@
|
||||
<td title="Read" class="read"></td>
|
||||
<td>
|
||||
<h4 class="min_padding">
|
||||
<a href="#">What.CD</a>
|
||||
<a href="#"><?=SITE_NAME?></a>
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="Dear Mortals, you have violated the rule..." href="#">Dear Mortals, you have violated the rule...</a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Drone</a> <span title="Sep 9 1992, 10:55" class="time">3 mins ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Drone</a> <span title="Sep 9 1992, 10:55" class="time">3 mins ago</span></span>
|
||||
</td>
|
||||
<td>2,624</td>
|
||||
<td>110,432</td>
|
||||
@ -198,11 +197,11 @@
|
||||
<h3>Community</h3>
|
||||
<table class="forum_index">
|
||||
<tbody><tr class="colhead">
|
||||
<td style="width:2%;"></td>
|
||||
<td style="width:25%;">Forum</td>
|
||||
<td style="width: 2%;"></td>
|
||||
<td style="width: 25%;">Forum</td>
|
||||
<td>Last post</td>
|
||||
<td style="width:7%;">Topics</td>
|
||||
<td style="width:7%;">Posts</td>
|
||||
<td style="width: 7%;">Topics</td>
|
||||
<td style="width: 7%;">Posts</td>
|
||||
</tr>
|
||||
<tr class="rowb">
|
||||
<td title="Unread" class="unread"></td>
|
||||
@ -212,13 +211,13 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="Last stand against Drone?" href="#">Last stand against Drone?</a>
|
||||
</span>
|
||||
<span title="Jump to last read" class="last_read" style="float: left;">
|
||||
<a href="#"></a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Ajax</a> <span class="time">Just now</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Ajax</a> <span class="time">Just now</span></span>
|
||||
</td>
|
||||
<td>37,531</td>
|
||||
<td>1,545,089</td>
|
||||
@ -231,10 +230,10 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="No fun allowed" href="#">No fun allowed</a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Drone</a> <span class="time">10 mins ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Drone</a> <span class="time">10 mins ago</span></span>
|
||||
</td>
|
||||
<td>424</td>
|
||||
<td>490,163</td>
|
||||
@ -247,10 +246,10 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="List of forbidden literature" href="#">List of forbidden literature</a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Drone</a> <span class="time">7 hours ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Drone</a> <span class="time">7 hours ago</span></span>
|
||||
</td>
|
||||
<td>424</td>
|
||||
<td>490,163</td>
|
||||
@ -263,10 +262,10 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="[Region] The Void" href="#">[Region] The Void</a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Drone</a> <span class="time">25 mins ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Drone</a> <span class="time">25 mins ago</span></span>
|
||||
</td>
|
||||
<td>305</td>
|
||||
<td>15,231</td>
|
||||
@ -279,13 +278,13 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="How did Drone take over the site?" href="#">How did Drone take over the site?</a>
|
||||
</span>
|
||||
<span title="Jump to last read" class="last_read" style="float: left;">
|
||||
<a href="#"></a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Etheryte</a> <span class="time">5 mins ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Etheryte</a> <span class="time">5 mins ago</span></span>
|
||||
</td>
|
||||
<td>25,031</td>
|
||||
<td>386,278</td>
|
||||
@ -296,11 +295,11 @@
|
||||
<table class="forum_index">
|
||||
<tbody>
|
||||
<tr class="colhead">
|
||||
<td style="width:2%;"></td>
|
||||
<td style="width:25%;">Forum</td>
|
||||
<td style="width: 2%;"></td>
|
||||
<td style="width: 25%;">Forum</td>
|
||||
<td>Last post</td>
|
||||
<td style="width:7%;">Topics</td>
|
||||
<td style="width:7%;">Posts</td>
|
||||
<td style="width: 7%;">Topics</td>
|
||||
<td style="width: 7%;">Posts</td>
|
||||
</tr>
|
||||
<tr class="rowb">
|
||||
<td title="Unread" class="unread"></td>
|
||||
@ -310,13 +309,13 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="Where did all the non-drone threads go?" href="#">Where did all the non-drone threads go?</a>
|
||||
</span>
|
||||
<span title="Jump to last read" class="last_read" style="float: left;">
|
||||
<a href="#"></a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Ananke</a> <span class="time">1 min ago</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Ananke</a> <span class="time">1 min ago</span></span>
|
||||
</td>
|
||||
<td>22,564</td>
|
||||
<td>608,253</td>
|
||||
@ -329,10 +328,10 @@
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
<span class="last_topic" style="float:left;">
|
||||
<span class="last_topic" style="float: left;">
|
||||
<a title="Drone - Drone [EP] (drone, noise)" href="#">Drone - Drone [EP] (drone, noise)</a>
|
||||
</span>
|
||||
<span class="last_poster" style="float:right;">by <a href="#">Drone</a> <span class="time">Just now</span></span>
|
||||
<span class="last_poster" style="float: right;">by <a href="#">Drone</a> <span class="time">Just now</span></span>
|
||||
</td>
|
||||
<td>3,948</td>
|
||||
<td>24,269</td>
|
||||
@ -344,6 +343,6 @@
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
<?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +120,7 @@
|
||||
$DisplayCustomTitle = $CustomTitle;
|
||||
if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
|
||||
$DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) {
|
||||
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
|
||||
return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
|
||||
}, $CustomTitle);
|
||||
}
|
||||
|
||||
@ -535,16 +535,14 @@ function check_paranoia_here($Setting) {
|
||||
?>
|
||||
<table class="layout recent" id="recent_snatches" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">Recent snatches</td>
|
||||
<td colspan="5">
|
||||
<a href="#recent_snatches"><strong>↑</strong></a> Recent snatches
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?
|
||||
foreach ($RecentSnatches as $RS) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$RS['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RS['WikiImage']);
|
||||
} ?>
|
||||
<? foreach ($RecentSnatches as $RS) { ?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$RS['ID']?>" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>"><img src="<?=ImageTools::thumbnail($RS['WikiImage'])?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$RS['ID']?>" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>"><img src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -580,15 +578,14 @@ function check_paranoia_here($Setting) {
|
||||
?>
|
||||
<table class="layout recent" id="recent_uploads" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">Recent uploads</td>
|
||||
<td colspan="5">
|
||||
<a href="#recent_uploads"><strong>↑</strong></a> Recent uploads
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? foreach ($RecentUploads as $RU) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$RU['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RU['WikiImage']);
|
||||
} ?>
|
||||
<? foreach ($RecentUploads as $RU) { ?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$RU['ID']?>" title="<?=$RU['Artist']?><?=$RU['Name']?>"><img src="<?=ImageTools::thumbnail($RU['WikiImage'])?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$RU['ID']?>" title="<?=$RU['Artist']?><?=$RU['Name']?>"><img src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -610,14 +607,14 @@ function check_paranoia_here($Setting) {
|
||||
ORDER BY ct.Sort LIMIT 5");
|
||||
$Collage = $DB->to_array();
|
||||
?>
|
||||
<table class="layout recent" id="collage<?=$CollageID?>" cellpadding="0" cellspacing="0" border="0">
|
||||
<table class="layout recent" id="collage<?=$CollageID?>_box" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">
|
||||
<span style="float:left;">
|
||||
<?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
|
||||
<a href="#collage<?=$CollageID?>_box"><strong>↑</strong></a> <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
|
||||
</span>
|
||||
<span style="float:right;">
|
||||
<a href="#" onclick="$('#collage<?=$CollageID?> .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol?'Hide':'Show'?></a>
|
||||
<a href="#" onclick="$('#collage<?=$CollageID?>_box .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol?'Hide':'Show'?></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@ -630,13 +627,9 @@ function check_paranoia_here($Setting) {
|
||||
$Name = '';
|
||||
$Name .= Artists::display_artists(array('1'=>$Artists), false, true);
|
||||
$Name .= $GroupName;
|
||||
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$C['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($C['WikiImage']);
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$GroupID?>" title="<?=$Name?>"><img src="<?=ImageTools::thumbnail($C['WikiImage'])?>" alt="<?=$Name?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$GroupID?>" title="<?=$Name?>"><img src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -658,8 +651,10 @@ function check_paranoia_here($Setting) {
|
||||
include(SERVER_ROOT.'/classes/class_invite_tree.php');
|
||||
$Tree = new INVITE_TREE($UserID, array('visible'=>false));
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="invitetree_box">
|
||||
<div class="head">
|
||||
<a href="#invitetree_box"><strong>↑</strong></a> Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<div id="invitetree" class="hidden">
|
||||
<? $Tree->make_tree(); ?>
|
||||
</div>
|
||||
@ -688,8 +683,10 @@ function check_paranoia_here($Setting) {
|
||||
if ($DB->record_count() > 0) {
|
||||
$Requests = $DB->to_array();
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="requests_box">
|
||||
<div class="head">
|
||||
<a href="#requests_box"><strong>↑</strong></a> Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<div id="requests" class="request_table hidden">
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead_dark">
|
||||
@ -787,8 +784,10 @@ function check_paranoia_here($Setting) {
|
||||
if ($DB->record_count()) {
|
||||
$StaffPMs = $DB->to_array();
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Staff PMs <a href="#" onclick="$('#staffpms').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="staffpms_box">
|
||||
<div class="head">
|
||||
<a href="#staffpms_box"><strong>↑</strong></a> Staff PMs <a href="#" onclick="$('#staffpms').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<table width="100%" class="message_table hidden" id="staffpms">
|
||||
<tr class="colhead">
|
||||
<td>Subject</td>
|
||||
@ -856,8 +855,9 @@ function check_paranoia_here($Setting) {
|
||||
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
|
||||
<div class="box">
|
||||
<div class="head">Staff notes
|
||||
<div class="box" id="staff_notes_box">
|
||||
<div class="head">
|
||||
<a href="#staff_notes_box"><strong>↑</strong></a> Staff notes
|
||||
<a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
|
||||
<a href="#" onclick="$('#staffnotes').toggle(); return false;" class="brackets">Toggle</a>
|
||||
</div>
|
||||
@ -872,9 +872,11 @@ function check_paranoia_here($Setting) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="layout">
|
||||
<table class="layout" id="user_info_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">User information</td>
|
||||
<td colspan="2">
|
||||
<a href="#user_info_box"><strong>↑</strong></a> User information
|
||||
</td>
|
||||
</tr>
|
||||
<? if (check_perms('users_edit_usernames', $Class)) { ?>
|
||||
<tr>
|
||||
@ -1055,9 +1057,11 @@ function check_paranoia_here($Setting) {
|
||||
</table><br />
|
||||
|
||||
<? if (check_perms('users_warn')) { ?>
|
||||
<table class="layout">
|
||||
<table class="layout" id="warn_user_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">Warn user</td>
|
||||
<td colspan="2">
|
||||
<a href="#warn_user_box"><strong>↑</strong></a> Warn user
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Warned:</td>
|
||||
@ -1112,8 +1116,12 @@ function check_paranoia_here($Setting) {
|
||||
</tr>
|
||||
<? } ?>
|
||||
</table><br />
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">User privileges</td></tr>
|
||||
<table class="layout" id="user_privs_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#user_privs_box"><strong>↑</strong></a> User privileges
|
||||
</td>
|
||||
</tr>
|
||||
<? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
|
||||
$DB->query("SELECT DISTINCT Email, IP FROM users_history_emails WHERE UserID = ".$UserID." ORDER BY Time ASC");
|
||||
$Emails = $DB->to_array();
|
||||
@ -1165,8 +1173,9 @@ function check_paranoia_here($Setting) {
|
||||
<option value="1"<? if ($Enabled=='1') { ?> selected="selected"<? } ?>>Enabled</option>
|
||||
<option value="2"<? if ($Enabled=='2') { ?> selected="selected"<? } ?>>Disabled</option>
|
||||
<? if (check_perms('users_delete_users')) { ?>
|
||||
<optgroup label="-- WARNING --"></optgroup>
|
||||
<option value="delete">Delete account</option>
|
||||
<optgroup label="-- WARNING --">
|
||||
<option value="delete">Delete account</option>
|
||||
</optgroup>
|
||||
<? } ?>
|
||||
</select>
|
||||
</td>
|
||||
@ -1193,8 +1202,12 @@ function check_paranoia_here($Setting) {
|
||||
<? } ?>
|
||||
</table><br />
|
||||
<? if (check_perms('users_logout')) { ?>
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">Session</td></tr>
|
||||
<table class="layout" id="session_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#session_box"><strong>↑</strong></a> Session
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Reset session:</td>
|
||||
<td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
|
||||
@ -1206,8 +1219,12 @@ function check_paranoia_here($Setting) {
|
||||
|
||||
</table>
|
||||
<? } ?>
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">Submit</td></tr>
|
||||
<table class="layout" id="submit_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#submit_box"><strong>↑</strong></a> Submit
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span title="This message will be entered into staff notes only.">Reason:</span></td>
|
||||
<td>
|
||||
|
@ -46,10 +46,6 @@
|
||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||
}
|
||||
|
||||
if (check_perms('site_proxy_images') && !empty($Avatar)) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
}
|
||||
|
||||
View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode');
|
||||
|
||||
if ($LoggedUser['CustomForums']) {
|
||||
@ -305,7 +301,7 @@
|
||||
<?
|
||||
if ($Avatar) {
|
||||
?>
|
||||
<img src="<?=$Avatar?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<img src="<?=ImageTools::process($Avatar)?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
@ -138,7 +138,7 @@
|
||||
<td colspan="5" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -217,7 +217,7 @@
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -168,13 +168,10 @@
|
||||
<tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>">
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (check_perms('site_proxy_images') && preg_match('/^https?:\/\/(localhost(:[0-9]{2,5})?|[0-9]{1,3}(\.[0-9]{1,3}){3}|([a-zA-Z0-9\-\_]+\.)+([a-zA-Z]{1,5}[^\.]))(:[0-9]{2,5})?(\/[^<>]+)+\.(jpg|jpeg|gif|png|tif|tiff|bmp)$/is',$AuthorAvatar)) {
|
||||
$AuthorAvatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($AuthorAvatar); ?>
|
||||
<img src="<?=$AuthorAvatar?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<? } elseif (!$AuthorAvatar) { ?>
|
||||
<img src="<?=STATIC_SERVER.'common/avatars/default.png'?>" width="150" style="max-height: 400px;" alt="Default avatar" />
|
||||
<? if ($AuthorAvatar) { ?>
|
||||
<img src="<?=ImageTools::process($AuthorAvatar)?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<img src="<?=$AuthorAvatar?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<img src="<?=STATIC_SERVER.'common/avatars/default.png'?>" width="150" style="max-height: 400px;" alt="Default avatar" />
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
|
@ -68,7 +68,7 @@
|
||||
/>
|
||||
<input value="Search" type="submit" class="hidden" />
|
||||
</form>
|
||||
<br style="line-height:10px;" />
|
||||
<br style="line-height: 10px;" />
|
||||
<strong><a href="wiki.php?action=browse" class="brackets">Browse articles</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
@ -104,7 +104,7 @@
|
||||
$i = 0;
|
||||
foreach ($AliasArray as $AliasItem) {
|
||||
?>
|
||||
<li id="alias_<?=$AliasItem?>"><a href="wiki.php?action=article&name=<?=$AliasItem?>"><?=Format::cut_string($AliasItem,20,1)?></a><? if (check_perms('admin_manage_wiki')) { ?> <a href="#" onclick="Remove_Alias('<?=$AliasItem?>');return false;" class="brackets" title="Delete Alias">X</a> <a href="user.php?id=<?=$UserArray[$i]?>" class="brackets" title="View User">U</a><? } ?></li>
|
||||
<li id="alias_<?=$AliasItem?>"><a href="wiki.php?action=article&name=<?=$AliasItem?>"><?=Format::cut_string($AliasItem,20,1)?></a><? if (check_perms('admin_manage_wiki')) { ?> <a href="#" onclick="Remove_Alias('<?=$AliasItem?>');return false;" class="brackets" title="Delete alias">X</a> <a href="user.php?id=<?=$UserArray[$i]?>" class="brackets" title="View user">U</a><? } ?></li>
|
||||
<? $i++;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
var BBCode = {
|
||||
spoiler: function(link) {
|
||||
if($(link.nextSibling).has_class('hidden')) {
|
||||
if ($(link.nextSibling).has_class('hidden')) {
|
||||
$(link.nextSibling).show();
|
||||
$(link).html('Hide');
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
function show_peers (TorrentID, Page) {
|
||||
if(Page>0) {
|
||||
if (Page > 0) {
|
||||
ajax.get('torrents.php?action=peerlist&page='+Page+'&torrentid=' + TorrentID,function(response){
|
||||
$('#peers_' + TorrentID).show().raw().innerHTML=response;
|
||||
});
|
||||
@ -20,7 +20,7 @@ function show_peers (TorrentID, Page) {
|
||||
}
|
||||
|
||||
function show_snatches (TorrentID, Page){
|
||||
if(Page>0) {
|
||||
if (Page > 0) {
|
||||
ajax.get('torrents.php?action=snatchlist&page='+Page+'&torrentid=' + TorrentID,function(response){
|
||||
$('#snatches_' + TorrentID).show().raw().innerHTML=response;
|
||||
});
|
||||
@ -41,7 +41,7 @@ function show_snatches (TorrentID, Page){
|
||||
}
|
||||
|
||||
function show_downloads (TorrentID, Page){
|
||||
if(Page>0) {
|
||||
if (Page > 0) {
|
||||
ajax.get('torrents.php?action=downloadlist&page='+Page+'&torrentid=' + TorrentID,function(response){
|
||||
$('#downloads_' + TorrentID).show().raw().innerHTML=response;
|
||||
});
|
||||
|
@ -139,7 +139,7 @@ function Bookmark(type, id, newName) {
|
||||
}
|
||||
|
||||
function Unbookmark(type, id, newName) {
|
||||
if(window.location.pathname.indexOf('bookmarks.php') != -1) {
|
||||
if (window.location.pathname.indexOf('bookmarks.php') != -1) {
|
||||
ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() {
|
||||
$('#group_' + id).remove();
|
||||
$('.groupid_' + id).remove();
|
||||
|
@ -56,7 +56,7 @@ function main () {
|
||||
get_headers(response);
|
||||
elements.titles[0].innerHTML = title;
|
||||
elements.pages[0].innerHTML = response;
|
||||
if(back_name){
|
||||
if (back_name) {
|
||||
elements.buttons[0].textContent = back_name;
|
||||
}
|
||||
});
|
||||
@ -78,7 +78,7 @@ function go_back() {
|
||||
// Get data from comments
|
||||
function get_headers(response) {
|
||||
title = response.match(/\<\!\-\-Title\:(.+?)\-\-\>/i)[1];
|
||||
if(response.match(/\<\!\-\-Back\:(.+?)\:(.+?)\-\-\>/i)) {
|
||||
if (response.match(/\<\!\-\-Back\:(.+?)\:(.+?)\-\-\>/i)) {
|
||||
back_name = response.match(/\<\!\-\-Back\:(.+?)\:(.+?)\-\-\>/i)[1];
|
||||
back_url = response.match(/\<\!\-\-Back\:(.+?)\:(.+?)\-\-\>/i)[2];
|
||||
} else {
|
||||
@ -89,10 +89,16 @@ function get_headers(response) {
|
||||
|
||||
// Load content
|
||||
function load(url,forward,formid) {
|
||||
if(forward===undefined) { forward=true; }
|
||||
if (transitions_in_progress && document.createTouch) { return; } //OS 2
|
||||
if (moved_after_touch) { return; }
|
||||
if(formid===undefined){
|
||||
if (forward === undefined) {
|
||||
forward = true;
|
||||
}
|
||||
if (transitions_in_progress && document.createTouch) { // OS 2
|
||||
return;
|
||||
}
|
||||
if (moved_after_touch) {
|
||||
return;
|
||||
}
|
||||
if (formid === undefined){
|
||||
ajax.get(url, function (response) {
|
||||
get_headers(response);
|
||||
transition_to_new_element(response, forward);
|
||||
@ -105,12 +111,18 @@ function load(url,forward,formid) {
|
||||
|
||||
// Moves
|
||||
var moved_after_touch = false;
|
||||
function touch_started () { moved_after_touch = false; };
|
||||
function touch_moved () { moved_after_touch = true; };
|
||||
function touch_started () {
|
||||
moved_after_touch = false;
|
||||
};
|
||||
function touch_moved () {
|
||||
moved_after_touch = true;
|
||||
};
|
||||
|
||||
// Transitions
|
||||
var transitions_in_progress = false;
|
||||
function transition_ended () { transitions_in_progress = false; };
|
||||
function transition_ended () {
|
||||
transitions_in_progress = false;
|
||||
};
|
||||
function transition_to_new_element (data, going_forward) {
|
||||
transitions_in_progress = true;
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
var PUSHOVER = 5;
|
||||
var TOASTY = 4;
|
||||
$(document).ready(function() {
|
||||
if($("#pushservice").val() > 0) {
|
||||
if ($("#pushservice").val() > 0) {
|
||||
$('#pushsettings').show();
|
||||
}
|
||||
$("#pushservice").change(function() {
|
||||
if($(this).val() > 0) {
|
||||
if ($(this).val() > 0) {
|
||||
$('#pushsettings').show(500);
|
||||
|
||||
if($(this).val() == TOASTY) {
|
||||
if ($(this).val() == TOASTY) {
|
||||
$('#pushservice_title').text("Device ID");
|
||||
} else if($(this).val() == PUSHOVER) {
|
||||
} else if ($(this).val() == PUSHOVER) {
|
||||
$('#pushservice_title').text("User Key");
|
||||
} else {
|
||||
$('#pushservice_title').text("API Key");
|
||||
|
@ -8,7 +8,7 @@
|
||||
id = $("#recommendation_div").data('id');
|
||||
$("#recommend").click(function() {
|
||||
$("#recommendation_div").slideToggle(150);
|
||||
if(!loaded) {
|
||||
if (!loaded) {
|
||||
$("#recommendation_status").html("Loading...");
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
|
@ -8,7 +8,7 @@ function ChangeResolve(reportid) {
|
||||
ajax.get('reportsv2.php?action=ajax_change_resolve&id=' + reportid + '&type=' + $('#resolve_type' + reportid).raw().value + '&categoryid=' + $('#categoryid' + reportid).raw().value, function (response) {
|
||||
var x = json.decode(response);
|
||||
$('#delete' + reportid).raw().checked = (x[0] == '1' ? true : false);
|
||||
if($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
|
||||
if ($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
|
||||
$('#warning' + reportid).raw().selectedIndex = 0;
|
||||
$('#upload' + reportid).raw().checked = false;
|
||||
} else {
|
||||
@ -23,7 +23,7 @@ function ChangeResolve(reportid) {
|
||||
function Load(reportid) {
|
||||
var t = $('#type' + reportid).raw().value;
|
||||
for (var i = 0; i<$('#resolve_type' + reportid).raw().options.length; i++) {
|
||||
if($('#resolve_type' + reportid).raw().options[i].value == t) {
|
||||
if ($('#resolve_type' + reportid).raw().options[i].value == t) {
|
||||
$('#resolve_type' + reportid).raw().selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
@ -32,7 +32,7 @@ function Load(reportid) {
|
||||
ajax.get('reportsv2.php?action=ajax_change_resolve&id=' + reportid + '&type=' + $('#resolve_type' + reportid).raw().value + '&categoryid=' + $('#categoryid' + reportid).raw().value, function (response) {
|
||||
var x = json.decode(response);
|
||||
$('#delete' + reportid).raw().checked = (x[0] == '1' ? true : false);
|
||||
if($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
|
||||
if ($('#uploaderid' + reportid).raw().value == $('#reporterid' + reportid).raw().value) {
|
||||
$('#warning' + reportid).raw().selectedIndex = 0;
|
||||
$('#upload' + reportid).raw().checked = false;
|
||||
} else {
|
||||
@ -52,7 +52,7 @@ function ErrorBox(reportid, message) {
|
||||
}
|
||||
|
||||
function HideErrors() {
|
||||
if($('#error_box')) {
|
||||
if ($('#error_box')) {
|
||||
$('#error_box').remove();
|
||||
}
|
||||
}
|
||||
@ -60,14 +60,14 @@ function HideErrors() {
|
||||
function TakeResolve(reportid) {
|
||||
$('#submit_' + reportid).disable();
|
||||
ajax.post("reportsv2.php?action=takeresolve","reportform_" + reportid, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
ErrorBox(reportid, response);
|
||||
} else {
|
||||
if($('#from_delete' + reportid).results()) {
|
||||
if ($('#from_delete' + reportid).results()) {
|
||||
window.location = location.protocol + '//' + location.host + location.pathname + "?id=" + $('#from_delete' + reportid).raw().value;
|
||||
} else {
|
||||
$('#report' + reportid).remove();
|
||||
if($('#dynamic').raw().checked) {
|
||||
if ($('#dynamic').raw().checked) {
|
||||
NewReport(1);
|
||||
}
|
||||
}
|
||||
@ -76,17 +76,17 @@ function TakeResolve(reportid) {
|
||||
}
|
||||
|
||||
function NewReport(q, view, id) {
|
||||
for(var i = 0; i < q; i++) {
|
||||
for (var i = 0; i < q; i++) {
|
||||
var url = "reportsv2.php?action=ajax_new_report";
|
||||
if(view) {
|
||||
if (view) {
|
||||
url += "&view=" + view;
|
||||
}
|
||||
if(id) {
|
||||
if (id) {
|
||||
url += "&id=" + id;
|
||||
}
|
||||
|
||||
ajax.get(url, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
var div = document.createElement("div");
|
||||
div.id = "report";
|
||||
div.innerHTML = response;
|
||||
@ -94,12 +94,12 @@ function NewReport(q, view, id) {
|
||||
var id = $('#newreportid').raw().value;
|
||||
Load(id);
|
||||
$('#newreportid').remove();
|
||||
if($('#no_reports').results()) {
|
||||
if ($('#no_reports').results()) {
|
||||
$('#all_reports').raw().removeChild($('#no_reports').raw());
|
||||
}
|
||||
} else {
|
||||
//No new reports at this time
|
||||
if(!$('#report').results() && !$('#no_reports').results()) {
|
||||
if (!$('#report').results() && !$('#no_reports').results()) {
|
||||
var div = document.createElement("div");
|
||||
div.id = "no_reports";
|
||||
div.innerHTML = "<table class='layout'><tr><td class='center'><strong>No new reports! \\o/</strong></td></tr></table>";
|
||||
@ -114,13 +114,13 @@ function AddMore(view, id) {
|
||||
//Function will add the amount of reports in the input box unless that will take it over 50
|
||||
var x = 10;
|
||||
var a = $('#repop_amount').raw().value;
|
||||
if(a) {
|
||||
if(!isNaN(a) && a <= 50) {
|
||||
if (a) {
|
||||
if (!isNaN(a) && a <= 50) {
|
||||
x = a;
|
||||
}
|
||||
}
|
||||
|
||||
if(document.getElementsByName("reportid").length + x <= 50) {
|
||||
if (document.getElementsByName("reportid").length + x <= 50) {
|
||||
NewReport(x, view, id);
|
||||
} else {
|
||||
NewReport(50 - document.getElementsByName("reportid").length, view, id);
|
||||
@ -129,7 +129,7 @@ function AddMore(view, id) {
|
||||
|
||||
function SendPM(reportid) {
|
||||
ajax.post("reportsv2.php?action=ajax_take_pm", "reportform_" + reportid, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
$('#uploader_pm' + reportid).raw().value = response;
|
||||
} else {
|
||||
$('#uploader_pm' + reportid).raw().value = "";
|
||||
@ -139,18 +139,18 @@ function SendPM(reportid) {
|
||||
|
||||
function UpdateComment(reportid) {
|
||||
ajax.post("reportsv2.php?action=ajax_update_comment", "reportform_" + reportid, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
alert(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function GiveBack(id) {
|
||||
if(!id) {
|
||||
if (!id) {
|
||||
var x = document.getElementsByName("reportid");
|
||||
for(i = 0; i < x.length; i++) {
|
||||
for (i = 0; i < x.length; i++) {
|
||||
/*ajax.get("ajax.php?action=giveback_report&id=" + x[i].value, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
alert(response);
|
||||
}
|
||||
});*/
|
||||
@ -158,7 +158,7 @@ function GiveBack(id) {
|
||||
}
|
||||
} else {
|
||||
ajax.get("ajax.php?action=giveback_report&id=" + id, function (response) {
|
||||
if(response) {
|
||||
if (response) {
|
||||
alert(response);
|
||||
}
|
||||
});
|
||||
@ -189,9 +189,9 @@ function ClearReport(reportid) {
|
||||
}
|
||||
|
||||
function Grab(reportid) {
|
||||
if(reportid) {
|
||||
if (reportid) {
|
||||
ajax.get("reportsv2.php?action=ajax_grab_report&id=" + reportid, function (response) {
|
||||
if(response == '1') {
|
||||
if (response == '1') {
|
||||
$('#grab' + reportid).raw().disabled = true;
|
||||
} else {
|
||||
alert('Grab failed for some reason :/');
|
||||
@ -199,9 +199,9 @@ function Grab(reportid) {
|
||||
});
|
||||
} else {
|
||||
var x = document.getElementsByName("reportid");
|
||||
for(i = 0; i < x.length; i++) {
|
||||
for (i = 0; i < x.length; i++) {
|
||||
ajax.get("reportsv2.php?action=ajax_grab_report&id=" + x[i].value, function (response) {
|
||||
if(response != '1') {
|
||||
if (response != '1') {
|
||||
alert("One of those grabs failed, sorry I can't be more useful :P");
|
||||
}
|
||||
});
|
||||
@ -241,7 +241,7 @@ function Switch(reportid, torrentid, otherid) {
|
||||
|
||||
ajax.post('reportsv2.php?action=ajax_create_report', report, function (response) {
|
||||
//Returns new report ID.
|
||||
if(isNaN(response)) {
|
||||
if (isNaN(response)) {
|
||||
alert(response);
|
||||
} else {
|
||||
window.location = 'reportsv2.php?view=report&id=' + response;
|
||||
|
@ -1,8 +1,8 @@
|
||||
function Subscribe(topicid) {
|
||||
ajax.get("userhistory.php?action=thread_subscribe&topicid=" + topicid + "&auth=" + authkey, function() {
|
||||
var subscribeLink = $("#subscribelink" + topicid).raw();
|
||||
if(subscribeLink) {
|
||||
if(subscribeLink.firstChild.nodeValue.charAt(0) == '[') {
|
||||
if (subscribeLink) {
|
||||
if (subscribeLink.firstChild.nodeValue.charAt(0) == '[') {
|
||||
subscribeLink.firstChild.nodeValue = subscribeLink.firstChild.nodeValue.charAt(1) == 'U'
|
||||
? '[Subscribe]'
|
||||
: '[Unsubscribe]';
|
||||
@ -19,10 +19,10 @@ function Subscribe(topicid) {
|
||||
function Collapse() {
|
||||
var collapseLink = $('#collapselink').raw();
|
||||
var hide = (collapseLink.innerHTML.substr(0,1) == 'H' ? 1 : 0);
|
||||
if($('.row').results() > 0) {
|
||||
if ($('.row').results() > 0) {
|
||||
$('.row').toggle();
|
||||
}
|
||||
if(hide) {
|
||||
if (hide) {
|
||||
collapseLink.innerHTML = 'Show post bodies';
|
||||
} else {
|
||||
collapseLink.innerHTML = 'Hide post bodies';
|
||||
|
@ -34,7 +34,7 @@ function ArtistManager() {
|
||||
|
||||
var elArtistList = ArtistList.cloneNode(true);
|
||||
elArtistList.id = 'artistmanager_list';
|
||||
for(var i=0; i<elArtistList.children.length; i++) {
|
||||
for (var i = 0; i < elArtistList.children.length; i++) {
|
||||
switch (elArtistList.children[i].className) {
|
||||
case 'artist_main':
|
||||
importance = 1;
|
||||
@ -170,9 +170,9 @@ function SelectArtist(e,obj) {
|
||||
}
|
||||
Dir = (EndBox > StartBox ? 1 : -1);
|
||||
var checked = obj.checked;
|
||||
for(var i = StartBox; i != EndBox; i += Dir) {
|
||||
for (var i = StartBox; i != EndBox; i += Dir) {
|
||||
var key, importance = obj.value.substr(0,1), id = obj.value.substr(2);
|
||||
$('#artistmanager_box'+i).raw().checked = checked;
|
||||
$('#artistmanager_box' + i).raw().checked = checked;
|
||||
}
|
||||
StartBox = Number(obj.id.substr(17));
|
||||
}
|
||||
@ -180,7 +180,7 @@ function SelectArtist(e,obj) {
|
||||
function ArtistManagerSubmit() {
|
||||
var Selection = new Array();
|
||||
var MainSelectionCount = 0;
|
||||
for(var i = 0, boxes = $('[name="artistmanager_box"]'); boxes.raw(i); i++) {
|
||||
for (var i = 0, boxes = $('[name="artistmanager_box"]'); boxes.raw(i); i++) {
|
||||
if (boxes.raw(i).checked) {
|
||||
Selection.push(boxes.raw(i).value);
|
||||
if (boxes.raw(i).value.substr(0,1) == '1') {
|
||||
|
@ -7,7 +7,7 @@ function Categories() {
|
||||
}
|
||||
|
||||
function Remaster() {
|
||||
if($('#remaster').raw().checked) {
|
||||
if ($('#remaster').raw().checked) {
|
||||
$('#remaster_true').show();
|
||||
} else {
|
||||
$('#remaster_true').hide();
|
||||
@ -16,9 +16,9 @@ function Remaster() {
|
||||
}
|
||||
|
||||
function Format() {
|
||||
if($('#format').raw().options[$('#format').raw().selectedIndex].value == 'FLAC') {
|
||||
if ($('#format').raw().options[$('#format').raw().selectedIndex].value == 'FLAC') {
|
||||
for (var i = 0; i<$('#bitrate').raw().options.length; i++) {
|
||||
if($('#bitrate').raw().options[i].value == 'Lossless') {
|
||||
if ($('#bitrate').raw().options[i].value == 'Lossless') {
|
||||
$('#bitrate').raw()[i].selected = true;
|
||||
}
|
||||
}
|
||||
@ -29,7 +29,7 @@ function Format() {
|
||||
$('#upload_logs').hide();
|
||||
}
|
||||
|
||||
if($('#format').raw().options[$('#format').raw().selectedIndex].value == 'AAC') {
|
||||
if ($('#format').raw().options[$('#format').raw().selectedIndex].value == 'AAC') {
|
||||
$('#format_warning').raw().innerHTML = 'Lossy AAC torrents may only be uploaded when they represent exclusive content not currently available in any other format. <a href="rules.php?p=upload#r2.1.24">(2.1.24)</a>';
|
||||
} else {
|
||||
$('#format_warning').raw().innerHTML = '';
|
||||
@ -38,7 +38,7 @@ function Format() {
|
||||
|
||||
function Bitrate() {
|
||||
$('#other_bitrate').raw().value = '';
|
||||
if($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') {
|
||||
if ($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') {
|
||||
$('#other_bitrate_span').show();
|
||||
} else {
|
||||
$('#other_bitrate_span').hide();
|
||||
@ -46,7 +46,7 @@ function Bitrate() {
|
||||
}
|
||||
|
||||
function AltBitrate() {
|
||||
if($('#other_bitrate').raw().value >= 320) {
|
||||
if ($('#other_bitrate').raw().value >= 320) {
|
||||
$('#vbr').raw().disabled = true;
|
||||
$('#vbr').raw().checked = false;
|
||||
} else {
|
||||
@ -55,9 +55,9 @@ function AltBitrate() {
|
||||
}
|
||||
|
||||
function add_tag() {
|
||||
if($('#tags').raw().value == "") {
|
||||
if ($('#tags').raw().value == "") {
|
||||
$('#tags').raw().value = $('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value;
|
||||
} else if($('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value == '---') {
|
||||
} else if ($('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value == '---') {
|
||||
} else {
|
||||
$('#tags').raw().value = $('#tags').raw().value + ', ' + $('#genre_tags').raw().options[$('#genre_tags').raw().selectedIndex].value;
|
||||
}
|
||||
@ -66,7 +66,7 @@ function add_tag() {
|
||||
var LogCount = 1;
|
||||
|
||||
function AddLogField() {
|
||||
if(LogCount >= 200) {
|
||||
if (LogCount >= 200) {
|
||||
return;
|
||||
}
|
||||
var LogField = document.createElement("input");
|
||||
@ -81,7 +81,7 @@ function AddLogField() {
|
||||
}
|
||||
|
||||
function RemoveLogField() {
|
||||
if(LogCount == 1) {
|
||||
if (LogCount == 1) {
|
||||
return;
|
||||
}
|
||||
var x = $('#logfields').raw();
|
||||
@ -94,7 +94,7 @@ function RemoveLogField() {
|
||||
var ExtraLogCount = 1;
|
||||
|
||||
function AddExtraLogField(id) {
|
||||
if(LogCount >= 200) {
|
||||
if (LogCount >= 200) {
|
||||
return;
|
||||
}
|
||||
var LogField = document.createElement("input");
|
||||
@ -109,7 +109,7 @@ function AddExtraLogField(id) {
|
||||
}
|
||||
|
||||
function RemoveLogField() {
|
||||
if(LogCount == 1) {
|
||||
if (LogCount == 1) {
|
||||
return;
|
||||
}
|
||||
var x = $('#logfields').raw();
|
||||
@ -122,7 +122,7 @@ function RemoveLogField() {
|
||||
var FormatCount = 0;
|
||||
|
||||
function AddFormat() {
|
||||
if(FormatCount >= 10) {
|
||||
if (FormatCount >= 10) {
|
||||
return;
|
||||
}
|
||||
FormatCount++;
|
||||
@ -157,14 +157,14 @@ function AddFormat() {
|
||||
NewCell2 = document.createElement("td");
|
||||
tmp = '<select id="releasetype" name="extra_formats[]"><option value="">---</option>';
|
||||
var formats=["Saab","Volvo","BMW"];
|
||||
for(var i in formats) {
|
||||
tmp += "<option value='"+formats[i]+"'>"+formats[i]+"</option>\n";
|
||||
for (var i in formats) {
|
||||
tmp += '<option value="'+formats[i]+'">'+formats[i]+"</option>\n";
|
||||
}
|
||||
tmp += "</select>";
|
||||
var bitrates=["1","2","3"];
|
||||
tmp += '<select id="releasetype" name="extra_bitrates[]"><option value="">---</option>';
|
||||
for(var i in bitrates) {
|
||||
tmp += "<option value='"+bitrates[i]+"'>"+bitrates[i]+"</option>\n";
|
||||
for (var i in bitrates) {
|
||||
tmp += '<option value="'+bitrates[i]+'">'+bitrates[i]+"</option>\n";
|
||||
}
|
||||
tmp += "</select>";
|
||||
|
||||
@ -188,7 +188,7 @@ function AddFormat() {
|
||||
}
|
||||
|
||||
function RemoveFormat() {
|
||||
if(FormatCount == 0) {
|
||||
if (FormatCount == 0) {
|
||||
return;
|
||||
}
|
||||
$('#extras').raw().value = FormatCount;
|
||||
@ -209,7 +209,7 @@ function RemoveFormat() {
|
||||
var ArtistCount = 1;
|
||||
|
||||
function AddArtistField() {
|
||||
if(ArtistCount >= 200) {
|
||||
if (ArtistCount >= 200) {
|
||||
return;
|
||||
}
|
||||
var ArtistField = document.createElement("input");
|
||||
@ -238,7 +238,7 @@ function AddArtistField() {
|
||||
}
|
||||
|
||||
function RemoveArtistField() {
|
||||
if(ArtistCount == 1) {
|
||||
if (ArtistCount == 1) {
|
||||
return;
|
||||
}
|
||||
var x = $('#artistfields').raw();
|
||||
@ -259,15 +259,15 @@ function CheckVA () {
|
||||
|
||||
function CheckYear() {
|
||||
var media = $('#media').raw().options[$('#media').raw().selectedIndex].text;
|
||||
if(media == "---" || media == "Vinyl" || media == "Soundboard" || media == "Cassette") {
|
||||
if (media == "---" || media == "Vinyl" || media == "Soundboard" || media == "Cassette") {
|
||||
media = "old";
|
||||
}
|
||||
var x = $('#year').raw();
|
||||
if(x.value < 1982 && x.value != '' && media != "old" && !$('#unknown').raw().checked) {
|
||||
if (x.value < 1982 && x.value != '' && media != "old" && !$('#unknown').raw().checked) {
|
||||
$('#yearwarning').show();
|
||||
$('#remaster').raw().checked = true;
|
||||
$('#remaster_true').show();
|
||||
} else if($('#unknown').raw().checked) {
|
||||
} else if ($('#unknown').raw().checked) {
|
||||
$('#remaster').raw().checked = true;
|
||||
$('#yearwarning').hide();
|
||||
$('#remaster_true').show();
|
||||
@ -277,13 +277,13 @@ function CheckYear() {
|
||||
}
|
||||
|
||||
function ToggleUnknown() {
|
||||
if($('#unknown').raw().checked) {
|
||||
if ($('#unknown').raw().checked) {
|
||||
$('#remaster_year').raw().value = "";
|
||||
$('#remaster_title').raw().value = "";
|
||||
$('#remaster_record_label').raw().value = "";
|
||||
$('#remaster_catalogue_number').raw().value = "";
|
||||
|
||||
if($('#groupremasters').raw()) {
|
||||
if ($('#groupremasters').raw()) {
|
||||
$('#groupremasters').raw().selectedIndex = 0;
|
||||
$('#groupremasters').raw().disabled = true;
|
||||
}
|
||||
@ -298,7 +298,7 @@ function ToggleUnknown() {
|
||||
$('#remaster_record_label').raw().disabled = false;
|
||||
$('#remaster_catalogue_number').raw().disabled = false;
|
||||
|
||||
if($('#groupremasters').raw()) {
|
||||
if ($('#groupremasters').raw()) {
|
||||
$('#groupremasters').raw().disabled = false;
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@ function ToggleUnknown() {
|
||||
function GroupRemaster() {
|
||||
var remasters = json.decode($('#json_remasters').raw().value);
|
||||
var index = $('#groupremasters').raw().options[$('#groupremasters').raw().selectedIndex].value;
|
||||
if(index != "") {
|
||||
if (index != "") {
|
||||
$('#remaster_year').raw().value = remasters[index][1];
|
||||
$('#remaster_title').raw().value = remasters[index][2];
|
||||
$('#remaster_record_label').raw().value = remasters[index][3];
|
||||
|
@ -4,7 +4,7 @@ function ChangeTo(to) {
|
||||
$('#admincomment').show();
|
||||
resize('admincomment');
|
||||
var buttons = document.getElementsByName('admincommentbutton');
|
||||
for(var i = 0; i < buttons.length; i++) {
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
buttons[i].setAttribute('onclick',"ChangeTo('links'); return false;");
|
||||
}
|
||||
} else if (to == "links") {
|
||||
@ -13,7 +13,7 @@ function ChangeTo(to) {
|
||||
$('#admincomment').hide();
|
||||
$('#admincommentlinks').show();
|
||||
var buttons = document.getElementsByName('admincommentbutton');
|
||||
for(var i = 0; i < buttons.length; i++) {
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
buttons[i].setAttribute('onclick',"ChangeTo('text'); return false;");
|
||||
}
|
||||
})
|
||||
|
@ -9,7 +9,7 @@ var tags = new Object();
|
||||
|
||||
function isValidTag(value) {
|
||||
var toReturn = false;
|
||||
if(tags[value] == true) {
|
||||
if (tags[value] == true) {
|
||||
toReturn = true;
|
||||
}
|
||||
return toReturn;
|
||||
|
@ -1,5 +1,5 @@
|
||||
var elemStyles=Array();
|
||||
var errorElems=Array();
|
||||
var elemStyles = Array();
|
||||
var errorElems = Array();
|
||||
|
||||
function validEmail(str) {
|
||||
if (str.match(/^[_a-z0-9-]+([.+][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i)) {
|
||||
@ -12,60 +12,80 @@ function validEmail(str) {
|
||||
function validLink(str) {
|
||||
if (str.match(/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i)) {
|
||||
return true;
|
||||
} else { return false; }
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNumeric(str,usePeriod) {
|
||||
matchStr='/[^0-9';
|
||||
matchStr = '/[^0-9';
|
||||
if (usePeriod) {
|
||||
matchStr+='\.';
|
||||
matchStr += '\.';
|
||||
}
|
||||
matchStr=']/';
|
||||
matchStr = ']/';
|
||||
|
||||
if (str.match(matchStr)) { return false; }
|
||||
if (str.match(matchStr)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function validDate(theDate) {
|
||||
days=0;
|
||||
days = 0;
|
||||
|
||||
theDate=theDate.split("/");
|
||||
month=theDate[0];
|
||||
day=theDate[1];
|
||||
year=theDate[2];
|
||||
theDate = theDate.split("/");
|
||||
month = theDate[0];
|
||||
day = theDate[1];
|
||||
year = theDate[2];
|
||||
|
||||
if (!isNumeric(month) || !isNumeric(day) || !isNumeric(year)) { return false; }
|
||||
|
||||
if (month==1) { days=31; }
|
||||
else if (month==2) { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { days=29; } else { days=28; }}
|
||||
else if (month==3) { days=31; }
|
||||
else if (month==4) { days=30; }
|
||||
else if (month==5) { days=31; }
|
||||
else if (month==6) { days=30; }
|
||||
else if (month==7) { days=31; }
|
||||
else if (month==8) { days=31; }
|
||||
else if (month==9) { days=30; }
|
||||
else if (month==10) { days=31; }
|
||||
else if (month==11) { days=30; }
|
||||
else if (month==12) { days=31; }
|
||||
if (month == 1) { days = 31; }
|
||||
else if (month == 2) {
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
|
||||
days = 29;
|
||||
} else {
|
||||
days = 28;
|
||||
}}
|
||||
else if (month == 3) { days = 31; }
|
||||
else if (month == 4) { days = 30; }
|
||||
else if (month == 5) { days = 31; }
|
||||
else if (month == 6) { days = 30; }
|
||||
else if (month == 7) { days = 31; }
|
||||
else if (month == 8) { days = 31; }
|
||||
else if (month == 9) { days = 30; }
|
||||
else if (month == 10) { days = 31; }
|
||||
else if (month == 11) { days = 30; }
|
||||
else if (month == 12) { days = 31; }
|
||||
|
||||
if (day>days || day==undefined || days==undefined || month==undefined || year==undefined || year.length<4) { return false; } else { return true; }
|
||||
if (day > days || day == undefined || days == undefined || month == undefined || year == undefined || year.length < 4) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function showError(fields,alertStr) {
|
||||
var tField=Array();
|
||||
|
||||
if (typeof(fields)=='object') { tField[0]=fields; } else { tField=fields.split(','); }
|
||||
for(s=0; s<=tField.length-1; s++) {
|
||||
if (typeof(fields) == 'object') {
|
||||
tField[0] = fields;
|
||||
} else {
|
||||
tField = fields.split(',');
|
||||
}
|
||||
for (s = 0; s <= tField.length - 1; s++) {
|
||||
if ($('#'+tField[s])) {
|
||||
$('#'+tField[s]).className=$('#'+tField[s]).className+" elem_error";
|
||||
if (s==0) {
|
||||
if (s == 0) {
|
||||
$('#'+tField[s]).focus();
|
||||
try { $('#'+tField[s]).select(); } catch (error) { }
|
||||
try {
|
||||
$('#'+tField[s]).select();
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
|
||||
errorElems[errorElems.length]=tField[s];
|
||||
if ($('#'+tField[s]).type!="select-one") {
|
||||
errorElems[errorElems.length] = tField[s];
|
||||
if ($('#'+tField[s]).type != "select-one") {
|
||||
$('#'+tField[s]).onkeypress=function() { clearElemError(); };
|
||||
} else {
|
||||
$('#'+tField[s]).onchange=function() { clearElemError(); };
|
||||
@ -73,34 +93,36 @@ function showError(fields,alertStr) {
|
||||
}
|
||||
}
|
||||
|
||||
if (alertStr!="") { alert(alertStr); }
|
||||
if (alertStr != "") {
|
||||
alert(alertStr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function clearErrors(theForm) {
|
||||
elementList=document.forms[theForm].elements;
|
||||
for(x=0; x<=elementList.length-1; x++) {
|
||||
if (elementList[x].type!="submit" && elementList[x].type!="button") {
|
||||
elementList = document.forms[theForm].elements;
|
||||
for (x = 0; x <= elementList.length - 1; x++) {
|
||||
if (elementList[x].type != "submit" && elementList[x].type != "button") {
|
||||
if (!elemStyles[elementList[x].id]) {
|
||||
elemStyles[elementList[x].id]=elementList[x].className;
|
||||
elemStyles[elementList[x].id] = elementList[x].className;
|
||||
}
|
||||
|
||||
try {
|
||||
elementList[x].className=elemStyles[elementList[x].id];
|
||||
elementList[x].className = elemStyles[elementList[x].id];
|
||||
} catch (error) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearElemError(evt) {
|
||||
for(x=0; x<=errorElems.length-1; x++) {
|
||||
elem=$('#'+errorElems[x]);
|
||||
if ($('#'+elem).type!="select-one") {
|
||||
$('#'+elem).onkeypress="";
|
||||
for (x = 0; x <= errorElems.length - 1; x++) {
|
||||
elem = $('#'+errorElems[x]);
|
||||
if ($('#'+elem).type != "select-one") {
|
||||
$('#'+elem).onkeypress = "";
|
||||
} else {
|
||||
$('#'+elem).onchange="";
|
||||
$('#'+elem).onchange = "";
|
||||
}
|
||||
elem.className=elemStyles[elem.id];
|
||||
elem.className = elemStyles[elem.id];
|
||||
}
|
||||
errorElems=Array();
|
||||
errorElems = Array();
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
$(document).ready(function () {
|
||||
// Upload button is clicked
|
||||
$("#post").click(function(e) {
|
||||
// Make sure "Music" category is selected.
|
||||
if($("#categories").find(":selected").val() == 0) {
|
||||
checkHasMainArtist(e);
|
||||
// Make sure "Music" category is selected.
|
||||
if ($("#categories").find(":selected").val() == 0) {
|
||||
checkHasMainArtist(e);
|
||||
}
|
||||
});
|
||||
|
||||
@ -14,16 +14,15 @@
|
||||
function checkHasMainArtist(e) {
|
||||
var has_main = false;
|
||||
$("select[id^=importance]").each(function() {
|
||||
if($(this).find(":selected").val() == 1) {
|
||||
if ($(this).find(":selected").val() == 1) {
|
||||
has_main = true;
|
||||
}
|
||||
});
|
||||
if(!has_main) {
|
||||
if (!has_main) {
|
||||
alert('A "Main" artist is required');
|
||||
// Don't POST the form.
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
Loading…
Reference in New Issue
Block a user