mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
0a565870d9
commit
b055e9c6f1
@ -456,7 +456,7 @@ public function constant_table($Constants=false) {
|
||||
|
||||
public function cache_table($CacheKeys=false) {
|
||||
global $Cache;
|
||||
$Header = 'Cache Keys';
|
||||
$Header = 'Cache keys';
|
||||
if (!is_array($CacheKeys)) {
|
||||
$CacheKeys = $this->get_cache_keys();
|
||||
$Header .= ' ('.number_format($this->get_cache_time(), 5).' ms)';
|
||||
|
@ -9,13 +9,13 @@ class ImageTools {
|
||||
* Store processed links to avoid repetition
|
||||
* @var array 'URL' => 'Parsed URL'
|
||||
*/
|
||||
static private $Storage = array();
|
||||
private static $Storage = array();
|
||||
|
||||
/**
|
||||
* We use true as an extra property to make the domain an array key
|
||||
* @var array $Hosts Array of image hosts
|
||||
*/
|
||||
static private $Hosts = array(
|
||||
private static $Hosts = array(
|
||||
'whatimg.com' => true,
|
||||
'imgur.com' => true
|
||||
);
|
||||
@ -24,7 +24,7 @@ class ImageTools {
|
||||
* Blacklisted sites
|
||||
* @var array $Blacklist Array of blacklisted hosts
|
||||
*/
|
||||
static private $Blacklist = array(
|
||||
private static $Blacklist = array(
|
||||
'tinypic.com'
|
||||
);
|
||||
|
||||
@ -32,7 +32,7 @@ class ImageTools {
|
||||
* Array of image hosts that provide thumbnailing
|
||||
* @var array $Thumbs
|
||||
*/
|
||||
static private $Thumbs = array(
|
||||
private static $Thumbs = array(
|
||||
'i.imgur.com' => true,
|
||||
'whatimg.com' => true
|
||||
);
|
||||
@ -41,7 +41,7 @@ class ImageTools {
|
||||
* Array of extensions
|
||||
* @var array $Extensions
|
||||
*/
|
||||
static private $Extensions = array(
|
||||
private static $Extensions = array(
|
||||
'jpg' => true,
|
||||
'jpeg' => true,
|
||||
'png' => true,
|
||||
@ -78,7 +78,7 @@ public static function blacklisted($Url) {
|
||||
* @param string $Url Link to an image
|
||||
* @return string|false Matched host or false
|
||||
*/
|
||||
public static function thumbnailable($Url) {
|
||||
private static function thumbnailable($Url) {
|
||||
$ParsedUrl = parse_url($Url);
|
||||
return !empty(self::$Thumbs[$ParsedUrl['host']]);
|
||||
}
|
||||
@ -88,7 +88,7 @@ public static function thumbnailable($Url) {
|
||||
* @param string $Ext Extension to check
|
||||
* @return boolean
|
||||
*/
|
||||
public static function valid_extension($Ext) {
|
||||
private static function valid_extension($Ext) {
|
||||
// return @self::$Extensions[$Ext] === true;
|
||||
return !empty(self::$Extensions[$Ext]) && self::$Extensions[$Ext] === true;
|
||||
}
|
||||
@ -98,7 +98,7 @@ public static function valid_extension($Ext) {
|
||||
* @param type $Link
|
||||
* @param type $Processed
|
||||
*/
|
||||
public static function store($Link, $Processed) {
|
||||
private static function store($Link, $Processed) {
|
||||
self::$Storage[$Link] = $Processed;
|
||||
}
|
||||
|
||||
@ -107,129 +107,24 @@ public static function store($Link, $Processed) {
|
||||
* @param type $Link
|
||||
* @return boolean|string Returns false if no match
|
||||
*/
|
||||
public static function get_stored($Link) {
|
||||
private static function get_stored($Link) {
|
||||
if (isset(self::$Storage[$Link])) {
|
||||
return self::$Storage[$Link];
|
||||
}
|
||||
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.
|
||||
*/
|
||||
function has_whatimg_thumb($Url) {
|
||||
return contains("_thumb", $Url);
|
||||
private static function has_whatimg_thumb($Url) {
|
||||
return (strpos($Url, '_thumb') !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
$Full = preg_replace('/\.[^.]*$/', '', $Url);
|
||||
$Base = substr($Full, 0, strrpos($Full, '/'));
|
||||
@ -242,3 +137,85 @@ function clean_imgur_url($Url) {
|
||||
}
|
||||
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&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)" />
|
||||
<?
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,9 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
|
||||
}
|
||||
if (is_array($Property)) {
|
||||
$all = true;
|
||||
foreach ($Property as $P) { $all = $all && check_paranoia($P, $Paranoia, $UserClass, $UserID); }
|
||||
foreach ($Property as $P) {
|
||||
$all = $all && check_paranoia($P, $Paranoia, $UserClass, $UserID);
|
||||
}
|
||||
return $all;
|
||||
} else {
|
||||
if (($UserID !== false) && ($LoggedUser['ID'] == $UserID)) {
|
||||
@ -69,8 +71,9 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
|
||||
if ($May)
|
||||
return PARANOIA_ALLOWED;
|
||||
|
||||
if(check_perms('users_override_paranoia', $UserClass))
|
||||
if (check_perms('users_override_paranoia', $UserClass)) {
|
||||
return PARANOIA_OVERRIDDEN;
|
||||
}
|
||||
$Override=false;
|
||||
switch ($Property) {
|
||||
case 'downloaded':
|
||||
|
@ -25,7 +25,9 @@ function show() {
|
||||
for ($i=0; $i<sizeof($this->file); $i++) {
|
||||
$TMPVAR=$this->file[$i];
|
||||
foreach ($this->vars as $k=>$v) {
|
||||
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; }
|
||||
if ($v[1] != '' && $v[0] == '') {
|
||||
$v[0] = $v[1];
|
||||
}
|
||||
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
}
|
||||
print $TMPVAR;
|
||||
@ -38,7 +40,9 @@ function get() {
|
||||
for ($i = 0; $i < sizeof($this->file); $i++) {
|
||||
$TMPVAR=$this->file[$i];
|
||||
foreach ($this->vars as $k=>$v) {
|
||||
if ($v[1]!="" && $v[0]=="") { $v[0]=$v[1]; }
|
||||
if ($v[1] != '' && $v[0] == '') {
|
||||
$v[0] = $v[1];
|
||||
}
|
||||
$TMPVAR = str_replace('{{'.$k.'}}',$v[0],$TMPVAR);
|
||||
}
|
||||
$RESULT.=$TMPVAR;
|
||||
@ -73,7 +77,6 @@ function str_align($len,$str,$align,$fill) {
|
||||
|
||||
$result.=str_repeat($fill,$snm);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@ -772,10 +772,8 @@ private function to_html ($Array) {
|
||||
$LocalURL = $this->local_url($Block['Val']);
|
||||
if ($LocalURL) {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$LocalURL.'" />';
|
||||
} elseif (check_perms('site_proxy_images')) {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
$Str.='<img class="scale_image" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -543,11 +543,7 @@ function to_html($Array) {
|
||||
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
|
||||
$Str.='[img]'.$Block['Val'].'[/img]';
|
||||
} else {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
}
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -504,11 +504,7 @@ function to_html($Array) {
|
||||
if (!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) {
|
||||
$Str.='[img]'.$Block['Val'].'[/img]';
|
||||
} else {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Block['Val']).'" />';
|
||||
} else {
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.$Block['Val'].'" />';
|
||||
}
|
||||
$Str.='<img style="max-width: 500px;" onclick="lightbox.init(this,500);" alt="'.$Block['Val'].'" src="'.ImageTools::process($Block['Val']).'" />';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -3,8 +3,7 @@
|
||||
* This super class is used to manage the ammount of textareas there are and to
|
||||
* generate the required JavaScript that enables the previews to work.
|
||||
*/
|
||||
class TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
class TEXTAREA_PREVIEW_SUPER {
|
||||
/**
|
||||
* @static
|
||||
* @var int $Textareas Total number of textareas created
|
||||
@ -37,11 +36,13 @@ class TEXTAREA_PREVIEW_SUPER
|
||||
* @example <pre><?php TEXT_PREVIEW::JavaScript(); ?></pre>
|
||||
* @return void
|
||||
*/
|
||||
static public function JavaScript ($all = true)
|
||||
{
|
||||
if (self::$Textareas === 0) return;
|
||||
if (self::$Exectuted === false && $all)
|
||||
static public function JavaScript ($all = true) {
|
||||
if (self::$Textareas === 0) {
|
||||
return;
|
||||
}
|
||||
if (self::$Exectuted === false && $all) {
|
||||
View::parse('generic/textarea/script.phtml');
|
||||
}
|
||||
|
||||
self::$Exectuted = true;
|
||||
self::iterator();
|
||||
@ -55,8 +56,7 @@ static public function JavaScript ($all = true)
|
||||
* @static
|
||||
* @return void
|
||||
*/
|
||||
static private function iterator ()
|
||||
{
|
||||
static private function iterator () {
|
||||
$script = array();
|
||||
for ($i = 0; $i < self::$Textareas; $i++) {
|
||||
if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
|
||||
@ -66,9 +66,9 @@ static private function iterator ()
|
||||
}
|
||||
$script[] = sprintf('[%s]', $a);
|
||||
}
|
||||
if (!empty($script))
|
||||
View::parse('generic/textarea/script_factory.phtml',
|
||||
array('script' => join(', ', $script)));
|
||||
if (!empty($script)) {
|
||||
View::parse('generic/textarea/script_factory.phtml', array('script' => join(', ', $script)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,8 +111,7 @@ static private function iterator ()
|
||||
* </div>
|
||||
* </pre>
|
||||
*/
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER {
|
||||
/**
|
||||
* @var int Unique ID
|
||||
*/
|
||||
@ -157,14 +156,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
|
||||
parent::$Textareas += 1;
|
||||
array_push(parent::$_ID, $ID);
|
||||
|
||||
if (empty($ID)) $ID = 'quickpost_' . $this->id;
|
||||
if (empty($ID)) {
|
||||
$ID = 'quickpost_' . $this->id;
|
||||
}
|
||||
|
||||
if (!empty($ExtraAttributes))
|
||||
if (!empty($ExtraAttributes)) {
|
||||
$Attributes = ' ' . implode(' ', $ExtraAttributes);
|
||||
else
|
||||
} else {
|
||||
$Attributes = '';
|
||||
}
|
||||
|
||||
if ($Preview === true) $this->preview();
|
||||
if ($Preview === true) {
|
||||
$this->preview();
|
||||
}
|
||||
|
||||
$this->buffer = View::parse('generic/textarea/textarea.phtml', array(
|
||||
'ID' => $ID,
|
||||
@ -176,17 +180,19 @@ public function __construct ($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 1
|
||||
'Attributes' => &$Attributes
|
||||
), $Buffer);
|
||||
|
||||
if ($Buttons === true) $this->buttons();
|
||||
if ($Buttons === true) {
|
||||
$this->buttons();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the divs required for previewing the AJAX content
|
||||
* Will only output once
|
||||
*/
|
||||
public function preview ()
|
||||
{
|
||||
if (!$this->preview)
|
||||
public function preview () {
|
||||
if (!$this->preview) {
|
||||
View::parse('generic/textarea/preview.phtml', array('ID' => $this->id));
|
||||
}
|
||||
$this->preview = true;
|
||||
}
|
||||
|
||||
@ -194,16 +200,14 @@ public function preview ()
|
||||
* Outputs the preview and edit buttons
|
||||
* Can be called many times to place buttons in different areas
|
||||
*/
|
||||
public function buttons ()
|
||||
{
|
||||
public function buttons () {
|
||||
View::parse('generic/textarea/buttons.phtml', array('ID' => $this->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the textarea's numeric ID.
|
||||
*/
|
||||
public function getID ()
|
||||
{
|
||||
public function getID () {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
@ -211,8 +215,7 @@ public function getID ()
|
||||
* Returns textarea string when buffer is enabled in the constructor
|
||||
* @return string
|
||||
*/
|
||||
public function getBuffer ()
|
||||
{
|
||||
public function getBuffer () {
|
||||
return $this->buffer;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ function update_tracker($Action, $Updates, $ToIRC = false) {
|
||||
}
|
||||
$Path = TRACKER_SECRET.$Get;
|
||||
|
||||
$Return = "";
|
||||
$Return = '';
|
||||
$Attempts = 0;
|
||||
while ($Return != "success" && $Attempts < 3) {
|
||||
|
||||
|
@ -104,9 +104,7 @@ public static function user_info($UserID) {
|
||||
}
|
||||
|
||||
// Image proxy
|
||||
if (check_perms('site_proxy_images') && !empty($UserInfo['Avatar'])) {
|
||||
$UserInfo['Avatar'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&avatar='.$UserID.'&i='.urlencode($UserInfo['Avatar']);
|
||||
}
|
||||
$UserInfo['Avatar'] = ImageTools::process($UserInfo['Avatar']);
|
||||
return $UserInfo;
|
||||
}
|
||||
|
||||
@ -481,7 +479,7 @@ public static function format_username($UserID, $Badges = false, $IsWarned = tru
|
||||
if (check_perms('site_proxy_images') && !empty($UserInfo['Title'])) {
|
||||
$UserInfo['Title'] = preg_replace_callback('~src=("?)(http.+?)(["\s>])~',
|
||||
function($Matches) {
|
||||
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
|
||||
return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
|
||||
},
|
||||
$UserInfo['Title']);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
/*------------------------------------------------------*/
|
||||
/********************************************************/
|
||||
require 'config.php'; //The config contains all site wide configuration information
|
||||
|
||||
//Deal with dumbasses
|
||||
if (isset($_REQUEST['info_hash']) && isset($_REQUEST['peer_id'])) { die('d14:failure reason40:Invalid .torrent, try downloading again.e'); }
|
||||
|
||||
@ -435,8 +434,6 @@ function authorize($Ajax = false) {
|
||||
$Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php');
|
||||
if (!preg_match('/^[a-z0-9]+$/i', $Document)) { error(404); }
|
||||
|
||||
|
||||
|
||||
require(SERVER_ROOT.'/sections/'.$Document.'/index.php');
|
||||
$Debug->set_flag('completed module execution');
|
||||
|
||||
|
@ -229,7 +229,7 @@
|
||||
$Cache->cache_value('news_latest_id', $CurrentNews, 0);
|
||||
}
|
||||
if ($MyNews < $CurrentNews) {
|
||||
$Alerts[] = '<a href="index.php">'.'New announcement!'.'</a>';
|
||||
$Alerts[] = '<a href="index.php">New announcement!</a>';
|
||||
}
|
||||
|
||||
// Blog
|
||||
@ -245,7 +245,7 @@
|
||||
$Cache->cache_value('blog_latest_id', $CurrentBlog, 0);
|
||||
}
|
||||
if ($MyBlog < $CurrentBlog) {
|
||||
$Alerts[] = '<a href="blog.php">'.'New blog post!'.'</a>';
|
||||
$Alerts[] = '<a href="blog.php">New blog post!</a>';
|
||||
}
|
||||
|
||||
// Staff blog
|
||||
@ -270,7 +270,7 @@
|
||||
$Cache->cache_value('staff_blog_latest_time', $LatestSBlogTime, 1209600);
|
||||
}
|
||||
if ($SBlogReadTime < $LatestSBlogTime) {
|
||||
$Alerts[] = '<a href="staffblog.php">'.'New staff blog post!'.'</a>';
|
||||
$Alerts[] = '<a href="staffblog.php">New staff blog post!</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@
|
||||
}
|
||||
|
||||
if ($NewStaffPMs > 0) {
|
||||
$Alerts[] = '<a href="staffpm.php">'.'You have '.$NewStaffPMs.(($NewStaffPMs > 1) ? ' new staff messages' : ' new staff message').'</a>';
|
||||
$Alerts[] = '<a href="staffpm.php">You have '.$NewStaffPMs.(($NewStaffPMs > 1) ? ' new staff messages' : ' new staff message').'</a>';
|
||||
}
|
||||
|
||||
//Inbox
|
||||
@ -295,13 +295,13 @@
|
||||
}
|
||||
|
||||
if ($NewMessages > 0) {
|
||||
$Alerts[] = '<a href="inbox.php">'.'You have '.$NewMessages.(($NewMessages > 1) ? ' new messages' : ' new message').'</a>';
|
||||
$Alerts[] = '<a href="inbox.php">You have '.$NewMessages.(($NewMessages > 1) ? ' new messages' : ' new message').'</a>';
|
||||
}
|
||||
|
||||
if ($LoggedUser['RatioWatch']) {
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">'.'Ratio Watch'.'</a>: '.'You have '.time_diff($LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: You have '.time_diff($LoggedUser['RatioWatchEnds'], 3).' to get your ratio over your required ratio or your leeching abilities will be disabled.';
|
||||
} elseif ($LoggedUser['CanLeech'] != 1) {
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">'.'Ratio Watch'.'</a>: '.'Your downloading privileges are disabled until you meet your required ratio.';
|
||||
$Alerts[] = '<a href="rules.php?p=ratio">Ratio Watch</a>: Your downloading privileges are disabled until you meet your required ratio.';
|
||||
}
|
||||
|
||||
if (check_perms('site_torrents_notify')) {
|
||||
@ -316,7 +316,7 @@
|
||||
$Cache->cache_value('notifications_new_'.$LoggedUser['ID'], $NewNotifications, 0);
|
||||
}
|
||||
if ($NewNotifications > 0) {
|
||||
$Alerts[] = '<a href="torrents.php?action=notify">'.'You have '.$NewNotifications.(($NewNotifications > 1) ? ' new torrent notifications' : ' new torrent notification').'</a>';
|
||||
$Alerts[] = '<a href="torrents.php?action=notify">You have '.$NewNotifications.(($NewNotifications > 1) ? ' new torrent notifications' : ' new torrent notification').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,11 +333,11 @@
|
||||
$Cache->cache_value('collage_subs_user_new_'.$LoggedUser['ID'], $NewCollages, 0);
|
||||
}
|
||||
if ($NewCollages > 0) {
|
||||
$Alerts[] = '<a href="userhistory.php?action=subscribed_collages">'.'You have '.$NewCollages.(($NewCollages > 1) ? ' new collage updates' : ' new collage update').'</a>';
|
||||
$Alerts[] = '<a href="userhistory.php?action=subscribed_collages">You have '.$NewCollages.(($NewCollages > 1) ? ' new collage updates' : ' new collage update').'</a>';
|
||||
}
|
||||
}
|
||||
if (check_perms('users_mod')) {
|
||||
$ModBar[] = '<a href="tools.php">'.'Toolbox'.'</a>';
|
||||
$ModBar[] = '<a href="tools.php">Toolbox</a>';
|
||||
}
|
||||
if (check_perms('users_mod') || $LoggedUser['PermissionID'] == FORUM_MOD) {
|
||||
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||
@ -387,7 +387,7 @@
|
||||
}
|
||||
|
||||
if ($NumUpdateReports > 0) {
|
||||
$ModBar[] = '<a href="reports.php">'.'Request update reports'.'</a>';
|
||||
$ModBar[] = '<a href="reports.php">Request update reports</a>';
|
||||
}
|
||||
} elseif (check_perms('site_moderate_forums')) {
|
||||
$NumForumReports = $Cache->get_value('num_forum_reports');
|
||||
|
@ -1510,7 +1510,7 @@ CREATE TABLE `users_sessions` (
|
||||
`SessionID` char(32) NOT NULL,
|
||||
`KeepLogged` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`Browser` varchar(40) DEFAULT NULL,
|
||||
`OperatingSystem` varchar(8) DEFAULT NULL,
|
||||
`OperatingSystem` varchar(13) DEFAULT NULL,
|
||||
`IP` varchar(15) NOT NULL,
|
||||
`LastUpdate` datetime NOT NULL,
|
||||
`Active` tinyint(4) NOT NULL DEFAULT '1',
|
||||
|
@ -22,6 +22,7 @@
|
||||
g.ID,
|
||||
g.Name,
|
||||
g.CategoryID,
|
||||
g.wikiImage,
|
||||
g.TagList,
|
||||
t.Format,
|
||||
t.Encoding,
|
||||
@ -54,7 +55,7 @@
|
||||
ORDER BY (t.Seeders + t.Leechers) DESC
|
||||
LIMIT $Limit;";
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastDay = $DB->to_array();
|
||||
$TopTorrentsActiveLastDay = $DB->to_array(); // TODO: MYSQLI_NUM to avoid duplicate data in the cache (does that break something with generate_torrent_json?)
|
||||
$Cache->cache_value('top10tor_day_'.$Limit.$WhereSum,$TopTorrentsActiveLastDay,3600*2);
|
||||
}
|
||||
$OuterResults[] = generate_torrent_json('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
||||
@ -144,7 +145,7 @@ function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
|
||||
global $LoggedUser,$Categories;
|
||||
$results = array();
|
||||
foreach ($Details as $Detail) {
|
||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$TorrentTags,
|
||||
list($TorrentID,$GroupID,$GroupName,$GroupCategoryID,$WikiImage,$TorrentTags,
|
||||
$Format,$Encoding,$Media,$Scene,$HasLog,$HasCue,$LogScore,$Year,$GroupYear,
|
||||
$RemasterTitle,$Snatched,$Seeders,$Leechers,$Data,$ReleaseType,$Size) = $Detail;
|
||||
|
||||
|
@ -54,10 +54,6 @@ function error_out($reason = '') {
|
||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||
}
|
||||
|
||||
if (check_perms('site_proxy_images') && !empty($Avatar)) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
}
|
||||
|
||||
if ($LoggedUser['CustomForums']) {
|
||||
unset($LoggedUser['CustomForums']['']);
|
||||
$RestrictedForums = implode("','", array_keys($LoggedUser['CustomForums'], 0));
|
||||
|
@ -387,7 +387,7 @@ function compare($X, $Y) {
|
||||
<td colspan="5" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -527,15 +527,11 @@ function compare($X, $Y) {
|
||||
</div>
|
||||
<? /* Misc::display_recommend($ArtistID, "artist"); */ ?>
|
||||
<div class="sidebar">
|
||||
<? if ($Image) {
|
||||
$WikiImage = $Image;
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
} ?>
|
||||
<? if ($Image) { ?>
|
||||
<div class="box box_image">
|
||||
<div class="head"><strong><?=$Name?></strong></div>
|
||||
<div style="text-align: center; padding: 10px 0px;">
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=$WikiImage?>',220);" />
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" />
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
|
@ -51,7 +51,7 @@
|
||||
if ($ThreadID && is_number($ThreadID)) {
|
||||
$DB->query("SELECT ForumID FROM forums_topics WHERE ID=".$ThreadID);
|
||||
if ($DB->record_count() < 1) {
|
||||
error("No such thread exists!");
|
||||
error('No such thread exists!');
|
||||
header('Location: blog.php');
|
||||
}
|
||||
} else {
|
||||
|
@ -210,11 +210,8 @@ function compare($X, $Y){
|
||||
<li class="image_group_<?=$GroupID?>">
|
||||
<a href="torrents.php?id=<?=$GroupID?>" class="bookmark_<?=$GroupID?>">
|
||||
<? if($WikiImage) {
|
||||
if(check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
}
|
||||
?>
|
||||
<img src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="117" />
|
||||
<img src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="117" />
|
||||
<? } else { ?>
|
||||
<div style="width:107px;padding:5px"><?=$DisplayName?></div>
|
||||
<? } ?>
|
||||
|
@ -285,11 +285,8 @@ function compare($X, $Y){
|
||||
<li class="image_group_<?=$GroupID?>">
|
||||
<a href="torrents.php?id=<?=$GroupID?>">
|
||||
<? if ($WikiImage) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($WikiImage);
|
||||
}
|
||||
?>
|
||||
<img src="<?=ImageTools::thumbnail($WikiImage)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="118" />
|
||||
<img src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$DisplayName?>" title="<?=$DisplayName?>" width="118" />
|
||||
<? } else { ?>
|
||||
<span style="width: 107px; padding: 5px;"><?=$DisplayName?></span>
|
||||
<? } ?>
|
||||
|
@ -75,7 +75,7 @@
|
||||
}
|
||||
|
||||
// Start printing
|
||||
View::show_header('Forums > '. $Forums[$ForumID]['Name']);
|
||||
View::show_header('Forums > '. $Forums[$ForumID]['Name']);
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > <?=$ForumName?></h2>
|
||||
|
@ -87,7 +87,7 @@
|
||||
</td>
|
||||
<? if ($NumPosts == 0) { ?>
|
||||
<td colspan="3">
|
||||
There are no topics here<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&forumid='.$ForumID.'">'.'create one'.'</a>' : ''?>.
|
||||
There are no topics here.<?=($MinCreate <= $LoggedUser['Class']) ? ', <a href="forums.php?action=new&forumid='.$ForumID.'">Create one!</a>' : '' ?>.
|
||||
</td>
|
||||
<? } else { ?>
|
||||
<td>
|
||||
|
@ -22,7 +22,7 @@
|
||||
if (!check_forumperm($ForumID, 'Write') || !check_forumperm($ForumID, 'Create')) {
|
||||
error(403);
|
||||
}
|
||||
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
|
||||
View::show_header('Forums > '.$Forum['Name'].' > New Topic','comments,bbcode');
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > <a href="forums.php?action=viewforum&forumid=<?=$ForumID?>"><?=$Forum['Name']?></a> > <span id="newthreadtitle">New Topic</span></h2>
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?
|
||||
|
||||
if(!isset($_POST['topicid']) || !is_number($_POST['topicid'])) { error(0,true); }
|
||||
if (!isset($_POST['topicid']) || !is_number($_POST['topicid'])) {
|
||||
error(0,true);
|
||||
}
|
||||
$TopicID = $_POST['topicid'];
|
||||
|
||||
if (!empty($_POST['large'])) {
|
||||
@ -23,7 +25,9 @@
|
||||
LEFT JOIN forums_polls AS p ON p.TopicID=t.ID
|
||||
WHERE t.ID = '$TopicID'
|
||||
GROUP BY fp.TopicID");
|
||||
if($DB->record_count()==0) { die(); }
|
||||
if ($DB->record_count() == 0) {
|
||||
die();
|
||||
}
|
||||
$ThreadInfo = $DB->next_record(MYSQLI_ASSOC);
|
||||
if (!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
|
||||
$Cache->cache_value('thread_'.$TopicID.'_info', $ThreadInfo, 0);
|
||||
@ -77,7 +81,7 @@
|
||||
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
|
||||
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
|
||||
<? } ?>
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br /><br />
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br /><br />
|
||||
<input type="button" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" />
|
||||
</form>
|
||||
<?
|
||||
@ -134,7 +138,7 @@
|
||||
foreach ($StaffVotes as $StaffVote) {
|
||||
list($StaffString, $StaffVoted) = $StaffVote;
|
||||
?>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$TopicID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? "Blank" : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li>
|
||||
<li><a href="forums.php?action=change_vote&threadid=<?=$TopicID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $StaffVoted?>"><?=display_str(empty($Answers[$StaffVoted]) ? 'Blank' : $Answers[$StaffVoted])?></a> - <?=$StaffString?></li>
|
||||
<?
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@
|
||||
}
|
||||
|
||||
// Let's hope we got some results - start printing out the content.
|
||||
View::show_header('Forums'.' > '.'Search', 'bbcode');
|
||||
View::show_header('Forums > Search', 'bbcode');
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><a href="forums.php">Forums</a> > Search<?=$Title?></h2>
|
||||
@ -278,7 +278,7 @@
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="forum_list border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td>Forum</td>
|
||||
<td><?=(!empty($ThreadID))?'Post Begins':'Topic'?></td>
|
||||
<td><?=(!empty($ThreadID)) ? 'Post begins' : 'Topic' ?></td>
|
||||
<td>Time</td>
|
||||
</tr>
|
||||
<? if ($DB->record_count() == 0) { ?>
|
||||
|
@ -309,7 +309,7 @@
|
||||
foreach($Answers as $i => $Answer) {
|
||||
?>
|
||||
<li>
|
||||
<a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>"><?=display_str($Answer == '' ? "Blank" : $Answer)?></a>
|
||||
<a href="forums.php?action=change_vote&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>"><?=display_str($Answer == '' ? 'Blank' : $Answer)?></a>
|
||||
- <?=$StaffVotes[$i]?> (<?=number_format(((float) $Votes[$i] / $TotalVotes) * 100, 2)?>%)
|
||||
<a href="forums.php?action=delete_poll_option&threadid=<?=$ThreadID?>&auth=<?=$LoggedUser['AuthKey']?>&vote=<?=(int) $i?>" class="brackets">X</a>
|
||||
</li>
|
||||
@ -322,7 +322,7 @@
|
||||
<br />
|
||||
<strong>Votes:</strong> <?=number_format($TotalVotes)?> / <?=$StaffCount ?>
|
||||
<br />
|
||||
<strong>Missing Votes:</strong> <?=implode(", ", $StaffNames)?>
|
||||
<strong>Missing votes:</strong> <?=implode(", ", $StaffNames)?>
|
||||
<br /><br />
|
||||
<?
|
||||
}
|
||||
@ -349,7 +349,7 @@
|
||||
<? } ?>
|
||||
<li>
|
||||
<br />
|
||||
<input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br />
|
||||
<input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br />
|
||||
</li>
|
||||
</ul>
|
||||
<? if($ForumID == STAFF_FORUM) { ?>
|
||||
|
@ -93,11 +93,8 @@
|
||||
<td width="50px" valign="top">
|
||||
<?
|
||||
if (empty($HeavyInfo['DisableAvatars'])) {
|
||||
if (!empty($Avatar)) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
} ?>
|
||||
<img src="<?=$Avatar?>" alt="<?=$Username?>'s avatar" width="50px" />
|
||||
if (!empty($Avatar)) { ?>
|
||||
<img src="<?=ImageTools::process($Avatar)?>" alt="<?=$Username?>'s avatar" width="50px" />
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="50px" alt="Default avatar" />
|
||||
<? }
|
||||
|
@ -16,10 +16,6 @@
|
||||
}
|
||||
if (is_number($FeaturedAlbum['GroupID'])) {
|
||||
$Artists = Artists::get_artist($FeaturedAlbum['GroupID']);
|
||||
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$FeaturedAlbum['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($FeaturedAlbum['WikiImage']);
|
||||
}
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head colhead_dark"><strong>Featured Album</strong></div>
|
||||
@ -28,7 +24,7 @@
|
||||
</div>
|
||||
<div class="center">
|
||||
<a href="torrents.php?id=<?=$FeaturedAlbum['GroupID']?>" title="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>">
|
||||
<img src="<?=ImageTools::thumbnail($FeaturedAlbum['WikiImage'])?>" alt="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" />
|
||||
<img src="<?=ImageTools::process($FeaturedAlbum['WikiImage'], true)?>" alt="<?=Artists::display_artists($Artists, false, false)?> - <?=$FeaturedAlbum['Name']?>" width="100%" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="center pad">
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?
|
||||
include(SERVER_ROOT.'/classes/class_text.php');
|
||||
|
||||
$Text = new TEXT(true);
|
||||
|
||||
if (!$News = $Cache->get_value('news')) {
|
||||
@ -294,7 +293,7 @@
|
||||
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' ['.'Closed'.']'; } ?></strong></div>
|
||||
<div class="head colhead_dark"><strong>Poll<? if ($Closed) { echo ' [Closed]'; } ?></strong></div>
|
||||
<div class="pad">
|
||||
<p><strong><?=display_str($Question)?></strong></p>
|
||||
<? if ($UserResponse !== null || $Closed) { ?>
|
||||
@ -327,7 +326,7 @@
|
||||
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
|
||||
<label for="answer_<?=$i?>"><?=display_str($Answers[$i])?></label><br />
|
||||
<? } ?>
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank - Show the results!</label><br /><br />
|
||||
<br /><input type="radio" name="vote" id="answer_0" value="0" /> <label for="answer_0">Blank — Show the results!</label><br /><br />
|
||||
<input type="button" onclick="ajax.post('index.php','poll',function(response) {$('#poll_container').raw().innerHTML = response});" value="Vote" />
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<? View::show_header('Login'); ?>
|
||||
<span id="no-cookies" class="hidden warning">You appear to have cookies disabled.<br /><br /></span>
|
||||
<noscript><span class="warning">You appear to have javascript disabled.</span><br /><br /></noscript>
|
||||
<noscript><span class="warning">You appear to have JavaScript disabled.</span><br /><br /></noscript>
|
||||
<?
|
||||
if (strtotime($BannedUntil) < time() && !$BanID) {
|
||||
?>
|
||||
@ -42,7 +42,7 @@
|
||||
} else {
|
||||
if ($BanID) {
|
||||
?>
|
||||
<span class="warning">Your IP is banned indefinitely.</span>
|
||||
<span class="warning">Your IP address is banned indefinitely.</span>
|
||||
<? } else { ?>
|
||||
<span class="warning">You are banned from logging in for another <?=time_diff($BannedUntil)?>.</span>
|
||||
<?
|
||||
|
@ -21,9 +21,11 @@
|
||||
<td colspan="2" align="right"><input type="submit" name="reset" value="Reset!" class="submit" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } else { ?>
|
||||
<?
|
||||
} else { ?>
|
||||
An email has been sent to you; please follow the directions in that email to reset your password.
|
||||
<? } ?>
|
||||
<?
|
||||
} ?>
|
||||
</div>
|
||||
</form>
|
||||
<?
|
||||
|
@ -48,7 +48,7 @@
|
||||
list($UserCount)=$DB->next_record();
|
||||
|
||||
if ($UserCount) {
|
||||
$Err = "There is already someone registered with that username.";
|
||||
$Err = 'There is already someone registered with that username.';
|
||||
$_REQUEST['username']='';
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,9 @@
|
||||
<? } else { ?>
|
||||
An email has been sent to the address that you provided. After you confirm your email address, you will be able to log into your account.
|
||||
|
||||
<? if($NewInstall) { echo "Since this is a new installation, you can log in directly without having to confirm your account."; }
|
||||
<? if ($NewInstall) {
|
||||
echo "Since this is a new installation, you can log in directly without having to confirm your account.";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -316,9 +316,8 @@
|
||||
<?
|
||||
$Images = explode(" ", $Images);
|
||||
foreach ($Images as $Image) {
|
||||
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Image);
|
||||
?>
|
||||
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=$Image?>" alt="Relevant image" />
|
||||
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=ImageTools::process($Image)?>" alt="Relevant image" />
|
||||
<?
|
||||
} ?>
|
||||
</td>
|
||||
|
@ -474,9 +474,8 @@
|
||||
<?
|
||||
$Images = explode(' ', $Images);
|
||||
foreach ($Images as $Image) {
|
||||
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Image);
|
||||
?>
|
||||
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=$Image?>" alt="Relevant image" />
|
||||
<img style="max-width: 200px;" onclick="lightbox.init(this,200);" src="<?=ImageTools::process($Image)?>" alt="Relevant image" />
|
||||
<?
|
||||
} ?>
|
||||
</td>
|
||||
|
@ -56,7 +56,9 @@
|
||||
}
|
||||
|
||||
$RequestID = $_POST['requestid'];
|
||||
if(!$RequestID) { error(404); }
|
||||
if (!$RequestID) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
$DB->query("SELECT CEIL((SELECT COUNT(ID)+1 FROM requests_comments AS rc WHERE rc.RequestID='".$RequestID."')/".TORRENT_COMMENTS_PER_PAGE.") AS Pages");
|
||||
list($Pages) = $DB->next_record();
|
||||
@ -85,7 +87,9 @@
|
||||
|
||||
case 'get_post':
|
||||
enforce_login();
|
||||
if (!$_GET['post'] || !is_number($_GET['post'])) { error(0); }
|
||||
if (!$_GET['post'] || !is_number($_GET['post'])) {
|
||||
error(0);
|
||||
}
|
||||
$DB->query("SELECT Body FROM requests_comments WHERE ID='".db_string($_GET['post'])."'");
|
||||
list($Body) = $DB->next_record(MYSQLI_NUM);
|
||||
|
||||
@ -100,7 +104,9 @@
|
||||
$Text = new TEXT;
|
||||
|
||||
// Quick SQL injection check
|
||||
if(!$_POST['post'] || !is_number($_POST['post'])) { error(0); }
|
||||
if (!$_POST['post'] || !is_number($_POST['post'])) {
|
||||
error(0);
|
||||
}
|
||||
|
||||
// Mainly
|
||||
$DB->query("SELECT
|
||||
@ -115,8 +121,12 @@
|
||||
$DB->query("SELECT ceil(COUNT(ID) / ".POSTS_PER_PAGE.") AS Page FROM requests_comments WHERE RequestID = $RequestID AND ID <= $_POST[post]");
|
||||
list($Page) = $DB->next_record();
|
||||
|
||||
if ($LoggedUser['ID']!=$AuthorID && !check_perms('site_moderate_forums')) { error(404); }
|
||||
if ($DB->record_count()==0) { error(404); }
|
||||
if ($LoggedUser['ID'] != $AuthorID && !check_perms('site_moderate_forums')) {
|
||||
error(404);
|
||||
}
|
||||
if ($DB->record_count() == 0) {
|
||||
error(404);
|
||||
}
|
||||
|
||||
// Perform the update
|
||||
$DB->query("UPDATE requests_comments SET
|
||||
@ -152,10 +162,14 @@
|
||||
authorize();
|
||||
|
||||
// Quick SQL injection check
|
||||
if (!$_GET['postid'] || !is_number($_GET['postid'])) { error(0); }
|
||||
if (!$_GET['postid'] || !is_number($_GET['postid'])) {
|
||||
error(0);
|
||||
}
|
||||
|
||||
// Make sure they are moderators
|
||||
if (!check_perms('site_moderate_forums')) { error(403); }
|
||||
if (!check_perms('site_moderate_forums')) {
|
||||
error(403);
|
||||
}
|
||||
|
||||
// Get topicid, forumid, number of pages
|
||||
$DB->query("SELECT DISTINCT
|
||||
|
@ -128,11 +128,9 @@
|
||||
<div class="head"><strong>Cover</strong></div>
|
||||
<?
|
||||
if (!empty($Image)) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$Image = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($Image);
|
||||
}
|
||||
$Image = ImageTools::process($Image, true);
|
||||
?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::thumbnail($Image)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=$Image?>',220);" /></p>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=$Image?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=$Image?>',220);" /></p>
|
||||
<? } else { ?>
|
||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID-1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
|
||||
<? } ?>
|
||||
|
@ -41,47 +41,47 @@
|
||||
<td>Required Ratio (100% seeded)</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] < 5 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>0-5 GB</td>
|
||||
<td>0–5 GB</td>
|
||||
<td>0.00</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 5 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 10 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>5-10 GB</td>
|
||||
<td>5–10 GB</td>
|
||||
<td>0.15</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 10 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 20 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>10-20 GB</td>
|
||||
<td>10–20 GB</td>
|
||||
<td>0.20</td>
|
||||
<td>0.00</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 20 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 30 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>20-30 GB</td>
|
||||
<td>20–30 GB</td>
|
||||
<td>0.30</td>
|
||||
<td>0.05</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 30 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 40 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>30-40 GB</td>
|
||||
<td>30–40 GB</td>
|
||||
<td>0.40</td>
|
||||
<td>0.10</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 40 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 50 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>40-50 GB</td>
|
||||
<td>40–50 GB</td>
|
||||
<td>0.50</td>
|
||||
<td>0.20</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 50 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 60 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>50-60 GB</td>
|
||||
<td>50–60 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.30</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 60 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 80 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>60-80 GB</td>
|
||||
<td>60–80 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.40</td>
|
||||
</tr>
|
||||
<tr class="row<?=($LoggedUser['BytesDownloaded'] >= 80 * 1024 * 1024 * 1024 && $LoggedUser['BytesDownloaded'] < 100 * 1024 * 1024 * 1024) ? 'a' : 'b' ?>">
|
||||
<td>80-100 GB</td>
|
||||
<td>80–100 GB</td>
|
||||
<td>0.60</td>
|
||||
<td>0.50</td>
|
||||
</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.
|
||||
</li>
|
||||
<li><strong>2: Determine the actual required ratio.</strong> Your actual required ratio will be a number that falls between the maximum and minimum required ratio values determined in the
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1-seeding/snatched]. Formatted
|
||||
previous step. To determine your actual required ratio, the system first uses the maximum required ratio (0% seeded) and multiplies it by the value [1 − (seeding / snatched)]. Formatted
|
||||
differently, the calculation performed by the system looks like this:
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div style="text-align:center"><img style="vertical-align: middle" src="static/blank.gif"
|
||||
<div style="text-align: center;"><img style="vertical-align: middle;" src="static/blank.gif"
|
||||
onload="if (this.src.substr(this.src.length-9,this.src.length) == 'blank.gif') { this.src = 'http://chart.apis.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chl=%5Ctextrm%7B%28maximum+required+ratio%29+%2A+%281-%5Cfrac%7Bseeding%7D%7Bsnatched%7D%29%7D&chco=' + hexify(getComputedStyle(this.parentNode,null).color); }" />
|
||||
</div>
|
||||
<br />
|
||||
@ -144,11 +144,11 @@
|
||||
<br />
|
||||
<strong>Required Ratio Example:</strong><br />
|
||||
<ul>
|
||||
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20-30 GB amount downloaded bracket in the table above. Rippy's maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
|
||||
<li>In this example, Rippy has downloaded 25 GB. Rippy falls into the 20–30 GB amount downloaded bracket in the table above. Rippy's maximum required ratio (0% seeded) is 0.30, and his minimum required ratio (100% seeded) is 0.05.
|
||||
</li>
|
||||
<li>In this example, Rippy has snatched 90 torrents, and is currently seeding 45 torrents.</li>
|
||||
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 - seeding/snatched] (which is 0.50). Written out:
|
||||
0.3 * [1 - (45/90)] = 0.15.
|
||||
<li>To calculate Rippy's actual required ratio, we take his maximum required ratio (0% seeded), which is 0.30, and multiply it by [1 − (seeding / snatched)] (which is 0.50). Written out:
|
||||
<samp>0.3 * [1 − (45 / 90)] = 0.15</samp>
|
||||
</li>
|
||||
<li>The resulting required ratio is 0.15, which falls between the maximum required ratio of 0.30 and the minimum required ratio of 0.05 for his amount downloaded bracket.</li>
|
||||
<li>If Rippy's on-site required ratio was listed as a value greater than the calculated value, this would be because he hadn't seeded those 45 torrents for a 72 hour period in the
|
||||
|
@ -18,7 +18,7 @@
|
||||
<li>This is a torrent site which promotes sharing amongst the community. If you are not willing to give back to the community what you take from it, this site is not for you. In other words, we expect you to have an acceptable share ratio. If you download a torrent, please, seed the copy you have until there are sufficient people seeding the torrent data before you stop.</li>
|
||||
<li>Do not browse the site using proxies or Tor. The site will automatically alert us. This includes VPNs with dynamic IP addresses.</li>
|
||||
<li>Asking for invites to any site is not allowed anywhere on What.CD or our IRC network. Invites may be offered in the Invites forum, and nowhere else.</li>
|
||||
<li>Trading and selling invites is strictly prohibited, as is offering them in public - this includes on any forum which is not a class-restricted section on an invitation-only torrent site.</li>
|
||||
<li>Trading and selling invites is strictly prohibited, as is offering them in public - this includes on any forum which is not a class-restricted section on an invitation-only torrent site. Responding to public requests for invites may also jeopardize your account and those whom you invite from a public request.</li>
|
||||
<li>Trading, selling, sharing, or giving away your account is prohibited. If you no longer want your account, send a staff PM requesting that it be disabled.</li>
|
||||
<li>You're completely responsible for the people you invite. If your invitees are caught cheating or trading/selling invites, not only will they be banned, so will you. Be careful who you invite. Invites are a precious commodity.</li>
|
||||
<li>Be careful when sharing an IP address or a computer with a friend if they have (or have had) an account. From then on your accounts will be inherently linked and if one of you violates the rules, both accounts will be disabled along with any other accounts linked by IP address. This rule applies to logging into the site.</li>
|
||||
|
@ -68,7 +68,7 @@
|
||||
<div class="head">
|
||||
<?=((empty($_GET['action'])) ? 'Create a staff blog post' : 'Edit staff blog post')?>
|
||||
<span style="float: right;">
|
||||
<a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='(Hide)'?'(Show)':'(Hide)'); return false;"><?=($_REQUEST['action']!='editblog')?'(Show)':'(Hide)'?></a>
|
||||
<a href="#" onclick="$('#postform').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="bracket"><?=($_REQUEST['action'] != 'editblog') ? 'Show' : 'Hide' ?></a>
|
||||
</span>
|
||||
</div>
|
||||
<form class="<?=((empty($_GET['action'])) ? 'create_form' : 'edit_form')?>" name="blog_post" action="staffblog.php" method="post">
|
||||
|
@ -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');
|
||||
|
||||
|
@ -506,7 +506,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -214,7 +214,7 @@
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -314,7 +314,7 @@
|
||||
<td class="nobr big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -1001,7 +1001,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td colspan="2" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID'] - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupInfo['CategoryID']) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -1122,7 +1122,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $CategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -119,12 +119,8 @@ function compare($X, $Y) {
|
||||
<div class="head"><strong>Cover</strong></div>
|
||||
<?
|
||||
if ($WikiImage != '') {
|
||||
$WikiImageThumb = ImageTools::wiki_image($WikiImage);
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$WikiImage = ImageTools::proxy_url($WikiImage);
|
||||
}
|
||||
?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=$WikiImageThumb?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=$WikiImage?>',220);" /></p>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=ImageTools::process($WikiImage)?>',220);" /></p>
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
|
@ -256,7 +256,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($GroupInfo['WikiImage'], $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -146,7 +146,9 @@
|
||||
$Validate->SetFields('other_bitrate',
|
||||
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||
$enc = trim($_POST['other_bitrate']);
|
||||
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
||||
if (isset($_POST['vbr'])) {
|
||||
$enc.=' (VBR)';
|
||||
}
|
||||
|
||||
$Properties['Encoding'] = $enc;
|
||||
$Properties['Bitrate'] = $enc;
|
||||
@ -183,7 +185,9 @@
|
||||
$Validate->SetFields('other_bitrate',
|
||||
'1','text','You must enter the other bitrate (max length: 9 characters).', array('maxlength'=>9));
|
||||
$enc = trim($_POST['other_bitrate']);
|
||||
if(isset($_POST['vbr'])) { $enc.=' (VBR)'; }
|
||||
if (isset($_POST['vbr'])) {
|
||||
$enc.=' (VBR)';
|
||||
}
|
||||
|
||||
$Properties['Encoding'] = $enc;
|
||||
$Properties['Bitrate'] = $enc;
|
||||
|
@ -492,7 +492,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -811,9 +811,9 @@
|
||||
foreach ($ArtistsUnescaped as $Importance => $Artists) {
|
||||
foreach ($Artists as $Artist) {
|
||||
if ($Importance == 1 || $Importance == 4 || $Importance == 5 || $Importance == 6) {
|
||||
$ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']))."|%'";
|
||||
$ArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']), true)."|%'";
|
||||
} else {
|
||||
$GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']))."|%'";
|
||||
$GuestArtistNameList[] = "Artists LIKE '%|".db_string(str_replace('\\','\\\\',$Artist['name']), true)."|%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,8 +166,10 @@ function user_dupes_table($UserID) {
|
||||
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" id="form_comment_hash" name="form_comment_hash" value="<?=$CommentHash?>" />
|
||||
<div class="box">
|
||||
<div class="head"><?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="l_a_box">
|
||||
<div class="head">
|
||||
<a href="#l_a_box"><strong>↑</strong></a> <?=max($DupeCount - 1, 0)?> Linked account<?=(($DupeCount == 2)?'':'s')?> <a href="#" onclick="$('.linkedaccounts').toggle(); return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<table width="100%" class="layout hidden linkedaccounts">
|
||||
<?=$DupeCount?'<tr>':''?>
|
||||
<?
|
||||
|
@ -33,7 +33,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="<? echo STATIC_SERVER; ?>styles/global.css?v=<?=filemtime(STATIC_SERVER.'styles/global.css')?>" rel="stylesheet" type="text/css" />
|
||||
<link href="<? echo STATIC_SERVER; ?>styles/<?= $Name ?>/style.css?v=<?=filemtime(STATIC_SERVER.'styles/'.$Name.'/style.css')?>" title="<?= $Name ?>" rel="stylesheet" type="text/css" media="screen" />
|
||||
<? if (isset($_GET['save']) && $_GET['save']==="true" && check_perms('admin_clear_cache')) { ?>
|
||||
<? if (isset($_GET['save']) && $_GET['save'] === 'true' && check_perms('admin_clear_cache')) { ?>
|
||||
<script src="<? echo STATIC_SERVER; ?>functions/jquery.js?v=<?=filemtime(STATIC_SERVER.'functions/jquery.js')?>"></script>
|
||||
<script src="<? echo STATIC_SERVER; ?>functions/stylesheetgallery.js?v=<?=filemtime(STATIC_SERVER.'functions/stylesheetgallery.js')?>"></script>
|
||||
<? } ?>
|
||||
@ -142,7 +142,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="thin">
|
||||
@ -181,7 +180,7 @@
|
||||
<td title="Read" class="read"></td>
|
||||
<td>
|
||||
<h4 class="min_padding">
|
||||
<a href="#">What.CD</a>
|
||||
<a href="#"><?=SITE_NAME?></a>
|
||||
</h4>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -120,7 +120,7 @@
|
||||
$DisplayCustomTitle = $CustomTitle;
|
||||
if (check_perms('site_proxy_images') && !empty($CustomTitle)) {
|
||||
$DisplayCustomTitle = preg_replace_callback('~src=("?)(http.+?)(["\s>])~', function($Matches) {
|
||||
return 'src='.$Matches[1].'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Matches[2]).$Matches[3];
|
||||
return 'src=' . $Matches[1] . ImageTools::process($Matches[2]) . $Matches[3];
|
||||
}, $CustomTitle);
|
||||
}
|
||||
|
||||
@ -535,16 +535,14 @@ function check_paranoia_here($Setting) {
|
||||
?>
|
||||
<table class="layout recent" id="recent_snatches" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">Recent snatches</td>
|
||||
<td colspan="5">
|
||||
<a href="#recent_snatches"><strong>↑</strong></a> Recent snatches
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?
|
||||
foreach ($RecentSnatches as $RS) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$RS['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RS['WikiImage']);
|
||||
} ?>
|
||||
<? foreach ($RecentSnatches as $RS) { ?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$RS['ID']?>" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>"><img src="<?=ImageTools::thumbnail($RS['WikiImage'])?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$RS['ID']?>" title="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>"><img src="<?=ImageTools::process($RS['WikiImage'], true)?>" alt="<?=display_str($RS['Artist'])?><?=display_str($RS['Name'])?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -580,15 +578,14 @@ function check_paranoia_here($Setting) {
|
||||
?>
|
||||
<table class="layout recent" id="recent_uploads" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">Recent uploads</td>
|
||||
<td colspan="5">
|
||||
<a href="#recent_uploads"><strong>↑</strong></a> Recent uploads
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? foreach ($RecentUploads as $RU) {
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$RU['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($RU['WikiImage']);
|
||||
} ?>
|
||||
<? foreach ($RecentUploads as $RU) { ?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$RU['ID']?>" title="<?=$RU['Artist']?><?=$RU['Name']?>"><img src="<?=ImageTools::thumbnail($RU['WikiImage'])?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$RU['ID']?>" title="<?=$RU['Artist']?><?=$RU['Name']?>"><img src="<?=ImageTools::process($RU['WikiImage'], true)?>" alt="<?=$RU['Artist']?><?=$RU['Name']?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -610,14 +607,14 @@ function check_paranoia_here($Setting) {
|
||||
ORDER BY ct.Sort LIMIT 5");
|
||||
$Collage = $DB->to_array();
|
||||
?>
|
||||
<table class="layout recent" id="collage<?=$CollageID?>" cellpadding="0" cellspacing="0" border="0">
|
||||
<table class="layout recent" id="collage<?=$CollageID?>_box" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr class="colhead">
|
||||
<td colspan="5">
|
||||
<span style="float:left;">
|
||||
<?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
|
||||
<a href="#collage<?=$CollageID?>_box"><strong>↑</strong></a> <?=display_str($CName)?> - <a href="collages.php?id=<?=$CollageID?>" class="brackets">See full</a>
|
||||
</span>
|
||||
<span style="float:right;">
|
||||
<a href="#" onclick="$('#collage<?=$CollageID?> .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol?'Hide':'Show'?></a>
|
||||
<a href="#" onclick="$('#collage<?=$CollageID?>_box .images').toggle(); this.innerHTML=(this.innerHTML=='Hide'?'Show':'Hide'); return false;" class="brackets"><?=$FirstCol?'Hide':'Show'?></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@ -630,13 +627,9 @@ function check_paranoia_here($Setting) {
|
||||
$Name = '';
|
||||
$Name .= Artists::display_artists(array('1'=>$Artists), false, true);
|
||||
$Name .= $GroupName;
|
||||
|
||||
if (check_perms('site_proxy_images')) {
|
||||
$C['WikiImage'] = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?i='.urlencode($C['WikiImage']);
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<a href="torrents.php?id=<?=$GroupID?>" title="<?=$Name?>"><img src="<?=ImageTools::thumbnail($C['WikiImage'])?>" alt="<?=$Name?>" width="107" /></a>
|
||||
<a href="torrents.php?id=<?=$GroupID?>" title="<?=$Name?>"><img src="<?=ImageTools::process($C['WikiImage'], true)?>" alt="<?=$Name?>" width="107" /></a>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
@ -658,8 +651,10 @@ function check_paranoia_here($Setting) {
|
||||
include(SERVER_ROOT.'/classes/class_invite_tree.php');
|
||||
$Tree = new INVITE_TREE($UserID, array('visible'=>false));
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="invitetree_box">
|
||||
<div class="head">
|
||||
<a href="#invitetree_box"><strong>↑</strong></a> Invite tree <a href="#" onclick="$('#invitetree').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<div id="invitetree" class="hidden">
|
||||
<? $Tree->make_tree(); ?>
|
||||
</div>
|
||||
@ -688,8 +683,10 @@ function check_paranoia_here($Setting) {
|
||||
if ($DB->record_count() > 0) {
|
||||
$Requests = $DB->to_array();
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="requests_box">
|
||||
<div class="head">
|
||||
<a href="#requests_box"><strong>↑</strong></a> Requests <a href="#" onclick="$('#requests').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<div id="requests" class="request_table hidden">
|
||||
<table cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead_dark">
|
||||
@ -787,8 +784,10 @@ function check_paranoia_here($Setting) {
|
||||
if ($DB->record_count()) {
|
||||
$StaffPMs = $DB->to_array();
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head">Staff PMs <a href="#" onclick="$('#staffpms').toggle();return false;" class="brackets">View</a></div>
|
||||
<div class="box" id="staffpms_box">
|
||||
<div class="head">
|
||||
<a href="#staffpms_box"><strong>↑</strong></a> Staff PMs <a href="#" onclick="$('#staffpms').toggle();return false;" class="brackets">View</a>
|
||||
</div>
|
||||
<table width="100%" class="message_table hidden" id="staffpms">
|
||||
<tr class="colhead">
|
||||
<td>Subject</td>
|
||||
@ -856,8 +855,9 @@ function check_paranoia_here($Setting) {
|
||||
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
|
||||
<div class="box">
|
||||
<div class="head">Staff notes
|
||||
<div class="box" id="staff_notes_box">
|
||||
<div class="head">
|
||||
<a href="#staff_notes_box"><strong>↑</strong></a> Staff notes
|
||||
<a href="#" name="admincommentbutton" onclick="ChangeTo('text'); return false;" class="brackets">Edit</a>
|
||||
<a href="#" onclick="$('#staffnotes').toggle(); return false;" class="brackets">Toggle</a>
|
||||
</div>
|
||||
@ -872,9 +872,11 @@ function check_paranoia_here($Setting) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="layout">
|
||||
<table class="layout" id="user_info_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">User information</td>
|
||||
<td colspan="2">
|
||||
<a href="#user_info_box"><strong>↑</strong></a> User information
|
||||
</td>
|
||||
</tr>
|
||||
<? if (check_perms('users_edit_usernames', $Class)) { ?>
|
||||
<tr>
|
||||
@ -1055,9 +1057,11 @@ function check_paranoia_here($Setting) {
|
||||
</table><br />
|
||||
|
||||
<? if (check_perms('users_warn')) { ?>
|
||||
<table class="layout">
|
||||
<table class="layout" id="warn_user_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">Warn user</td>
|
||||
<td colspan="2">
|
||||
<a href="#warn_user_box"><strong>↑</strong></a> Warn user
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Warned:</td>
|
||||
@ -1112,8 +1116,12 @@ function check_paranoia_here($Setting) {
|
||||
</tr>
|
||||
<? } ?>
|
||||
</table><br />
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">User privileges</td></tr>
|
||||
<table class="layout" id="user_privs_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#user_privs_box"><strong>↑</strong></a> User privileges
|
||||
</td>
|
||||
</tr>
|
||||
<? if (check_perms('users_disable_posts') || check_perms('users_disable_any')) {
|
||||
$DB->query("SELECT DISTINCT Email, IP FROM users_history_emails WHERE UserID = ".$UserID." ORDER BY Time ASC");
|
||||
$Emails = $DB->to_array();
|
||||
@ -1165,8 +1173,9 @@ function check_paranoia_here($Setting) {
|
||||
<option value="1"<? if ($Enabled=='1') { ?> selected="selected"<? } ?>>Enabled</option>
|
||||
<option value="2"<? if ($Enabled=='2') { ?> selected="selected"<? } ?>>Disabled</option>
|
||||
<? if (check_perms('users_delete_users')) { ?>
|
||||
<optgroup label="-- WARNING --"></optgroup>
|
||||
<optgroup label="-- WARNING --">
|
||||
<option value="delete">Delete account</option>
|
||||
</optgroup>
|
||||
<? } ?>
|
||||
</select>
|
||||
</td>
|
||||
@ -1193,8 +1202,12 @@ function check_paranoia_here($Setting) {
|
||||
<? } ?>
|
||||
</table><br />
|
||||
<? if (check_perms('users_logout')) { ?>
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">Session</td></tr>
|
||||
<table class="layout" id="session_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#session_box"><strong>↑</strong></a> Session
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Reset session:</td>
|
||||
<td><input type="checkbox" name="ResetSession" id="ResetSession" /></td>
|
||||
@ -1206,8 +1219,12 @@ function check_paranoia_here($Setting) {
|
||||
|
||||
</table>
|
||||
<? } ?>
|
||||
<table class="layout">
|
||||
<tr class="colhead"><td colspan="2">Submit</td></tr>
|
||||
<table class="layout" id="submit_box">
|
||||
<tr class="colhead">
|
||||
<td colspan="2">
|
||||
<a href="#submit_box"><strong>↑</strong></a> Submit
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><span title="This message will be entered into staff notes only.">Reason:</span></td>
|
||||
<td>
|
||||
|
@ -46,10 +46,6 @@
|
||||
extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
|
||||
}
|
||||
|
||||
if (check_perms('site_proxy_images') && !empty($Avatar)) {
|
||||
$Avatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($Avatar);
|
||||
}
|
||||
|
||||
View::show_header('Post history for '.$Username,'subscriptions,comments,bbcode');
|
||||
|
||||
if ($LoggedUser['CustomForums']) {
|
||||
@ -305,7 +301,7 @@
|
||||
<?
|
||||
if ($Avatar) {
|
||||
?>
|
||||
<img src="<?=$Avatar?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<img src="<?=ImageTools::process($Avatar)?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
@ -138,7 +138,7 @@
|
||||
<td colspan="5" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
@ -217,7 +217,7 @@
|
||||
<td class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID - 1) ?>
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
|
@ -168,13 +168,10 @@
|
||||
<tr class="row<?=$ShowCollapsed ? ' hidden' : '' ?>">
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (check_perms('site_proxy_images') && preg_match('/^https?:\/\/(localhost(:[0-9]{2,5})?|[0-9]{1,3}(\.[0-9]{1,3}){3}|([a-zA-Z0-9\-\_]+\.)+([a-zA-Z]{1,5}[^\.]))(:[0-9]{2,5})?(\/[^<>]+)+\.(jpg|jpeg|gif|png|tif|tiff|bmp)$/is',$AuthorAvatar)) {
|
||||
$AuthorAvatar = 'http'.($SSL?'s':'').'://'.SITE_URL.'/image.php?c=1&i='.urlencode($AuthorAvatar); ?>
|
||||
<img src="<?=$AuthorAvatar?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<? } elseif (!$AuthorAvatar) { ?>
|
||||
<img src="<?=STATIC_SERVER.'common/avatars/default.png'?>" width="150" style="max-height: 400px;" alt="Default avatar" />
|
||||
<? if ($AuthorAvatar) { ?>
|
||||
<img src="<?=ImageTools::process($AuthorAvatar)?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<img src="<?=$AuthorAvatar?>" width="150" style="max-height: 400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<img src="<?=STATIC_SERVER.'common/avatars/default.png'?>" width="150" style="max-height: 400px;" alt="Default avatar" />
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
|
@ -104,7 +104,7 @@
|
||||
$i = 0;
|
||||
foreach ($AliasArray as $AliasItem) {
|
||||
?>
|
||||
<li id="alias_<?=$AliasItem?>"><a href="wiki.php?action=article&name=<?=$AliasItem?>"><?=Format::cut_string($AliasItem,20,1)?></a><? if (check_perms('admin_manage_wiki')) { ?> <a href="#" onclick="Remove_Alias('<?=$AliasItem?>');return false;" class="brackets" title="Delete Alias">X</a> <a href="user.php?id=<?=$UserArray[$i]?>" class="brackets" title="View User">U</a><? } ?></li>
|
||||
<li id="alias_<?=$AliasItem?>"><a href="wiki.php?action=article&name=<?=$AliasItem?>"><?=Format::cut_string($AliasItem,20,1)?></a><? if (check_perms('admin_manage_wiki')) { ?> <a href="#" onclick="Remove_Alias('<?=$AliasItem?>');return false;" class="brackets" title="Delete alias">X</a> <a href="user.php?id=<?=$UserArray[$i]?>" class="brackets" title="View user">U</a><? } ?></li>
|
||||
<? $i++;
|
||||
}
|
||||
}
|
||||
|
@ -89,9 +89,15 @@ function get_headers(response) {
|
||||
|
||||
// Load content
|
||||
function load(url,forward,formid) {
|
||||
if(forward===undefined) { forward=true; }
|
||||
if (transitions_in_progress && document.createTouch) { return; } //OS 2
|
||||
if (moved_after_touch) { return; }
|
||||
if (forward === undefined) {
|
||||
forward = true;
|
||||
}
|
||||
if (transitions_in_progress && document.createTouch) { // OS 2
|
||||
return;
|
||||
}
|
||||
if (moved_after_touch) {
|
||||
return;
|
||||
}
|
||||
if (formid === undefined){
|
||||
ajax.get(url, function (response) {
|
||||
get_headers(response);
|
||||
@ -105,12 +111,18 @@ function load(url,forward,formid) {
|
||||
|
||||
// Moves
|
||||
var moved_after_touch = false;
|
||||
function touch_started () { moved_after_touch = false; };
|
||||
function touch_moved () { moved_after_touch = true; };
|
||||
function touch_started () {
|
||||
moved_after_touch = false;
|
||||
};
|
||||
function touch_moved () {
|
||||
moved_after_touch = true;
|
||||
};
|
||||
|
||||
// Transitions
|
||||
var transitions_in_progress = false;
|
||||
function transition_ended () { transitions_in_progress = false; };
|
||||
function transition_ended () {
|
||||
transitions_in_progress = false;
|
||||
};
|
||||
function transition_to_new_element (data, going_forward) {
|
||||
transitions_in_progress = true;
|
||||
|
||||
|
@ -158,13 +158,13 @@ function AddFormat() {
|
||||
tmp = '<select id="releasetype" name="extra_formats[]"><option value="">---</option>';
|
||||
var formats=["Saab","Volvo","BMW"];
|
||||
for (var i in formats) {
|
||||
tmp += "<option value='"+formats[i]+"'>"+formats[i]+"</option>\n";
|
||||
tmp += '<option value="'+formats[i]+'">'+formats[i]+"</option>\n";
|
||||
}
|
||||
tmp += "</select>";
|
||||
var bitrates=["1","2","3"];
|
||||
tmp += '<select id="releasetype" name="extra_bitrates[]"><option value="">---</option>';
|
||||
for (var i in bitrates) {
|
||||
tmp += "<option value='"+bitrates[i]+"'>"+bitrates[i]+"</option>\n";
|
||||
tmp += '<option value="'+bitrates[i]+'">'+bitrates[i]+"</option>\n";
|
||||
}
|
||||
tmp += "</select>";
|
||||
|
||||
|
@ -12,7 +12,9 @@ function validEmail(str) {
|
||||
function validLink(str) {
|
||||
if (str.match(/^(https?):\/\/([a-z0-9\-\_]+\.)+([a-z]{1,5}[^\.])(\/[^<>]+)*$/i)) {
|
||||
return true;
|
||||
} else { return false; }
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isNumeric(str,usePeriod) {
|
||||
@ -22,7 +24,9 @@ function isNumeric(str,usePeriod) {
|
||||
}
|
||||
matchStr = ']/';
|
||||
|
||||
if (str.match(matchStr)) { return false; }
|
||||
if (str.match(matchStr)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -37,7 +41,12 @@ function validDate(theDate) {
|
||||
if (!isNumeric(month) || !isNumeric(day) || !isNumeric(year)) { return false; }
|
||||
|
||||
if (month == 1) { days = 31; }
|
||||
else if (month==2) { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { days=29; } else { days=28; }}
|
||||
else if (month == 2) {
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
|
||||
days = 29;
|
||||
} else {
|
||||
days = 28;
|
||||
}}
|
||||
else if (month == 3) { days = 31; }
|
||||
else if (month == 4) { days = 30; }
|
||||
else if (month == 5) { days = 31; }
|
||||
@ -49,19 +58,30 @@ function validDate(theDate) {
|
||||
else if (month == 11) { days = 30; }
|
||||
else if (month == 12) { days = 31; }
|
||||
|
||||
if (day>days || day==undefined || days==undefined || month==undefined || year==undefined || year.length<4) { return false; } else { return true; }
|
||||
if (day > days || day == undefined || days == undefined || month == undefined || year == undefined || year.length < 4) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function showError(fields,alertStr) {
|
||||
var tField=Array();
|
||||
|
||||
if (typeof(fields)=='object') { tField[0]=fields; } else { tField=fields.split(','); }
|
||||
if (typeof(fields) == 'object') {
|
||||
tField[0] = fields;
|
||||
} else {
|
||||
tField = fields.split(',');
|
||||
}
|
||||
for (s = 0; s <= tField.length - 1; s++) {
|
||||
if ($('#'+tField[s])) {
|
||||
$('#'+tField[s]).className=$('#'+tField[s]).className+" elem_error";
|
||||
if (s == 0) {
|
||||
$('#'+tField[s]).focus();
|
||||
try { $('#'+tField[s]).select(); } catch (error) { }
|
||||
try {
|
||||
$('#'+tField[s]).select();
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
|
||||
errorElems[errorElems.length] = tField[s];
|
||||
@ -73,7 +93,9 @@ function showError(fields,alertStr) {
|
||||
}
|
||||
}
|
||||
|
||||
if (alertStr!="") { alert(alertStr); }
|
||||
if (alertStr != "") {
|
||||
alert(alertStr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -25,5 +25,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
Loading…
Reference in New Issue
Block a user