mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 20:21:37 +00:00
Empty commit
This commit is contained in:
parent
c1294d48b1
commit
2380381c26
@ -9,6 +9,7 @@
|
|||||||
class DEBUG {
|
class DEBUG {
|
||||||
public $Errors = array();
|
public $Errors = array();
|
||||||
public $Flags = array();
|
public $Flags = array();
|
||||||
|
public $Perf = array();
|
||||||
private $LoggedVars = array();
|
private $LoggedVars = array();
|
||||||
|
|
||||||
public function profile($Automatic='') {
|
public function profile($Automatic='') {
|
||||||
@ -44,6 +45,15 @@ public function profile($Automatic='') {
|
|||||||
$Reason[] = 'Requested by '.$LoggedUser['Username'];
|
$Reason[] = 'Requested by '.$LoggedUser['Username'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->Perf['Memory usage'] = (($Ram>>10)/1024)." MB";
|
||||||
|
$this->Perf['Page process time'] = (round($Micro)/1000)." s";
|
||||||
|
|
||||||
|
if (!defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||||
|
global $CPUTimeStart;
|
||||||
|
$RUsage = getrusage();
|
||||||
|
$this->Perf['CPU time'] = (round(($RUsage["ru_utime.tv_sec"]*1000000 + $RUsage['ru_utime.tv_usec'] - $CPUTimeStart)/1000)/1000)." s";
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($Reason[0])) {
|
if (isset($Reason[0])) {
|
||||||
$this->analysis(implode(', ', $Reason));
|
$this->analysis(implode(', ', $Reason));
|
||||||
return true;
|
return true;
|
||||||
@ -68,7 +78,8 @@ public function analysis($Message, $Report='', $Time=43200) {
|
|||||||
'flags' => $this->get_flags(),
|
'flags' => $this->get_flags(),
|
||||||
'includes' => $this->get_includes(),
|
'includes' => $this->get_includes(),
|
||||||
'cache' => $this->get_cache_keys(),
|
'cache' => $this->get_cache_keys(),
|
||||||
'vars' => $this->get_logged_vars()
|
'vars' => $this->get_logged_vars(),
|
||||||
|
'perf' => $this->get_perf()
|
||||||
),
|
),
|
||||||
$Time
|
$Time
|
||||||
);
|
);
|
||||||
@ -187,6 +198,10 @@ public function php_error_handler($Level, $Error, $File, $Line) {
|
|||||||
|
|
||||||
/* Data wrappers */
|
/* Data wrappers */
|
||||||
|
|
||||||
|
public function get_perf() {
|
||||||
|
return $this->Perf;
|
||||||
|
}
|
||||||
|
|
||||||
public function get_flags() {
|
public function get_flags() {
|
||||||
return $this->Flags;
|
return $this->Flags;
|
||||||
}
|
}
|
||||||
@ -272,6 +287,34 @@ public function get_logged_vars() {
|
|||||||
|
|
||||||
/* Output Formatting */
|
/* Output Formatting */
|
||||||
|
|
||||||
|
public function perf_table($Perf=false) {
|
||||||
|
if (!is_array($Perf)) {
|
||||||
|
$Perf = $this->get_perf();
|
||||||
|
}
|
||||||
|
if (empty($Perf)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<table class="layout" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td align="left"><strong><a href="#" onclick="$('#debug_perf').toggle();return false;">(View)</a> Performance stats:</strong></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table id="debug_perf" class="debug_table hidden" width="100%">
|
||||||
|
<?
|
||||||
|
foreach ($Perf as $Stat => $Value) {
|
||||||
|
?>
|
||||||
|
<tr valign="top">
|
||||||
|
<td class="debug_perf_stat"><?=$Stat?></td>
|
||||||
|
<td class="debug_perf_data"><?=$Value?></td>
|
||||||
|
</tr>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
<?
|
||||||
|
}
|
||||||
|
|
||||||
public function include_table($Includes=false) {
|
public function include_table($Includes=false) {
|
||||||
if (!is_array($Includes)) {
|
if (!is_array($Includes)) {
|
||||||
$Includes = $this->get_includes();
|
$Includes = $this->get_includes();
|
||||||
|
@ -126,9 +126,6 @@ public function header ()
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h2><?=display_str($this->Heading)?></h2>
|
<h2><?=display_str($this->Heading)?></h2>
|
||||||
</div>
|
</div>
|
||||||
<script src="static/functions/jquery-ui.js" type="text/javascript"></script>
|
|
||||||
<script src="static/functions/jquery.tablesorter.min.js" type="text/javascript"></script>
|
|
||||||
<script src="static/functions/sort.js" type="text/javascript"></script>
|
|
||||||
|
|
||||||
<table width="100%" class="layout">
|
<table width="100%" class="layout">
|
||||||
<tr class="colhead"><td id="sorting_head">Sorting</td></tr>
|
<tr class="colhead"><td id="sorting_head">Sorting</td></tr>
|
||||||
@ -157,8 +154,8 @@ public function header ()
|
|||||||
<th style="width:1%"><span>Year</span></th>
|
<th style="width:1%"><span>Year</span></th>
|
||||||
<th style="width:15%"><span>Artist</span></th>
|
<th style="width:15%"><span>Artist</span></th>
|
||||||
<th><span>Torrent</span></th>
|
<th><span>Torrent</span></th>
|
||||||
<th style="width:1%"><span>User</span></th>
|
<th style="width:5%"><span>Bookmarked</span></th>
|
||||||
<th style="width:3%" id="check_all"><span>Remove</span></th>
|
<th style="width:1%" id="check_all"><span>Remove</span></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -200,6 +197,7 @@ public function body ()
|
|||||||
if ($this->HasTorrents)
|
if ($this->HasTorrents)
|
||||||
foreach ($this->TorrentList as $GroupID => $Group) {
|
foreach ($this->TorrentList as $GroupID => $Group) {
|
||||||
$Artists = array();
|
$Artists = array();
|
||||||
|
|
||||||
extract($Group);
|
extract($Group);
|
||||||
extract($this->CollageDataList[$GroupID]);
|
extract($this->CollageDataList[$GroupID]);
|
||||||
|
|
||||||
@ -208,8 +206,9 @@ public function body ()
|
|||||||
$DisplayName = self::display_name($ExtendedArtists, $Artists, $VanityHouse);
|
$DisplayName = self::display_name($ExtendedArtists, $Artists, $VanityHouse);
|
||||||
$TorrentLink = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$Name.'</a>';
|
$TorrentLink = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$Name.'</a>';
|
||||||
$Year = $Year > 0 ? $Year : '';
|
$Year = $Year > 0 ? $Year : '';
|
||||||
|
$DateAdded = date($Time);
|
||||||
|
|
||||||
$this->row($Sort, $GroupID, $Year, $DisplayName, $TorrentLink);
|
$this->row($Sort, $GroupID, $Year, $DisplayName, $TorrentLink, $DateAdded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +221,7 @@ public function body ()
|
|||||||
* @param string $DisplayName
|
* @param string $DisplayName
|
||||||
* @param string $TorrentLink
|
* @param string $TorrentLink
|
||||||
*/
|
*/
|
||||||
public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink)
|
public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink, $DateAdded)
|
||||||
{
|
{
|
||||||
$CSS = $this->NumGroups % 2 === 0 ? 'rowa' : 'rowb';
|
$CSS = $this->NumGroups % 2 === 0 ? 'rowa' : 'rowb';
|
||||||
?>
|
?>
|
||||||
@ -232,10 +231,10 @@ public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink)
|
|||||||
<input class="sort_numbers" type="text" name="sort[<?=$GroupID?>]" value="<?=$Sort?>" id="sort_<?=$GroupID?>" size="4" />
|
<input class="sort_numbers" type="text" name="sort[<?=$GroupID?>]" value="<?=$Sort?>" id="sort_<?=$GroupID?>" size="4" />
|
||||||
</td>
|
</td>
|
||||||
<td><?=$this->NumGroups?></td>
|
<td><?=$this->NumGroups?></td>
|
||||||
<td><?=trim($GroupYear)?></td>
|
<td><?=$GroupYear?trim($GroupYear):' '?></td>
|
||||||
<td><?=trim($DisplayName)?></td>
|
<td><?=$DisplayName?trim($DisplayName):' '?></td>
|
||||||
<td><?=trim($TorrentLink)?></td>
|
<td><?=$TorrentLink?trim($TorrentLink):' '?></td>
|
||||||
<td class="nobr"><?=Users::format_username($this->UserID, false, false, false)?></td>
|
<td class="nobr" title="<?=$DateAdded?>"><?=$DateAdded?time_diff($DateAdded):' '?></td>
|
||||||
<td class="center"><input type="checkbox" name="remove[<?=$GroupID?>]" value="" /></td>
|
<td class="center"><input type="checkbox" name="remove[<?=$GroupID?>]" value="" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
|
@ -47,7 +47,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
|||||||
$Key = $Torrents ? 'torrent_group_' : 'torrent_group_light_';
|
$Key = $Torrents ? 'torrent_group_' : 'torrent_group_light_';
|
||||||
|
|
||||||
foreach ($GroupIDs as $GroupID) {
|
foreach ($GroupIDs as $GroupID) {
|
||||||
$Data = $Cache->get_value($Key.$GroupID);
|
$Data = $Cache->get_value($Key.$GroupID, true);
|
||||||
if (!empty($Data) && (@$Data['ver'] >= 4)) {
|
if (!empty($Data) && (@$Data['ver'] >= 4)) {
|
||||||
unset($NotFound[$GroupID]);
|
unset($NotFound[$GroupID]);
|
||||||
$Found[$GroupID] = $Data['d'];
|
$Found[$GroupID] = $Data['d'];
|
||||||
@ -93,11 +93,14 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
|||||||
RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding, ID");
|
RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding, ID");
|
||||||
while($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) {
|
while($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) {
|
||||||
$Found[$Torrent['GroupID']]['Torrents'][$Torrent['ID']] = $Torrent;
|
$Found[$Torrent['GroupID']]['Torrents'][$Torrent['ID']] = $Torrent;
|
||||||
|
}
|
||||||
|
|
||||||
$Cache->cache_value('torrent_group_'.$Torrent['GroupID'],
|
// Cache it all
|
||||||
array('ver'=>4, 'd'=>$Found[$Torrent['GroupID']]), 0);
|
foreach ($Found as $GroupID=>$GroupInfo) {
|
||||||
$Cache->cache_value('torrent_group_light_'.$Torrent['GroupID'],
|
$Cache->cache_value('torrent_group_'.$GroupID,
|
||||||
array('ver'=>4, 'd'=>$Found[$Torrent['GroupID']]), 0);
|
array('ver'=>4, 'd'=>$GroupInfo), 0);
|
||||||
|
$Cache->cache_value('torrent_group_light_'.$GroupID,
|
||||||
|
array('ver'=>4, 'd'=>$GroupInfo), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -580,17 +583,23 @@ public static function has_snatched($TorrentID) {
|
|||||||
// This bucket hasn't been checked before
|
// This bucket hasn't been checked before
|
||||||
$CurSnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID.'_'.$BucketID, true);
|
$CurSnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID.'_'.$BucketID, true);
|
||||||
if ($CurSnatchedTorrents === false || $CurTime - $LastUpdate > 1800) {
|
if ($CurSnatchedTorrents === false || $CurTime - $LastUpdate > 1800) {
|
||||||
if ($CurSnatchedTorrents === false) {
|
$Updated = array();
|
||||||
|
if ($CurSnatchedTorrents === false || $LastUpdate == 0) {
|
||||||
|
for ($i = 0; $i < $Buckets; $i++) {
|
||||||
|
$SnatchedTorrents[$i] = array();
|
||||||
|
}
|
||||||
// Not found in cache. Since we don't have a suitable index, it's faster to update everything
|
// Not found in cache. Since we don't have a suitable index, it's faster to update everything
|
||||||
$DB->query("SELECT fid, tstamp AS TorrentID FROM xbt_snatched WHERE uid='$UserID'");
|
$DB->query("SELECT fid, tstamp AS TorrentID FROM xbt_snatched WHERE uid='$UserID'");
|
||||||
|
while (list($ID) = $DB->next_record(MYSQLI_NUM, false)) {
|
||||||
|
$SnatchedTorrents[$ID & $LastBucket][(int)$ID] = true;
|
||||||
|
}
|
||||||
|
$Updated = array_fill(0, $Buckets, true);
|
||||||
} elseif (isset($CurSnatchedTorrents[$TorrentID])) {
|
} elseif (isset($CurSnatchedTorrents[$TorrentID])) {
|
||||||
// Old cache, but torrent is snatched, so no need to update
|
// Old cache, but torrent is snatched, so no need to update
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Old cache, check if torrent has been snatched recently
|
// Old cache, check if torrent has been snatched recently
|
||||||
$DB->query("SELECT fid AS TorrentID FROM xbt_snatched WHERE uid='$UserID' AND tstamp>=".$LastUpdate);
|
$DB->query("SELECT fid FROM xbt_snatched WHERE uid='$UserID' AND tstamp>=$LastUpdate");
|
||||||
}
|
|
||||||
$Updated = array();
|
|
||||||
while (list($ID) = $DB->next_record(MYSQLI_NUM, false)) {
|
while (list($ID) = $DB->next_record(MYSQLI_NUM, false)) {
|
||||||
$CurBucketID = $ID & $LastBucket;
|
$CurBucketID = $ID & $LastBucket;
|
||||||
if ($SnatchedTorrents[$CurBucketID] === false) {
|
if ($SnatchedTorrents[$CurBucketID] === false) {
|
||||||
@ -602,15 +611,8 @@ public static function has_snatched($TorrentID) {
|
|||||||
$SnatchedTorrents[$CurBucketID][(int)$ID] = true;
|
$SnatchedTorrents[$CurBucketID][(int)$ID] = true;
|
||||||
$Updated[$CurBucketID] = true;
|
$Updated[$CurBucketID] = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for ($i = 0; $i < $Buckets; $i++) {
|
for ($i = 0; $i < $Buckets; $i++) {
|
||||||
if (empty($SnatchedTorrents[$i])) {
|
|
||||||
$SnatchedTorrents[$i] = $Cache->get_value('users_snatched_'.$UserID.'_'.$i, true);
|
|
||||||
if ($SnatchedTorrents[$i] === false) {
|
|
||||||
// No snatched torrents with this bucket number
|
|
||||||
$SnatchedTorrents[$i] = array();
|
|
||||||
$Updated[$i] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($Updated[$i]) {
|
if ($Updated[$i]) {
|
||||||
$Cache->cache_value('users_snatched_'.$UserID.'_'.$i, $SnatchedTorrents[$i], 0);
|
$Cache->cache_value('users_snatched_'.$UserID.'_'.$i, $SnatchedTorrents[$i], 0);
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$ScriptStartTime=microtime(true); //To track how long a page takes to create
|
$ScriptStartTime = microtime(true); //To track how long a page takes to create
|
||||||
|
if (!defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||||
|
$RUsage = getrusage();
|
||||||
|
$CPUTimeStart = $RUsage["ru_utime.tv_sec"]*1000000 + $RUsage['ru_utime.tv_usec'];
|
||||||
|
}
|
||||||
ob_start(); //Start a buffer, mainly in case there is a mysql error
|
ob_start(); //Start a buffer, mainly in case there is a mysql error
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,9 +205,9 @@
|
|||||||
$DB->query($sql);
|
$DB->query($sql);
|
||||||
list($QuoteNotificationsCount) = $DB->next_record();
|
list($QuoteNotificationsCount) = $DB->next_record();
|
||||||
$Cache->cache_value('forums_quotes_'.$LoggedUser['ID'], $QuoteNotificationsCount, 0);
|
$Cache->cache_value('forums_quotes_'.$LoggedUser['ID'], $QuoteNotificationsCount, 0);
|
||||||
if($QuoteNotificationsCount > 0) {
|
|
||||||
$Alerts[] = '<a href="userhistory.php?action=quote_notifications">'. 'New Quote'. ($QuoteNotificationsCount > 1 ? 's' : '');
|
|
||||||
}
|
}
|
||||||
|
if($QuoteNotificationsCount > 0) {
|
||||||
|
$Alerts[] = '<a href="userhistory.php?action=quote_notifications">'. 'New Quote'. ($QuoteNotificationsCount > 1 ? 's' : '') . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,6 +516,8 @@ function compare($X, $Y){
|
|||||||
<a href="artist.php?action=edit&artistid=<?=$ArtistID?>">[Edit]</a>
|
<a href="artist.php?action=edit&artistid=<?=$ArtistID?>">[Edit]</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
<a href="artist.php?action=history&artistid=<?=$ArtistID?>">[View history]</a>
|
<a href="artist.php?action=history&artistid=<?=$ArtistID?>">[View history]</a>
|
||||||
|
<a href="artist.php?id=<?=$ArtistID?>#info">[Info]</a>
|
||||||
|
<a href="artist.php?id=<?=$ArtistID?>#artistcomments">[Comments]</a>
|
||||||
<? if (check_perms('site_delete_artist') && check_perms('torrents_delete')) { ?>
|
<? if (check_perms('site_delete_artist') && check_perms('torrents_delete')) { ?>
|
||||||
<a href="artist.php?action=delete&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>">[Delete]</a>
|
<a href="artist.php?action=delete&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>">[Delete]</a>
|
||||||
<? }
|
<? }
|
||||||
@ -891,8 +893,11 @@ function require(file, callback) {
|
|||||||
|
|
||||||
<? } // if $NumSimilar>0 ?>
|
<? } // if $NumSimilar>0 ?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="head"><strong>Artist info</strong></div>
|
<div id="info" class="head">
|
||||||
<div class="body"><?=$Text->full_format($Body)?></div>
|
<strong>Artist info</strong>
|
||||||
|
<a href="#" onclick="$('#body').toggle(); return false;">[Toggle]</a>
|
||||||
|
</div>
|
||||||
|
<div id="body" class="body"><?=$Text->full_format($Body)?></div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
// --- Comments ---
|
// --- Comments ---
|
||||||
@ -945,7 +950,7 @@ function require(file, callback) {
|
|||||||
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
|
//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);
|
$Thread = array_slice($Catalogue,((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)%THREAD_CATALOGUE),TORRENT_COMMENTS_PER_PAGE,true);
|
||||||
?>
|
?>
|
||||||
<div class="linkbox">
|
<div id="artistcomments" class="linkbox">
|
||||||
<a name="comments"></a>
|
<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');
|
||||||
|
@ -79,6 +79,57 @@
|
|||||||
include(SERVER_ROOT.'/sections/artist/take_warn.php');
|
include(SERVER_ROOT.'/sections/artist/take_warn.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
default:
|
||||||
|
error(0);
|
||||||
|
}
|
||||||
|
} elseif(!empty($_GET['action'])) {
|
||||||
|
switch ($_GET['action']) {
|
||||||
|
case 'get_post':
|
||||||
|
if (!$_GET['post'] || !is_number($_GET['post'])) { error(0); }
|
||||||
|
$DB->query("SELECT Body FROM artist_comments WHERE ID='".db_string($_GET['post'])."'");
|
||||||
|
list($Body) = $DB->next_record(MYSQLI_NUM);
|
||||||
|
echo trim($Body);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'delete_comment':
|
||||||
|
authorize();
|
||||||
|
|
||||||
|
// Quick SQL injection check
|
||||||
|
if (!$_GET['postid'] || !is_number($_GET['postid'])) { error(0); }
|
||||||
|
|
||||||
|
// Make sure they are moderators
|
||||||
|
if (!check_perms('site_moderate_forums')) { error(403); }
|
||||||
|
|
||||||
|
// Get topicid, forumid, number of pages
|
||||||
|
$DB->query("SELECT
|
||||||
|
ArtistID,
|
||||||
|
CEIL(COUNT(ac.ID)/".TORRENT_COMMENTS_PER_PAGE.") AS Pages,
|
||||||
|
CEIL(SUM(IF(ac.ID<=".$_GET['postid'].",1,0))/".TORRENT_COMMENTS_PER_PAGE.") AS Page
|
||||||
|
FROM artist_comments AS ac
|
||||||
|
WHERE ac.ArtistID=(SELECT ArtistID FROM artist_comments WHERE ID=".$_GET['postid'].")
|
||||||
|
GROUP BY ac.ArtistID");
|
||||||
|
list($ArtistID,$Pages,$Page)=$DB->next_record();
|
||||||
|
|
||||||
|
// $Pages = number of pages in the thread
|
||||||
|
// $Page = which page the post is on
|
||||||
|
// These are set for cache clearing.
|
||||||
|
|
||||||
|
$DB->query("DELETE FROM artist_comments WHERE ID='".db_string($_GET['postid'])."'");
|
||||||
|
|
||||||
|
//We need to clear all subsequential catalogues as they've all been bumped with the absence of this post
|
||||||
|
$ThisCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
||||||
|
$LastCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Pages-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
||||||
|
for($i=$ThisCatalogue;$i<=$LastCatalogue;$i++) {
|
||||||
|
$Cache->delete('artist_comments_'.$ArtistID.'_catalogue_'.$i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete thread info cache (eg. number of pages)
|
||||||
|
$Cache->delete('artist_comments_'.$ArtistID);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 'takeedit_post':
|
case 'takeedit_post':
|
||||||
authorize();
|
authorize();
|
||||||
|
|
||||||
@ -133,55 +184,6 @@
|
|||||||
echo $Text->full_format($_POST['body']);
|
echo $Text->full_format($_POST['body']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
error(0);
|
|
||||||
}
|
|
||||||
} elseif(!empty($_GET['action'])) {
|
|
||||||
switch ($_GET['action']) {
|
|
||||||
case 'get_post':
|
|
||||||
if (!$_GET['post'] || !is_number($_GET['post'])) { error(0); }
|
|
||||||
$DB->query("SELECT Body FROM artist_comments WHERE ID='".db_string($_GET['post'])."'");
|
|
||||||
list($Body) = $DB->next_record(MYSQLI_NUM);
|
|
||||||
echo trim($Body);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'delete_comment':
|
|
||||||
authorize();
|
|
||||||
|
|
||||||
// Quick SQL injection check
|
|
||||||
if (!$_GET['postid'] || !is_number($_GET['postid'])) { error(0); }
|
|
||||||
|
|
||||||
// Make sure they are moderators
|
|
||||||
if (!check_perms('site_moderate_forums')) { error(403); }
|
|
||||||
|
|
||||||
// Get topicid, forumid, number of pages
|
|
||||||
$DB->query("SELECT
|
|
||||||
ArtistID,
|
|
||||||
CEIL(COUNT(ac.ID)/".TORRENT_COMMENTS_PER_PAGE.") AS Pages,
|
|
||||||
CEIL(SUM(IF(ac.ID<=".$_GET['postid'].",1,0))/".TORRENT_COMMENTS_PER_PAGE.") AS Page
|
|
||||||
FROM artist_comments AS ac
|
|
||||||
WHERE ac.ArtistID=(SELECT ArtistID FROM artist_comments WHERE ID=".$_GET['postid'].")
|
|
||||||
GROUP BY ac.ArtistID");
|
|
||||||
list($ArtistID,$Pages,$Page)=$DB->next_record();
|
|
||||||
|
|
||||||
// $Pages = number of pages in the thread
|
|
||||||
// $Page = which page the post is on
|
|
||||||
// These are set for cache clearing.
|
|
||||||
|
|
||||||
$DB->query("DELETE FROM artist_comments WHERE ID='".db_string($_GET['postid'])."'");
|
|
||||||
|
|
||||||
//We need to clear all subsequential catalogues as they've all been bumped with the absence of this post
|
|
||||||
$ThisCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Page-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
|
||||||
$LastCatalogue = floor((TORRENT_COMMENTS_PER_PAGE*$Pages-TORRENT_COMMENTS_PER_PAGE)/THREAD_CATALOGUE);
|
|
||||||
for($i=$ThisCatalogue;$i<=$LastCatalogue;$i++) {
|
|
||||||
$Cache->delete('artist_comments_'.$ArtistID.'_catalogue_'.$i);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete thread info cache (eg. number of pages)
|
|
||||||
$Cache->delete('artist_comments_'.$ArtistID);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
require(SERVER_ROOT.'/sections/artist/edit.php');
|
require(SERVER_ROOT.'/sections/artist/edit.php');
|
||||||
break;
|
break;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
//Require the table class
|
//Require the table class
|
||||||
// require_once SERVER_ROOT . '/classes/class_mass_user_torrents_table_view.php';
|
// require_once SERVER_ROOT . '/classes/class_mass_user_torrents_table_view.php';
|
||||||
|
|
||||||
View::show_header('Organize Bookmarks', 'browse,jquery');
|
View::show_header('Organize Bookmarks', 'browse,jquery,jquery-ui,jquery.tablesorter,sort');
|
||||||
|
|
||||||
$EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
|
$EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
$OtherLink = '';
|
$OtherLink = '';
|
||||||
|
|
||||||
$Title = 'Artist comments made by '.($Self?'you':$Username);
|
$Title = 'Artist comments made by '.($Self?'you':$Username);
|
||||||
$Header = 'Artist comments left by '.($Self?'you':format_username($UserID, false, false, false)).'';
|
$Header = 'Artist comments left by '.($Self?'you':Users::format_username($UserID, false, false, false)).'';
|
||||||
|
|
||||||
$Comments = $DB->query("SELECT
|
$Comments = $DB->query("SELECT
|
||||||
SQL_CALC_FOUND_ROWS
|
SQL_CALC_FOUND_ROWS
|
||||||
|
@ -137,8 +137,17 @@
|
|||||||
$Cache->delete_value('subscriptions_user_new_'.$LoggedUser['ID']);
|
$Cache->delete_value('subscriptions_user_new_'.$LoggedUser['ID']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$DB->query("UPDATE users_notify_quoted SET Unread = '0' WHERE UserID = '$LoggedUser[ID]' AND TopicID = '$ThreadID'");
|
$DB->query("UPDATE users_notify_quoted SET Unread = '0' WHERE UserID = '$LoggedUser[ID]' AND TopicID = '$ThreadID'");
|
||||||
|
|
||||||
|
$QuoteNotifiactionsCount = $Cache->get_value('forums_quotes_'.$LoggedUser['ID']);
|
||||||
|
if($QuoteNotificationsCount > 0) {
|
||||||
|
$Cache->cache_value('forums_quotes_'.$LoggedUser['ID'], $QuoteNotificationsCount - 1, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$Cache->delete_value('forums_quotes_'.$LoggedUser['ID']);
|
||||||
|
}
|
||||||
|
|
||||||
// Start printing
|
// Start printing
|
||||||
View::show_header($ThreadInfo['Title'] . ' < '.$Forums[$ForumID]['Name'].' < '. 'Forums','comments,subscriptions,bbcode,jquery');
|
View::show_header($ThreadInfo['Title'] . ' < '.$Forums[$ForumID]['Name'].' < '. 'Forums','comments,subscriptions,bbcode,jquery');
|
||||||
?>
|
?>
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<pre id="#debug_report"><?=display_str($Analysis['message'])?></pre>
|
<pre id="#debug_report"><?=display_str($Analysis['message'])?></pre>
|
||||||
<?
|
<?
|
||||||
|
$Debug->perf_table($Analysis['perf']);
|
||||||
$Debug->flag_table($Analysis['flags']);
|
$Debug->flag_table($Analysis['flags']);
|
||||||
$Debug->include_table($Analysis['includes']);
|
$Debug->include_table($Analysis['includes']);
|
||||||
$Debug->error_table($Analysis['errors']);
|
$Debug->error_table($Analysis['errors']);
|
||||||
|
@ -52,6 +52,41 @@
|
|||||||
} else {
|
} else {
|
||||||
authorize();
|
authorize();
|
||||||
|
|
||||||
|
// Votes ninjutsu. This is so annoyingly complicated.
|
||||||
|
// 1. Get a list of everybody who voted on the old group and clear their cache keys
|
||||||
|
$DB->query("SELECT UserID FROM users_votes WHERE GroupID='$GroupID'");
|
||||||
|
while (list($UserID) = $DB->next_record()) {
|
||||||
|
$Cache->delete_value('voted_albums_'.$UserID);
|
||||||
|
}
|
||||||
|
// 2. Update the existing votes where possible, clear out the duplicates left by key
|
||||||
|
// conflicts, and update the torrents_votes table
|
||||||
|
$DB->query("UPDATE IGNORE users_votes SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
|
||||||
|
$DB->query("DELETE FROM users_votes WHERE GroupID='$GroupID'");
|
||||||
|
$DB->query("INSERT INTO torrents_votes (GroupID, Ups, Total, Score)
|
||||||
|
SELECT $NewGroupID, UpVotes, TotalVotes, VoteScore
|
||||||
|
FROM (SELECT IFNULL(SUM(IF(Type='Up',1,0)),0) As UpVotes,
|
||||||
|
COUNT(1) AS TotalVotes,
|
||||||
|
binomial_ci(IFNULL(SUM(IF(Type='Up',1,0)),0), COUNT(1)) AS VoteScore
|
||||||
|
FROM users_votes
|
||||||
|
WHERE GroupID = $NewGroupID
|
||||||
|
GROUP BY GroupID) AS a
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
Ups = a.UpVotes,
|
||||||
|
Total = a.TotalVotes,
|
||||||
|
Score = a.VoteScore;");
|
||||||
|
// 3. Clear the votes_pairs keys!
|
||||||
|
$DB->query("SELECT v2.GroupID
|
||||||
|
FROM users_votes AS v1
|
||||||
|
INNER JOIN users_votes AS v2 USING (UserID)
|
||||||
|
WHERE (v1.Type = 'Up' OR v2.Type='Up')
|
||||||
|
AND (v1.GroupID IN($GroupID, $NewGroupID))
|
||||||
|
AND (v2.GroupID NOT IN($GroupID, $NewGroupID));");
|
||||||
|
while (list($CacheGroupID) = $DB->next_record()) {
|
||||||
|
$Cache->delete_value('vote_pairs_'.$CacheGroupID);
|
||||||
|
}
|
||||||
|
// 4. Clear the new groups vote keys
|
||||||
|
|
||||||
|
|
||||||
$DB->query("UPDATE torrents SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
|
$DB->query("UPDATE torrents SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
|
||||||
$DB->query("UPDATE wiki_torrents SET PageID='$NewGroupID' WHERE PageID='$GroupID'");
|
$DB->query("UPDATE wiki_torrents SET PageID='$NewGroupID' WHERE PageID='$GroupID'");
|
||||||
$DB->query("UPDATE torrents_comments SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
|
$DB->query("UPDATE torrents_comments SET GroupID='$NewGroupID' WHERE GroupID='$GroupID'");
|
||||||
|
@ -114,7 +114,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
|||||||
|
|
||||||
// Get the relevant filter labels
|
// Get the relevant filter labels
|
||||||
$DB->query("SELECT ID, Label, Artists FROM users_notify_filters WHERE ID IN (".implode(',', $FilterIDs).")");
|
$DB->query("SELECT ID, Label, Artists FROM users_notify_filters WHERE ID IN (".implode(',', $FilterIDs).")");
|
||||||
$Filters = $DB->to_array('ID', MYSQLI_ASSOC, array(2));
|
$Filters = $DB->to_array('ID', MYSQLI_ASSOC, array('Artists'));
|
||||||
foreach ($Filters as &$Filter) {
|
foreach ($Filters as &$Filter) {
|
||||||
$Filter['Artists'] = explode('|', trim($Filter['Artists'], '|'));
|
$Filter['Artists'] = explode('|', trim($Filter['Artists'], '|'));
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
|||||||
foreach ($GroupInfo['ExtendedArtists'] as $GroupArtists) {
|
foreach ($GroupInfo['ExtendedArtists'] as $GroupArtists) {
|
||||||
foreach ($GroupArtists as $GroupArtist) {
|
foreach ($GroupArtists as $GroupArtist) {
|
||||||
foreach ($Filters[$FilterID]['Artists'] as $FilterArtist) {
|
foreach ($Filters[$FilterID]['Artists'] as $FilterArtist) {
|
||||||
if (!strcasecmp($FilterArtist, $GroupArtist['name'])) {
|
if (mb_strtolower($FilterArtist, 'UTF-8') == mb_strtolower($GroupArtist['name'], 'UTF-8')) {
|
||||||
$MatchingArtists[] = $GroupArtist['name'];
|
$MatchingArtists[] = $GroupArtist['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
|||||||
|
|
||||||
// print row
|
// print row
|
||||||
?>
|
?>
|
||||||
<tr class="torrent" id="torrent<?=$TorrentID?>"<?=$MatchingArtistsText ? 'title="'.$MatchingArtistsText.'"' : ''?>>
|
<tr class="torrent" id="torrent<?=$TorrentID?>"<?=$MatchingArtistsText ? 'title="'.display_str($MatchingArtistsText).'"' : ''?>>
|
||||||
<td style="text-align: center"><input type="checkbox" value="<?=$TorrentID?>" id="clear_<?=$TorrentID?>" /></td>
|
<td style="text-align: center"><input type="checkbox" value="<?=$TorrentID?>" id="clear_<?=$TorrentID?>" /></td>
|
||||||
<td class="center cats_col"><div title="<?=ucfirst(str_replace('_',' ',$MainTag))?>" class="cats_<?=strtolower(str_replace(array('-',' '),array('',''),$Categories[$GroupCategoryID-1])).' tags_'.str_replace('.','_',$MainTag)?>"></div></td>
|
<td class="center cats_col"><div title="<?=ucfirst(str_replace('_',' ',$MainTag))?>" class="cats_<?=strtolower(str_replace(array('-',' '),array('',''),$Categories[$GroupCategoryID-1])).' tags_'.str_replace('.','_',$MainTag)?>"></div></td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
$Voted = isset($UserVotes[$GroupID])?$UserVotes[$GroupID]['Type']:false;
|
$Voted = isset($UserVotes[$GroupID])?$UserVotes[$GroupID]['Type']:false;
|
||||||
?>
|
?>
|
||||||
<div class="box" id="votes">
|
<div class="box" id="votes">
|
||||||
<div class="head"><strong>Favorite Album Votes</strong></div>
|
<div class="head"><strong>Album Votes</strong></div>
|
||||||
<div class="album_votes body">
|
<div class="album_votes body">
|
||||||
This has <span id="upvotes" class="favoritecount"><?=$UpVotes?></span> <?=(($UpVotes==1)?'upvote':'upvotes')?> out of <span id="totalvotes" class="favoritecount"><?=$TotalVotes?></span> total<span id="upvoted" <?=($Voted!='Up'?'class="hidden"':'')?>>, including your upvote</span><span id="downvoted" <?=($Voted!='Down'?'class="hidden"':'')?>>, including your downvote</span>.
|
This has <span id="upvotes" class="favoritecount"><?=$UpVotes?></span> <?=(($UpVotes==1)?'upvote':'upvotes')?> out of <span id="totalvotes" class="favoritecount"><?=$TotalVotes?></span> total<span id="upvoted" <?=($Voted!='Up'?'class="hidden"':'')?>>, including your upvote</span><span id="downvoted" <?=($Voted!='Down'?'class="hidden"':'')?>>, including your downvote</span>.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
@ -163,6 +163,7 @@ function checked($Checked) {
|
|||||||
|
|
||||||
<a href="#" id="toggle_sortable" onclick="return false;">Expand</a>
|
<a href="#" id="toggle_sortable" onclick="return false;">Expand</a>
|
||||||
<div id="sortable_container" style="display: none;">
|
<div id="sortable_container" style="display: none;">
|
||||||
|
<a href="#" id="reset_sortable" onclick="return false;">Reset to Default</a>
|
||||||
<ul class="sortable_list" id="sortable">
|
<ul class="sortable_list" id="sortable">
|
||||||
|
|
||||||
<?
|
<?
|
||||||
@ -204,36 +205,6 @@ function checked($Checked) {
|
|||||||
<input type="hidden" id="sorthide" name="sorthide" value=""/>
|
<input type="hidden" id="sorthide" name="sorthide" value=""/>
|
||||||
|
|
||||||
<?
|
<?
|
||||||
/*
|
|
||||||
for($i = 0; list($Key,$Val) = each($ReleaseTypes); $i++) {
|
|
||||||
if(!($i % 7)) {
|
|
||||||
if($i) {
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
<?
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr style="border:none;">
|
|
||||||
<?
|
|
||||||
}
|
|
||||||
if(!empty($SiteOptions['HideTypes']) && in_array($Key, $SiteOptions['HideTypes'])) {
|
|
||||||
$Checked = 'checked="checked" ';
|
|
||||||
} else {
|
|
||||||
$Checked='';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<td style="border:none;">
|
|
||||||
<label><input type="checkbox" id="hide_type_<?=$Key?>" name="hidetypes[]=" value="<?=$Key?>" <?=$Checked?>/>
|
|
||||||
<?=$Val?></label>
|
|
||||||
</td>
|
|
||||||
<?
|
|
||||||
}
|
|
||||||
if($i % 7) {
|
|
||||||
?>
|
|
||||||
<td style="border:none;" colspan="<?=7 - ($i % 7)?>"></td>
|
|
||||||
<?
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
unset($ReleaseTypes[1023], $ReleaseTypes[1024], $ReleaseTypes[1022]);
|
unset($ReleaseTypes[1023], $ReleaseTypes[1024], $ReleaseTypes[1022]);
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
|
1031
static/functions/jquery.tablesorter.js
Normal file
1031
static/functions/jquery.tablesorter.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
|||||||
//Couldn't use an associative array because javascript sorting is stupid http://dev-answers.blogspot.com/2012/03/javascript-object-keys-being-sorted-in.html
|
//Couldn't use an associative array because javascript sorting is stupid http://dev-answers.blogspot.com/2012/03/javascript-object-keys-being-sorted-in.html
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
|
var DEFAULT = '\x3Cul class=\"sortable_list ui-sortable\" id=\"sortable\" style=\"\"\x3E\n\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"1_0\"\x3EAlbum\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"3_0\"\x3ESoundtrack\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"5_0\"\x3EEP\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"6_0\"\x3EAnthology\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"7_0\"\x3ECompilation\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"9_0\"\x3ESingle\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"11_0\"\x3ELive album\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"13_0\"\x3ERemix\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"14_0\"\x3EBootleg\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"15_0\"\x3EInterview\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"16_0\"\x3EMixtape\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"21_0\"\x3EUnknown\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"1024_0\"\x3EGuest Appearance\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"1023_0\"\x3ERemixed By\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"1022_0\"\x3EComposition\x3C\x2Fli\x3E\n\t\t\x3Cli class=\"sortable_item\" style=\"\"\x3E\x3Cinput type=\"checkbox\" id=\"1021_0\"\x3EProduced By\x3C\x2Fli\x3E\n\t\t\x3C\x2Ful\x3E';
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
serialize();
|
serialize();
|
||||||
$("#sortable").sortable({
|
$("#sortable").sortable({
|
||||||
@ -14,6 +15,10 @@
|
|||||||
$("#toggle_sortable").text($(this).is(":visible") ? "Collapse" : "Expand");
|
$("#toggle_sortable").text($(this).is(":visible") ? "Collapse" : "Expand");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
$("#reset_sortable").click(function () {
|
||||||
|
$('#sortable').html(DEFAULT);
|
||||||
|
serialize();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
function serialize() {
|
function serialize() {
|
||||||
var a = new Array();
|
var a = new Array();
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
var sortableTable;
|
var sortableTable;
|
||||||
jQuery(document).ready(function ($) {
|
jQuery(document).ready(function ($) {
|
||||||
|
|
||||||
|
$.tablesorter.addParser({
|
||||||
|
id: 'relative_time',
|
||||||
|
is: function (s) {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
format: function(str, table, td) {
|
||||||
|
return td.title;
|
||||||
|
},
|
||||||
|
type: 'text'
|
||||||
|
});
|
||||||
|
|
||||||
sortableTable = {
|
sortableTable = {
|
||||||
container : $('#manage_collage_table'),
|
container : $('#manage_collage_table'),
|
||||||
form : $('#drag_drop_collage_form'),
|
form : $('#drag_drop_collage_form'),
|
||||||
@ -57,17 +69,14 @@ jQuery(document).ready(function ($) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
tableSorter : function () {
|
tableSorter : function () {
|
||||||
|
var obj = { 0: { sorter : false }, 6: { sorter : false } };
|
||||||
|
if (this.check.length !== 0) {
|
||||||
|
obj[5] = { sorter : 'relative_time' };
|
||||||
|
}
|
||||||
this.container.tablesorter({
|
this.container.tablesorter({
|
||||||
cssHeader : 'headerSort',
|
cssHeader : 'headerSort',
|
||||||
textExtraction: sortableTable.extractor,
|
textExtraction: sortableTable.extractor,
|
||||||
headers : {
|
headers : obj
|
||||||
0: {
|
|
||||||
sorter : false
|
|
||||||
},
|
|
||||||
6: {
|
|
||||||
sorter : false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).on('sortEnd', sortableTable.postSort);
|
}).on('sortEnd', sortableTable.postSort);
|
||||||
},
|
},
|
||||||
extractor : function (node) {
|
extractor : function (node) {
|
||||||
@ -81,7 +90,7 @@ jQuery(document).ready(function ($) {
|
|||||||
var span = $('<a href="#" title="Toggle Note">(Hide)</a>').click(function (e) {
|
var span = $('<a href="#" title="Toggle Note">(Hide)</a>').click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$('#drag_drop_textnote > :first-child').toggle();
|
$('#drag_drop_textnote > :first-child').toggle();
|
||||||
$this = $(this);
|
var $this = $(this);
|
||||||
$this.text($this.text() === '(Hide)' ? '(Show)' : '(Hide)');
|
$this.text($this.text() === '(Hide)' ? '(Show)' : '(Hide)');
|
||||||
});
|
});
|
||||||
$('#sorting_head').append(' ', span);
|
$('#sorting_head').append(' ', span);
|
||||||
|
Loading…
Reference in New Issue
Block a user