Empty commit

This commit is contained in:
Git 2013-04-30 18:18:07 +00:00
parent 0a565870d9
commit b055e9c6f1
88 changed files with 812 additions and 798 deletions

View File

@ -456,7 +456,7 @@ public function constant_table($Constants=false) {
public function cache_table($CacheKeys=false) { public function cache_table($CacheKeys=false) {
global $Cache; global $Cache;
$Header = 'Cache Keys'; $Header = 'Cache keys';
if (!is_array($CacheKeys)) { if (!is_array($CacheKeys)) {
$CacheKeys = $this->get_cache_keys(); $CacheKeys = $this->get_cache_keys();
$Header .= ' ('.number_format($this->get_cache_time(), 5).' ms)'; $Header .= ' ('.number_format($this->get_cache_time(), 5).' ms)';

View File

@ -9,13 +9,13 @@ class ImageTools {
* Store processed links to avoid repetition * Store processed links to avoid repetition
* @var array 'URL' => 'Parsed URL' * @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 * We use true as an extra property to make the domain an array key
* @var array $Hosts Array of image hosts * @var array $Hosts Array of image hosts
*/ */
static private $Hosts = array( private static $Hosts = array(
'whatimg.com' => true, 'whatimg.com' => true,
'imgur.com' => true 'imgur.com' => true
); );
@ -24,7 +24,7 @@ class ImageTools {
* Blacklisted sites * Blacklisted sites
* @var array $Blacklist Array of blacklisted hosts * @var array $Blacklist Array of blacklisted hosts
*/ */
static private $Blacklist = array( private static $Blacklist = array(
'tinypic.com' 'tinypic.com'
); );
@ -32,7 +32,7 @@ class ImageTools {
* Array of image hosts that provide thumbnailing * Array of image hosts that provide thumbnailing
* @var array $Thumbs * @var array $Thumbs
*/ */
static private $Thumbs = array( private static $Thumbs = array(
'i.imgur.com' => true, 'i.imgur.com' => true,
'whatimg.com' => true 'whatimg.com' => true
); );
@ -41,7 +41,7 @@ class ImageTools {
* Array of extensions * Array of extensions
* @var array $Extensions * @var array $Extensions
*/ */
static private $Extensions = array( private static $Extensions = array(
'jpg' => true, 'jpg' => true,
'jpeg' => true, 'jpeg' => true,
'png' => true, 'png' => true,
@ -78,7 +78,7 @@ public static function blacklisted($Url) {
* @param string $Url Link to an image * @param string $Url Link to an image
* @return string|false Matched host or false * @return string|false Matched host or false
*/ */
public static function thumbnailable($Url) { private static function thumbnailable($Url) {
$ParsedUrl = parse_url($Url); $ParsedUrl = parse_url($Url);
return !empty(self::$Thumbs[$ParsedUrl['host']]); return !empty(self::$Thumbs[$ParsedUrl['host']]);
} }
@ -88,7 +88,7 @@ public static function thumbnailable($Url) {
* @param string $Ext Extension to check * @param string $Ext Extension to check
* @return boolean * @return boolean
*/ */
public static function valid_extension($Ext) { private static function valid_extension($Ext) {
// return @self::$Extensions[$Ext] === true; // return @self::$Extensions[$Ext] === true;
return !empty(self::$Extensions[$Ext]) && 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 $Link
* @param type $Processed * @param type $Processed
*/ */
public static function store($Link, $Processed) { private static function store($Link, $Processed) {
self::$Storage[$Link] = $Processed; self::$Storage[$Link] = $Processed;
} }
@ -107,129 +107,24 @@ public static function store($Link, $Processed) {
* @param type $Link * @param type $Link
* @return boolean|string Returns false if no match * @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])) { if (isset(self::$Storage[$Link])) {
return self::$Storage[$Link]; return self::$Storage[$Link];
} }
return false; return false;
} }
/**
* 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
*/
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];
}
/**
* 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
*/
public static function thumbnail($Link) {
if (($Found = self::get_stored($Link))) {
return $Found;
}
return self::process_thumbnail($Link);
}
/**
* Matches a hosts that thumbnails and stores link
* @param string $Link Image link
* @return string Thumbnail link or Image link
*/
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?>)" />
<?
}
/**
* Create image proxy URL
* @param string $Url image URL
* @return image proxy URL
*/
public static function proxy_url($Url) {
global $SSL;
return ($SSL ? 'https' : 'http') . '://' . SITE_URL
. '/image.php?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. * Checks if URL points to a whatimg thumbnail.
*/ */
function has_whatimg_thumb($Url) { private static function has_whatimg_thumb($Url) {
return contains("_thumb", $Url); return (strpos($Url, '_thumb') !== false);
} }
/** /**
* Cleans up imgur URL if it already has a modifier attached to the end of it. * Cleans up imgur URL if it already has a modifier attached to the end of it.
*/ */
function clean_imgur_url($Url) { private static function clean_imgur_url($Url) {
$Extension = pathinfo($Url, PATHINFO_EXTENSION); $Extension = pathinfo($Url, PATHINFO_EXTENSION);
$Full = preg_replace('/\.[^.]*$/', '', $Url); $Full = preg_replace('/\.[^.]*$/', '', $Url);
$Base = substr($Full, 0, strrpos($Full, '/')); $Base = substr($Full, 0, strrpos($Full, '/'));
@ -242,3 +137,85 @@ function clean_imgur_url($Url) {
} }
return $Base . '/' . $Path . '.' . $Extension; return $Base . '/' . $Path . '.' . $Extension;
} }
/**
* Replaces the extension.
*/
private static function replace_extension($String, $Extension) {
return preg_replace('/\.[^.]*$/', $Extension, $String);
}
/**
* Create image proxy URL
* @param string $Url image URL
* @return image proxy URL
*/
public static function proxy_url($Url) {
global $SSL;
return ($SSL ? 'https' : 'http') . '://' . SITE_URL . '/image.php?c=1&amp;i=' . urlencode($Url);
}
/**
* 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)" />
<?
}
}

View File

@ -58,7 +58,9 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
} }
if (is_array($Property)) { if (is_array($Property)) {
$all = true; $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; return $all;
} else { } else {
if (($UserID !== false) && ($LoggedUser['ID'] == $UserID)) { if (($UserID !== false) && ($LoggedUser['ID'] == $UserID)) {
@ -69,8 +71,9 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
if ($May) if ($May)
return PARANOIA_ALLOWED; return PARANOIA_ALLOWED;
if(check_perms('users_override_paranoia', $UserClass)) if (check_perms('users_override_paranoia', $UserClass)) {
return PARANOIA_OVERRIDDEN; return PARANOIA_OVERRIDDEN;
}
$Override=false; $Override=false;
switch ($Property) { switch ($Property) {
case 'downloaded': case 'downloaded':

View File

@ -25,7 +25,9 @@ function show() {
for ($i=0; $i<sizeof($this->file); $i++) { for ($i=0; $i<sizeof($this->file); $i++) {
$TMPVAR=$this->file[$i]; $TMPVAR=$this->file[$i];
foreach ($this->vars as $k=>$v) { foreach ($this->vars as $k=>$v) {
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; } if ($v[1] != '' && $v[0] == '') {
$v[0] = $v[1];
}
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR); $TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
} }
print $TMPVAR; print $TMPVAR;
@ -38,7 +40,9 @@ function get() {
for ($i = 0; $i < sizeof($this->file); $i++) { for ($i = 0; $i < sizeof($this->file); $i++) {
$TMPVAR=$this->file[$i]; $TMPVAR=$this->file[$i];
foreach ($this->vars as $k=>$v) { foreach ($this->vars as $k=>$v) {
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; } if ($v[1] != '' && $v[0] == '') {
$v[0] = $v[1];
}
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR); $TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
} }
$RESULT.=$TMPVAR; $RESULT.=$TMPVAR;
@ -73,7 +77,6 @@ function str_align($len,$str,$align,$fill) {
$result.=str_repeat($fill,$snm); $result.=str_repeat($fill,$snm);
} }
return $result; return $result;
} }
} }

View File

@ -772,10 +772,8 @@ private function to_html ($Array) {
$LocalURL = $this->local_url($Block['Val']); $LocalURL = $this->local_url($Block['Val']);
if ($LocalURL) { if ($LocalURL) {
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$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 { } 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; break;

View File

@ -543,11 +543,7 @@ function to_html($Array) {
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) { if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
$Str.='[img]'.$Block['Val'].'[/img]'; $Str.='[img]'.$Block['Val'].'[/img]';
} else { } else {
if (check_perms('site_proxy_images')) { $Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
$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'].'" />';
}
} }
break; break;

View File

@ -504,11 +504,7 @@ function to_html($Array) {
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) { if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
$Str.='[img]'.$Block['Val'].'[/img]'; $Str.='[img]'.$Block['Val'].'[/img]';
} else { } else {
if (check_perms('site_proxy_images')) { $Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
$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'].'" />';
}
} }
break; break;

View File

@ -3,8 +3,7 @@
* This super class is used to manage the ammount of textareas there are and to * 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. * generate the required JavaScript that enables the previews to work.
*/ */
class TEXTAREA_PREVIEW_SUPER class TEXTAREA_PREVIEW_SUPER {
{
/** /**
* @static * @static
* @var int $Textareas Total number of textareas created * @var int $Textareas Total number of textareas created
@ -37,11 +36,13 @@ class TEXTAREA_PREVIEW_SUPER
* @example <pre><?php TEXT_PREVIEW::JavaScript(); ?></pre> * @example <pre><?php TEXT_PREVIEW::JavaScript(); ?></pre>
* @return void * @return void
*/ */
static public function JavaScript ($all = true) static public function JavaScript ($all = true) {
{ if (self::$Textareas === 0) {
if (self::$Textareas === 0) return; return;
if (self::$Exectuted === false && $all) }
if (self::$Exectuted === false && $all) {
View::parse('generic/textarea/script.phtml'); View::parse('generic/textarea/script.phtml');
}
self::$Exectuted = true; self::$Exectuted = true;
self::iterator(); self::iterator();
@ -55,8 +56,7 @@ static public function JavaScript ($all = true)
* @static * @static
* @return void * @return void
*/ */
static private function iterator () static private function iterator () {
{
$script = array(); $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])) { if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
@ -66,9 +66,9 @@ static private function iterator ()
} }
$script[] = sprintf('[%s]', $a); $script[] = sprintf('[%s]', $a);
} }
if (!empty($script)) if (!empty($script)) {
View::parse('generic/textarea/script_factory.phtml', View::parse('generic/textarea/script_factory.phtml', array('script' => join(', ', $script)));
array('script' => join(', ', $script))); }
} }
} }
@ -111,8 +111,7 @@ static private function iterator ()
* </div> * </div>
* </pre> * </pre>
*/ */
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER {
{
/** /**
* @var int Unique ID * @var int Unique ID
*/ */
@ -157,14 +156,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
parent::$Textareas += 1; parent::$Textareas += 1;
array_push(parent::$_ID, $ID); 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); $Attributes = ' ' . implode(' ', $ExtraAttributes);
else } else {
$Attributes = ''; $Attributes = '';
}
if ($Preview === true) $this->preview(); if ($Preview === true) {
$this->preview();
}
$this->buffer = View::parse('generic/textarea/textarea.phtml', array( $this->buffer = View::parse('generic/textarea/textarea.phtml', array(
'ID' => $ID, 'ID' => $ID,
@ -176,17 +180,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
'Attributes' => &$Attributes 'Attributes' => &$Attributes
), $Buffer); ), $Buffer);
if ($Buttons === true) $this->buttons(); if ($Buttons === true) {
$this->buttons();
}
} }
/** /**
* Outputs the divs required for previewing the AJAX content * Outputs the divs required for previewing the AJAX content
* Will only output once * Will only output once
*/ */
public function preview () public function preview () {
{ if (!$this->preview) {
if (!$this->preview)
View::parse('generic/textarea/preview.phtml', array('ID' => $this->id)); View::parse('generic/textarea/preview.phtml', array('ID' => $this->id));
}
$this->preview = true; $this->preview = true;
} }
@ -194,16 +200,14 @@ public function preview ()
* Outputs the preview and edit buttons * Outputs the preview and edit buttons
* Can be called many times to place buttons in different areas * 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)); View::parse('generic/textarea/buttons.phtml', array('ID' => $this->id));
} }
/** /**
* Returns the textarea's numeric ID. * Returns the textarea's numeric ID.
*/ */
public function getID () public function getID () {
{
return $this->id; return $this->id;
} }
@ -211,8 +215,7 @@ public function getID ()
* Returns textarea string when buffer is enabled in the constructor * Returns textarea string when buffer is enabled in the constructor
* @return string * @return string
*/ */
public function getBuffer () public function getBuffer () {
{
return $this->buffer; return $this->buffer;
} }
} }

View File

@ -23,7 +23,7 @@ function update_tracker($Action, $Updates, $ToIRC = false) {
} }
$Path = TRACKER_SECRET.$Get; $Path = TRACKER_SECRET.$Get;
$Return = ""; $Return = '';
$Attempts = 0; $Attempts = 0;
while ($Return != "success" && $Attempts < 3) { while ($Return != "success" && $Attempts < 3) {

View File

@ -104,9 +104,7 @@ public static function user_info($UserID) {
} }
// Image proxy // Image proxy
if (check_perms('site_proxy_images') && !empty($UserInfo['Avatar'])) { $UserInfo['Avatar'] = ImageTools::process($UserInfo['Avatar']);
$UserInfo['Avatar'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;avatar='.$UserID.'&amp;i='.urlencode($UserInfo['Avatar']);
}
return $UserInfo; return $UserInfo;
} }
@ -481,7 +479,7 @@ public static function format_username($UserID, $Badges = false, $IsWarned = tru
if (check_perms('site_proxy_images') && !empty($UserInfo['Title'])) { if (check_perms('site_proxy_images') && !empty($UserInfo['Title'])) {
$UserInfo['Title'] = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', $UserInfo['Title'] = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
function($Matches) { function($Matches) {
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;i='.urlencode($Matches[2]).$Matches[3]; return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
}, },
$UserInfo['Title']); $UserInfo['Title']);
} }

View File

@ -10,7 +10,6 @@
/*------------------------------------------------------*/ /*------------------------------------------------------*/
/********************************************************/ /********************************************************/
require 'config.php'; //The config contains all site wide configuration information require 'config.php'; //The config contains all site wide configuration information
//Deal with dumbasses //Deal with dumbasses
if (isset($_REQUEST['info_hash']) && isset($_REQUEST['peer_id'])) { die('d14:failure reason40:Invalid .torrent, try downloading again.e'); } 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'); $Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php');
if (!preg_match('/^[a-z0-9]+$/i', $Document)) { error(404); } if (!preg_match('/^[a-z0-9]+$/i', $Document)) { error(404); }
require(SERVER_ROOT.'/sections/'.$Document.'/index.php'); require(SERVER_ROOT.'/sections/'.$Document.'/index.php');
$Debug->set_flag('completed module execution'); $Debug->set_flag('completed module execution');

View File

@ -229,7 +229,7 @@
$Cache->cache_value('news_latest_id', $CurrentNews, 0); $Cache->cache_value('news_latest_id', $CurrentNews, 0);
} }
if ($MyNews < $CurrentNews) { if ($MyNews < $CurrentNews) {
$Alerts[] = '<a href="index.php">'.'New announcement!'.'</a>'; $Alerts[] = '<a href="index.php">New announcement!</a>';
} }
// Blog // Blog
@ -245,7 +245,7 @@
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0); $Cache->cache_value('blog_latest_id', $CurrentBlog, 0);
} }
if ($MyBlog < $CurrentBlog) { if ($MyBlog < $CurrentBlog) {
$Alerts[] = '<a href="blog.php">'.'New blog post!'.'</a>'; $Alerts[] = '<a href="blog.php">New blog post!</a>';
} }
// Staff blog // Staff blog
@ -270,7 +270,7 @@
$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600); $Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600);
} }
if ($SBlogReadTime < $LatestSBlogTime) { 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) { 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 //Inbox
@ -295,13 +295,13 @@
} }
if ($NewMessages > 0) { 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']) { 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) { } 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')) { if (check_perms('site_torrents_notify')) {
@ -316,7 +316,7 @@
$Cache->cache_value('notifications_new_'.$LoggedUser['ID'], $NewNotifications, 0); $Cache->cache_value('notifications_new_'.$LoggedUser['ID'], $NewNotifications, 0);
} }
if ($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); $Cache->cache_value('collage_subs_user_new_'.$LoggedUser['ID'], $NewCollages, 0);
} }
if ($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')) { 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) { if (check_perms('users_mod') || $LoggedUser['PermissionID'] == FORUM_MOD) {
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']); $NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
@ -387,7 +387,7 @@
} }
if ($NumUpdateReports > 0) { 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')) { } elseif (check_perms('site_moderate_forums')) {
$NumForumReports = $Cache->get_value('num_forum_reports'); $NumForumReports = $Cache->get_value('num_forum_reports');

View File

@ -1510,7 +1510,7 @@ CREATE TABLE `users_sessions` (
`SessionID` char(32) NOT NULL, `SessionID` char(32) NOT NULL,
`KeepLogged` enum('0','1') NOT NULL DEFAULT '0', `KeepLogged` enum('0','1') NOT NULL DEFAULT '0',
`Browser` varchar(40) DEFAULT NULL, `Browser` varchar(40) DEFAULT NULL,
`OperatingSystem` varchar(8) DEFAULT NULL, `OperatingSystem` varchar(13) DEFAULT NULL,
`IP` varchar(15) NOT NULL, `IP` varchar(15) NOT NULL,
`LastUpdate` datetime NOT NULL, `LastUpdate` datetime NOT NULL,
`Active` tinyint(4) NOT NULL DEFAULT '1', `Active` tinyint(4) NOT NULL DEFAULT '1',

View File

@ -22,6 +22,7 @@
g.ID, g.ID,
g.Name, g.Name,
g.CategoryID, g.CategoryID,
g.wikiImage,
g.TagList, g.TagList,
t.Format, t.Format,
t.Encoding, t.Encoding,
@ -54,7 +55,7 @@
ORDER BY (t.Seeders + t.Leechers) DESC ORDER BY (t.Seeders + t.Leechers) DESC
LIMIT $Limit;"; LIMIT $Limit;";
$DB->query($Query); $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); $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); $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; global $LoggedUser,$Categories;
$results = array(); $results = array();
foreach ($Details as $Detail) { 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, $Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail; $RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail;

View File

@ -54,10 +54,6 @@ function error_out($reason = '') {
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned')))); 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&amp;i='.urlencode($Avatar);
}
if ($LoggedUser['CustomForums']) { if ($LoggedUser['CustomForums']) {
unset($LoggedUser['CustomForums']['']); unset($LoggedUser['CustomForums']['']);
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0)); $RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));

View File

@ -387,7 +387,7 @@ function compare($X, $Y) {
<td colspan="5" class="big_info"> <td colspan="5" class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">
@ -527,15 +527,11 @@ function compare($X, $Y) {
</div> </div>
<? /* Misc::display_recommend($ArtistID, "artist"); */ ?> <? /* Misc::display_recommend($ArtistID, "artist"); */ ?>
<div class="sidebar"> <div class="sidebar">
<? if ($Image) { <? if ($Image) { ?>
$WikiImage = $Image;
if (check_perms('site_proxy_images')) {
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
} ?>
<div class="box box_image"> <div class="box box_image">
<div class="head"><strong><?=$Name?></strong></div> <div class="head"><strong><?=$Name?></strong></div>
<div style="text-align: center; padding: 10px 0px;"> <div style="text-align: center; padding: 10px 0px;">
<img style="max-width: 220px;" src="<?=ImageTools::thumbnail($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>
</div> </div>
<? } ?> <? } ?>

View File

@ -51,7 +51,7 @@
if ($ThreadID && is_number($ThreadID)) { if ($ThreadID && is_number($ThreadID)) {
$DB->query("SELECT ForumID FROM forums_topics WHERE ID=".$ThreadID); $DB->query("SELECT ForumID FROM forums_topics WHERE ID=".$ThreadID);
if ($DB->record_count() < 1) { if ($DB->record_count() < 1) {
error("No such thread exists!"); error('No such thread exists!');
header('Location: blog.php'); header('Location: blog.php');
} }
} else { } else {

View File

@ -210,11 +210,8 @@ function compare($X, $Y){
<li class="image_group_<?=$GroupID?>"> <li class="image_group_<?=$GroupID?>">
<a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>"> <a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
<? if($WikiImage) { <? 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 { ?> <? } else { ?>
<div style="width:107px;padding:5px"><?=$DisplayName?></div> <div style="width:107px;padding:5px"><?=$DisplayName?></div>
<? } ?> <? } ?>

View File

@ -285,11 +285,8 @@ function compare($X, $Y){
<li class="image_group_<?=$GroupID?>"> <li class="image_group_<?=$GroupID?>">
<a href="torrents.php?id=<?=$GroupID?>"> <a href="torrents.php?id=<?=$GroupID?>">
<? if ($WikiImage) { <? 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 { ?> <? } else { ?>
<span style="width: 107px; padding: 5px;"><?=$DisplayName?></span> <span style="width: 107px; padding: 5px;"><?=$DisplayName?></span>
<? } ?> <? } ?>

View File

@ -75,7 +75,7 @@
} }
// Start printing // Start printing
View::show_header('Forums > '. $Forums[$ForumID]['Name']); View::show_header('Forums &gt; '. $Forums[$ForumID]['Name']);
?> ?>
<div class="thin"> <div class="thin">
<h2><a href="forums.php">Forums</a> &gt; <?=$ForumName?></h2> <h2><a href="forums.php">Forums</a> &gt; <?=$ForumName?></h2>

View File

@ -87,7 +87,7 @@
</td> </td>
<? if ($NumPosts == 0) { ?> <? if ($NumPosts == 0) { ?>
<td colspan="3"> <td colspan="3">
There are no topics here<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&amp;forumid='.$ForumID.'">'.'create one'.'</a>' : ''?>. There are no topics here.<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&amp;forumid='.$ForumID.'">Create one!</a>' : '' ?>.
</td> </td>
<? } else { ?> <? } else { ?>
<td> <td>

View File

@ -22,7 +22,7 @@
if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) { if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) {
error(403); error(403);
} }
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode'); View::show_header('Forums &gt; '.$Forum['Name'].' &gt; New Topic','comments,bbcode');
?> ?>
<div class="thin"> <div class="thin">
<h2><a href="forums.php">Forums</a> &gt; <a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$Forum['Name']?></a> &gt; <span id="newthreadtitle">New Topic</span></h2> <h2><a href="forums.php">Forums</a> &gt; <a href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$Forum['Name']?></a> &gt; <span id="newthreadtitle">New Topic</span></h2>

View File

@ -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']; $TopicID = $_POST['topicid'];
if (!empty($_POST['large'])) { if (!empty($_POST['large'])) {
@ -23,7 +25,9 @@
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
WHERE t.ID = '$TopicID' WHERE t.ID = '$TopicID'
GROUP BY fp.TopicID"); GROUP BY fp.TopicID");
if($DB->record_count()==0) { die(); } if ($DB->record_count() == 0) {
die();
}
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC); $ThreadInfo = $DB->next_record(MYSQLI_ASSOC);
if (!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) { if (!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
$Cache->cache_value('thread_'.$TopicID.'_info', $ThreadInfo, 0); $Cache->cache_value('thread_'.$TopicID.'_info', $ThreadInfo, 0);
@ -77,7 +81,7 @@
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" /> <input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br /> <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 &mdash; Show the results!</label><br /><br />
<input type="button" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" /> <input type="button" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" />
</form> </form>
<? <?
@ -134,7 +138,7 @@
foreach ($StaffVotes as $StaffVote) { foreach ($StaffVotes as $StaffVote) {
list($StaffString, $StaffVoted) = $StaffVote; list($StaffString, $StaffVoted) = $StaffVote;
?> ?>
<li><a href="forums.php?action=change_vote&amp;threadid=<?=$TopicID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? "Blank" : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li> <li><a href="forums.php?action=change_vote&amp;threadid=<?=$TopicID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? 'Blank' : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li>
<? <?
} }
} }

View File

@ -86,7 +86,7 @@
} }
// Let's hope we got some results - start printing out the content. // Let's hope we got some results - start printing out the content.
View::show_header('Forums'.' > '.'Search', 'bbcode'); View::show_header('Forums &gt; Search', 'bbcode');
?> ?>
<div class="thin"> <div class="thin">
<h2><a href="forums.php">Forums</a> &gt; Search<?=$Title?></h2> <h2><a href="forums.php">Forums</a> &gt; Search<?=$Title?></h2>
@ -278,7 +278,7 @@
<table cellpadding="6" cellspacing="1" border="0" class="forum_list border" width="100%"> <table cellpadding="6" cellspacing="1" border="0" class="forum_list border" width="100%">
<tr class="colhead"> <tr class="colhead">
<td>Forum</td> <td>Forum</td>
<td><?=(!empty($ThreadID))?'Post Begins':'Topic'?></td> <td><?=(!empty($ThreadID)) ? 'Post begins' : 'Topic' ?></td>
<td>Time</td> <td>Time</td>
</tr> </tr>
<? if ($DB->record_count() == 0) { ?> <? if ($DB->record_count() == 0) { ?>

View File

@ -309,7 +309,7 @@
foreach($Answers as $i => $Answer) { foreach($Answers as $i => $Answer) {
?> ?>
<li> <li>
<a href="forums.php?action=change_vote&amp;threadid=<?=$ThreadID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $i?>"><?=display_str($Answer == '' ? "Blank" : $Answer)?></a> <a href="forums.php?action=change_vote&amp;threadid=<?=$ThreadID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $i?>"><?=display_str($Answer == '' ? 'Blank' : $Answer)?></a>
- <?=$StaffVotes[$i]?>&nbsp;(<?=number_format(((float) $Votes[$i] / $TotalVotes) * 100, 2)?>%) - <?=$StaffVotes[$i]?>&nbsp;(<?=number_format(((float) $Votes[$i] / $TotalVotes) * 100, 2)?>%)
<a href="forums.php?action=delete_poll_option&amp;threadid=<?=$ThreadID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $i?>" class="brackets">X</a> <a href="forums.php?action=delete_poll_option&amp;threadid=<?=$ThreadID?>&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;vote=<?=(int) $i?>" class="brackets">X</a>
</li> </li>
@ -322,7 +322,7 @@
<br /> <br />
<strong>Votes:</strong> <?=number_format($TotalVotes)?> / <?=$StaffCount ?> <strong>Votes:</strong> <?=number_format($TotalVotes)?> / <?=$StaffCount ?>
<br /> <br />
<strong>Missing Votes:</strong> <?=implode(", ", $StaffNames)?> <strong>Missing votes:</strong> <?=implode(", ", $StaffNames)?>
<br /><br /> <br /><br />
<? <?
} }
@ -349,7 +349,7 @@
<? } ?> <? } ?>
<li> <li>
<br /> <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 &mdash; Show the results!</label><br />
</li> </li>
</ul> </ul>
<? if($ForumID == STAFF_FORUM) { ?> <? if($ForumID == STAFF_FORUM) { ?>

View File

@ -93,11 +93,8 @@
<td width="50px" valign="top"> <td width="50px" valign="top">
<? <?
if (empty($HeavyInfo['DisableAvatars'])) { if (empty($HeavyInfo['DisableAvatars'])) {
if (!empty($Avatar)) { if (!empty($Avatar)) { ?>
if (check_perms('site_proxy_images')) { <img src="<?=ImageTools::process($Avatar)?>" alt="<?=$Username?>'s avatar" width="50px" />
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;i='.urlencode($Avatar);
} ?>
<img src="<?=$Avatar?>" alt="<?=$Username?>'s avatar" width="50px" />
<? } else { ?> <? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" /> <img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" />
<? } <? }

View File

@ -16,10 +16,6 @@
} }
if (is_number($FeaturedAlbum['GroupID'])) { if (is_number($FeaturedAlbum['GroupID'])) {
$Artists = Artists::get_artist($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="box">
<div class="head colhead_dark"><strong>Featured Album</strong></div> <div class="head colhead_dark"><strong>Featured Album</strong></div>
@ -28,7 +24,7 @@
</div> </div>
<div class="center"> <div class="center">
<a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>" title="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>"> <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> </a>
</div> </div>
<div class="center pad"> <div class="center pad">

View File

@ -1,6 +1,5 @@
<? <?
include(SERVER_ROOT.'/classes/class_text.php'); include(SERVER_ROOT.'/classes/class_text.php');
$Text = new TEXT(true); $Text = new TEXT(true);
if (!$News = $Cache->get_value('news')) { if (!$News = $Cache->get_value('news')) {
@ -294,7 +293,7 @@
?> ?>
<div class="box"> <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"> <div class="pad">
<p><strong><?=display_str($Question)?></strong></p> <p><strong><?=display_str($Question)?></strong></p>
<? if ($UserResponse !== null || $Closed) { ?> <? if ($UserResponse !== null || $Closed) { ?>
@ -327,7 +326,7 @@
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" /> <input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br /> <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 &mdash; Show the results!</label><br /><br />
<input type="button" onclick="ajax.post('index.php','poll',function(response) {$('#poll_container').raw().innerHTML = response});" value="Vote" /> <input type="button" onclick="ajax.post('index.php','poll',function(response) {$('#poll_container').raw().innerHTML = response});" value="Vote" />
</form> </form>
</div> </div>

View File

@ -1,6 +1,6 @@
<? View::show_header('Login'); ?> <? View::show_header('Login'); ?>
<span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span> <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) {
?> ?>
@ -42,7 +42,7 @@
} else { } 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 { ?> <? } else { ?>
<span class="warning">You are banned from logging in for another <?=time_diff($BannedUntil)?>.</span> <span class="warning">You are banned from logging in for another <?=time_diff($BannedUntil)?>.</span>
<? <?

View File

@ -21,9 +21,11 @@
<td colspan="2" align="right"><input type="submit" name="reset" value="Reset!" class="submit" /></td> <td colspan="2" align="right"><input type="submit" name="reset" value="Reset!" class="submit" /></td>
</tr> </tr>
</table> </table>
<? } else { ?> <?
} else { ?>
An email has been sent to you; please follow the directions in that email to reset your password. An email has been sent to you; please follow the directions in that email to reset your password.
<? } ?> <?
} ?>
</div> </div>
</form> </form>
<? <?

View File

@ -48,7 +48,7 @@
list($UserCount)=$DB->next_record(); list($UserCount)=$DB->next_record();
if ($UserCount) { if ($UserCount) {
$Err = "There is already someone registered with that username."; $Err = 'There is already someone registered with that username.';
$_REQUEST['username']=''; $_REQUEST['username']='';
} }

View File

@ -61,7 +61,9 @@
<? } else { ?> <? } 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. 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> </div>
</form> </form>

View File

@ -316,9 +316,8 @@
<? <?
$Images = explode(" ", $Images); $Images = explode(" ", $Images);
foreach ($Images as $Image) { foreach ($Images as $Image) {
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;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> </td>

View File

@ -474,9 +474,8 @@
<? <?
$Images = explode(' ', $Images); $Images = explode(' ', $Images);
foreach ($Images as $Image) { foreach ($Images as $Image) {
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;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> </td>

View File

@ -56,7 +56,9 @@
} }
$RequestID = $_POST['requestid']; $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"); $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(); list($Pages) = $DB->next_record();
@ -85,7 +87,9 @@
case 'get_post': case 'get_post':
enforce_login(); 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'])."'"); $DB->query("SELECT Body FROM requests_comments WHERE ID='".db_string($_GET['post'])."'");
list($Body) = $DB->next_record(MYSQLI_NUM); list($Body) = $DB->next_record(MYSQLI_NUM);
@ -100,7 +104,9 @@
$Text = new TEXT; $Text = new TEXT;
// Quick SQL injection check // Quick SQL injection check
if(!$_POST['post'] || !is_number($_POST['post'])) { error(0); } if (!$_POST['post'] || !is_number($_POST['post'])) {
error(0);
}
// Mainly // Mainly
$DB->query("SELECT $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]"); $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(); list($Page) = $DB->next_record();
if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); } if ($LoggedUser['ID'] != $AuthorID && !check_perms('site_moderate_forums')) {
if ($DB->record_count()==0) { error(404); } error(404);
}
if ($DB->record_count() == 0) {
error(404);
}
// Perform the update // Perform the update
$DB->query("UPDATE requests_comments SET $DB->query("UPDATE requests_comments SET
@ -152,10 +162,14 @@
authorize(); authorize();
// Quick SQL injection check // 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 // 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 // Get topicid, forumid, number of pages
$DB->query("SELECT DISTINCT $DB->query("SELECT DISTINCT

View File

@ -128,11 +128,9 @@
<div class="head"><strong>Cover</strong></div> <div class="head"><strong>Cover</strong></div>
<? <?
if (!empty($Image)) { if (!empty($Image)) {
if (check_perms('site_proxy_images')) { $Image = ImageTools::process($Image, true);
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Image);
}
?> ?>
<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 { ?> <? } else { ?>
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID-1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p> <p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID-1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
<? } ?> <? } ?>

View File

@ -41,47 +41,47 @@
<td>Required Ratio (100% seeded)</td> <td>Required Ratio (100% seeded)</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] < 5 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] < 5 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>0-5 GB</td> <td>0&ndash;5 GB</td>
<td>0.00</td> <td>0.00</td>
<td>0.00</td> <td>0.00</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 5 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 10 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 5 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 10 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>5-10 GB</td> <td>5&ndash;10 GB</td>
<td>0.15</td> <td>0.15</td>
<td>0.00</td> <td>0.00</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 10 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 20 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 10 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 20 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>10-20 GB</td> <td>10&ndash;20 GB</td>
<td>0.20</td> <td>0.20</td>
<td>0.00</td> <td>0.00</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 20 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 30 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 20 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 30 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>20-30 GB</td> <td>20&ndash;30 GB</td>
<td>0.30</td> <td>0.30</td>
<td>0.05</td> <td>0.05</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 30 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 40 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 30 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 40 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>30-40 GB</td> <td>30&ndash;40 GB</td>
<td>0.40</td> <td>0.40</td>
<td>0.10</td> <td>0.10</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 40 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 50 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 40 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 50 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>40-50 GB</td> <td>40&ndash;50 GB</td>
<td>0.50</td> <td>0.50</td>
<td>0.20</td> <td>0.20</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 50 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 60 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 50 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 60 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>50-60 GB</td> <td>50&ndash;60 GB</td>
<td>0.60</td> <td>0.60</td>
<td>0.30</td> <td>0.30</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 60 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 80 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 60 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 80 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>60-80 GB</td> <td>60&ndash;80 GB</td>
<td>0.60</td> <td>0.60</td>
<td>0.40</td> <td>0.40</td>
</tr> </tr>
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 80 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 100 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>"> <tr class="row<?=($LoggedUser['BytesDownloaded'] >= 80 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 100 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
<td>80-100 GB</td> <td>80&ndash;100 GB</td>
<td>0.60</td> <td>0.60</td>
<td>0.50</td> <td>0.50</td>
</tr> </tr>
@ -101,14 +101,14 @@
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. 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>
<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 <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 &minus; (seeding / snatched)]. Formatted
differently, the calculation performed by the system looks like this: differently, the calculation performed by the system looks like this:
</li> </li>
</ul> </ul>
<br /> <br />
<br /> <br />
<div style="text-align:center"><img style="vertical-align: middle" src="static/blank.gif" <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&amp;chf=bg,s,FFFFFF00&amp;chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&amp;chco=' + hexify(getComputedStyle(this.parentNode,null).color); }" /> onload="if (this.src.substr(this.src.length-9,this.src.length) == 'blank.gif') { this.src = 'http://chart.apis.google.com/chart?cht=tx&amp;chf=bg,s,FFFFFF00&amp;chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&amp;chco=' + hexify(getComputedStyle(this.parentNode,null).color); }" />
</div> </div>
<br /> <br />
@ -144,11 +144,11 @@
<br /> <br />
<strong>Required Ratio Example:</strong><br /> <strong>Required Ratio Example:</strong><br />
<ul> <ul>
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20-30 GB amount downloaded bracket in the table above. Rippy&#39;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&ndash;30 GB amount downloaded bracket in the table above. Rippy&#39;s maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
</li> </li>
<li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li> <li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li>
<li>To calculate Rippy&#39;s actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 - seeding/snatched] (which is 0.50). Written out: <li>To calculate Rippy&#39;s actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 &minus; (seeding / snatched)] (which is 0.50). Written out:
0.3 * [1 - (45/90)] = 0.15. <samp>0.3 * [1 &minus; (45 / 90)] = 0.15</samp>
</li> </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>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&#39;s on-site required ratio was listed as a value greater than the calculated value, this would be because he hadn&#39;t seeded those 45 torrents for a 72 hour period in the <li>If Rippy&#39;s on-site required ratio was listed as a value greater than the calculated value, this would be because he hadn&#39;t seeded those 45 torrents for a 72 hour period in the

View File

@ -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>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>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>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>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>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> <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>

View File

@ -68,7 +68,7 @@
<div class="head"> <div class="head">
<?=((empty($_GET['action'])) ? 'Create a staff blog post' : 'Edit staff blog post')?> <?=((empty($_GET['action'])) ? 'Create a staff blog post' : 'Edit staff blog post')?>
<span style="float: right;"> <span style="float: right;">
<a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='(Hide)'?'(Show)':'(Hide)'); return false;"><?=($_REQUEST['action']!='editblog')?'(Show)':'(Hide)'?></a> <a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="bracket"><?=($_REQUEST['action'] != 'editblog') ? 'Show' : 'Hide' ?></a>
</span> </span>
</div> </div>
<form class="<?=((empty($_GET['action'])) ? 'create_form' : 'edit_form')?>" name="blog_post" action="staffblog.php" method="post"> <form class="<?=((empty($_GET['action'])) ? 'create_form' : 'edit_form')?>" name="blog_post" action="staffblog.php" method="post">

View File

@ -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'); include(SERVER_ROOT.'/sections/donate/config.php');

View File

@ -506,7 +506,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -214,7 +214,7 @@
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">
@ -314,7 +314,7 @@
<td class="nobr big_info"> <td class="nobr big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -1001,7 +1001,7 @@ function header_link($SortKey,$DefaultWay="desc") {
<td colspan="2" class="big_info"> <td colspan="2" class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID'] - 1) ?> <? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID']) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">
@ -1122,7 +1122,7 @@ function header_link($SortKey,$DefaultWay="desc") {
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID - 1) ?> <? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -119,12 +119,8 @@ function compare($X, $Y) {
<div class="head"><strong>Cover</strong></div> <div class="head"><strong>Cover</strong></div>
<? <?
if ($WikiImage != '') { 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 { } else {
?> ?>

View File

@ -256,7 +256,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -146,7 +146,9 @@
$Validate->SetFields('other_bitrate', $Validate->SetFields('other_bitrate',
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9)); '1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
$enc = trim($_POST['other_bitrate']); $enc = trim($_POST['other_bitrate']);
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; } if (isset($_POST['vbr'])) {
$enc.=' (VBR)';
}
$Properties['Encoding'] = $enc; $Properties['Encoding'] = $enc;
$Properties['Bitrate'] = $enc; $Properties['Bitrate'] = $enc;
@ -183,7 +185,9 @@
$Validate->SetFields('other_bitrate', $Validate->SetFields('other_bitrate',
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9)); '1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
$enc = trim($_POST['other_bitrate']); $enc = trim($_POST['other_bitrate']);
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; } if (isset($_POST['vbr'])) {
$enc.=' (VBR)';
}
$Properties['Encoding'] = $enc; $Properties['Encoding'] = $enc;
$Properties['Bitrate'] = $enc; $Properties['Bitrate'] = $enc;

View File

@ -492,7 +492,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -811,9 +811,9 @@
foreach ($ArtistsUnescaped as $Importance => $Artists) { foreach ($ArtistsUnescaped as $Importance => $Artists) {
foreach ($Artists as $Artist) { foreach ($Artists as $Artist) {
if ($Importance == 1 || $Importance == 4 || $Importance == 5 || $Importance == 6) { 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 { } else {
$GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']))."|%'"; $GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']), true)."|%'";
} }
} }
} }

View File

@ -166,8 +166,10 @@ function user_dupes_table($UserID) {
<input type="hidden" name="userid" value="<?=$UserID?>" /> <input type="hidden" name="userid" value="<?=$UserID?>" />
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" /> <input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" />
<div class="box"> <div class="box" id="l_a_box">
<div class="head"><?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a></div> <div class="head">
<a href="#l_a_box"><strong>&uarr;</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"> <table width="100%" class="layout hidden linkedaccounts">
<?=$DupeCount?'<tr>':''?> <?=$DupeCount?'<tr>':''?>
<? <?

View File

@ -33,7 +33,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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/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" /> <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/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> <script src="<? echo STATIC_SERVER; ?>functions/stylesheetgallery.js?v=<?=filemtime(STATIC_SERVER.'functions/stylesheetgallery.js')?>"></script>
<? } ?> <? } ?>
@ -142,7 +142,6 @@
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="content"> <div id="content">
<div class="thin"> <div class="thin">
@ -181,7 +180,7 @@
<td title="Read" class="read"></td> <td title="Read" class="read"></td>
<td> <td>
<h4 class="min_padding"> <h4 class="min_padding">
<a href="#">What.CD</a> <a href="#"><?=SITE_NAME?></a>
</h4> </h4>
</td> </td>
<td> <td>

View File

@ -120,7 +120,7 @@
$DisplayCustomTitle = $CustomTitle; $DisplayCustomTitle = $CustomTitle;
if (check_perms('site_proxy_images') && !empty($CustomTitle)) { if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
$DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) { $DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) {
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;i='.urlencode($Matches[2]).$Matches[3]; return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
}, $CustomTitle); }, $CustomTitle);
} }
@ -535,16 +535,14 @@ function check_paranoia_here($Setting) {
?> ?>
<table class="layout recent" id="recent_snatches" cellpadding="0" cellspacing="0" border="0"> <table class="layout recent" id="recent_snatches" cellpadding="0" cellspacing="0" border="0">
<tr class="colhead"> <tr class="colhead">
<td colspan="5">Recent snatches</td> <td colspan="5">
<a href="#recent_snatches"><strong>&uarr;</strong></a> Recent snatches
</td>
</tr> </tr>
<tr> <tr>
<? <? foreach ($RecentSnatches as $RS) { ?>
foreach ($RecentSnatches as $RS) {
if (check_perms('site_proxy_images')) {
$RS['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RS['WikiImage']);
} ?>
<td> <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> </td>
<? } ?> <? } ?>
</tr> </tr>
@ -580,15 +578,14 @@ function check_paranoia_here($Setting) {
?> ?>
<table class="layout recent" id="recent_uploads" cellpadding="0" cellspacing="0" border="0"> <table class="layout recent" id="recent_uploads" cellpadding="0" cellspacing="0" border="0">
<tr class="colhead"> <tr class="colhead">
<td colspan="5">Recent uploads</td> <td colspan="5">
<a href="#recent_uploads"><strong>&uarr;</strong></a> Recent uploads
</td>
</tr> </tr>
<tr> <tr>
<? foreach ($RecentUploads as $RU) { <? foreach ($RecentUploads as $RU) { ?>
if (check_perms('site_proxy_images')) {
$RU['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RU['WikiImage']);
} ?>
<td> <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> </td>
<? } ?> <? } ?>
</tr> </tr>
@ -610,14 +607,14 @@ function check_paranoia_here($Setting) {
ORDER BY ct.Sort LIMIT 5"); ORDER BY ct.Sort LIMIT 5");
$Collage = $DB->to_array(); $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"> <tr class="colhead">
<td colspan="5"> <td colspan="5">
<span style="float:left;"> <span style="float:left;">
<?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a> <a href="#collage<?=$CollageID?>_box"><strong>&uarr;</strong></a> <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
</span> </span>
<span style="float:right;"> <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> </span>
</td> </td>
</tr> </tr>
@ -630,13 +627,9 @@ function check_paranoia_here($Setting) {
$Name = ''; $Name = '';
$Name .= Artists::display_artists(array('1'=>$Artists), false, true); $Name .= Artists::display_artists(array('1'=>$Artists), false, true);
$Name .= $GroupName; $Name .= $GroupName;
if (check_perms('site_proxy_images')) {
$C['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($C['WikiImage']);
}
?> ?>
<td> <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> </td>
<? } ?> <? } ?>
</tr> </tr>
@ -658,8 +651,10 @@ function check_paranoia_here($Setting) {
include(SERVER_ROOT.'/classes/class_invite_tree.php'); include(SERVER_ROOT.'/classes/class_invite_tree.php');
$Tree = new INVITE_TREE($UserID, array('visible'=>false)); $Tree = new INVITE_TREE($UserID, array('visible'=>false));
?> ?>
<div class="box"> <div class="box" id="invitetree_box">
<div class="head">Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a></div> <div class="head">
<a href="#invitetree_box"><strong>&uarr;</strong></a> Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a>
</div>
<div id="invitetree" class="hidden"> <div id="invitetree" class="hidden">
<? $Tree->make_tree(); ?> <? $Tree->make_tree(); ?>
</div> </div>
@ -688,8 +683,10 @@ function check_paranoia_here($Setting) {
if ($DB->record_count() > 0) { if ($DB->record_count() > 0) {
$Requests = $DB->to_array(); $Requests = $DB->to_array();
?> ?>
<div class="box"> <div class="box" id="requests_box">
<div class="head">Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a></div> <div class="head">
<a href="#requests_box"><strong>&uarr;</strong></a> Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a>
</div>
<div id="requests" class="request_table hidden"> <div id="requests" class="request_table hidden">
<table cellpadding="6" cellspacing="1" border="0" class="border" width="100%"> <table cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
<tr class="colhead_dark"> <tr class="colhead_dark">
@ -787,8 +784,10 @@ function check_paranoia_here($Setting) {
if ($DB->record_count()) { if ($DB->record_count()) {
$StaffPMs = $DB->to_array(); $StaffPMs = $DB->to_array();
?> ?>
<div class="box"> <div class="box" id="staffpms_box">
<div class="head">Staff PMs <a href="#" onclick="$('#staffpms').toggle();return false;" class="brackets">View</a></div> <div class="head">
<a href="#staffpms_box"><strong>&uarr;</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"> <table width="100%" class="message_table hidden" id="staffpms">
<tr class="colhead"> <tr class="colhead">
<td>Subject</td> <td>Subject</td>
@ -856,8 +855,9 @@ function check_paranoia_here($Setting) {
<input type="hidden" name="userid" value="<?=$UserID?>" /> <input type="hidden" name="userid" value="<?=$UserID?>" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<div class="box"> <div class="box" id="staff_notes_box">
<div class="head">Staff notes <div class="head">
<a href="#staff_notes_box"><strong>&uarr;</strong></a> Staff notes
<a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a> <a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
<a href="#" onclick="$('#staffnotes').toggle(); return false;" class="brackets">Toggle</a> <a href="#" onclick="$('#staffnotes').toggle(); return false;" class="brackets">Toggle</a>
</div> </div>
@ -872,9 +872,11 @@ function check_paranoia_here($Setting) {
</div> </div>
</div> </div>
<table class="layout"> <table class="layout" id="user_info_box">
<tr class="colhead"> <tr class="colhead">
<td colspan="2">User information</td> <td colspan="2">
<a href="#user_info_box"><strong>&uarr;</strong></a> User information
</td>
</tr> </tr>
<? if (check_perms('users_edit_usernames', $Class)) { ?> <? if (check_perms('users_edit_usernames', $Class)) { ?>
<tr> <tr>
@ -1055,9 +1057,11 @@ function check_paranoia_here($Setting) {
</table><br /> </table><br />
<? if (check_perms('users_warn')) { ?> <? if (check_perms('users_warn')) { ?>
<table class="layout"> <table class="layout" id="warn_user_box">
<tr class="colhead"> <tr class="colhead">
<td colspan="2">Warn user</td> <td colspan="2">
<a href="#warn_user_box"><strong>&uarr;</strong></a> Warn user
</td>
</tr> </tr>
<tr> <tr>
<td class="label">Warned:</td> <td class="label">Warned:</td>
@ -1112,8 +1116,12 @@ function check_paranoia_here($Setting) {
</tr> </tr>
<? } ?> <? } ?>
</table><br /> </table><br />
<table class="layout"> <table class="layout" id="user_privs_box">
<tr class="colhead"><td colspan="2">User privileges</td></tr> <tr class="colhead">
<td colspan="2">
<a href="#user_privs_box"><strong>&uarr;</strong></a> User privileges
</td>
</tr>
<? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) { <? 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"); $DB->query("SELECT DISTINCT Email, IP FROM users_history_emails WHERE UserID = ".$UserID." ORDER BY Time ASC");
$Emails = $DB->to_array(); $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="1"<? if ($Enabled=='1') { ?> selected="selected"<? } ?>>Enabled</option>
<option value="2"<? if ($Enabled=='2') { ?> selected="selected"<? } ?>>Disabled</option> <option value="2"<? if ($Enabled=='2') { ?> selected="selected"<? } ?>>Disabled</option>
<? if (check_perms('users_delete_users')) { ?> <? if (check_perms('users_delete_users')) { ?>
<optgroup label="-- WARNING --"></optgroup> <optgroup label="-- WARNING --">
<option value="delete">Delete account</option> <option value="delete">Delete account</option>
</optgroup>
<? } ?> <? } ?>
</select> </select>
</td> </td>
@ -1193,8 +1202,12 @@ function check_paranoia_here($Setting) {
<? } ?> <? } ?>
</table><br /> </table><br />
<? if (check_perms('users_logout')) { ?> <? if (check_perms('users_logout')) { ?>
<table class="layout"> <table class="layout" id="session_box">
<tr class="colhead"><td colspan="2">Session</td></tr> <tr class="colhead">
<td colspan="2">
<a href="#session_box"><strong>&uarr;</strong></a> Session
</td>
</tr>
<tr> <tr>
<td class="label">Reset session:</td> <td class="label">Reset session:</td>
<td><input type="checkbox" name="ResetSession" id="ResetSession" /></td> <td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
@ -1206,8 +1219,12 @@ function check_paranoia_here($Setting) {
</table> </table>
<? } ?> <? } ?>
<table class="layout"> <table class="layout" id="submit_box">
<tr class="colhead"><td colspan="2">Submit</td></tr> <tr class="colhead">
<td colspan="2">
<a href="#submit_box"><strong>&uarr;</strong></a> Submit
</td>
</tr>
<tr> <tr>
<td class="label"><span title="This message will be entered into staff notes only.">Reason:</span></td> <td class="label"><span title="This message will be entered into staff notes only.">Reason:</span></td>
<td> <td>

View File

@ -46,10 +46,6 @@
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned')))); 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&amp;i='.urlencode($Avatar);
}
View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode'); View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode');
if ($LoggedUser['CustomForums']) { if ($LoggedUser['CustomForums']) {
@ -305,7 +301,7 @@
<? <?
if ($Avatar) { 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" />
<? <?
} }
?> ?>

View File

@ -138,7 +138,7 @@
<td colspan="5" class="big_info"> <td colspan="5" class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">
@ -217,7 +217,7 @@
<td class="big_info"> <td class="big_info">
<? if ($LoggedUser['CoverArt']) : ?> <? if ($LoggedUser['CoverArt']) : ?>
<div class="group_image float_left clear"> <div class="group_image float_left clear">
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?> <? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
</div> </div>
<? endif; ?> <? endif; ?>
<div class="group_info clear"> <div class="group_info clear">

View File

@ -168,13 +168,10 @@
<tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>"> <tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>">
<? if (empty($HeavyInfo['DisableAvatars'])) { ?> <? if (empty($HeavyInfo['DisableAvatars'])) { ?>
<td class="avatar" valign="top"> <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)) { <? if ($AuthorAvatar) { ?>
$AuthorAvatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&amp;i='.urlencode($AuthorAvatar); ?> <img src="<?=ImageTools::process($AuthorAvatar)?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
<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" />
<? } else { ?> <? } 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> </td>
<? } ?> <? } ?>

View File

@ -104,7 +104,7 @@
$i = 0; $i = 0;
foreach ($AliasArray as $AliasItem) { foreach ($AliasArray as $AliasItem) {
?> ?>
<li id="alias_<?=$AliasItem?>"><a href="wiki.php?action=article&amp;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&amp;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++; <? $i++;
} }
} }

View File

@ -89,9 +89,15 @@ function get_headers(response) {
// Load content // Load content
function load(url,forward,formid) { function load(url,forward,formid) {
if(forward===undefined) { forward=true; } if (forward === undefined) {
if (transitions_in_progress && document.createTouch) { return; } //OS 2 forward = true;
if (moved_after_touch) { return; } }
if (transitions_in_progress && document.createTouch) { // OS 2
return;
}
if (moved_after_touch) {
return;
}
if (formid === undefined){ if (formid === undefined){
ajax.get(url, function (response) { ajax.get(url, function (response) {
get_headers(response); get_headers(response);
@ -105,12 +111,18 @@ function load(url,forward,formid) {
// Moves // Moves
var moved_after_touch = false; var moved_after_touch = false;
function touch_started () { moved_after_touch = false; }; function touch_started () {
function touch_moved () { moved_after_touch = true; }; moved_after_touch = false;
};
function touch_moved () {
moved_after_touch = true;
};
// Transitions // Transitions
var transitions_in_progress = false; 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) { function transition_to_new_element (data, going_forward) {
transitions_in_progress = true; transitions_in_progress = true;

View File

@ -158,13 +158,13 @@ function AddFormat() {
tmp = '<select id="releasetype" name="extra_formats[]"><option value="">---</option>'; tmp = '<select id="releasetype" name="extra_formats[]"><option value="">---</option>';
var formats=["Saab","Volvo","BMW"]; var formats=["Saab","Volvo","BMW"];
for (var i in formats) { for (var i in formats) {
tmp += "<option value='"+formats[i]+"'>"+formats[i]+"</option>\n"; tmp += '<option value="'+formats[i]+'">'+formats[i]+"</option>\n";
} }
tmp += "</select>"; tmp += "</select>";
var bitrates=["1","2","3"]; var bitrates=["1","2","3"];
tmp += '<select id="releasetype" name="extra_bitrates[]"><option value="">---</option>'; tmp += '<select id="releasetype" name="extra_bitrates[]"><option value="">---</option>';
for (var i in bitrates) { for (var i in bitrates) {
tmp += "<option value='"+bitrates[i]+"'>"+bitrates[i]+"</option>\n"; tmp += '<option value="'+bitrates[i]+'">'+bitrates[i]+"</option>\n";
} }
tmp += "</select>"; tmp += "</select>";

View File

@ -12,7 +12,9 @@ function validEmail(str) {
function validLink(str) { function validLink(str) {
if (str.match(/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i)) { if (str.match(/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i)) {
return true; return true;
} else { return false; } } else {
return false;
}
} }
function isNumeric(str,usePeriod) { function isNumeric(str,usePeriod) {
@ -22,7 +24,9 @@ function isNumeric(str,usePeriod) {
} }
matchStr = ']/'; matchStr = ']/';
if (str.match(matchStr)) { return false; } if (str.match(matchStr)) {
return false;
}
return true; return true;
} }
@ -37,7 +41,12 @@ function validDate(theDate) {
if (!isNumeric(month) || !isNumeric(day) || !isNumeric(year)) { return false; } if (!isNumeric(month) || !isNumeric(day) || !isNumeric(year)) { return false; }
if (month == 1) { 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 == 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 == 3) { days = 31; }
else if (month == 4) { days = 30; } else if (month == 4) { days = 30; }
else if (month == 5) { days = 31; } else if (month == 5) { days = 31; }
@ -49,19 +58,30 @@ function validDate(theDate) {
else if (month == 11) { days = 30; } else if (month == 11) { days = 30; }
else if (month == 12) { days = 31; } 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) { function showError(fields,alertStr) {
var tField=Array(); var tField=Array();
if (typeof(fields)=='object') { tField[0]=fields; } else { tField=fields.split(','); } if (typeof(fields) == 'object') {
tField[0] = fields;
} else {
tField = fields.split(',');
}
for (s = 0; s <= tField.length - 1; s++) { for (s = 0; s <= tField.length - 1; s++) {
if ($('#'+tField[s])) { if ($('#'+tField[s])) {
$('#'+tField[s]).className=$('#'+tField[s]).className+" elem_error"; $('#'+tField[s]).className=$('#'+tField[s]).className+" elem_error";
if (s == 0) { if (s == 0) {
$('#'+tField[s]).focus(); $('#'+tField[s]).focus();
try { $('#'+tField[s]).select(); } catch (error) { } try {
$('#'+tField[s]).select();
} catch (error) {
}
} }
errorElems[errorElems.length] = tField[s]; errorElems[errorElems.length] = tField[s];
@ -73,7 +93,9 @@ function showError(fields,alertStr) {
} }
} }
if (alertStr!="") { alert(alertStr); } if (alertStr != "") {
alert(alertStr);
}
return false; return false;
} }

View File

@ -25,5 +25,4 @@
} }
} }
}); });
})(jQuery); })(jQuery);