mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
2ab1207afa
commit
c1294d48b1
@ -1,74 +1,74 @@
|
||||
<?php
|
||||
|
||||
//require_once 'class_mass_user_torrents_editor.php';
|
||||
|
||||
/**
|
||||
* This class helps with mass-editing bookmarked torrents.
|
||||
*
|
||||
* It can later be used for other bookmark tables.
|
||||
*
|
||||
*/
|
||||
class MASS_USER_BOOKMARKS_EDITOR extends MASS_USER_TORRENTS_EDITOR
|
||||
{
|
||||
public function __construct ($Table = 'bookmarks_torrents')
|
||||
{
|
||||
parent::__construct();
|
||||
$this->set_table($Table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a SQL query and clears the bookmarks_torrent_{$UserID}_full Cache key
|
||||
*
|
||||
* $Cache->delete_value didn't always work, but setting the key to null, did. (?)
|
||||
*
|
||||
* @param string $sql
|
||||
*/
|
||||
protected function query_and_clear_cache ($sql)
|
||||
{
|
||||
if (is_string($sql) && $this->DB->query($sql)) {
|
||||
$this->Cache->cache_value('bookmarks_torrent_' . $this->UserID, null, 0);
|
||||
$this->Cache->cache_value('bookmarks_torrent_' . $this->UserID . '_full', null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses (checkboxes) $_POST['remove'] to delete entries.
|
||||
*
|
||||
* Uses an IN() to match multiple items in one query.
|
||||
*/
|
||||
public function mass_remove () {
|
||||
$SQL = array();
|
||||
foreach ($_POST['remove'] as $GroupID => $K) {
|
||||
if (is_number($GroupID))
|
||||
$SQL[] = sprintf('%d', $GroupID);
|
||||
}
|
||||
|
||||
if (!empty($SQL)) {
|
||||
$SQL = sprintf('DELETE FROM %s WHERE UserID = %d AND GroupID IN (%s)',
|
||||
$this->Table,
|
||||
$this->UserID,
|
||||
implode(', ', $SQL)
|
||||
);
|
||||
$this->query_and_clear_cache($SQL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses $_POST['sort'] values to update the DB.
|
||||
*/
|
||||
public function mass_update () {
|
||||
$SQL = array();
|
||||
foreach ($_POST['sort'] as $GroupID => $Sort) {
|
||||
if (is_number($Sort) && is_number($GroupID))
|
||||
$SQL[] = sprintf('(%d, %d, %d)', $GroupID, $Sort, $this->UserID);
|
||||
}
|
||||
|
||||
if (!empty($SQL)) {
|
||||
$SQL = sprintf('INSERT INTO %s (GroupID, Sort, UserID) VALUES %s
|
||||
ON DUPLICATE KEY UPDATE Sort = VALUES (Sort)',
|
||||
$this->Table,
|
||||
implode(', ', $SQL));
|
||||
$this->query_and_clear_cache($SQL);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
//require_once 'class_mass_user_torrents_editor.php';
|
||||
|
||||
/**
|
||||
* This class helps with mass-editing bookmarked torrents.
|
||||
*
|
||||
* It can later be used for other bookmark tables.
|
||||
*
|
||||
*/
|
||||
class MASS_USER_BOOKMARKS_EDITOR extends MASS_USER_TORRENTS_EDITOR
|
||||
{
|
||||
public function __construct ($Table = 'bookmarks_torrents')
|
||||
{
|
||||
parent::__construct();
|
||||
$this->set_table($Table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a SQL query and clears the bookmarks_torrent_{$UserID}_full Cache key
|
||||
*
|
||||
* $Cache->delete_value didn't always work, but setting the key to null, did. (?)
|
||||
*
|
||||
* @param string $sql
|
||||
*/
|
||||
protected function query_and_clear_cache ($sql)
|
||||
{
|
||||
if (is_string($sql) && $this->DB->query($sql)) {
|
||||
$this->Cache->cache_value('bookmarks_torrent_' . $this->UserID, null, 0);
|
||||
$this->Cache->cache_value('bookmarks_torrent_' . $this->UserID . '_full', null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses (checkboxes) $_POST['remove'] to delete entries.
|
||||
*
|
||||
* Uses an IN() to match multiple items in one query.
|
||||
*/
|
||||
public function mass_remove () {
|
||||
$SQL = array();
|
||||
foreach ($_POST['remove'] as $GroupID => $K) {
|
||||
if (is_number($GroupID))
|
||||
$SQL[] = sprintf('%d', $GroupID);
|
||||
}
|
||||
|
||||
if (!empty($SQL)) {
|
||||
$SQL = sprintf('DELETE FROM %s WHERE UserID = %d AND GroupID IN (%s)',
|
||||
$this->Table,
|
||||
$this->UserID,
|
||||
implode(', ', $SQL)
|
||||
);
|
||||
$this->query_and_clear_cache($SQL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses $_POST['sort'] values to update the DB.
|
||||
*/
|
||||
public function mass_update () {
|
||||
$SQL = array();
|
||||
foreach ($_POST['sort'] as $GroupID => $Sort) {
|
||||
if (is_number($Sort) && is_number($GroupID))
|
||||
$SQL[] = sprintf('(%d, %d, %d)', $GroupID, $Sort, $this->UserID);
|
||||
}
|
||||
|
||||
if (!empty($SQL)) {
|
||||
$SQL = sprintf('INSERT INTO %s (GroupID, Sort, UserID) VALUES %s
|
||||
ON DUPLICATE KEY UPDATE Sort = VALUES (Sort)',
|
||||
$this->Table,
|
||||
implode(', ', $SQL));
|
||||
$this->query_and_clear_cache($SQL);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,99 +1,99 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Abstract class
|
||||
* Mass User-Torrents Editor
|
||||
*
|
||||
* A class that deals with mass editing a user's torrents.
|
||||
*
|
||||
* This abstract class is used by sub-classes as a way to access the Cache/DB.
|
||||
*
|
||||
* It is intended to streamline the process of processing data sent by the
|
||||
* MASS_USER_TORRENT_TABLE_VIEW class.
|
||||
*
|
||||
* It could also be used for other types like collages.
|
||||
*/
|
||||
abstract class MASS_USER_TORRENTS_EDITOR
|
||||
{
|
||||
/**
|
||||
* Internal access to the Cache
|
||||
* @var Cache $Cache
|
||||
*/
|
||||
protected $Cache;
|
||||
|
||||
/**
|
||||
* Internal access to the Database
|
||||
* @var DB_MYSQL $DB
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Current User's ID
|
||||
* @var str|int $UserID
|
||||
*/
|
||||
protected $UserID;
|
||||
|
||||
/**
|
||||
* The affected DB table
|
||||
* @var string $Table
|
||||
*/
|
||||
protected $Table;
|
||||
|
||||
/**
|
||||
* Extended classes should call this method.
|
||||
* @example parent::__construct()
|
||||
* @global CACHE $Cache
|
||||
* @global DB_MYSQL $DB
|
||||
* @global string|int $UserID
|
||||
*/
|
||||
public function __construct (/*CACHE &$Cache, DB_MYSQL &$DB, $UserID*/)
|
||||
{
|
||||
global $Cache, $DB, $UserID;
|
||||
$this->Cache = $Cache;
|
||||
$this->DB = $DB;
|
||||
$this->UserID = (int) $UserID;
|
||||
if ($this->UserID < 1) error(403);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Table
|
||||
* @param string $Table
|
||||
*/
|
||||
final public function set_table ($Table)
|
||||
{
|
||||
$this->Table = db_string($Table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Table
|
||||
* @param sting $Table
|
||||
* @return string $Table
|
||||
*/
|
||||
final public function get_table ()
|
||||
{
|
||||
return $this->Table;
|
||||
}
|
||||
|
||||
/**
|
||||
* The extending class must provide a method to send a query and clear the cache
|
||||
*/
|
||||
abstract protected function query_and_clear_cache ($sql);
|
||||
|
||||
/**
|
||||
* A method to insert many rows into a single table
|
||||
* Not required in subsequent classes
|
||||
*/
|
||||
public function mass_add () {}
|
||||
|
||||
/**
|
||||
* A method to remove many rows from a table
|
||||
* The extending class must have a mass_remove method
|
||||
*/
|
||||
abstract public function mass_remove ();
|
||||
|
||||
/**
|
||||
* A method to update many rows in a table
|
||||
* The extending class must have a mass_update method
|
||||
*/
|
||||
abstract public function mass_update ();
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Abstract class
|
||||
* Mass User-Torrents Editor
|
||||
*
|
||||
* A class that deals with mass editing a user's torrents.
|
||||
*
|
||||
* This abstract class is used by sub-classes as a way to access the Cache/DB.
|
||||
*
|
||||
* It is intended to streamline the process of processing data sent by the
|
||||
* MASS_USER_TORRENT_TABLE_VIEW class.
|
||||
*
|
||||
* It could also be used for other types like collages.
|
||||
*/
|
||||
abstract class MASS_USER_TORRENTS_EDITOR
|
||||
{
|
||||
/**
|
||||
* Internal access to the Cache
|
||||
* @var Cache $Cache
|
||||
*/
|
||||
protected $Cache;
|
||||
|
||||
/**
|
||||
* Internal access to the Database
|
||||
* @var DB_MYSQL $DB
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
* Current User's ID
|
||||
* @var str|int $UserID
|
||||
*/
|
||||
protected $UserID;
|
||||
|
||||
/**
|
||||
* The affected DB table
|
||||
* @var string $Table
|
||||
*/
|
||||
protected $Table;
|
||||
|
||||
/**
|
||||
* Extended classes should call this method.
|
||||
* @example parent::__construct()
|
||||
* @global CACHE $Cache
|
||||
* @global DB_MYSQL $DB
|
||||
* @global string|int $UserID
|
||||
*/
|
||||
public function __construct (/*CACHE &$Cache, DB_MYSQL &$DB, $UserID*/)
|
||||
{
|
||||
global $Cache, $DB, $UserID;
|
||||
$this->Cache = $Cache;
|
||||
$this->DB = $DB;
|
||||
$this->UserID = (int) $UserID;
|
||||
if ($this->UserID < 1) error(403);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Table
|
||||
* @param string $Table
|
||||
*/
|
||||
final public function set_table ($Table)
|
||||
{
|
||||
$this->Table = db_string($Table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Table
|
||||
* @param sting $Table
|
||||
* @return string $Table
|
||||
*/
|
||||
final public function get_table ()
|
||||
{
|
||||
return $this->Table;
|
||||
}
|
||||
|
||||
/**
|
||||
* The extending class must provide a method to send a query and clear the cache
|
||||
*/
|
||||
abstract protected function query_and_clear_cache ($sql);
|
||||
|
||||
/**
|
||||
* A method to insert many rows into a single table
|
||||
* Not required in subsequent classes
|
||||
*/
|
||||
public function mass_add () {}
|
||||
|
||||
/**
|
||||
* A method to remove many rows from a table
|
||||
* The extending class must have a mass_remove method
|
||||
*/
|
||||
abstract public function mass_remove ();
|
||||
|
||||
/**
|
||||
* A method to update many rows in a table
|
||||
* The extending class must have a mass_update method
|
||||
*/
|
||||
abstract public function mass_update ();
|
||||
}
|
@ -1,199 +1,199 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
/**
|
||||
* @static
|
||||
* @var int $Textareas Total number of textareas created
|
||||
*/
|
||||
static protected $Textareas = 0;
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @var array $_ID Array of textarea IDs
|
||||
*/
|
||||
static protected $_ID = array();
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @var bool For use in JavaScript method
|
||||
*/
|
||||
static private $Exectuted = false;
|
||||
|
||||
/**
|
||||
* This method should only run once with $all as true and should be placed
|
||||
* in the header or footer.
|
||||
*
|
||||
* If $all is true, it includes TextareaPreview and jQuery with noConflict()
|
||||
* for use with Sizzle.
|
||||
*
|
||||
* jQuery is required for this to work, include it in the headers.
|
||||
*
|
||||
* @static
|
||||
* @param bool $all Output all required scripts, otherwise just do iterator()
|
||||
* @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)
|
||||
View::parse('generic/textarea/script.phtml');
|
||||
|
||||
self::$Exectuted = true;
|
||||
self::iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* This iterator generates JavaScript to initialize each JavaScript
|
||||
* TextareaPreview object.
|
||||
*
|
||||
* It will generate a numeric or custom ID related to the textarea.
|
||||
* @static
|
||||
* @return void
|
||||
*/
|
||||
static private function iterator ()
|
||||
{
|
||||
$script = array();
|
||||
for($i = 0; $i < self::$Textareas; $i++) {
|
||||
if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
|
||||
$a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
|
||||
} else {
|
||||
$a = $i;
|
||||
}
|
||||
$script[] = sprintf('[%s]', $a);
|
||||
}
|
||||
if (!empty($script))
|
||||
View::parse('generic/textarea/script_factory.phtml',
|
||||
array('script' => join(', ', $script)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Textarea Preview Class
|
||||
*
|
||||
* This class generates a textarea that works with the JS preview script.
|
||||
*
|
||||
* Templates found in design/views/generic/textarea
|
||||
*
|
||||
* @example <pre><?php
|
||||
* // Create a textarea with a name of content.
|
||||
* // Buttons and preview divs are generated automatically near the textarea.
|
||||
* new TEXTAREA_PREVIEW('content');
|
||||
*
|
||||
* // Create a textarea with name and id body_text with default text and
|
||||
* // no buttons or wrap preview divs.
|
||||
* // Buttons and preview divs are generated manually
|
||||
* $text = new TEXTAREA_PREVIEW('body_text', 'body_text', 'default text',
|
||||
* 50, 20, false, false, array('disabled="disabled"', 'class="text"'));
|
||||
*
|
||||
* $text->buttons(); // output buttons
|
||||
*
|
||||
* $text->preview(); // output preview div
|
||||
*
|
||||
* // Create a textarea with custom preview wrapper around a table
|
||||
* // the table will be (in)visible depending on the toggle
|
||||
* $text = new TEXTAREA_PREVIEW('body', '', '', 30, 10, false, false);
|
||||
* $id = $text->getID();
|
||||
*
|
||||
* // some template
|
||||
* <div id="preview_wrap_<?=$id?>">
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td>
|
||||
* <div id="preview_<?=$id?>"></div>
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </div>
|
||||
* </pre>
|
||||
*/
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
/**
|
||||
* @var int Unique ID
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* Flag for preview output
|
||||
* @var bool $preview
|
||||
*/
|
||||
private $preview = false;
|
||||
|
||||
/**
|
||||
* This method creates a textarea
|
||||
*
|
||||
* @param string $Name name attribute
|
||||
* @param string $ID id attribute
|
||||
* @param string $Value default text attribute
|
||||
* @param string $Cols cols attribute
|
||||
* @param string $Rows rows attribute
|
||||
* @param bool $Preview add the preview divs near the textarea
|
||||
* @param bool $Buttons add the edit/preview buttons near the textarea
|
||||
*
|
||||
* If false for either, use the appropriate methods to add the those
|
||||
* elements elsewhere. Alternatively, use getID to create your own.
|
||||
*
|
||||
* @param array $ExtraAttributes array of attribute="value"
|
||||
*/
|
||||
public function __construct ($Name, $ID = '', $Value='', $Cols=50, $Rows=10,
|
||||
$Preview = true, $Buttons = true, array $ExtraAttributes = array()
|
||||
) {
|
||||
$this->id = parent::$Textareas;
|
||||
parent::$Textareas += 1;
|
||||
array_push(parent::$_ID, $ID);
|
||||
|
||||
if (empty($ID)) $ID = 'quickpost_' . $this->id;
|
||||
|
||||
if (!empty($ExtraAttributes))
|
||||
$Attributes = ' ' . implode(' ', $ExtraAttributes);
|
||||
else
|
||||
$Attributes = '';
|
||||
|
||||
if ($Preview === true) $this->preview();
|
||||
|
||||
View::parse('generic/textarea/textarea.phtml', array(
|
||||
'ID' => $ID,
|
||||
'NID' => $this->id,
|
||||
'Name' => &$Name,
|
||||
'Value' => &$Value,
|
||||
'Cols' => &$Cols,
|
||||
'Rows' => &$Rows,
|
||||
'Attributes' => &$Attributes
|
||||
));
|
||||
|
||||
if ($Buttons === true) $this->buttons();
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the divs required for previewing the AJAX content
|
||||
* Will only output once
|
||||
*/
|
||||
public function preview ()
|
||||
{
|
||||
if (!$this->preview)
|
||||
View::parse('generic/textarea/preview.phtml', array('ID' => $this->id));
|
||||
$this->preview = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the preview and edit buttons
|
||||
* Can be called many times to place buttons in different areas
|
||||
*/
|
||||
public function buttons ()
|
||||
{
|
||||
View::parse('generic/textarea/buttons.phtml', array('ID' => $this->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the textarea's numeric ID.
|
||||
*/
|
||||
public function getID ()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
/**
|
||||
* @static
|
||||
* @var int $Textareas Total number of textareas created
|
||||
*/
|
||||
static protected $Textareas = 0;
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @var array $_ID Array of textarea IDs
|
||||
*/
|
||||
static protected $_ID = array();
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @var bool For use in JavaScript method
|
||||
*/
|
||||
static private $Exectuted = false;
|
||||
|
||||
/**
|
||||
* This method should only run once with $all as true and should be placed
|
||||
* in the header or footer.
|
||||
*
|
||||
* If $all is true, it includes TextareaPreview and jQuery with noConflict()
|
||||
* for use with Sizzle.
|
||||
*
|
||||
* jQuery is required for this to work, include it in the headers.
|
||||
*
|
||||
* @static
|
||||
* @param bool $all Output all required scripts, otherwise just do iterator()
|
||||
* @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)
|
||||
View::parse('generic/textarea/script.phtml');
|
||||
|
||||
self::$Exectuted = true;
|
||||
self::iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* This iterator generates JavaScript to initialize each JavaScript
|
||||
* TextareaPreview object.
|
||||
*
|
||||
* It will generate a numeric or custom ID related to the textarea.
|
||||
* @static
|
||||
* @return void
|
||||
*/
|
||||
static private function iterator ()
|
||||
{
|
||||
$script = array();
|
||||
for($i = 0; $i < self::$Textareas; $i++) {
|
||||
if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
|
||||
$a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
|
||||
} else {
|
||||
$a = $i;
|
||||
}
|
||||
$script[] = sprintf('[%s]', $a);
|
||||
}
|
||||
if (!empty($script))
|
||||
View::parse('generic/textarea/script_factory.phtml',
|
||||
array('script' => join(', ', $script)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Textarea Preview Class
|
||||
*
|
||||
* This class generates a textarea that works with the JS preview script.
|
||||
*
|
||||
* Templates found in design/views/generic/textarea
|
||||
*
|
||||
* @example <pre><?php
|
||||
* // Create a textarea with a name of content.
|
||||
* // Buttons and preview divs are generated automatically near the textarea.
|
||||
* new TEXTAREA_PREVIEW('content');
|
||||
*
|
||||
* // Create a textarea with name and id body_text with default text and
|
||||
* // no buttons or wrap preview divs.
|
||||
* // Buttons and preview divs are generated manually
|
||||
* $text = new TEXTAREA_PREVIEW('body_text', 'body_text', 'default text',
|
||||
* 50, 20, false, false, array('disabled="disabled"', 'class="text"'));
|
||||
*
|
||||
* $text->buttons(); // output buttons
|
||||
*
|
||||
* $text->preview(); // output preview div
|
||||
*
|
||||
* // Create a textarea with custom preview wrapper around a table
|
||||
* // the table will be (in)visible depending on the toggle
|
||||
* $text = new TEXTAREA_PREVIEW('body', '', '', 30, 10, false, false);
|
||||
* $id = $text->getID();
|
||||
*
|
||||
* // some template
|
||||
* <div id="preview_wrap_<?=$id?>">
|
||||
* <table>
|
||||
* <tr>
|
||||
* <td>
|
||||
* <div id="preview_<?=$id?>"></div>
|
||||
* </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </div>
|
||||
* </pre>
|
||||
*/
|
||||
class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER
|
||||
{
|
||||
/**
|
||||
* @var int Unique ID
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* Flag for preview output
|
||||
* @var bool $preview
|
||||
*/
|
||||
private $preview = false;
|
||||
|
||||
/**
|
||||
* This method creates a textarea
|
||||
*
|
||||
* @param string $Name name attribute
|
||||
* @param string $ID id attribute
|
||||
* @param string $Value default text attribute
|
||||
* @param string $Cols cols attribute
|
||||
* @param string $Rows rows attribute
|
||||
* @param bool $Preview add the preview divs near the textarea
|
||||
* @param bool $Buttons add the edit/preview buttons near the textarea
|
||||
*
|
||||
* If false for either, use the appropriate methods to add the those
|
||||
* elements elsewhere. Alternatively, use getID to create your own.
|
||||
*
|
||||
* @param array $ExtraAttributes array of attribute="value"
|
||||
*/
|
||||
public function __construct ($Name, $ID = '', $Value='', $Cols=50, $Rows=10,
|
||||
$Preview = true, $Buttons = true, array $ExtraAttributes = array()
|
||||
) {
|
||||
$this->id = parent::$Textareas;
|
||||
parent::$Textareas += 1;
|
||||
array_push(parent::$_ID, $ID);
|
||||
|
||||
if (empty($ID)) $ID = 'quickpost_' . $this->id;
|
||||
|
||||
if (!empty($ExtraAttributes))
|
||||
$Attributes = ' ' . implode(' ', $ExtraAttributes);
|
||||
else
|
||||
$Attributes = '';
|
||||
|
||||
if ($Preview === true) $this->preview();
|
||||
|
||||
View::parse('generic/textarea/textarea.phtml', array(
|
||||
'ID' => $ID,
|
||||
'NID' => $this->id,
|
||||
'Name' => &$Name,
|
||||
'Value' => &$Value,
|
||||
'Cols' => &$Cols,
|
||||
'Rows' => &$Rows,
|
||||
'Attributes' => &$Attributes
|
||||
));
|
||||
|
||||
if ($Buttons === true) $this->buttons();
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the divs required for previewing the AJAX content
|
||||
* Will only output once
|
||||
*/
|
||||
public function preview ()
|
||||
{
|
||||
if (!$this->preview)
|
||||
View::parse('generic/textarea/preview.phtml', array('ID' => $this->id));
|
||||
$this->preview = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the preview and edit buttons
|
||||
* Can be called many times to place buttons in different areas
|
||||
*/
|
||||
public function buttons ()
|
||||
{
|
||||
View::parse('generic/textarea/buttons.phtml', array('ID' => $this->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the textarea's numeric ID.
|
||||
*/
|
||||
public function getID ()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
@ -615,7 +615,8 @@ public static function has_snatched($TorrentID) {
|
||||
$Cache->cache_value('users_snatched_'.$UserID.'_'.$i, $SnatchedTorrents[$i], 0);
|
||||
}
|
||||
}
|
||||
$Cache->cache_value('users_snatched_'.$UserID.'_lastupdate', $CurTime, 21600);
|
||||
$Cache->cache_value('users_snatched_'.$UserID.'_lastupdate', $CurTime, 0);
|
||||
$LastUpdate = $CurTime;
|
||||
}
|
||||
}
|
||||
return isset($CurSnatchedTorrents[$TorrentID]);
|
||||
|
@ -1,3 +1,3 @@
|
||||
|
||||
<input type="button" value="Preview" class="hidden button_preview_<?=$ID?>" title="Preview text" />
|
||||
<input type="button" value="Edit" class="hidden button_edit_<?=$ID?>" title="Edit text" />
|
||||
|
||||
<input type="button" value="Preview" class="hidden button_preview_<?=$ID?>" title="Preview text" />
|
||||
<input type="button" value="Edit" class="hidden button_edit_<?=$ID?>" title="Edit text" />
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
<div class="box vertical_space body hidden preview_wrap" id="preview_wrap_<?=$ID?>">
|
||||
<div id="preview_<?=$ID?>"></div>
|
||||
</div>
|
||||
|
||||
<div class="box vertical_space body hidden preview_wrap" id="preview_wrap_<?=$ID?>">
|
||||
<div id="preview_<?=$ID?>"></div>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
<script type="text/javascript" class="preview_code">
|
||||
jQuery(document).ready(function () { TextareaPreview.factory([<?=$script?>]); });
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" class="preview_code">
|
||||
jQuery(document).ready(function () { TextareaPreview.factory([<?=$script?>]); });
|
||||
</script>
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
<div id="textarea_wrap_<?=$NID?>" class="textarea_wrap">
|
||||
<textarea name="<?=$Name?>" id="<?=$ID?>" cols="<?=$Cols?>" rows="<?=$Rows?>" <?=$Attributes?>><?=$Value?></textarea>
|
||||
</div>
|
||||
|
||||
<div id="textarea_wrap_<?=$NID?>" class="textarea_wrap">
|
||||
<textarea name="<?=$Name?>" id="<?=$ID?>" cols="<?=$Cols?>" rows="<?=$Rows?>" <?=$Attributes?>><?=$Value?></textarea>
|
||||
</div>
|
||||
|
@ -1614,7 +1614,10 @@ CREATE TABLE `xbt_snatched` (
|
||||
KEY `tstamp` (`tstamp`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
;
|
||||
CREATE DEFINER=`root`@`localhost` FUNCTION `binomial_ci`(p int, n int) RETURNS float
|
||||
DETERMINISTIC
|
||||
SQL SECURITY INVOKER
|
||||
RETURN IF(n = 0,0.0,((p + 1.9208) / n - 1.96 * SQRT((p * (n-p)) / n + 0.9604) / n) / (1 + 3.8416 / n));
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
}
|
||||
|
||||
// What groups has this guy voted?
|
||||
$UserVotes = $Cache->get_value('voted_albums_'.$LoggedUser['ID']);
|
||||
$UserVotes = $Cache->get_value('voted_albums_'.$LoggedUser['ID'], true);
|
||||
if ($UserVotes === FALSE) {
|
||||
$DB->query('SELECT GroupID, Type FROM users_votes WHERE UserID='.$LoggedUser['ID']);
|
||||
$UserVotes = $DB->to_array('GroupID', MYSQL_ASSOC, false);
|
||||
@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
// What are the votes for this group?
|
||||
$GroupVotes = $Cache->get_value('votes_'.$GroupID);
|
||||
$GroupVotes = $Cache->get_value('votes_'.$GroupID, true);
|
||||
if ($GroupVotes === FALSE) {
|
||||
$DB->query("SELECT Ups AS Ups, Total AS Total FROM torrents_votes WHERE GroupID=$GroupID");
|
||||
if ($DB->record_count() == 0) {
|
||||
@ -59,7 +59,7 @@
|
||||
$DB->query("INSERT INTO torrents_votes (GroupID, Total, Ups, Score)
|
||||
VALUES ($GroupID, 1, ".($Type=='Up'?1:0).", 0)
|
||||
ON DUPLICATE KEY UPDATE Total = Total + 1,
|
||||
Score = IFNULL(binomial_ci(".$GroupVotes['Ups'].",". $GroupVotes['Total']."),0)".
|
||||
Score = IFNULL(binomial_ci(Ups".($Type=='Up'?'+1':'').",Total),0)".
|
||||
($Type=='Up'?', Ups = Ups+1':''));
|
||||
|
||||
$UserVotes[$GroupID] = array('GroupID' => $GroupID, 'Type' => $Type);
|
||||
@ -71,7 +71,7 @@
|
||||
// First update this album's paired votes. If this keys is magically not set,
|
||||
// our life just got a bit easier. We're only tracking paired votes on upvotes.
|
||||
if ($Type == 'Up') {
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID);
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
|
||||
if ($VotePairs !== FALSE) {
|
||||
foreach ($UserVotes as $Vote) {
|
||||
if ($Vote['GroupID'] == $GroupID) {
|
||||
@ -100,8 +100,11 @@
|
||||
// We're only track paired votes on upvotes
|
||||
continue;
|
||||
}
|
||||
if ($VGID == $GroupID) {
|
||||
continue;
|
||||
}
|
||||
// Again, if the cache key is not set, move along
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID);
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID, true);
|
||||
if ($VotePairs !== FALSE) {
|
||||
// Go through all of the other albums paired to this one, and update
|
||||
// this group's entry in their vote_pairs keys
|
||||
@ -142,14 +145,14 @@
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
|
||||
$DB->query("UPDATE torrents_votes SET Total = GREATEST(0, Total - 1),
|
||||
Score = IFNULL(binomial_ci(".$GroupVotes['Ups'].",".$GroupVotes['Total']."),0)".
|
||||
Score = IFNULL(binomial_ci(GREATEST(0,Ups".($Type=='Up'?'-1':'')."),GREATEST(0, Total)),0)".
|
||||
($Type=='Up'?', Ups = GREATEST(0, Ups - 1)':'')."
|
||||
WHERE GroupID=$GroupID");
|
||||
// Update paired cache keys
|
||||
// First update this album's paired votes. If this keys is magically not set,
|
||||
// our life just got a bit easier. We're only tracking paired votes on upvotes.
|
||||
if ($Type == 'Up') {
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID);
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
|
||||
if ($VotePairs !== FALSE) {
|
||||
foreach ($UserVotes as $Vote) {
|
||||
if (isset($VotePairs[$Vote['GroupID']])) {
|
||||
@ -178,8 +181,11 @@
|
||||
// We're only track paired votes on upvotes
|
||||
continue;
|
||||
}
|
||||
if ($VGID == $GroupID) {
|
||||
continue;
|
||||
}
|
||||
// Again, if the cache key is not set, move along
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID);
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$VGID, true);
|
||||
if ($VotePairs !== FALSE) {
|
||||
if (isset($VotePairs[$GroupID])) {
|
||||
if ($VotePairs[$GroupID]['Total'] == 0) {
|
||||
|
@ -420,7 +420,7 @@ function compare($X, $Y){
|
||||
|
||||
?>
|
||||
<tr class="releases_<?=$ReleaseType?> groupid_<?=$GroupID?> edition group_torrent discog<?=$HideDiscog.$HideTorrents?>">
|
||||
<td colspan="6" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event)" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?=$RemasterName?></strong></a></td>
|
||||
<td colspan="6" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event)" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?=$RemasterName?></strong></td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
@ -435,7 +435,7 @@ function compare($X, $Y){
|
||||
$MasterName .= $AddExtra.display_str($Torrent['Media']);
|
||||
?>
|
||||
<tr class="releases_<?=$ReleaseType?> groupid_<?=$GroupID?> edition group_torrent<?=$HideDiscog.$HideTorrents?>">
|
||||
<td colspan="6" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event)" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?=$MasterName?></strong></a></td>
|
||||
<td colspan="6" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event)" title="Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.">−</a> <?=$MasterName?></strong></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
@ -540,17 +540,17 @@ function compare($X, $Y){
|
||||
|
||||
<div class="box box_search">
|
||||
<div class="head"><strong>Search File Lists</strong></div>
|
||||
<ul class="nobullet">
|
||||
<li>
|
||||
<form class="search_form" name="filelists" action="torrents.php">
|
||||
<input type="hidden" name="artistname" value="<?=$Name?>" />
|
||||
<input type="hidden" name="action" value="advanced" />
|
||||
<input type="text" autocomplete="off" id="filelist" name="filelist" size="20" />
|
||||
<input type="submit" value=">" />
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="nobullet">
|
||||
<li>
|
||||
<form class="search_form" name="filelists" action="torrents.php">
|
||||
<input type="hidden" name="artistname" value="<?=$Name?>" />
|
||||
<input type="hidden" name="action" value="advanced" />
|
||||
<input type="text" autocomplete="off" id="filelist" name="filelist" size="20" />
|
||||
<input type="submit" value=">" />
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?
|
||||
|
||||
if(check_perms('zip_downloader')){
|
||||
@ -569,17 +569,17 @@ function compare($X, $Y){
|
||||
<input type="hidden" name="action" value="download" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<ul id="list" class="nobullet">
|
||||
<ul id="list" class="nobullet">
|
||||
<? foreach ($ZIPList as $ListItem) { ?>
|
||||
<li id="list<?=$ListItem?>">
|
||||
<input type="hidden" name="list[]" value="<?=$ListItem?>" />
|
||||
<span style="float:left;"><?=$ZIPOptions[$ListItem]['2']?></span>
|
||||
<a href="#" onclick="remove_selection('<?=$ListItem?>');return false;" style="float:right;" title="Remove format from the Collector">[X]</a>
|
||||
<br style="clear:all;" />
|
||||
</li>
|
||||
<li id="list<?=$ListItem?>">
|
||||
<input type="hidden" name="list[]" value="<?=$ListItem?>" />
|
||||
<span style="float:left;"><?=$ZIPOptions[$ListItem]['2']?></span>
|
||||
<a href="#" onclick="remove_selection('<?=$ListItem?>');return false;" style="float:right;" title="Remove format from the Collector">[X]</a>
|
||||
<br style="clear:all;" />
|
||||
</li>
|
||||
<? } ?>
|
||||
</ul>
|
||||
<select id="formats" style="width:180px">
|
||||
</ul>
|
||||
<select id="formats" style="width:180px">
|
||||
<?
|
||||
$OpenGroup = false;
|
||||
$LastGroupID=-1;
|
||||
@ -590,25 +590,25 @@ function compare($X, $Y){
|
||||
if($GroupID!=$LastGroupID) {
|
||||
$LastGroupID=$GroupID;
|
||||
if($OpenGroup) { ?>
|
||||
</optgroup>
|
||||
</optgroup>
|
||||
<? } ?>
|
||||
<optgroup label="<?=$ZIPGroups[$GroupID]?>">
|
||||
<optgroup label="<?=$ZIPGroups[$GroupID]?>">
|
||||
<? $OpenGroup = true;
|
||||
}
|
||||
?>
|
||||
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if(in_array($GroupID.$OptionID,$ZIPList)){ echo ' disabled="disabled"'; }?>><?=$OptName?></option>
|
||||
<option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if(in_array($GroupID.$OptionID,$ZIPList)){ echo ' disabled="disabled"'; }?>><?=$OptName?></option>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
</select>
|
||||
<button type="button" onclick="add_selection()">+</button>
|
||||
<select name="preference" style="width:210px">
|
||||
<option value="0"<? if($ZIPPrefs==0){ echo ' selected="selected"'; } ?>>Prefer Original</option>
|
||||
<option value="1"<? if($ZIPPrefs==1){ echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
|
||||
<option value="2"<? if($ZIPPrefs==2){ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
|
||||
</select>
|
||||
<input type="submit" style="width:210px" value="Download" />
|
||||
</optgroup>
|
||||
</select>
|
||||
<button type="button" onclick="add_selection()">+</button>
|
||||
<select name="preference" style="width:210px">
|
||||
<option value="0"<? if($ZIPPrefs==0){ echo ' selected="selected"'; } ?>>Prefer Original</option>
|
||||
<option value="1"<? if($ZIPPrefs==1){ echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
|
||||
<option value="2"<? if($ZIPPrefs==2){ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
|
||||
</select>
|
||||
<input type="submit" style="width:210px" value="Download" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -620,7 +620,7 @@ function compare($X, $Y){
|
||||
uasort($Tags, 'compare');
|
||||
foreach ($Tags as $TagName => $Tag) {
|
||||
?>
|
||||
<li><a href="torrents.php?taglist=<?=$TagName?>"><?=$TagName?></a> (<?=$Tag['count']?>)</li>
|
||||
<li><a href="torrents.php?taglist=<?=$TagName?>"><?=$TagName?></a> (<?=$Tag['count']?>)</li>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
@ -630,7 +630,7 @@ function compare($X, $Y){
|
||||
|
||||
// Stats
|
||||
?>
|
||||
<div class="box box_info box_statistics_artist">
|
||||
<div class="box box_info box_statistics_artist">
|
||||
<div class="head"><strong>Statistics</strong></div>
|
||||
<ul class="stats nobullet">
|
||||
<li>Number of groups: <?=number_format($NumGroups)?></li>
|
||||
@ -815,30 +815,22 @@ function compare($X, $Y){
|
||||
|
||||
<div id="similar_artist_map" class="box">
|
||||
<div id="flipper_head" class="head">
|
||||
<strong id="flipper_title">Similar Artist Map</strong>
|
||||
<a id="flip_to" href="#null" onclick="flipView();"> [Switch to Cloud]</a>
|
||||
</div>
|
||||
<div id="flip_view_1" style="display:block;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;position:relative;background-image:url(static/similar/<?=$ArtistID?>.png?t=<?=time()?>)">
|
||||
<strong id="flipper_title">Similar Artist Map</strong>
|
||||
<a id="flip_to" href="#null" onclick="flipView();"> [Switch to Cloud]</a>
|
||||
</div>
|
||||
<div id="flip_view_1" style="display:block;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;position:relative;background-image:url(static/similar/<?=$ArtistID?>.png?t=<?=time()?>)">
|
||||
<?
|
||||
$Similar->write_artists();
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<? } // if $NumSimilar>0
|
||||
|
||||
if($NumSimilar>0) { ?>
|
||||
|
||||
<div id="flip_view_2" style="display:none;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;">
|
||||
<canvas width="<?=WIDTH?>px" height="<?=HEIGHT-20?>px" id="similarArtistsCanvas"></canvas>
|
||||
<div id="artistTags" style="display:none;">
|
||||
<ul/>
|
||||
</div>
|
||||
<strong style="margin-left:10px;"><a id="currentArtist" href="#null">Loading...</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="flip_view_2" style="display:none;width:<?=WIDTH?>px;height:<?=HEIGHT?>px;">
|
||||
<canvas width="<?=WIDTH?>px" height="<?=HEIGHT-20?>px" id="similarArtistsCanvas"></canvas>
|
||||
<div id="artistTags" style="display:none;">
|
||||
<ul></ul>
|
||||
</div>
|
||||
<strong style="margin-left:10px;"><a id="currentArtist" href="#null">Loading...</a></strong>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var cloudLoaded = false;
|
||||
@ -897,7 +889,7 @@ function require(file, callback) {
|
||||
|
||||
</script>
|
||||
|
||||
<? } ?>
|
||||
<? } // if $NumSimilar>0 ?>
|
||||
<div class="box">
|
||||
<div class="head"><strong>Artist info</strong></div>
|
||||
<div class="body"><?=$Text->full_format($Body)?></div>
|
||||
@ -953,106 +945,125 @@ function require(file, callback) {
|
||||
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
|
||||
$Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true);
|
||||
?>
|
||||
<div class="linkbox"><a name="comments"></a>
|
||||
<div class="linkbox">
|
||||
<a name="comments"></a>
|
||||
<?
|
||||
$Pages=Format::get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
|
||||
$Pages = Format::get_pages($Page,$Results,TORRENT_COMMENTS_PER_PAGE,9,'#comments');
|
||||
echo $Pages;
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
|
||||
//---------- Begin printing
|
||||
foreach($Thread as $Key => $Post){
|
||||
foreach($Thread as $Key => $Post) {
|
||||
list($PostID, $AuthorID, $AddedTime, $CommentBody, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a class="post_id" href='artist.php?id=<?=$ArtistID?>&postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?> <a href="reports.php?action=report&type=artist_comment&id=<?=$PostID?>">[Report]</a>
|
||||
<? if(check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if($LoggedUser['Class'] >= $AuthorInfo['Class']) { ?>
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="document.warn<?=$PostID?>.submit(); return false;">[Warn]</a>
|
||||
|
||||
<? }
|
||||
} ?>
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<div style="float:left;"><a class="post_id" href='artist.php?id=<?=$ArtistID?>&postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
|
||||
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');">[Quote]</a>
|
||||
<?if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a><? }
|
||||
if (check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a> <? } ?>
|
||||
</span>
|
||||
<span id="bar<?=$PostID?>" style="float:right;">
|
||||
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
|
||||
<? }
|
||||
if (check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div id="bar<?=$PostID?>" style="float:right;">
|
||||
<a href="reports.php?action=report&type=artist_comment&id=<?=$PostID?>">[Report]</a>
|
||||
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if ($LoggedUser['Class'] >= $AuthorInfo['Class']) {
|
||||
?>
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="$('#warn<?=$PostID?>').raw().submit(); return false;">[Warn]</a>
|
||||
<? }
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if ($Avatar) { ?>
|
||||
<? if ($Avatar) { ?>
|
||||
<img src="<?=$Avatar?>" width="150" alt="<?=$Username ?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($CommentBody)?>
|
||||
<? if($EditedUserID){ ?>
|
||||
<? if ($EditedUserID) { ?>
|
||||
<br />
|
||||
<br />
|
||||
<? if(Paranoia::check_perms('site_admin_forums')) { ?>
|
||||
<? if (check_perms('site_admin_forums')) { ?>
|
||||
<a href="#content<?=$PostID?>" onclick="LoadEdit('artist', <?=$PostID?>, 1); return false;">«</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
Last edited by
|
||||
<?=Users::format_username($EditedUserID, false, false, false) ?> <?=time_diff($EditedTime,2,true,true)?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<?
|
||||
if(!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
<div style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
<a href="#quickreplypreview">[Report Comment]</a>
|
||||
</span>
|
||||
<span id="barpreview" style="float:right;">
|
||||
</div>
|
||||
<div id="barpreview" style="float:right;">
|
||||
<a href="#quickreplypreview">[Report]</a>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
@ -1069,6 +1080,7 @@ function require(file, callback) {
|
||||
<input type="submit" id="submit_button" value="Post reply" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -1078,7 +1090,7 @@ function require(file, callback) {
|
||||
|
||||
// Cache page for later use
|
||||
|
||||
if($RevisionID) {
|
||||
if ($RevisionID) {
|
||||
$Key = "artist_$ArtistID"."_revision_$RevisionID";
|
||||
} else {
|
||||
$Key = 'artist_'.$ArtistID;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!check_perms('users_warn')) { error(404);
|
||||
}
|
||||
isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'artistid', 'postid', 'userid'));
|
||||
Misc::assert_isset_request($_POST, array('reason', 'privatemessage', 'body', 'length', 'artistid', 'postid', 'userid'));
|
||||
|
||||
$Reason = db_string($_POST['reason']);
|
||||
$PrivateMessage = db_string($_POST['privatemessage']);
|
||||
@ -12,62 +12,58 @@
|
||||
$UserID = (int)$_POST['userid'];
|
||||
$Key = (int)$_POST['key'];
|
||||
$SQLTime = sqltime();
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserInfo = Users::user_info($UserID);
|
||||
if($UserInfo['Class'] > $LoggedUser['Class']) {
|
||||
error(403);
|
||||
error(403);
|
||||
}
|
||||
$URL = "https://". SSL_SITE_URL."/artist.php?id=$ArtistID&postid=$PostID#post$PostID";
|
||||
if ($Length != 'verbal') {
|
||||
$Time = ((int)$Length) * (7 * 24 * 60 * 60);
|
||||
warn_user($UserID, $Time, "$URL - ". $Reason);
|
||||
$Subject = "You have received a warning";
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this artist comment.[/url]\n\n" . $PrivateMessage;
|
||||
$Time = ((int)$Length) * (7 * 24 * 60 * 60);
|
||||
Tools::warn_user($UserID, $Time, "$URL - ". $Reason);
|
||||
$Subject = "You have received a warning";
|
||||
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this artist comment.[/url]\n\n" . $PrivateMessage;
|
||||
$WarnTime = time_plus($Time);
|
||||
$AdminComment = date("Y-m-d").' - Warned until '.$WarnTime.' by '.$LoggedUser['Username']."\nReason: $URL - $Reason\n\n";
|
||||
} else {
|
||||
$Subject = "You have received a verbal warning";
|
||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||
$Subject = "You have received a verbal warning";
|
||||
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post.[/url]\n\n" . $PrivateMessage;
|
||||
|
||||
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
$DB -> query('UPDATE users_info SET
|
||||
Warned=\'' . db_string($WarnTime) . '\',
|
||||
WarnedTimes=WarnedTimes+1,
|
||||
AdminComment=CONCAT(\'' . db_string($AdminComment) . '\',AdminComment)
|
||||
WHERE UserID=\'' . db_string($UserID) . '\'');
|
||||
}
|
||||
$DB -> query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment) . "')
|
||||
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
|
||||
send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
|
||||
$AdminComment = date("Y-m-d") . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
|
||||
}
|
||||
$DB->query("INSERT INTO users_warnings_forums (UserID, Comment) VALUES('$UserID', '" . db_string($AdminComment) . "')
|
||||
ON DUPLICATE KEY UPDATE Comment = CONCAT('" . db_string($AdminComment) . "', Comment)");
|
||||
Tools::update_user_notes($UserID,$AdminComment);
|
||||
Misc::send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
|
||||
|
||||
// Mainly
|
||||
$DB -> query("SELECT
|
||||
ac.Body,
|
||||
ac.AuthorID,
|
||||
ac.ArtistID,
|
||||
ac.AddedTime
|
||||
FROM artist_comments AS ac
|
||||
WHERE ac.ID='$PostID'");
|
||||
list($OldBody, $AuthorID, $ArtistID, $AddedTime) = $DB -> next_record();
|
||||
$DB->query("SELECT
|
||||
ac.Body,
|
||||
ac.AuthorID,
|
||||
ac.ArtistID,
|
||||
ac.AddedTime
|
||||
FROM artist_comments AS ac
|
||||
WHERE ac.ID='$PostID'");
|
||||
list($OldBody, $AuthorID, $ArtistID, $AddedTime) = $DB->next_record();
|
||||
|
||||
$DB -> query("SELECT ceil(COUNT(ID) / " . TORRENT_COMMENTS_PER_PAGE . ") AS Page FROM artist_comments WHERE ArtistID = $ArtistID AND ID <= $PostID");
|
||||
list($Page) = $DB -> next_record();
|
||||
$DB->query("SELECT ceil(COUNT(ID) / " . TORRENT_COMMENTS_PER_PAGE . ") AS Page FROM artist_comments WHERE ArtistID = $ArtistID AND ID <= $PostID");
|
||||
list($Page) = $DB->next_record();
|
||||
|
||||
// Perform the update
|
||||
$DB -> query("UPDATE Artist_comments SET
|
||||
Body = '$Body',
|
||||
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
||||
EditedTime = '" . sqltime() . "'
|
||||
WHERE ID='$PostID'");
|
||||
$DB->query("UPDATE artist_comments SET
|
||||
Body = '$Body',
|
||||
EditedUserID = '" . db_string($LoggedUser['ID']) . "',
|
||||
EditedTime = '" . sqltime() . "'
|
||||
WHERE ID='$PostID'");
|
||||
|
||||
// Update the cache
|
||||
$CatalogueID = floor((TORRENT_COMMENTS_PER_PAGE * $Page - TORRENT_COMMENTS_PER_PAGE) / THREAD_CATALOGUE);
|
||||
$Cache -> begin_transaction('artist_comments_' . $ArtistID . '_catalogue_' . $CatalogueID);
|
||||
$Cache->begin_transaction('artist_comments_' . $ArtistID . '_catalogue_' . $CatalogueID);
|
||||
|
||||
$Cache -> update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $_POST['body'], 'EditedUserID' => db_string($LoggedUser['ID']), 'EditedTime' => sqltime(), 'Username' => $LoggedUser['Username']));
|
||||
$Cache -> commit_transaction(0);
|
||||
$Cache->update_row($_POST['key'], array('ID' => $_POST['postid'], 'AuthorID' => $AuthorID, 'AddedTime' => $AddedTime, 'Body' => $_POST['body'], 'EditedUserID' => db_string($LoggedUser['ID']), 'EditedTime' => sqltime(), 'Username' => $LoggedUser['Username']));
|
||||
$Cache->commit_transaction(0);
|
||||
|
||||
$DB -> query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||
VALUES ('artist', " . db_string($_POST['postid']) . ", " . db_string($LoggedUser['ID']) . ", '" . sqltime() . "', '" . db_string($OldBody) . "')");
|
||||
$DB->query("INSERT INTO comments_edits (Page, PostID, EditUser, EditTime, Body)
|
||||
VALUES ('artist', " . db_string($_POST['postid']) . ", " . db_string($LoggedUser['ID']) . ", '" . sqltime() . "', '" . db_string($OldBody) . "')");
|
||||
|
||||
header("Location: artist.php?id=$ArtistID&postid=$PostID#post$PostID");
|
||||
?>;
|
||||
?>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<?php
|
||||
if (!check_perms('users_warn')) { error(404);}
|
||||
isset_request($_POST, array('artistid', 'postid', 'userid', 'key'));
|
||||
Misc::assert_isset_request($_POST, array('artistid', 'postid', 'userid', 'key'));
|
||||
|
||||
$ArtistID = (int) $_POST['artistid'];
|
||||
$PostID = (int) $_POST['postid'];
|
||||
$UserID = (int) $_POST['userid'];
|
||||
$Key = (int) $_POST['key'];
|
||||
$UserInfo = user_info($UserID);
|
||||
$UserInfo = Users::user_info($UserID);
|
||||
$DB -> query("SELECT
|
||||
tc.Body,
|
||||
tc.AddedTime
|
||||
FROM torrents_comments AS tc
|
||||
WHERE tc.ID='" . db_string($PostID) . "'");
|
||||
ac.Body,
|
||||
ac.AddedTime
|
||||
FROM artist_comments AS ac
|
||||
WHERE ac.ID='" . db_string($PostID) . "'");
|
||||
list($PostBody) = $DB -> next_record();
|
||||
|
||||
show_header('Warn User');
|
||||
View::show_header('Warn User');
|
||||
?>
|
||||
|
||||
<div class="thin">
|
||||
@ -65,4 +65,4 @@
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<? show_footer(); ?>
|
||||
<? View::show_footer(); ?>
|
||||
|
@ -1,29 +1,29 @@
|
||||
<?php
|
||||
// ugly UserID code that should be turned into a function . . .
|
||||
if(!empty($_GET['userid'])) {
|
||||
if(!check_perms('users_override_paranoia')) {
|
||||
error(403);
|
||||
}
|
||||
$UserID = $_GET['userid'];
|
||||
if(!is_number($UserID)) { error(404); }
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID='$UserID'");
|
||||
list($Username) = $DB->next_record();
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
}
|
||||
|
||||
// Finally we start
|
||||
|
||||
//Require the table class
|
||||
// require_once SERVER_ROOT . '/classes/class_mass_user_torrents_table_view.php';
|
||||
|
||||
View::show_header('Organize Bookmarks', 'browse,jquery');
|
||||
|
||||
$EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
|
||||
|
||||
list($K, $GroupIDs, $CollageDataList, $TorrentList) = Users::bookmark_data($UserID);
|
||||
|
||||
$TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
|
||||
$TT->render_all();
|
||||
|
||||
<?php
|
||||
// ugly UserID code that should be turned into a function . . .
|
||||
if(!empty($_GET['userid'])) {
|
||||
if(!check_perms('users_override_paranoia')) {
|
||||
error(403);
|
||||
}
|
||||
$UserID = $_GET['userid'];
|
||||
if(!is_number($UserID)) { error(404); }
|
||||
$DB->query("SELECT Username FROM users_main WHERE ID='$UserID'");
|
||||
list($Username) = $DB->next_record();
|
||||
} else {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
}
|
||||
|
||||
// Finally we start
|
||||
|
||||
//Require the table class
|
||||
// require_once SERVER_ROOT . '/classes/class_mass_user_torrents_table_view.php';
|
||||
|
||||
View::show_header('Organize Bookmarks', 'browse,jquery');
|
||||
|
||||
$EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
|
||||
|
||||
list($K, $GroupIDs, $CollageDataList, $TorrentList) = Users::bookmark_data($UserID);
|
||||
|
||||
$TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
|
||||
$TT->render_all();
|
||||
|
||||
View::show_footer();
|
@ -73,8 +73,14 @@
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
by <?=Users::format_username($AuthorID, true, true, true, true, true)?> <?=time_diff($AddedTime)?> <a href="reports.php?action=report&type=collages_comment&id=<?=$PostID?>">[Report Comment]</a>
|
||||
<? if (!$ThreadInfo['IsLocked']){ ?> - <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');">[Quote]</a><? }
|
||||
|
@ -30,13 +30,13 @@
|
||||
|
||||
$DB->query("SELECT FOUND_ROWS()");
|
||||
list($Results) = $DB->next_record();
|
||||
$Pages=get_pages($Page,$Results,$PerPage, 11);
|
||||
$Pages=Format::get_pages($Page,$Results,$PerPage, 11);
|
||||
|
||||
$DB->set_query_id($Comments);
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
|
||||
|
||||
show_header($Title,'bbcode');
|
||||
View::show_header($Title,'bbcode');
|
||||
$DB->set_query_id($Comments);
|
||||
|
||||
?><div class="thin">
|
||||
@ -64,5 +64,5 @@
|
||||
</div>
|
||||
<?
|
||||
|
||||
show_footer();
|
||||
View::show_footer();
|
||||
|
||||
|
@ -57,4 +57,3 @@
|
||||
require(SERVER_ROOT.'/sections/comments/torrentcomments.php');
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -13,22 +13,28 @@
|
||||
* @returns void, prints output
|
||||
*/
|
||||
function comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime) {
|
||||
global $Text;
|
||||
global $Text,$HeavyInfo;
|
||||
$UserInfo = Users::user_info($UserID);
|
||||
$postheader = "by <strong>" . Users::format_username($UserID, true, true, true, true, false) . "</strong> "
|
||||
. time_diff($AddedTime) . $postheader;
|
||||
|
||||
?>
|
||||
<table class='forum_post box vertical_margin<?=$noavatar ? ' noavatar' : ''?>' id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if(empty($UserInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class='colhead_dark'>
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($UserInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='<?=$permalink ?>'>#<?=$PostID?></a>
|
||||
<?=$postheader ?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($UserInfo['DisableAvatars'])) { ?>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class='avatar' valign="top">
|
||||
<? if($UserInfo['Avatar']){ ?>
|
||||
<img src='<?=$UserInfo['Avatar']?>' width='150' alt="<?=$UserInfo['Username']?>'s avatar" />
|
||||
|
@ -43,8 +43,14 @@
|
||||
</div>
|
||||
<? } ?>
|
||||
<table class="forum_post box vertical_margin" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#newthreadpreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?></strong>
|
||||
Just now
|
||||
|
@ -328,28 +328,29 @@
|
||||
<input type="hidden" name="large" value="1" />
|
||||
<input type="hidden" name="topicid" value="<?=$ThreadID?>" />
|
||||
<ul style="list-style: none;" id="poll_options">
|
||||
<? foreach($Answers as $i => $Answer) { //for ($i = 1, $il = count($Answers); $i <= $il; $i++) { ?>
|
||||
<? foreach($Answers as $i => $Answer) { //for ($i = 1, $il = count($Answers); $i <= $il; $i++) { ?>
|
||||
<li>
|
||||
<input type="radio" name="vote" id="answer_<?=$i?>" value="<?=$i?>" />
|
||||
<label for="answer_<?=$i?>"><?=display_str($Answer)?></label>
|
||||
</li>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<li>
|
||||
<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) { ?>
|
||||
<? if($ForumID == STAFF_FORUM) { ?>
|
||||
<a href="#" onclick="AddPollOption(<?=$ThreadID?>); return false;">[+]</a>
|
||||
<br />
|
||||
<br />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<input type="button" style="float: left;" onclick="ajax.post('index.php','poll',function(response){$('#poll_container').raw().innerHTML = response});" value="Vote" />
|
||||
</form>
|
||||
</div>
|
||||
<? } ?>
|
||||
<? if(check_perms('forums_polls_moderate') && !$RevealVoters) { ?>
|
||||
<? if (!$Featured || $Featured == '0000-00-00 00:00:00') { ?>
|
||||
<? } ?>
|
||||
<? if(check_perms('forums_polls_moderate') && !$RevealVoters) {
|
||||
if (!$Featured || $Featured == '0000-00-00 00:00:00') {
|
||||
?>
|
||||
<form class="manage_form" name="poll" action="forums.php" method="post">
|
||||
<input type="hidden" name="action" value="poll_mod" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
@ -357,7 +358,7 @@
|
||||
<input type="hidden" name="feature" value="1" />
|
||||
<input type="submit" style="float: left;" onclick="return confirm('Are you sure you want to feature this poll?');" value="Feature" />
|
||||
</form>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<form class="manage_form" name="poll" action="forums.php" method="post">
|
||||
<input type="hidden" name="action" value="poll_mod" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
@ -365,7 +366,7 @@
|
||||
<input type="hidden" name="close" value="1" />
|
||||
<input type="submit" style="float: left;" value="<?=(!$Closed ? 'Close' : 'Open')?>" />
|
||||
</form>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
@ -381,94 +382,100 @@
|
||||
}
|
||||
}
|
||||
|
||||
foreach($Thread as $Key => $Post){
|
||||
foreach ($Thread as $Key => $Post) {
|
||||
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?
|
||||
if (((!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) && $PostID>$LastRead && strtotime($AddedTime)>$LoggedUser['CatchupTime']) || (isset($RequestKey) && $Key==$RequestKey)) {
|
||||
echo ' forum_unread';
|
||||
}
|
||||
if ($HeavyInfo['DisableAvatars']) {
|
||||
echo ' noavatar';
|
||||
}
|
||||
if ($ThreadInfo['OP'] == $AuthorID) {
|
||||
echo ' important_user';
|
||||
} ?>" id="post<?=$PostID?>">
|
||||
if (((!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) && $PostID>$LastRead && strtotime($AddedTime)>$LoggedUser['CatchupTime']) || (isset($RequestKey) && $Key==$RequestKey)) {
|
||||
echo ' forum_unread';
|
||||
}
|
||||
if ($HeavyInfo['DisableAvatars']) {
|
||||
echo ' noavatar';
|
||||
}
|
||||
if ($ThreadInfo['OP'] == $AuthorID) {
|
||||
echo ' important_user';
|
||||
} ?>" id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<div style="float:left;"><a class="post_id" href="forums.php?action=viewthread&threadid=<?=$ThreadID?>&postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
|
||||
<?=Users::format_username($AuthorID, true, true, true, true, true)?>
|
||||
<?=time_diff($AddedTime,2)?>
|
||||
<? if(!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')){ ?>
|
||||
<? if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>', true);">[Quote]</a>
|
||||
<? }
|
||||
if (((!$ThreadInfo['IsLocked'] && check_forumperm($ForumID, 'Write')) && ($AuthorID == $LoggedUser['ID']) || check_perms('site_moderate_forums'))) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
|
||||
<? }
|
||||
if(check_perms('site_admin_forums') && $ThreadInfo['Posts'] > 1) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a>
|
||||
<? }
|
||||
if($PostID == $ThreadInfo['StickyPostID']) { ?>
|
||||
<strong><span class="sticky_post">[Sticky]</span></strong>
|
||||
<? if(check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="forums.php?action=sticky_post&threadid=<?=$ThreadID?>&postid=<?=$PostID?>&remove=true&auth=<?=$LoggedUser['AuthKey']?>" >[X]</a>
|
||||
<? }
|
||||
} else {
|
||||
if(check_perms('site_moderate_forums')) { ?>
|
||||
if ((!$ThreadInfo['IsLocked'] && check_forumperm($ForumID, 'Write') && $AuthorID == $LoggedUser['ID']) || check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
|
||||
<? }
|
||||
if(check_perms('site_admin_forums') && $ThreadInfo['Posts'] > 1) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a>
|
||||
<? }
|
||||
if($PostID == $ThreadInfo['StickyPostID']) { ?>
|
||||
<strong><span class="sticky_post">[Sticky]</span></strong>
|
||||
<? if(check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="forums.php?action=sticky_post&threadid=<?=$ThreadID?>&postid=<?=$PostID?>&remove=true&auth=<?=$LoggedUser['AuthKey']?>" >[X]</a>
|
||||
<? }
|
||||
} else {
|
||||
if(check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="forums.php?action=sticky_post&threadid=<?=$ThreadID?>&postid=<?=$PostID?>&auth=<?=$LoggedUser['AuthKey']?>" >[⇕]</a>
|
||||
<? }
|
||||
}
|
||||
<? }
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div id="bar<?=$PostID?>" style="float:right;">
|
||||
<a href="reports.php?action=report&type=post&id=<?=$PostID?>">[Report]</a>
|
||||
<?
|
||||
if(check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if($LoggedUser['Class'] >= $AuthorInfo['Class']) { ?>
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="$('#warn<?=$PostID?>').raw().submit(); return false;">[Warn]</a>
|
||||
<? } ?>
|
||||
<? }
|
||||
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if($LoggedUser['Class'] >= $AuthorInfo['Class']) {
|
||||
?>
|
||||
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="$('#warn<?=$PostID?>').raw().submit(); return false;">[Warn]</a>
|
||||
<? }
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if ($Avatar) { ?>
|
||||
<? if ($Avatar) { ?>
|
||||
<img src="<?=$Avatar?>" width="150" style="max-height:400px;" alt="<?=$Username ?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top"<? if(!empty($HeavyInfo['DisableAvatars'])) { echo ' colspan="2"'; } ?>>
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($Body) ?>
|
||||
<? if($EditedUserID){ ?>
|
||||
<? if ($EditedUserID) { ?>
|
||||
<br />
|
||||
<br />
|
||||
<? if(check_perms('site_admin_forums')) { ?>
|
||||
<? if(check_perms('site_admin_forums')) { ?>
|
||||
<a href="#content<?=$PostID?>" onclick="LoadEdit('forums', <?=$PostID?>, 1); return false;">«</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
Last edited by
|
||||
<?=Users::format_username($EditedUserID, false, false, false) ?> <?=time_diff($EditedTime,2,true,true)?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<div class="breadcrumbs">
|
||||
<a href="forums.php">Forums</a> >
|
||||
<a href="forums.php?action=viewforum&forumid=<?=$ThreadInfo['ForumID']?>"><?=$ForumName?></a> >
|
||||
@ -478,7 +485,7 @@
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<?
|
||||
if(!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
|
||||
if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
|
||||
if(check_forumperm($ForumID, 'Write') && !$LoggedUser['DisablePosting']) {
|
||||
//TODO: Preview, come up with a standard, make it look like post or just a block of formatted BBcode, but decide and write some proper XHTML
|
||||
?>
|
||||
@ -487,8 +494,14 @@
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <?=Users::format_username($LoggedUser['ID'], true, true, true, true, true)?> Just now
|
||||
</span>
|
||||
@ -500,19 +513,21 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" <? if(!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?> method="post">
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" <? if(!check_perms('users_mod')) { ?> onsubmit="quickpostform.submit_button.disabled=true;" <? } ?> method="post">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="thread" value="<?=$ThreadID?>" />
|
||||
@ -521,27 +536,28 @@
|
||||
<textarea id="quickpost" style="width: 95%;" tabindex="1" onkeyup="resize('quickpost');" name="body" cols="90" rows="8"></textarea> <br />
|
||||
</div>
|
||||
<div>
|
||||
<? if(!in_array($ThreadID, $UserSubscriptions)) { ?>
|
||||
<? if(!in_array($ThreadID, $UserSubscriptions)) { ?>
|
||||
<input id="subscribebox" type="checkbox" name="subscribe"<?=!empty($HeavyInfo['AutoSubscribe'])?' checked="checked"':''?> tabindex="2" />
|
||||
<label for="subscribebox">Subscribe</label>
|
||||
<?
|
||||
}
|
||||
if($ThreadInfo['LastPostAuthorID']==$LoggedUser['ID'] && (check_perms('site_forums_double_post') || in_array($ForumID, $ForumsDoublePost))) {
|
||||
}
|
||||
if($ThreadInfo['LastPostAuthorID']==$LoggedUser['ID'] && (check_perms('site_forums_double_post') || in_array($ForumID, $ForumsDoublePost))) {
|
||||
?>
|
||||
<input id="mergebox" type="checkbox" name="merge" tabindex="2" />
|
||||
<label for="mergebox">Merge</label>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<input id="post_preview" type="button" value="Preview" tabindex="1" onclick="if(this.preview){Quick_Edit();}else{Quick_Preview();}" />
|
||||
<input type="submit" id="submit_button" value="Post reply" tabindex="1" />
|
||||
</div>
|
||||
<?
|
||||
if (!$LoggedUser['DisableAutoSave']) {
|
||||
if (!$LoggedUser['DisableAutoSave']) {
|
||||
?>
|
||||
<script type="application/javascript">new StoreText('quickpost', 'quickpostform', <?=$ThreadID?>);</script>
|
||||
<?
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
@ -582,37 +598,37 @@
|
||||
<td>
|
||||
<select name="forumid" tabindex="2">
|
||||
<?
|
||||
$OpenGroup = false;
|
||||
$LastCategoryID=-1;
|
||||
$OpenGroup = false;
|
||||
$LastCategoryID = -1;
|
||||
|
||||
foreach ($Forums as $Forum) {
|
||||
if ($Forum['MinClassRead'] > $LoggedUser['Class']) {
|
||||
continue;
|
||||
}
|
||||
foreach ($Forums as $Forum) {
|
||||
if ($Forum['MinClassRead'] > $LoggedUser['Class']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($Forum['CategoryID'] != $LastCategoryID) {
|
||||
$LastCategoryID = $Forum['CategoryID'];
|
||||
if($OpenGroup) { ?>
|
||||
if ($Forum['CategoryID'] != $LastCategoryID) {
|
||||
$LastCategoryID = $Forum['CategoryID'];
|
||||
if($OpenGroup) { ?>
|
||||
</optgroup>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<optgroup label="<?=$ForumCats[$Forum['CategoryID']]?>">
|
||||
<? $OpenGroup = true;
|
||||
}
|
||||
<? $OpenGroup = true;
|
||||
}
|
||||
?>
|
||||
<option value="<?=$Forum['ID']?>"<? if($ThreadInfo['ForumID'] == $Forum['ID']) { echo ' selected="selected"';} ?>><?=display_str($Forum['Name'])?></option>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</optgroup>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<? if(check_perms('site_admin_forums')) { ?>
|
||||
<? if(check_perms('site_admin_forums')) { ?>
|
||||
<tr>
|
||||
<td class="label">Delete thread</td>
|
||||
<td>
|
||||
<input type="checkbox" name="delete" tabindex="2" />
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<tr>
|
||||
<td colspan="2" class="center">
|
||||
<input type="submit" value="Edit thread" tabindex="2" />
|
||||
|
@ -58,6 +58,12 @@
|
||||
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
|
||||
$Link = "torrents.php?id=".$GroupID."&page=".$PageNum."#post".$ID;
|
||||
break;
|
||||
case "artist_comment" :
|
||||
$DB->query("SELECT ac.ArtistID, ac.Body, (SELECT COUNT(ID) FROM artist_comments WHERE ID <= ".$ID." AND artist_comments.ArtistID = ac.ArtistID) AS CommentNum FROM artist_comments AS ac WHERE ID=".$ID);
|
||||
list($ArtistID, $Body, $PostNum) = $DB->next_record();
|
||||
$PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE);
|
||||
$Link = "artist.php?id=".$ArtistID."&page=".$PageNum."#post".$ID;
|
||||
break;
|
||||
case "collages_comment" :
|
||||
$DB->query("SELECT cc.CollageID, cc.Body, (SELECT COUNT(ID) FROM collages_comments WHERE ID <= ".$ID." AND collages_comments.CollageID = cc.CollageID) AS CommentNum FROM collages_comments AS cc WHERE ID=".$ID);
|
||||
list($CollageID, $Body, $PostNum) = $DB->next_record();
|
||||
|
@ -515,90 +515,106 @@
|
||||
<?
|
||||
|
||||
//---------- Begin printing
|
||||
foreach($Thread as $Key => $Post){
|
||||
foreach($Thread as $Key => $Post) {
|
||||
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a href='#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
by <strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?> <a href="reports.php?action=report&type=requests_comment&id=<?=$PostID?>">[Report Comment]</a>
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<div style="float:left;"><a href='#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
by <strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
|
||||
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');">[Quote]</a>
|
||||
<?if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a><? }
|
||||
if (check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a> <? } ?>
|
||||
</span>
|
||||
<span id="bar<?=$PostID?>" style="float:right;">
|
||||
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
|
||||
<? }
|
||||
if (check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div id="bar<?=$PostID?>" style="float:right;">
|
||||
<a href="reports.php?action=report&type=requests_comment&id=<?=$PostID?>">[Report]</a>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if ($Avatar) { ?>
|
||||
<? if ($Avatar) { ?>
|
||||
<img src="<?=$Avatar?>" width="150" alt="<?=$Username ?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($Body)?>
|
||||
<? if($EditedUserID){ ?>
|
||||
<? if ($EditedUserID) { ?>
|
||||
<br />
|
||||
<br />
|
||||
<? if(check_perms('site_moderate_forums')) { ?>
|
||||
<? if(check_perms('site_moderate_forums')) { ?>
|
||||
<a href="#content<?=$PostID?>" onclick="LoadEdit('requests', <?=$PostID?>, 1); return false;">«</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
Last edited by
|
||||
<?=Users::format_username($EditedUserID, false, false, false) ?> <?=time_diff($EditedTime,2,true,true)?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<?
|
||||
if(!$LoggedUser['DisablePosting']) { ?>
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post comment</h3>
|
||||
<div class="box pad" style="padding:20px 10px 10px 10px;">
|
||||
<table id="quickreplypreview" class="hidden forum_post box vertical_margin" id="preview">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?> Just now
|
||||
<a href="#quickreplypreview">[Report Comment]</a>
|
||||
</span>
|
||||
<span style="float:right;">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<div style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<a href="#quickreplypreview">[Report]</a>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<div id="quickreplytext">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
|
@ -61,6 +61,7 @@
|
||||
<? } if (check_perms('admin_manage_permissions')) { ?>
|
||||
<tr><td><a href="tools.php?action=special_users">Special Users</a></td></tr>
|
||||
|
||||
<? } ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="permission_container">
|
||||
|
@ -126,7 +126,7 @@
|
||||
</div>
|
||||
<?
|
||||
|
||||
if ($_GET['anyall'] == 'any') {
|
||||
if ($_GET['anyall'] == 'any' && !empty($Where)) {
|
||||
$Where = '('.implode(' OR ', $Where).')';
|
||||
} else {
|
||||
$Where = implode(' AND ', $Where);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
if(!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
|
||||
$Details = 'all';
|
||||
$Limit = 10;
|
||||
$Limit = 25;
|
||||
|
||||
if($_GET['tags']) {
|
||||
$Tags = explode(',', str_replace(".","_",trim($_GET['tags'])));
|
||||
@ -28,12 +28,12 @@
|
||||
} else {
|
||||
$Details = 'all';
|
||||
// defaults to 10 (duh)
|
||||
$Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
|
||||
$Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
|
||||
$Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 25;
|
||||
$Limit = in_array($Limit, array(25, 100, 250)) ? $Limit : 25;
|
||||
}
|
||||
$Filtered = !empty($Where);
|
||||
|
||||
if ($_GET['anyall'] == 'any') {
|
||||
if ($_GET['anyall'] == 'any' && !empty($Where)) {
|
||||
$Where = '('.implode(' OR ', $Where).')';
|
||||
} else {
|
||||
$Where = implode(' AND ', $Where);
|
||||
@ -143,17 +143,17 @@
|
||||
<?
|
||||
switch($Limit) {
|
||||
case 100: ?>
|
||||
- [<a href="top10.php?type=votes">Top 10</a>]
|
||||
- [<a href="top10.php?type=votes">Top 25</a>]
|
||||
- [Top 100]
|
||||
- [<a href="top10.php?type=votes&limit=250">Top 250</a>]
|
||||
<? break;
|
||||
case 250: ?>
|
||||
- [<a href="top10.php?type=votes">Top 10</a>]
|
||||
- [<a href="top10.php?type=votes">Top 25</a>]
|
||||
- [<a href="top10.php?type=votes&limit=100">Top 100</a>]
|
||||
- [Top 250]
|
||||
<? break;
|
||||
default: ?>
|
||||
- [Top 10]
|
||||
- [Top 25]
|
||||
- [<a href="top10.php?type=votes&limit=100">Top 100</a>]
|
||||
- [<a href="top10.php?type=votes&limit=250">Top 250</a>]
|
||||
<? } ?>
|
||||
@ -221,7 +221,7 @@
|
||||
<? } ?>
|
||||
<?=$TorrentTags?>
|
||||
</td>
|
||||
<td colspan="4" class="votes_info_td"><strong><?=$Ups?></strong> upvotes out of <strong><?=$Total?></strong> total (Score: <?=round($Score*100)?>).</td>
|
||||
<td colspan="4" class="votes_info_td"><strong><?=$Ups?></strong> upvotes out of <strong><?=$Total?></strong> total (<span title="Score: <?=round($Score*100,4)?>">Score: <?=round($Score*100)?></span>).</td>
|
||||
</tr>
|
||||
<?
|
||||
$LastRemasterYear = '-';
|
||||
|
@ -141,7 +141,7 @@ function compare($X, $Y){
|
||||
foreach($Artists[4] as $Artist) {
|
||||
?>
|
||||
<li class="artists_composers">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
@ -149,7 +149,7 @@ function compare($X, $Y){
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=4');this.parentNode.parentNode.style.display = 'none';" title="Remove artist">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -160,17 +160,17 @@ function compare($X, $Y){
|
||||
foreach($Artists[6] as $Artist) {
|
||||
?>
|
||||
<li class="artists_dj">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=6');this.parentNode.parentNode.style.display = 'none';" title="Remove artist">[X]</a></span>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
}
|
||||
@ -183,14 +183,14 @@ function compare($X, $Y){
|
||||
foreach($Artists[1] as $Artist) {
|
||||
?>
|
||||
<li class="artist_main">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$AliasID = $Artist['aliasid'];
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=1');this.parentNode.parentNode.style.display = 'none';" title="Remove artist">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -201,7 +201,7 @@ function compare($X, $Y){
|
||||
foreach($Artists[2] as $Artist) {
|
||||
?>
|
||||
<li class="artist_guest">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
@ -209,7 +209,7 @@ function compare($X, $Y){
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=2');this.parentNode.parentNode.style.display = 'none';" title="Remove artist">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -221,7 +221,7 @@ function compare($X, $Y){
|
||||
foreach($Artists[5] as $Artist) {
|
||||
?>
|
||||
<li class="artists_conductors">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
@ -229,7 +229,7 @@ function compare($X, $Y){
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=5');this.parentNode.parentNode.style.display = 'none';" title="Remove conductor">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -241,7 +241,7 @@ function compare($X, $Y){
|
||||
foreach($Artists[3] as $Artist) {
|
||||
?>
|
||||
<li class="artists_remix">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
@ -249,7 +249,7 @@ function compare($X, $Y){
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=3');this.parentNode.parentNode.style.display = 'none';" title="Remove artist">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -261,7 +261,7 @@ function compare($X, $Y){
|
||||
foreach($Artists[7] as $Artist) {
|
||||
?>
|
||||
<li class="artists_producer">
|
||||
<?=Artists::display_artist($Artist).'‎'?>
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if(check_perms('torrents_edit')){
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
@ -269,7 +269,7 @@ function compare($X, $Y){
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=7');this.parentNode.parentNode.style.display = 'none';" title="Remove producer">[X]</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
@ -305,7 +305,9 @@ function compare($X, $Y){
|
||||
</div>
|
||||
</div>
|
||||
<? }
|
||||
}?>
|
||||
}
|
||||
include(SERVER_ROOT.'/sections/torrents/vote.php');
|
||||
?>
|
||||
<div class="box box_tags">
|
||||
<div class="head"><strong>Tags</strong></div>
|
||||
<?
|
||||
@ -357,8 +359,7 @@ function compare($X, $Y){
|
||||
<strong><a href="rules.php?p=tag">Tagging rules</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<? include(SERVER_ROOT.'/sections/torrents/vote.php'); ?>
|
||||
|
||||
</div>
|
||||
<div class="main_column">
|
||||
<table class="torrent_table details" id="torrent_details">
|
||||
@ -797,83 +798,97 @@ function filelist($Str) {
|
||||
<?
|
||||
|
||||
//---------- Begin printing
|
||||
foreach($Thread as $Key => $Post){
|
||||
foreach($Thread as $Key => $Post) {
|
||||
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
<colgroup>
|
||||
<? if (empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a class="post_id" href='torrents.php?id=<?=$GroupID?>&postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?> <a href="reports.php?action=report&type=torrents_comment&id=<?=$PostID?>">[Report]</a>
|
||||
<? if(check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if($LoggedUser['Class'] >= $AuthorInfo['Class']) { ?>
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="$('#warn<?=$PostID?>').raw().submit(); return false;">[Warn]</a>
|
||||
|
||||
<? }
|
||||
} ?>
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<div style="float:left;"><a class="post_id" href="torrents.php?id=<?=$GroupID?>&postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
|
||||
<strong><?=Users::format_username($AuthorID, true, true, true, true)?></strong> <?=time_diff($AddedTime)?>
|
||||
- <a href="#quickpost" onclick="Quote('<?=$PostID?>','<?=$Username?>');">[Quote]</a>
|
||||
<?if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a><? }
|
||||
if (check_perms('site_moderate_forums')){ ?> - <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a> <? } ?>
|
||||
</span>
|
||||
<span id="bar<?=$PostID?>" style="float:right;">
|
||||
<? if ($AuthorID == $LoggedUser['ID'] || check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Edit_Form('<?=$PostID?>','<?=$Key?>');">[Edit]</a>
|
||||
<? }
|
||||
if (check_perms('site_moderate_forums')) { ?>
|
||||
- <a href="#post<?=$PostID?>" onclick="Delete('<?=$PostID?>');">[Delete]</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
<div id="bar<?=$PostID?>" style="float:right;">
|
||||
<a href="reports.php?action=report&type=torrents_comment&id=<?=$PostID?>">[Report]</a>
|
||||
<? if (check_perms('users_warn') && $AuthorID != $LoggedUser['ID']) {
|
||||
$AuthorInfo = Users::user_info($AuthorID);
|
||||
if ($LoggedUser['Class'] >= $AuthorInfo['Class']) {
|
||||
?>
|
||||
<form class="manage_form hidden" name="user" id="warn<?=$PostID?>" action="" method="post">
|
||||
<input type="hidden" name="action" value="warn" />
|
||||
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
|
||||
<input type="hidden" name="postid" value="<?=$PostID?>" />
|
||||
<input type="hidden" name="userid" value="<?=$AuthorID?>" />
|
||||
<input type="hidden" name="key" value="<?=$Key?>" />
|
||||
</form>
|
||||
- <a href="#" onclick="$('#warn<?=$PostID?>').raw().submit(); return false;">[Warn]</a>
|
||||
<? }
|
||||
}
|
||||
?>
|
||||
|
||||
<a href="#">↑</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class="avatar" valign="top">
|
||||
<? if ($Avatar) { ?>
|
||||
<? if ($Avatar) { ?>
|
||||
<img src="<?=$Avatar?>" width="150" alt="<?=$Username ?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<? } ?>
|
||||
<td class="body" valign="top">
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($Body)?>
|
||||
<? if($EditedUserID){ ?>
|
||||
<? if ($EditedUserID) { ?>
|
||||
<br />
|
||||
<br />
|
||||
<? if(check_perms('site_admin_forums')) { ?>
|
||||
<? if (check_perms('site_admin_forums')) { ?>
|
||||
<a href="#content<?=$PostID?>" onclick="LoadEdit('torrents', <?=$PostID?>, 1); return false;">«</a>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
Last edited by
|
||||
<?=Users::format_username($EditedUserID, false, false, false) ?> <?=time_diff($EditedTime,2,true,true)?>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
<div class="linkbox">
|
||||
<?=$Pages?>
|
||||
</div>
|
||||
<?
|
||||
if(!$LoggedUser['DisablePosting']) { ?>
|
||||
<? if (!$LoggedUser['DisablePosting']) { ?>
|
||||
<br />
|
||||
<div id="reply_box">
|
||||
<h3>Post reply</h3>
|
||||
<div class="box pad">
|
||||
<table id="quickreplypreview" class="forum_post box vertical_margin hidden" style="text-align:left;">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;"><a href='#quickreplypreview'>#XXXXXX</a>
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
by <strong><?=Users::format_username($LoggedUser['ID'], true, true, true, true)?></strong> Just now
|
||||
<a href="#quickreplypreview">[Report Comment]</a>
|
||||
</span>
|
||||
<span id="barpreview" style="float:right;">
|
||||
@ -883,18 +898,18 @@ function filelist($Str) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="avatar" valign="top">
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<? if (!empty($LoggedUser['Avatar'])) { ?>
|
||||
<img src="<?=$LoggedUser['Avatar']?>" width="150" alt="<?=$LoggedUser['Username']?>'s avatar" />
|
||||
<? } else { ?>
|
||||
<? } else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</td>
|
||||
<td class="body" valign="top">
|
||||
<div id="contentpreview" style="text-align:left;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<form class="send_form center" name="reply" id="quickpostform" action="" onsubmit="quickpostform.submit_button.disabled=true;" method="post">
|
||||
<div id="quickreplytext">
|
||||
<input type="hidden" name="action" value="reply" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
|
@ -5,7 +5,7 @@
|
||||
$Top10 = $Cache->get_value('similar_albums_'.$GroupID);
|
||||
if ($Top10 === False) {
|
||||
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID);
|
||||
$VotePairs = $Cache->get_value('vote_pairs_'.$GroupID, true);
|
||||
if ($VotePairs === False) {
|
||||
$DB->query("SELECT v.GroupID, SUM(IF(v.Type='Up',1,0)) AS Ups, COUNT(1) AS Total
|
||||
FROM (SELECT UserID FROM users_votes WHERE GroupID = $GroupID AND Type='Up') AS a
|
||||
|
@ -8,6 +8,9 @@
|
||||
$DB->query("SELECT COUNT(ID) FROM torrents_comments WHERE AuthorID='$UserID'");
|
||||
list($NumComments) = $DB->next_record();
|
||||
|
||||
$DB->query("SELECT COUNT(ID) FROM artist_comments WHERE AuthorID='$UserID'");
|
||||
list($NumArtistComments) = $DB->next_record();
|
||||
|
||||
$DB->query("SELECT COUNT(ID) FROM collages WHERE Deleted='0' AND UserID='$UserID'");
|
||||
list($NumCollages) = $DB->next_record();
|
||||
|
||||
@ -31,6 +34,14 @@
|
||||
?> title="View">View</a>]
|
||||
<? } ?>
|
||||
</li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('torrentcomments+'))) { ?>
|
||||
<li <?= $Override===2 ? 'class="paranoia_override"' : ''?>>Artist comments: <?=number_format($NumArtistComments)?>
|
||||
<? if($Override=check_paranoia_here('torrentcomments')) { ?>[<a href="comments.php?id=<?=$UserID?>&action=artists" <?= $Override===2 ? 'class="paranoia_override"'
|
||||
: ''
|
||||
?> title="View">View</a>]
|
||||
<? } ?>
|
||||
</li>
|
||||
<? }
|
||||
if (($Override=check_paranoia_here('collages+'))) { ?>
|
||||
<li <?= $Override===2 ? 'class="paranoia_override"' : ''?>>Collages started: <?=number_format($NumCollages)?>
|
||||
|
@ -254,8 +254,14 @@
|
||||
while(list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()){
|
||||
?>
|
||||
<table class="forum_post vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID ?>">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;">
|
||||
<?=time_diff($AddedTime) ?>
|
||||
in <a href="forums.php?action=viewthread&threadid=<?=$TopicID?>&postid=<?=$PostID?>#post<?=$PostID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a>
|
||||
|
@ -140,8 +140,14 @@
|
||||
while(list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()){
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>">
|
||||
<colgroup>
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<col class="col_avatar" />
|
||||
<? } ?>
|
||||
<col class="col_post_body" />
|
||||
</colgroup>
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<td colspan="<?=empty($HeavyInfo['DisableAvatars']) ? 2 : 1?>">
|
||||
<span style="float:left;">
|
||||
<a href="forums.php?action=viewforum&forumid=<?=$ForumID?>"><?=$ForumName?></a> >
|
||||
<a href="forums.php?action=viewthread&threadid=<?=$TopicID?>" title="<?=display_str($ThreadTitle)?>"><?=Format::cut_string($ThreadTitle, 75)?></a>
|
||||
|
@ -68,7 +68,7 @@
|
||||
|
||||
?>
|
||||
<div class="header">
|
||||
<h2>Freeleech token history for <?=Users::format_username($UserID, true, true, true)?></h2>
|
||||
<h2>Freeleech token history for <?=Users::format_username($UserID, false, false, false)?></h2>
|
||||
</div>
|
||||
<div class="linkbox"><?=$Pages?></div>
|
||||
<table>
|
||||
|
@ -34,7 +34,7 @@ function Edit_Form(post,key) {
|
||||
$('#reply_box').toggle();
|
||||
postid = post;
|
||||
if (location.href.match(/torrents\.php/) ||
|
||||
location.href.match(/artist\.php/)) {
|
||||
location.href.match(/artist\.php/)) {
|
||||
boxWidth="50";
|
||||
} else {
|
||||
boxWidth="80";
|
||||
|
@ -1,14 +1,13 @@
|
||||
function say() {
|
||||
ajax.get("ajax.php?action=rippy", function(message) {
|
||||
if (message) {
|
||||
$('#rippywrap').raw().style.display = "inline";
|
||||
$('#rippy-says').raw().innerHTML = message;
|
||||
$('#bubble').raw().style.display = "block";
|
||||
} else {
|
||||
$('#bubble').raw().style.display = "none";
|
||||
|
||||
}
|
||||
});
|
||||
ajax.get("ajax.php?action=rippy", function (message) {
|
||||
if(message) {
|
||||
$('#rippy-says').raw().innerHTML = message;
|
||||
$('#bubble').raw().style.display = "block";
|
||||
} else {
|
||||
$('#bubble').raw().style.display = "none";
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function rippyclick() {
|
||||
|
@ -624,6 +624,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post td,
|
||||
#userhistory .forum_post td,
|
||||
#collage .forum_post td,
|
||||
#artist .forum_post td,
|
||||
#torrents .forum_post td,
|
||||
#comments .forum_post td,
|
||||
#requests .forum_post td {
|
||||
@ -641,9 +642,11 @@ ul#userinfo_username {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.col_avatar,
|
||||
#forums .forum_post td.avatar,
|
||||
#userhistory .forum_post td.avatar,
|
||||
#collage .forum_post td.avatar,
|
||||
#artist .forum_post td.avatar,
|
||||
#torrents .forum_post td.avatar,
|
||||
#comments .forum_post td.avatar,
|
||||
#requests .forum_post td.avatar {
|
||||
@ -656,6 +659,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post blockquote,
|
||||
#userhistory .forum_post blockquote,
|
||||
#collage .forum_post blockquote,
|
||||
#artist .forum_post blockquote,
|
||||
#torrents .forum_post blockquote,
|
||||
#comments .forum_post blockquote,
|
||||
#requests .forum_post blockquote,
|
||||
@ -669,6 +673,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post blockquote.spoiler,
|
||||
#userhistory .forum_post blockquote.spoiler,
|
||||
#collage .forum_post blockquote.spoiler,
|
||||
#artist .forum_post blockquote.spoiler,
|
||||
#torrents .forum_post blockquote.spoiler,
|
||||
#comments .forum_post blockquote.spoiler,
|
||||
#requests .forum_post blockquote.spoiler,
|
||||
@ -680,6 +685,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post .body,
|
||||
#userhistory .forum_post .body,
|
||||
#collage .forum_post .body,
|
||||
#artist .forum_post .body,
|
||||
#torrents .forum_post .body,
|
||||
#comments .forum_post .body,
|
||||
#requests .forum_post .body {
|
||||
@ -691,6 +697,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post,
|
||||
#userhistory .forum_post,
|
||||
#collage .forum_post,
|
||||
#artist .forum_post,
|
||||
#torrents .forum_post,
|
||||
#comments .forum_post,
|
||||
#requests .forum_post {
|
||||
@ -700,6 +707,7 @@ ul#userinfo_username {
|
||||
#forums .forum_post td,
|
||||
#userhistory .forum_post td,
|
||||
#collage .forum_post td,
|
||||
#artist .forum_post td,
|
||||
#torrents .forum_post td,
|
||||
#comments .forum_post td,
|
||||
#requests .forum_post td {
|
||||
@ -709,6 +717,7 @@ ul#userinfo_username {
|
||||
|
||||
#forums .forum_post .body div,
|
||||
#collage .forum_post .body div,
|
||||
#artist .forum_post .body div,
|
||||
#torrents .forum_post .body div,
|
||||
#userhistory .forum_post .body,
|
||||
#comments .forum_post .body,
|
||||
@ -720,6 +729,7 @@ ul#userinfo_username {
|
||||
|
||||
#forums .forum_post .body div a,
|
||||
#collage .forum_post .body div a,
|
||||
#artist .forum_post .body div a,
|
||||
#torrents .forum_post .body div a,
|
||||
#userhistory .forum_post .body a,
|
||||
#comments .forum_post .body div a,
|
||||
@ -727,6 +737,12 @@ ul#userinfo_username {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#artist .forum_post .body textarea,
|
||||
#torrents .forum_post .body textarea,
|
||||
#requests .forum_post .body textarea {
|
||||
width: 420px !important;
|
||||
}
|
||||
|
||||
#userhistory .forum_post .body {
|
||||
padding: 20px 20px 20px 40px;
|
||||
}
|
||||
@ -744,6 +760,7 @@ ul#userinfo_username {
|
||||
|
||||
#forums .forum_post .body div div,
|
||||
#collage .forum_post .body div div,
|
||||
#artist .forum_post .body div div,
|
||||
#torrents .forum_post .body div div{
|
||||
background: none;
|
||||
padding: 0;
|
||||
@ -1014,6 +1031,7 @@ strong.quoteheader {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#artist #content .center .box form div textarea,
|
||||
#torrents #content .center .box form div textarea,
|
||||
#wiki #content .center .box form div textarea,
|
||||
#upload textarea#album_desc,
|
||||
|
Loading…
Reference in New Issue
Block a user