diff --git a/classes/class_cache.php b/classes/class_cache.php index 88952b12..d3bc5a21 100644 --- a/classes/class_cache.php +++ b/classes/class_cache.php @@ -37,7 +37,8 @@ class CACHE extends Memcache { private $PersistentKeys = array( 'stats_*', 'percentiles_*', - 'top10tor_*' + 'top10tor_*', + 'query_lock_*' ); public $CanClear = false; diff --git a/classes/class_torrent.php b/classes/class_torrent.php index 966486b2..407c3d5c 100644 --- a/classes/class_torrent.php +++ b/classes/class_torrent.php @@ -251,29 +251,42 @@ 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; - foreach($Files as $File) { - $TotalSize += $File->Val['length']; + if (isset($Files[0]->Val['path.utf-8'])) { + $PathKey = 'path.utf-8'; + } else { + $PathKey = 'path'; + } + foreach ($Files as $File) { $FileSize = $File->Val['length']; + $TotalSize += $FileSize; - $FileName = ltrim(implode('/',$File->Val['path']->Val), '/'); + $FileName = ltrim(implode('/',$File->Val[$PathKey]->Val), '/'); $FileSizes[] = $FileSize; $FileNames[] = $FileName; } natcasesort($FileNames); - foreach($FileNames as $Index => $FileName) { + foreach ($FileNames as $Index => $FileName) { $FileList[] = array($FileSizes[$Index], $FileName); } } 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: diff --git a/classes/class_torrent_32bit.php b/classes/class_torrent_32bit.php index 2afb118e..643923a5 100644 --- a/classes/class_torrent_32bit.php +++ b/classes/class_torrent_32bit.php @@ -248,29 +248,42 @@ 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; - foreach($Files as $File) { + 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; } natcasesort($FileNames); - foreach($FileNames as $Index => $FileName) { + foreach ($FileNames as $Index => $FileName) { $FileList[] = array($FileSizes[$Index], $FileName); } } 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: diff --git a/classes/class_torrent_form.php b/classes/class_torrent_form.php index 3e31c46b..905e187e 100644 --- a/classes/class_torrent_form.php +++ b/classes/class_torrent_form.php @@ -78,7 +78,7 @@ function head() { } ?> NewTorrent) { ?> - +
@@ -300,7 +300,7 @@ function show() { diff --git a/classes/class_wiki.php b/classes/class_wiki.php index 17525980..301670dc 100644 --- a/classes/class_wiki.php +++ b/classes/class_wiki.php @@ -1,6 +1,6 @@ PageID." ORDER BY RevisionID DESC"); //----------------------------------------------- ?> -
Torrent file @@ -94,8 +94,8 @@ function head() {

Be sure that your torrent is approved by the rules. Not doing this will result in a warning or worse.

NewTorrent) { ?> -

After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent. Make use of this time wisely, and search the requests.

+

After uploading the torrent, you will have a one hour grace period during which no one other than you can fill requests with this torrent. Make use of this time wisely, and search the requests.

NewTorrent) { echo "value=\"Upload torrent\""; } else { echo "value=\"Edit torrent\"";} ?> />
- + Disabled?> onblur="CheckYear();" /> This is the year of the original release.
+
@@ -83,4 +83,4 @@ function revision_history(){ } } // class -?> \ No newline at end of file +?> diff --git a/classes/script_start.php b/classes/script_start.php index 18d28b52..147b0eeb 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -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'); diff --git a/ocelot-0.5.1.tar.bz2 b/ocelot-0.5.1.tar.bz2 new file mode 100644 index 00000000..dee4418d Binary files /dev/null and b/ocelot-0.5.1.tar.bz2 differ diff --git a/ocelot-0.5.tar.bz2 b/ocelot-0.5.tar.bz2 deleted file mode 100644 index 602afb20..00000000 Binary files a/ocelot-0.5.tar.bz2 and /dev/null differ diff --git a/sections/comments/index.php b/sections/comments/index.php index bec0f266..c17c51ed 100644 --- a/sections/comments/index.php +++ b/sections/comments/index.php @@ -109,10 +109,10 @@ while(list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) { $UserInfo = user_info($UserID); ?> -
Revision Summary
' id="post"> - +
+
- # + # by on @@ -122,11 +122,11 @@ - + - ' width='150' alt="'s avatar" /> + <?=$UserInfo['Username']?>'s avatar Default avatar @@ -137,7 +137,7 @@ - + full_format($Body) ?> - diff --git a/sections/reportsv2/static.php b/sections/reportsv2/static.php index 2ea65432..dbdd5278 100644 --- a/sections/reportsv2/static.php +++ b/sections/reportsv2/static.php @@ -212,7 +212,7 @@
+ Report for torrent (deleted) has been automatically resolved.
- diff --git a/sections/top10/torrents.php b/sections/top10/torrents.php index 95a9c376..553b12b9 100644 --- a/sections/top10/torrents.php +++ b/sections/top10/torrents.php @@ -144,133 +144,188 @@ 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)) { - $DayAgo = time_minus(86400); - $Query = $BaseQuery.' WHERE t.Seeders>0 AND '; - if (!empty($Where)) { $Query .= $Where.' AND '; } - $Query .= " - t.Time>'$DayAgo' - ORDER BY (t.Seeders + t.Leechers) DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsActiveLastDay = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_day_'.$Limit.$WhereSum,$TopTorrentsActiveLastDay,3600*2); + $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 '; } + $Query .= " + t.Time>'$DayAgo' + ORDER BY (t.Seeders + t.Leechers) DESC + LIMIT $Limit;"; + $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)) { - $WeekAgo = time_minus(604800); - $Query = $BaseQuery.' WHERE '; - if (!empty($Where)) { $Query .= $Where.' AND '; } - $Query .= " - t.Time>'$WeekAgo' - ORDER BY (t.Seeders + t.Leechers) DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsActiveLastWeek = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_week_'.$Limit.$WhereSum,$TopTorrentsActiveLastWeek,3600*6); + $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 '; } + $Query .= " + t.Time>'$WeekAgo' + ORDER BY (t.Seeders + t.Leechers) DESC + LIMIT $Limit;"; + $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)) { - $Query = $BaseQuery.' WHERE '; - if (!empty($Where)) { $Query .= $Where.' AND '; } - $Query .= " - t.Time>'".sqltime()."' - INTERVAL 1 MONTH - ORDER BY (t.Seeders + t.Leechers) DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsActiveLastMonth = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_month_'.$Limit.$WhereSum,$TopTorrentsActiveLastMonth,3600*6); + $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 .= " + t.Time>'".sqltime()."' - INTERVAL 1 MONTH + ORDER BY (t.Seeders + t.Leechers) DESC + LIMIT $Limit;"; + $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)) { - // 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) { - $Query .= 't.Seeders>=200 AND '; - if (!empty($Where)) { $Query .= $Where.' AND '; } + $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) { + $Query .= 't.Seeders>=200 AND '; + if (!empty($Where)) { $Query .= $Where.' AND '; } + } + elseif (!empty($Where)) { $Query .= $Where.' AND '; } + $Query .= " + t.Time>'".sqltime()."' - INTERVAL 1 YEAR + ORDER BY (t.Seeders + t.Leechers) DESC + LIMIT $Limit;"; + $DB->query($Query); + $TopTorrentsActiveLastYear = $DB->to_array(false, MYSQLI_NUM); + $Cache->cache_value('top10tor_year_'.$Limit.$WhereSum,$TopTorrentsActiveLastYear,3600*6); + clear_query_lock('top10'); } - elseif (!empty($Where)) { $Query .= $Where.' AND '; } - $Query .= " - t.Time>'".sqltime()."' - INTERVAL 1 YEAR - ORDER BY (t.Seeders + t.Leechers) DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsActiveLastYear = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_year_'.$Limit.$WhereSum,$TopTorrentsActiveLastYear,3600*6); } 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)) { - // 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) { - $Query .= " WHERE t.Seeders>=500 "; - if (!empty($Where)) { $Query .= ' AND '.$Where; } + $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) { + $Query .= " WHERE t.Seeders>=500 "; + if (!empty($Where)) { $Query .= ' AND '.$Where; } + } + elseif (!empty($Where)) { $Query .= ' WHERE '.$Where; } + $Query .= " + ORDER BY (t.Seeders + t.Leechers) DESC + LIMIT $Limit;"; + $DB->query($Query); + $TopTorrentsActiveAllTime = $DB->to_array(false, MYSQLI_NUM); + $Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum,$TopTorrentsActiveAllTime,3600*6); + clear_query_lock('top10'); } - elseif (!empty($Where)) { $Query .= ' WHERE '.$Where; } - $Query .= " - ORDER BY (t.Seeders + t.Leechers) DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsActiveAllTime = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum,$TopTorrentsActiveAllTime,3600*6); } 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)) { - $Query = $BaseQuery; - if (!empty($Where)) { $Query .= ' WHERE '.$Where; } - $Query .= " - ORDER BY t.Snatched DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsSnatched = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_snatched_'.$Limit.$WhereSum,$TopTorrentsSnatched,3600*6); + $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 .= " + ORDER BY t.Snatched DESC + LIMIT $Limit;"; + $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)) { - // IMPORTANT NOTE - we use WHERE t.Snatched>100 in order to speed up this query. You should remove it! - $Query = $BaseQuery; - if ($Details=='all') { - $Query .= " WHERE t.Snatched>=100 "; - if (!empty($Where)) { $Query .= ' AND '.$Where; } + $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') { + $Query .= " WHERE t.Snatched>=100 "; + if (!empty($Where)) { $Query .= ' AND '.$Where; } + } + $Query .= " + ORDER BY Data DESC + LIMIT $Limit;"; + $DB->query($Query); + $TopTorrentsTransferred = $DB->to_array(false, MYSQLI_NUM); + $Cache->cache_value('top10tor_data_'.$Limit.$WhereSum,$TopTorrentsTransferred,3600*6); + clear_query_lock('top10'); } - $Query .= " - ORDER BY Data DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsTransferred = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_data_'.$Limit.$WhereSum,$TopTorrentsTransferred,3600*6); } 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) { - $Query = $BaseQuery; - if (!empty($Where)) { $Query .= ' WHERE '.$Where; } - $Query .= " - ORDER BY t.Seeders DESC - LIMIT $Limit;"; - $DB->query($Query); - $TopTorrentsSeeded = $DB->to_array(false, MYSQLI_NUM); - $Cache->cache_value('top10tor_seeded_'.$Limit.$WhereSum,$TopTorrentsSeeded,3600*6); + if ($TopTorrentsSeeded === false) { + if (query_locked('top10')) { + $TopTorrentsSeeded = false; + } else { + set_query_lock('top10'); + $Query = $BaseQuery; + if (!empty($Where)) { $Query .= ' WHERE '.$Where; } + $Query .= " + ORDER BY t.Seeders DESC + LIMIT $Limit;"; + $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,8 +374,20 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) { + + + +
+ No new reports! \o/
Peers
+ Server is busy processing another top10 request. Please try again in a minute. +

+
diff --git a/sections/torrents/details.php b/sections/torrents/details.php index e26ccac4..d3d187c0 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -421,7 +421,7 @@ function filelist($Str) { if(count($Reports) > 0) { $Reported = true; include(SERVER_ROOT.'/sections/reportsv2/array.php'); - $ReportInfo = ""; + $ReportInfo = '
This torrent has ".count($Reports)." active ".(count($Reports) > 1 ?'reports' : 'report').":
'; foreach($Reports as $Report) { list($ReportID, $ReporterID, $ReportType, $ReportReason, $ReportedTime) = $Report; diff --git a/sections/torrents/index.php b/sections/torrents/index.php index 4434fc62..6cf43109 100644 --- a/sections/torrents/index.php +++ b/sections/torrents/index.php @@ -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); diff --git a/sections/upload/upload_handle.php b/sections/upload/upload_handle.php index 1fdcad8a..27f4a89c 100644 --- a/sections/upload/upload_handle.php +++ b/sections/upload/upload_handle.php @@ -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'"; @@ -384,11 +384,11 @@ } // Add file and size to array - $TmpFileList []= $Name .'{{{'.$Size.'}}}'; // Name {{{Size}}} + $TmpFileList[] = $Name .'{{{'.$Size.'}}}'; // Name {{{Size}}} } // 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)))."'"; diff --git a/sections/user/edit.php b/sections/user/edit.php index 09f206fb..b75e3145 100644 --- a/sections/user/edit.php +++ b/sections/user/edit.php @@ -74,7 +74,7 @@ function checked($Checked) { -
This torrent has '.count($Reports).' active '.(count($Reports) > 1 ? "reports" : "report").':
+
Site preferences diff --git a/sections/userhistory/post_history.php b/sections/userhistory/post_history.php index 88c013fe..08f4abe1 100644 --- a/sections/userhistory/post_history.php +++ b/sections/userhistory/post_history.php @@ -253,8 +253,8 @@ next_record()){ ?> - ' id='post'> - +
+
@@ -293,11 +293,11 @@ - + - <?=$Username?>'s avatar + <?=$Username?>'s avatar @@ -305,7 +305,7 @@ - +
full_format($Body)?> diff --git a/sections/userhistory/subscriptions.php b/sections/userhistory/subscriptions.php index d6159780..4d9ba036 100644 --- a/sections/userhistory/subscriptions.php +++ b/sections/userhistory/subscriptions.php @@ -138,8 +138,8 @@ next_record()){ ?> - '> - +
+ - -
> @@ -160,7 +160,7 @@
+ ]+)+\.(jpg|jpeg|gif|png|tif|tiff|bmp)$/is',$AuthorAvatar)) { ?> <?=$AuthorName?>'s avatar @@ -170,7 +170,7 @@ +
full_format($Body) ?>