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
8e4937f6ff
commit
0be451b552
@ -37,7 +37,8 @@ class CACHE extends Memcache {
|
||||
private $PersistentKeys = array(
|
||||
'stats_*',
|
||||
'percentiles_*',
|
||||
'top10tor_*'
|
||||
'top10tor_*',
|
||||
'query_lock_*'
|
||||
);
|
||||
|
||||
public $CanClear = false;
|
||||
|
@ -251,19 +251,24 @@ function set_announce_url($Announce) {
|
||||
// * the total size of files described therein
|
||||
function file_list() {
|
||||
$FileList = array();
|
||||
if(!$this->Val['info']->Val['files']) { // Single file mode
|
||||
if (!isset($this->Val['info']->Val['files'])) { // Single file mode
|
||||
$TotalSize = $this->Val['info']->Val['length'];
|
||||
$FileList[]= array($this->Val['info']->Val['length'], $this->Val['info']->Val['name']);
|
||||
$FileList[] = array($TotalSize, $this->get_name());
|
||||
} else { // Multiple file mode
|
||||
$FileNames = array();
|
||||
$FileSizes = array();
|
||||
$TotalSize = 0;
|
||||
$Files = $this->Val['info']->Val['files']->Val;
|
||||
if (isset($Files[0]->Val['path.utf-8'])) {
|
||||
$PathKey = 'path.utf-8';
|
||||
} else {
|
||||
$PathKey = 'path';
|
||||
}
|
||||
foreach ($Files as $File) {
|
||||
$TotalSize += $File->Val['length'];
|
||||
$FileSize = $File->Val['length'];
|
||||
$TotalSize += $FileSize;
|
||||
|
||||
$FileName = ltrim(implode('/',$File->Val['path']->Val), '/');
|
||||
$FileName = ltrim(implode('/',$File->Val[$PathKey]->Val), '/');
|
||||
$FileSizes[] = $FileSize;
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
@ -275,6 +280,14 @@ function file_list() {
|
||||
return array($TotalSize, $FileList);
|
||||
}
|
||||
|
||||
function get_name() {
|
||||
if (isset($this->Val['info']->Val['name.utf-8'])) {
|
||||
return $this->Val['info']->Val['name.utf-8'];
|
||||
} else {
|
||||
return $this->Val['info']->Val['name'];
|
||||
}
|
||||
}
|
||||
|
||||
function make_private() {
|
||||
//----- The following properties do not affect the infohash:
|
||||
|
||||
|
@ -248,19 +248,24 @@ function set_announce_url($Announce) {
|
||||
// * the total size of files described therein
|
||||
function file_list() {
|
||||
$FileList = array();
|
||||
if(!$this->Val['info']->Val['files']) { // Single file mode
|
||||
if (!isset($this->Val['info']->Val['files'])) { // Single file mode
|
||||
$TotalSize = substr($this->Val['info']->Val['length'],7);
|
||||
$FileList[]= array($TotalSize, $this->Val['info']->Val['name']);
|
||||
$FileList[] = array($TotalSize, $this->get_name());
|
||||
} else { // Multiple file mode
|
||||
$FileNames = array();
|
||||
$FileSizes = array();
|
||||
$TotalSize = 0;
|
||||
$Files = $this->Val['info']->Val['files']->Val;
|
||||
if (isset($Files[0]->Val['path.utf-8'])) {
|
||||
$PathKey = 'path.utf-8';
|
||||
} else {
|
||||
$PathKey = 'path';
|
||||
}
|
||||
foreach ($Files as $File) {
|
||||
$FileSize = substr($File->Val['length'], 7);
|
||||
$TotalSize += $FileSize;
|
||||
|
||||
$FileName = ltrim(implode('/',$File->Val['path']->Val), '/');
|
||||
$FileName = ltrim(implode('/',$File->Val[$PathKey]->Val), '/');
|
||||
$FileSizes[] = $FileSize;
|
||||
$FileNames[] = $FileName;
|
||||
}
|
||||
@ -272,6 +277,14 @@ function file_list() {
|
||||
return array($TotalSize, $FileList);
|
||||
}
|
||||
|
||||
function get_name() {
|
||||
if (isset($this->Val['info']->Val['name.utf-8'])) {
|
||||
return $this->Val['info']->Val['name.utf-8'];
|
||||
} else {
|
||||
return $this->Val['info']->Val['name'];
|
||||
}
|
||||
}
|
||||
|
||||
function make_private() {
|
||||
//----- The following properties do not affect the infohash:
|
||||
|
||||
|
@ -78,7 +78,7 @@ function head() {
|
||||
} ?>
|
||||
</div>
|
||||
<? if($this->NewTorrent) { ?>
|
||||
<table cellpadding="3" cellspacing='1' border='0' class='layout border' width="100%">
|
||||
<table cellpadding="3" cellspacing="1" border="0" class="layout border" width="100%">
|
||||
<tr>
|
||||
<td class="label">
|
||||
Torrent file
|
||||
@ -94,8 +94,8 @@ function head() {
|
||||
<td>
|
||||
<select id="categories" name="type" onchange="Categories()"<?=$this->Disabled?>>
|
||||
<? foreach(display_array($this->Categories) as $Index => $Cat) {
|
||||
echo "<option value='$Index'";
|
||||
if($Cat == $this->Torrent['CategoryName']) { echo " selected='selected'"; }
|
||||
echo "<option value=\"$Index\"";
|
||||
if($Cat == $this->Torrent['CategoryName']) { echo ' selected="selected"'; }
|
||||
echo ">";
|
||||
echo $Cat;
|
||||
echo "</option>\n";
|
||||
@ -300,7 +300,7 @@ function show() {
|
||||
<span id="year_label_remaster"<? if(!$IsRemaster) { echo ' class="hidden"';}?>>Year of original release</span>
|
||||
</td>
|
||||
<td>
|
||||
<p id="yearwarning" class="hidden">You have entered a year for a release which predates the medium's availibility. You will need to change the year, enter additional edition information or if this information cannot be provided, select the 'Unknown Release' checkbox below</p>
|
||||
<p id="yearwarning" class="hidden">You have entered a year for a release which predates the medium's availibility. You will need to change the year, enter additional edition information. If this information cannot be provided, select the "Unknown Release" checkbox below</p>
|
||||
<input type="text" id="year" name="year" size="5" value="<?=display_str($Torrent['Year']) ?>"<?=$this->Disabled?> onblur="CheckYear();" /> This is the year of the original release.
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -12,19 +12,19 @@
|
||||
|
||||
class_wiki depends on your wiki table being structured like this:
|
||||
|
||||
+------------+---------------+------+-----+---------------------+-------+
|
||||
+------------+--------------+------+-----+----------------------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+------------+---------------+------+-----+---------------------+-------+
|
||||
+------------+--------------+------+-----+----------------------+-------+
|
||||
| RevisionID | int(12) | NO | PRI | 0 | |
|
||||
| PageID | int(10) | NO | MUL | 0 | |
|
||||
| Body | text | YES | | NULL | |
|
||||
| UserID | int(10) | NO | MUL | 0 | |
|
||||
| Summary | varchar(100) | YES | | NULL | |
|
||||
| Time | datetime | NO | MUL | 0000-00-00 00:00:00 | |
|
||||
+------------+---------------+------+-----+---------------------+-------+
|
||||
+------------+--------------+------+-----+----------------------+-------+
|
||||
|
||||
It is also recommended that you have a field in the main table for
|
||||
whatever the page is (eg. details.php main table = torrents), so you can
|
||||
whatever the page is (e.g. details.php main table = torrents), so you can
|
||||
do a JOIN.
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ function revision_history(){
|
||||
WHERE wiki.PageID = ".$this->PageID."
|
||||
ORDER BY RevisionID DESC");
|
||||
//----------------------------------------------- ?>
|
||||
<table cellpadding='6' cellspacing='1' border='0' width='100%' class='border'>
|
||||
<table cellpadding="6" cellspacing="1" border="0" width="100%" class="border">
|
||||
<tr class="colhead">
|
||||
<td>Revision</td>
|
||||
<td>Summary</td>
|
||||
|
@ -2534,6 +2534,40 @@ function isset_request($Request, $Keys=NULL, $AllowEmpty = False, $Error=0) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if there's an active lock with the given name
|
||||
*
|
||||
* @param string $LockName name on the lock
|
||||
* @return true if lock is active
|
||||
*/
|
||||
function query_locked($LockName) {
|
||||
global $Cache;
|
||||
if ($Cache->get_value('query_lock_'.$LockName) !== false) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add lock. Expiry time is one hour to avoid indefinite locks
|
||||
*
|
||||
* @param string $LockName name on the lock
|
||||
*/
|
||||
function set_query_lock($LockName) {
|
||||
global $Cache;
|
||||
$Cache->cache_value('query_lock_'.$LockName, 1, 3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove lock. Expiry time is one hour to avoid indefinite locks
|
||||
*
|
||||
* @param string $LockName name on the lock
|
||||
*/
|
||||
function clear_query_lock($LockName) {
|
||||
global $Cache;
|
||||
$Cache->delete_value('query_lock_'.$LockName);
|
||||
}
|
||||
|
||||
$Debug->set_flag('ending function definitions');
|
||||
//Include /sections/*/index.php
|
||||
$Document = basename(parse_url($_SERVER['SCRIPT_FILENAME'], PHP_URL_PATH), '.php');
|
||||
|
BIN
ocelot-0.5.1.tar.bz2
Normal file
BIN
ocelot-0.5.1.tar.bz2
Normal file
Binary file not shown.
Binary file not shown.
@ -109,10 +109,10 @@
|
||||
while(list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
|
||||
$UserInfo = user_info($UserID);
|
||||
?>
|
||||
<table class='forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>' id="post<?=$PostID?>">
|
||||
<tr class='colhead_dark'>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;"><a href='torrents.php?id=<?=$GroupID?>&postid=<?=$PostID?>#post<?=$PostID?>'>#<?=$PostID?></a>
|
||||
<span style="float:left;"><a href="torrents.php?id=<?=$GroupID?>&postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
|
||||
by <strong><?=format_username($UserID, true, true, true, true, false)?></strong> <?=time_diff($AddedTime) ?>
|
||||
on <?=display_artists($Artists[$GroupID])?><a href="torrents.php?id=<?=$GroupID?>"><?=$Title?></a>
|
||||
</span>
|
||||
@ -122,11 +122,11 @@
|
||||
<?
|
||||
if(empty($HeavyInfo['DisableAvatars'])) {
|
||||
?>
|
||||
<td class='avatar' valign="top">
|
||||
<td class="avatar" valign="top">
|
||||
<?
|
||||
if($UserInfo['Avatar']){
|
||||
?>
|
||||
<img src='<?=$UserInfo['Avatar']?>' width='150' alt="<?=$UserInfo['Username']?>'s avatar" />
|
||||
<img src="<?=$UserInfo['Avatar']?>" width="150" alt="<?=$UserInfo['Username']?>'s avatar" />
|
||||
<?
|
||||
} else { ?>
|
||||
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
|
||||
@ -137,7 +137,7 @@
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<td class='body' valign="top">
|
||||
<td class="body" valign="top">
|
||||
<?=$Text->full_format($Body) ?>
|
||||
<?
|
||||
if($EditorID){
|
||||
|
@ -94,7 +94,7 @@
|
||||
<div>
|
||||
<table class="layout">
|
||||
<tr>
|
||||
<td class='center'>
|
||||
<td class="center">
|
||||
<a href="reportsv2.php?view=report&id=<?=$ReportID?>">Report <?=$ReportID?></a> for torrent <?=$TorrentID?> (deleted) has been automatically resolved. <input type="button" value="Clear" onclick="ClearReport(<?=$ReportID?>);" />
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -212,7 +212,7 @@
|
||||
<div>
|
||||
<table class="layout">
|
||||
<tr>
|
||||
<td class='center'>
|
||||
<td class="center">
|
||||
<strong>No new reports! \o/</strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -144,7 +144,12 @@
|
||||
LEFT JOIN torrents_group AS g ON g.ID = t.GroupID ";
|
||||
|
||||
if($Details=='all' || $Details=='day') {
|
||||
if (!$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsActiveLastDay === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsActiveLastDay = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
$DayAgo = time_minus(86400);
|
||||
$Query = $BaseQuery.' WHERE t.Seeders>0 AND ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
@ -155,11 +160,18 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastDay = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_day_'.$Limit.$WhereSum,$TopTorrentsActiveLastDay,3600*2);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Day', 'day', $TopTorrentsActiveLastDay, $Limit);
|
||||
}
|
||||
if($Details=='all' || $Details=='week') {
|
||||
if (!$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsActiveLastWeek = $Cache->get_value('top10tor_week_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsActiveLastWeek === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsActiveLastWeek = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
$WeekAgo = time_minus(604800);
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
@ -170,12 +182,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastWeek = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_week_'.$Limit.$WhereSum,$TopTorrentsActiveLastWeek,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Week', 'week', $TopTorrentsActiveLastWeek, $Limit);
|
||||
}
|
||||
|
||||
if($Details=='all' || $Details=='month') {
|
||||
if (!$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsActiveLastMonth = $Cache->get_value('top10tor_month_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsActiveLastMonth === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsActiveLastMonth = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if (!empty($Where)) { $Query .= $Where.' AND '; }
|
||||
$Query .= "
|
||||
@ -185,12 +204,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastMonth = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_month_'.$Limit.$WhereSum,$TopTorrentsActiveLastMonth,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Month', 'month', $TopTorrentsActiveLastMonth, $Limit);
|
||||
}
|
||||
|
||||
if($Details=='all' || $Details=='year') {
|
||||
if (!$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsActiveLastYear = $Cache->get_value('top10tor_year_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsActiveLastYear === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsActiveLastYear = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
// IMPORTANT NOTE - we use WHERE t.Seeders>200 in order to speed up this query. You should remove it!
|
||||
$Query = $BaseQuery.' WHERE ';
|
||||
if ($Details=='all' && !$Filtered) {
|
||||
@ -205,12 +231,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveLastYear = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_year_'.$Limit.$WhereSum,$TopTorrentsActiveLastYear,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents Uploaded in the Past Year', 'year', $TopTorrentsActiveLastYear, $Limit);
|
||||
}
|
||||
|
||||
if($Details=='all' || $Details=='overall') {
|
||||
if (!$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsActiveAllTime = $Cache->get_value('top10tor_overall_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsActiveAllTime === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsActiveAllTime = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
// IMPORTANT NOTE - we use WHERE t.Seeders>500 in order to speed up this query. You should remove it!
|
||||
$Query = $BaseQuery;
|
||||
if ($Details=='all' && !$Filtered) {
|
||||
@ -224,12 +257,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsActiveAllTime = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum,$TopTorrentsActiveAllTime,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Active Torrents of All Time', 'overall', $TopTorrentsActiveAllTime, $Limit);
|
||||
}
|
||||
|
||||
if(($Details=='all' || $Details=='snatched') && !$Filtered) {
|
||||
if (!$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsSnatched = $Cache->get_value('top10tor_snatched_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsSnatched === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsSnatched = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
$Query = $BaseQuery;
|
||||
if (!empty($Where)) { $Query .= ' WHERE '.$Where; }
|
||||
$Query .= "
|
||||
@ -238,12 +278,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsSnatched = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_snatched_'.$Limit.$WhereSum,$TopTorrentsSnatched,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Snatched Torrents', 'snatched', $TopTorrentsSnatched, $Limit);
|
||||
}
|
||||
|
||||
if(($Details=='all' || $Details=='data') && !$Filtered) {
|
||||
if (!$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum)) {
|
||||
$TopTorrentsTransferred = $Cache->get_value('top10tor_data_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsTransferred === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsTransferred = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
// IMPORTANT NOTE - we use WHERE t.Snatched>100 in order to speed up this query. You should remove it!
|
||||
$Query = $BaseQuery;
|
||||
if ($Details=='all') {
|
||||
@ -256,13 +303,19 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsTransferred = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_data_'.$Limit.$WhereSum,$TopTorrentsTransferred,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Most Data Transferred Torrents', 'data', $TopTorrentsTransferred, $Limit);
|
||||
}
|
||||
|
||||
if(($Details=='all' || $Details=='seeded') && !$Filtered) {
|
||||
$TopTorrentsSeeded = $Cache->get_value('top10tor_seeded_'.$Limit.$WhereSum);
|
||||
if ($TopTorrentsSeeded === FALSE) {
|
||||
if ($TopTorrentsSeeded === false) {
|
||||
if (query_locked('top10')) {
|
||||
$TopTorrentsSeeded = false;
|
||||
} else {
|
||||
set_query_lock('top10');
|
||||
$Query = $BaseQuery;
|
||||
if (!empty($Where)) { $Query .= ' WHERE '.$Where; }
|
||||
$Query .= "
|
||||
@ -271,6 +324,8 @@
|
||||
$DB->query($Query);
|
||||
$TopTorrentsSeeded = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('top10tor_seeded_'.$Limit.$WhereSum,$TopTorrentsSeeded,3600*6);
|
||||
clear_query_lock('top10');
|
||||
}
|
||||
}
|
||||
generate_torrent_table('Best Seeded Torrents', 'seeded', $TopTorrentsSeeded, $Limit);
|
||||
}
|
||||
@ -319,6 +374,18 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
<td style="text-align:right"><strong>Peers</strong></td>
|
||||
</tr>
|
||||
<?
|
||||
// Server is already processing a top10 query. Starting another one will make things slow
|
||||
if ($Details === false) {
|
||||
?>
|
||||
<tr class="rowb">
|
||||
<td colspan="9" class="center">
|
||||
Server is busy processing another top10 request. Please try again in a minute.
|
||||
</td>
|
||||
</tr>
|
||||
</table><br />
|
||||
<?
|
||||
return;
|
||||
}
|
||||
// in the unlikely event that query finds 0 rows...
|
||||
if (empty($Details)) {
|
||||
?>
|
||||
|
@ -421,7 +421,7 @@ function filelist($Str) {
|
||||
if(count($Reports) > 0) {
|
||||
$Reported = true;
|
||||
include(SERVER_ROOT.'/sections/reportsv2/array.php');
|
||||
$ReportInfo = "<table><tr class='colhead_dark' style='font-weight: bold;'><td>This torrent has ".count($Reports)." active ".(count($Reports) > 1 ?'reports' : 'report').":</td></tr>";
|
||||
$ReportInfo = '<table><tr class="colhead_dark" style="font-weight: bold;"><td>This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? "reports" : "report").':</td></tr>';
|
||||
|
||||
foreach($Reports as $Report) {
|
||||
list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report;
|
||||
|
@ -354,7 +354,7 @@ function js_pages($Action, $TorrentID, $NumResults, $CurrentPage) {
|
||||
list($Size, $Name) = $File;
|
||||
$TmpFileList []= $Name .'{{{'.$Size.'}}}'; // Name {{{Size}}}
|
||||
}
|
||||
$FilePath = $Tor->Val['info']->Val['files'] ? make_utf8($Tor->Val['info']->Val['name']) : "";
|
||||
$FilePath = isset($Tor->Val['info']->Val['files']) ? make_utf8($Tor->get_name()) : "";
|
||||
$FileString = make_utf8(implode('|||', $TmpFileList));
|
||||
$DB->query("UPDATE torrents SET Size = ".$TotalSize.", FilePath = '".db_string($FilePath)."', FileList = '".db_string($FileString)."' WHERE ID = ".$TorrentID);
|
||||
$Cache->delete_value('torrents_details_'.$GroupID);
|
||||
|
@ -358,7 +358,7 @@
|
||||
|
||||
// File list and size
|
||||
list($TotalSize, $FileList) = $Tor->file_list();
|
||||
$DirName = $Tor->Val['info']->Val['name'];
|
||||
$DirName = $Tor->get_name();
|
||||
|
||||
$TmpFileList = array();
|
||||
$HasLog = "'0'";
|
||||
@ -388,7 +388,7 @@
|
||||
}
|
||||
|
||||
// To be stored in the database
|
||||
$FilePath = $Tor->Val['info']->Val['files'] ? db_string(make_utf8($Tor->Val['info']->Val['name'])) : "";
|
||||
$FilePath = isset($Tor->Val['info']->Val['files']) ? db_string(make_utf8($DirName)) : "";
|
||||
|
||||
// Name {{{Size}}}|||Name {{{Size}}}|||Name {{{Size}}}|||Name {{{Size}}}
|
||||
$FileString = "'".db_string(make_utf8(implode('|||', $TmpFileList)))."'";
|
||||
|
@ -74,7 +74,7 @@ function checked($Checked) {
|
||||
<input type="hidden" name="userid" value="<?=$UserID?>" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
</div>
|
||||
<table cellpadding='6' cellspacing='1' border='0' width='100%' class='layout border'>
|
||||
<table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border">
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<strong>Site preferences</strong>
|
||||
|
@ -253,8 +253,8 @@
|
||||
<?
|
||||
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 ?>'>
|
||||
<tr class='colhead_dark'>
|
||||
<table class="forum_post vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID ?>">
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;">
|
||||
<?=time_diff($AddedTime) ?>
|
||||
@ -293,11 +293,11 @@
|
||||
<?
|
||||
if(empty($HeavyInfo['DisableAvatars'])) {
|
||||
?>
|
||||
<td class='avatar' valign="top">
|
||||
<td class="avatar" valign="top">
|
||||
<?
|
||||
if($Avatar) {
|
||||
?>
|
||||
<img src='<?=$Avatar?>' width='150' style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<img src="<?=$Avatar?>" width="150" style="max-height:400px;" alt="<?=$Username?>'s avatar" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
@ -305,7 +305,7 @@
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<td class='body' valign="top">
|
||||
<td class="body" valign="top">
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($Body)?>
|
||||
<? if($EditedUserID) { ?>
|
||||
|
@ -138,8 +138,8 @@
|
||||
<?
|
||||
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' : ''?>'>
|
||||
<tr class='colhead_dark'>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>">
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<span style="float:left;">
|
||||
<a href="forums.php?action=viewforum&forumid=<?=$ForumID?>"><?=$ForumName?></a> >
|
||||
@ -160,7 +160,7 @@
|
||||
</tr>
|
||||
<tr class="row<?=$ShowCollapsed?' hidden':''?>">
|
||||
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
|
||||
<td class='avatar' valign="top">
|
||||
<td class="avatar" valign="top">
|
||||
<? if(check_perms('site_proxy_images') && preg_match('/^https?:\/\/(localhost(:[0-9]{2,5})?|[0-9]{1,3}(\.[0-9]{1,3}){3}|([a-zA-Z0-9\-\_]+\.)+([a-zA-Z]{1,5}[^\.]))(:[0-9]{2,5})?(\/[^<>]+)+\.(jpg|jpeg|gif|png|tif|tiff|bmp)$/is',$AuthorAvatar)) { ?>
|
||||
<img src="<?='http://'.SITE_URL.'/image.php?c=1&i='.urlencode($AuthorAvatar)?>" width="150" style="max-height:400px;" alt="<?=$AuthorName?>'s avatar" />
|
||||
<? } elseif(!$AuthorAvatar) { ?>
|
||||
@ -170,7 +170,7 @@
|
||||
<? } ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
<td class='body' valign="top">
|
||||
<td class="body" valign="top">
|
||||
<div class="content3">
|
||||
<?=$Text->full_format($Body) ?>
|
||||
<? if($EditedUserID) { ?>
|
||||
|
Loading…
Reference in New Issue
Block a user