diff --git a/app/Feed.php b/app/Feed.php index f85416e8c..e3a44b0b9 100644 --- a/app/Feed.php +++ b/app/Feed.php @@ -90,7 +90,7 @@ class Feed extends Base { public function bookmark(User $user, string $feedName): string { return $this->wrap( $this->channel( - 'Bookmarked torrent notifications', + 'Bookmarked Torrent Notifications', 'RSS feed for bookmarked torrents' ) . $this->retrieve($user, $feedName) diff --git a/app/Json/Artist.php b/app/Json/Artist.php index 77b9eed56..ad744dcf4 100644 --- a/app/Json/Artist.php +++ b/app/Json/Artist.php @@ -21,15 +21,15 @@ class Artist extends \Gazelle\Json { public function payload(): array { $artist = $this->artist; - $artistId = $artist->id(); + $artistId = $artist->id; $artist->loadArtistRole(); - $GroupIDs = $artist->groupIds(); + $tgroupIds = $artist->groupIds(); $JsonTorrents = []; $Tags = []; - foreach ($GroupIDs as $GroupID) { - $tgroup = $this->tgMan->findById($GroupID); + foreach ($tgroupIds as $tgroupId) { + $tgroup = $this->tgMan->findById($tgroupId); if (is_null($tgroup)) { continue; } @@ -57,8 +57,8 @@ class Artist extends \Gazelle\Json { } $InnerTorrents[] = [ - 'id' => $torrent->id(), - 'groupId' => $GroupID, + 'id' => $torrent->id, + 'groupId' => $tgroupId, 'media' => $torrent->media(), 'format' => $torrent->format(), 'encoding' => $torrent->encoding(), @@ -77,11 +77,11 @@ class Artist extends \Gazelle\Json { 'seeders' => $torrent->seederTotal(), 'snatched' => $torrent->snatchTotal(), 'time' => $torrent->created(), - 'hasFile' => $torrent->id(), /* legacy wtf */ + 'hasFile' => $torrent->id, /* legacy wtf */ ]; } $JsonTorrents[] = [ - 'groupId' => $GroupID, + 'groupId' => $tgroupId, 'groupName' => $tgroup->name(), 'groupYear' => $tgroup->year(), 'groupRecordLabel' => $tgroup->recordLabel(), @@ -91,7 +91,7 @@ class Artist extends \Gazelle\Json { 'releaseType' => (int)$tgroup->releaseType(), 'wikiImage' => $tgroup->image(), 'groupVanityHouse' => $tgroup->isShowcase(), - 'hasBookmarked' => $this->bookmark->isTorrentBookmarked($GroupID), + 'hasBookmarked' => $this->bookmark->isTGroupBookmarked($tgroup), 'artists' => $artists, 'extendedArtists' => $tgroup->artistRole()->legacyList(), 'torrent' => $InnerTorrents, @@ -112,7 +112,7 @@ class Artist extends \Gazelle\Json { if (!$this->user->disableRequests()) { $requestList = array_map( fn ($r) => [ - 'requestId' => $r->id(), + 'requestId' => $r->id, 'categoryId' => $r->categoryId(), 'title' => $r->title(), 'year' => $r->year(), @@ -128,7 +128,7 @@ class Artist extends \Gazelle\Json { 'id' => $artistId, 'name' => $artist->name(), 'notificationsEnabled' => $this->user->hasArtistNotification($artist->name()), - 'hasBookmarked' => $this->bookmark->isArtistBookmarked($artistId), + 'hasBookmarked' => $this->bookmark->isArtistBookmarked($artist), 'image' => $artist->image(), 'body' => \Text::full_format($artist->body()), 'bodyBbcode' => $artist->body(), diff --git a/app/Json/Collage.php b/app/Json/Collage.php index 5758ffe36..98006142e 100644 --- a/app/Json/Collage.php +++ b/app/Json/Collage.php @@ -40,7 +40,7 @@ class Collage extends \Gazelle\Json { $entryList = $this->collage->entryList(); return array_merge( [ - 'id' => $this->collage->id(), + 'id' => $this->collage->id, 'name' => $this->collage->name(), 'description' => \Text::full_format($this->collage->description()), 'description_raw' => $this->collage->description(), @@ -51,7 +51,7 @@ class Collage extends \Gazelle\Json { 'locked' => $this->collage->isLocked(), 'maxGroups' => $this->collage->maxGroups(), 'maxGroupsPerUser' => $this->collage->maxGroupsPerUser(), - 'hasBookmarked' => new \Gazelle\User\Bookmark($this->user)->isCollageBookmarked($this->collage->id()), + 'hasBookmarked' => new \Gazelle\User\Bookmark($this->user)->isCollageBookmarked($this->collage), 'subscriberCount' => $this->collage->numSubscribers(), 'torrentGroupIDList' => $entryList, 'pages' => $this->collage->isArtist() ? 1 : ceil(count($entryList) / static::$ENTRIES_PER_PAGE), diff --git a/app/Json/Request.php b/app/Json/Request.php index a39a6552b..7e0d27649 100644 --- a/app/Json/Request.php +++ b/app/Json/Request.php @@ -20,7 +20,7 @@ class Request extends \Gazelle\Json { return [ ...$request->ajaxInfo(), 'requestorName' => $user->username(), - 'isBookmarked' => $this->bookmark->isRequestBookmarked($request->id()), + 'isBookmarked' => $this->bookmark->isRequestBookmarked($request), 'requestTax' => REQUEST_TAX, 'canEdit' => $request->canEdit($this->viewer), 'canVote' => $request->canVote($this->viewer), diff --git a/app/Json/TGroup.php b/app/Json/TGroup.php index 6a84156df..ff0fac79f 100644 --- a/app/Json/TGroup.php +++ b/app/Json/TGroup.php @@ -18,7 +18,7 @@ class TGroup extends \Gazelle\Json { 'wikiBBcode' => $tgroup->description(), 'wikiImage' => $tgroup->image(), 'proxyImage' => image_cache_encode($tgroup->image()), - 'id' => $tgroup->id(), + 'id' => $tgroup->id, 'name' => $tgroup->name(), 'year' => $tgroup->year(), 'recordLabel' => $tgroup->recordLabel() ?? '', @@ -29,7 +29,7 @@ class TGroup extends \Gazelle\Json { 'categoryName' => $tgroup->categoryName(), 'time' => $tgroup->time(), 'vanityHouse' => $tgroup->isShowcase(), - 'isBookmarked' => new \Gazelle\User\Bookmark($this->user)->isTorrentBookmarked($tgroup->id()), + 'isBookmarked' => new \Gazelle\User\Bookmark($this->user)->isTGroupBookmarked($tgroup), 'tags' => array_values($tgroup->tagNameList()), 'musicInfo' => $musicInfo, ]; diff --git a/app/Json/TGroupList.php b/app/Json/TGroupList.php index c3a80e709..bc96c2192 100644 --- a/app/Json/TGroupList.php +++ b/app/Json/TGroupList.php @@ -47,7 +47,7 @@ class TGroupList extends \Gazelle\Json { $prev = $current; $groupList[] = [ - 'torrentId' => $torrent->id(), + 'torrentId' => $torrent->id, 'editionId' => $EditionID, 'artists' => $tgroup->artistRole()->roleList()['main'], 'remastered' => $torrent->isRemastered(), @@ -83,7 +83,7 @@ class TGroupList extends \Gazelle\Json { 'artist' => $tgroup->artistName(), 'cover' => $tgroup->image(), 'tags' => array_values($tgroup->tagNameList()), - 'bookmarked' => $this->bookmark->isTorrentBookmarked($tgroup->id()), + 'bookmarked' => $this->bookmark->isTGroupBookmarked($tgroup), 'vanityHouse' => $tgroup->isShowcase(), 'groupYear' => $tgroup->year(), 'releaseType' => $tgroup->releaseTypeName() ?? '', @@ -108,7 +108,7 @@ class TGroupList extends \Gazelle\Json { $list[] = [ 'groupId' => $tgroupId, 'groupName' => $tgroup->name(), - 'torrentId' => $torrent->id(), + 'torrentId' => $torrent->id, 'tags' => array_values($tgroup->tagNameList()), 'category' => $tgroup->categoryName(), 'fileCount' => $torrent->fileTotal(), diff --git a/app/User/Bookmark.php b/app/User/Bookmark.php index f027e092e..c9e26bdd6 100644 --- a/app/User/Bookmark.php +++ b/app/User/Bookmark.php @@ -2,6 +2,11 @@ namespace Gazelle\User; +use Gazelle\Artist; +use Gazelle\Collage; +use Gazelle\Request; +use Gazelle\TGroup; + class Bookmark extends \Gazelle\BaseUser { final public const tableName = 'pm_conversations_users'; // not really @@ -134,29 +139,29 @@ class Bookmark extends \Gazelle\BaseUser { /** * Check if an artist is bookmarked by a user */ - public function isArtistBookmarked(int $artistId): bool { - return in_array($artistId, $this->allBookmarks('artist')); + public function isArtistBookmarked(Artist $artist): bool { + return in_array($artist->id, $this->allBookmarks('artist')); } /** * Check if a collage is bookmarked by a user */ - public function isCollageBookmarked(int $collageId): bool { - return in_array($collageId, $this->allBookmarks('collage')); + public function isCollageBookmarked(Collage $collage): bool { + return in_array($collage->id, $this->allBookmarks('collage')); } /** * Check if a request is bookmarked by a user */ - public function isRequestBookmarked(int $requestId): bool { - return in_array($requestId, $this->allBookmarks('request')); + public function isRequestBookmarked(Request $request): bool { + return in_array($request, $this->allBookmarks('request')); } /** * Check if an torrent is bookmarked by a user */ - public function isTorrentBookmarked(int $tgroupId): bool { - return in_array($tgroupId, $this->allBookmarks('torrent')); + public function isTGroupBookmarked(TGroup $tgroup): bool { + return in_array($tgroup->id, $this->allBookmarks('torrent')); } /** @@ -181,7 +186,9 @@ class Bookmark extends \Gazelle\BaseUser { return $bookmarkList; } - public function torrentArtistLeaderboard(\Gazelle\Manager\Artist $artistMan): array { + public function tgroupArtistLeaderboard( + \Gazelle\Manager\Artist $artistMan = new \Gazelle\Manager\Artist(), + ): array { self::$db->prepared_query(" SELECT aa.ArtistID AS id, count(*) AS total @@ -206,7 +213,7 @@ class Bookmark extends \Gazelle\BaseUser { return $list; } - public function torrentArtistTotal(): int { + public function tgroupArtistTotal(): int { return (int)self::$db->scalar(" SELECT count(*) AS total FROM bookmarks_torrents b @@ -216,7 +223,7 @@ class Bookmark extends \Gazelle\BaseUser { ); } - public function torrentTagLeaderboard(): array { + public function tgroupTagLeaderboard(): array { self::$db->prepared_query(" SELECT t.Name AS name, count(*) AS total @@ -261,7 +268,7 @@ class Bookmark extends \Gazelle\BaseUser { * Returns an array of torrent bookmarks * @return array containing [group_id, seq, added, torrent_id] */ - public function torrentList(int $limit, int $offset): array { + public function tgroupList(int $limit, int $offset): array { self::$db->prepared_query(" SELECT b.GroupID AS tgroup_id, b.Sort AS seq, diff --git a/sections/artist/artist.php b/sections/artist/artist.php index 3f0141401..2794e19fd 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -17,7 +17,7 @@ if (is_null($artist)) { Error404::error(); } $artist->loadArtistRole(); -$artistId = $artist->id(); +$artistId = $artist->id; $bookmark = new User\Bookmark($Viewer); $collageMan = new Manager\Collage(); @@ -39,7 +39,7 @@ if (count($artist->groupIds()) > 1000) { echo $Twig->render('artist/header.twig', [ 'artist' => $artist, - 'is_bookmarked' => $bookmark->isArtistBookmarked($artist->id()), + 'is_bookmarked' => $bookmark->isArtistBookmarked($artist), 'is_subscribed' => $isSubscribed, 'revision_id' => $revisionId, 'viewer' => $Viewer, @@ -247,7 +247,7 @@ if ($sections = $artist->sections()) { echo $Twig->render('bookmark/action.twig', [ 'class' => 'torrent', 'id' => $groupId, - 'is_bookmarked' => $bookmark->isTorrentBookmarked($groupId), + 'is_bookmarked' => $bookmark->isTGroupBookmarked($tgroup), ]); if (!$Viewer->option('NoVoteLinks')) { diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index 0d6045b76..0b7d4b0bd 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -38,13 +38,13 @@ $collMan = new Manager\Collage()->setImageProxy(new Util\ImageProxy($Viewer)); $paginator = new Util\Paginator(200, (int)($_GET['page'] ?? 1)); $paginator->setTotal($bookmark->torrentTotal()); -$bookmarkList = $bookmark->torrentList($paginator->limit(), $paginator->offset()); +$bookmarkList = $bookmark->tgroupList($paginator->limit(), $paginator->offset()); $NumGroups = count($bookmarkList); -$artistLeaderboard = $bookmark->torrentArtistLeaderboard(new Manager\Artist()); -$tagLeaderboard = $bookmark->torrentTagLeaderboard(); +$artistLeaderboard = $bookmark->tgroupArtistLeaderboard(); +$tagLeaderboard = $bookmark->tgroupTagLeaderboard(); $CollageCovers = (int)($Viewer->option('CollageCovers') ?? 25); -View::show_header($user->username() . " › Bookmarked torrent groups", ['js' => 'browse,collage']); +View::show_header($user->username() . " › Bookmarked Torrent Groups", ['js' => 'browse,collage']); ?>
@@ -56,10 +56,10 @@ if ($ownProfile) { RSS feed  - link() ?> › Bookmarked torrent groups + link() ?> › Bookmarked Torrent Groups
diff --git a/sections/collages/collage.php b/sections/collages/collage.php index 410e66d32..0744ceb36 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -5,16 +5,15 @@ declare(strict_types=1); namespace Gazelle; $collageMan = new Manager\Collage(); -$Collage = $collageMan->findById((int)($_GET['id'] ?? 0)); -if (is_null($Collage)) { +$collage = $collageMan->findById((int)($_GET['id'] ?? 0)); +if (is_null($collage)) { Error404::error(); } - -if ($Collage->isDeleted()) { - header("Location: log.php?search=Collage+" . $Collage->id()); +if ($collage->isDeleted()) { + header("Location: log.php?search=Collage+" . $collage->id); exit; } -require_once $Collage->isArtist() ? 'collage_artists.php' : 'collage_torrent.php'; +require_once $collage->isArtist() ? 'collage_artists.php' : 'collage_torrent.php'; View::show_footer(); diff --git a/sections/collages/collage_artists.php b/sections/collages/collage_artists.php index 6393872f4..1b51bc696 100644 --- a/sections/collages/collage_artists.php +++ b/sections/collages/collage_artists.php @@ -8,14 +8,12 @@ declare(strict_types=1); namespace Gazelle; -/** @var Collage $Collage required from collage.php */ -$Collage->setViewer($Viewer); -$CollageID = $Collage->id(); -$CollageCovers = (int)($Viewer->option('CollageCovers') ?? 25) * (1 - (int)$Viewer->option('HideCollage')); -$CollagePages = []; -$NumGroups = $Collage->numEntries(); -$Artists = $Collage->artistList(); -$NumGroups = $Collage->numArtists(); +/** @var Collage $collage required from collage.php */ +$collage->setViewer($Viewer); +$collageCovers = (int)($Viewer->option('CollageCovers') ?? 25) * (1 - (int)$Viewer->option('HideCollage')); +$collagePages = []; +$Artists = $collage->artistList(); +$NumGroups = $collage->numArtists(); $NumGroupsByUser = 0; $Render = []; $ArtistTable = ''; @@ -31,30 +29,30 @@ foreach ($Artists as $id => $Artist) { $Render[] = "
  • $image
  • "; } -if ($CollageCovers) { - if ($NumGroups > $CollageCovers) { +if ($collageCovers) { + if ($NumGroups > $collageCovers) { $Render = array_merge($Render, - array_fill(0, $CollageCovers * (int)ceil($NumGroups / $CollageCovers) - $NumGroups, '
  • ') + array_fill(0, $collageCovers * (int)ceil($NumGroups / $collageCovers) - $NumGroups, '
  • ') ); } - for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) { - $CollagePages[] = implode('', array_slice($Render, $i * $CollageCovers, $CollageCovers)); + for ($i = 0; $i < $NumGroups / $collageCovers; $i++) { + $collagePages[] = implode('', array_slice($Render, $i * $collageCovers, $collageCovers)); } } echo $Twig->render('collage/header.twig', [ - 'bookmarked' => new User\Bookmark($Viewer)->isCollageBookmarked($CollageID), - 'collage' => $Collage, + 'bookmarked' => new User\Bookmark($Viewer)->isCollageBookmarked($collage), + 'collage' => $collage, 'object' => 'artist', 'viewer' => $Viewer, ]); echo $Twig->render('collage/sidebar.twig', [ 'artists' => 0, // only makes sense for torrent collages - 'collage' => $Collage, - 'comments' => new Manager\Comment()->collageSummary($Collage), - 'contributors' => array_slice($Collage->contributors(), 0, 5, true), - 'entries' => $Collage->numArtists(), + 'collage' => $collage, + 'comments' => new Manager\Comment()->collageSummary($collage), + 'contributors' => array_slice($collage->contributors(), 0, 5, true), + 'entries' => $collage->numArtists(), 'object' => 'artist', 'object_name' => 'artist', 'viewer' => $Viewer, @@ -62,32 +60,32 @@ echo $Twig->render('collage/sidebar.twig', [ ?>
    - +
    Cover Art
    - $CollageCovers) { ?> + $collageCovers) { ?> setImageProxy(new \Gazelle\Util\ImagePro $urlStem = new User\Stylesheet($Viewer)->imagePath(); $vote = new User\Vote($Viewer); -/** @var Collage $Collage required from collage.php */ +/** @var Collage $collage required from collage.php */ -$Collage->setViewer($Viewer); -$CollageID = $Collage->id(); -$CollageCovers = (int)($Viewer->option('CollageCovers') ?? 25) * (1 - (int)$Viewer->option('HideCollage')); -$CollagePages = []; -$NumGroups = $Collage->numEntries(); +$collage->setViewer($Viewer); +$collageCovers = (int)($Viewer->option('CollageCovers') ?? 25) * (1 - (int)$Viewer->option('HideCollage')); +$collagePages = []; +$NumGroups = $collage->numEntries(); $snatcher = $Viewer->snatch(); -$entryList = $Collage->entryList(); +$entryList = $collage->entryList(); $groupsClosed = (bool)$Viewer->option('TorrentGrouping'); echo $Twig->render('collage/header.twig', [ - 'bookmarked' => $bookmark->isCollageBookmarked($CollageID), - 'collage' => $Collage, + 'bookmarked' => $bookmark->isCollageBookmarked($collage), + 'collage' => $collage, 'object' => 'torrent', 'viewer' => $Viewer, ]); echo$Twig->render('collage/sidebar.twig', [ - 'artists' => $Collage->numArtists(), - 'collage' => $Collage, - 'comments' => new Manager\Comment()->collageSummary($Collage), - 'contributors' => array_slice($Collage->contributors(), 0, 5, true), - 'entries' => $Collage->numEntries(), + 'artists' => $collage->numArtists(), + 'collage' => $collage, + 'comments' => new Manager\Comment()->collageSummary($collage), + 'contributors' => array_slice($collage->contributors(), 0, 5, true), + 'entries' => $collage->numEntries(), 'object' => 'torrent', 'object_name' => 'torrent group', - 'top_artists' => $Collage->topArtists(10), - 'top_tags' => $Collage->topTags(5), + 'top_artists' => $collage->topArtists(10), + 'top_tags' => $collage->topTags(5), 'viewer' => $Viewer, ]); @@ -66,7 +65,7 @@ if ($Viewer->permitted('zip_downloader')) {
    - +
    • @@ -116,13 +115,13 @@ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks
    - +
    Cover Art
      findById($tgroupId); if ($tgroup) { @@ -136,22 +135,22 @@ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks ?>
    - $CollageCovers) { ?> + $collageCovers) { ?> findById($id); @@ -161,17 +160,17 @@ echo ' selected="selected"'; } ?>>Prefer Bonus Tracks ); } } - if ($NumGroups > $CollageCovers) { - for ($i = $NumGroups + 1; $i <= ceil($NumGroups / $CollageCovers) * $CollageCovers; $i++) { - $CollagePages[count($CollagePages) - 1] .= '
  • '; + if ($NumGroups > $collageCovers) { + for ($i = $NumGroups + 1; $i <= ceil($NumGroups / $collageCovers) * $collageCovers; $i++) { + $collagePages[count($collagePages) - 1] .= '
  • '; } } ?> @@ -226,7 +225,7 @@ foreach ($entryList as $tgroupId) { echo $Twig->render('bookmark/action.twig', [ 'class' => 'torrent', 'id' => $tgroupId, - 'is_bookmarked' => $bookmark->isTorrentBookmarked($tgroupId), + 'is_bookmarked' => $bookmark->isTGroupBookmarked($tgroup), ]); if (!$Viewer->option('NoVoteLinks') && $Viewer->permitted('site_album_votes')) { ?> diff --git a/sections/requests/request.php b/sections/requests/request.php index e4a3645b9..1016e7104 100644 --- a/sections/requests/request.php +++ b/sections/requests/request.php @@ -11,7 +11,7 @@ if (is_null($request)) { Error404::error(); } -$commentPage = new Comment\Request($request->id(), (int)($_GET['page'] ?? 0), (int)($_GET['postid'] ?? 0)); +$commentPage = new Comment\Request($request->id, (int)($_GET['page'] ?? 0), (int)($_GET['postid'] ?? 0)); $commentPage->load()->handleSubscription($Viewer); $paginator = new Util\Paginator(TORRENT_COMMENTS_PER_PAGE, $commentPage->pageNum()); @@ -35,8 +35,8 @@ echo $Twig->render('request/detail.twig', [ 'unit_GiB' => isset($unitGiB), 'comment_page' => $commentPage, 'filler' => $userMan->findById($request->fillerId()), - 'is_bookmarked' => new User\Bookmark($Viewer)->isRequestBookmarked($request->id()), - 'is_subscribed' => new User\Subscription($Viewer)->isSubscribedComments('requests', $request->id()), + 'is_bookmarked' => new User\Bookmark($Viewer)->isRequestBookmarked($request), + 'is_subscribed' => new User\Subscription($Viewer)->isSubscribedComments('requests', $request->id), 'paginator' => $paginator, 'reply' => new Util\Textarea('quickpost', '', 90, 8)->setPreviewManual(true), 'request' => $request, diff --git a/sections/top10/torrents.php b/sections/top10/torrents.php index ae60aaec7..7c4159006 100644 --- a/sections/top10/torrents.php +++ b/sections/top10/torrents.php @@ -218,7 +218,7 @@ foreach ($context as $c) { continue; } $tgroup = $torrent->group(); - $isBookmarked = $bookmark->isTorrentBookmarked($tgroup->id()); + $isBookmarked = $bookmark->isTGroupBookmarked($tgroup); ?> diff --git a/sections/top10/votes.php b/sections/top10/votes.php index 34497fc38..7ad07611c 100644 --- a/sections/top10/votes.php +++ b/sections/top10/votes.php @@ -184,7 +184,7 @@ echo ' [' . $tgroup->year() . ']'; } ?> render('bookmark/action.twig', [ 'class' => 'torrent', 'id' => $tgroupId, - 'is_bookmarked' => $bookmark->isTorrentBookmarked($tgroupId), + 'is_bookmarked' => $bookmark->isTGroupBookmarked($tgroup), ]) ?>
    diff --git a/sections/torrents/browse.php b/sections/torrents/browse.php index cf1f0c592..2ebad9073 100644 --- a/sections/torrents/browse.php +++ b/sections/torrents/browse.php @@ -165,7 +165,7 @@ foreach ($Results as $Key => $GroupID) { if ($GroupResults && (count($torrentList) > 1 || $tgroup->categoryGrouped())) { ?> -render('tgroup/collapse-tgroup.twig', [ 'closed' => $groupsClosed, 'id' => $tgroup->id() ]) ?> +render('tgroup/collapse-tgroup.twig', ['closed' => $groupsClosed, 'id' => $tgroup->id]) ?>
    @@ -181,8 +181,8 @@ foreach ($Results as $Key => $GroupID) { render('bookmark/action.twig', [ 'class' => 'torrent', - 'id' => $tgroup->id(), - 'is_bookmarked' => $bookmark->isTorrentBookmarked($tgroup->id()), + 'id' => $tgroup->id, + 'is_bookmarked' => $bookmark->isTGroupBookmarked($tgroup), ]) ?>
    @@ -203,9 +203,9 @@ foreach ($Results as $Key => $GroupID) { stats()->leechTotal())?> $GroupID) { $EditionID++; ?> - + render('torrent/edition-header.twig', [ 'edition_id' => $EditionID, @@ -236,7 +236,7 @@ foreach ($Results as $Key => $GroupID) { $prev = $current; $SnatchedTorrentClass = $snatcher->showSnatch($torrent) ? ' snatched_torrent' : ''; ?> - + render('torrent/action-v2.twig', [ 'pl' => true, diff --git a/sections/torrents/details.php b/sections/torrents/details.php index accdf432a..22b90ac5b 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -18,7 +18,7 @@ $tgroup = $tgMan->findById((int)($_GET['id'] ?? 0)); if (is_null($tgroup)) { Error404::error(); } -$tgroupId = $tgroup->id(); +$tgroupId = $tgroup->id; $RevisionID = (int)($_GET['revisionid'] ?? 0); // Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly) @@ -59,7 +59,7 @@ $section = [ ]; echo $Twig->render('torrent/detail-header.twig', [ - 'is_bookmarked' => new User\Bookmark($Viewer)->isTorrentBookmarked($tgroup->id()), + 'is_bookmarked' => new User\Bookmark($Viewer)->isTGroupBookmarked($tgroup), 'is_subscribed' => $isSubscribed, 'revision_id' => $RevisionID, 'tgroup' => $tgroup, @@ -138,7 +138,7 @@ if ($musicRelease) { echo $Twig->render('tgroup/stats.twig', [ 'collage_list' => $collageMan->addToCollageDefault($tgroup, $Viewer), 'featured' => new Manager\FeaturedAlbum()->findById($tgroupId), - 'tag_undo' => $Cache->get_value("deleted_tags_{$tgroupId}_{$Viewer->id()}"), + 'tag_undo' => $Cache->get_value("deleted_tags_{$tgroupId}_{$Viewer->id}"), 'tgroup' => $tgroup, 'viewer' => $Viewer, 'vote' => $vote, diff --git a/sections/torrents/notify.php b/sections/torrents/notify.php index c6609a020..9173caf2c 100644 --- a/sections/torrents/notify.php +++ b/sections/torrents/notify.php @@ -21,7 +21,7 @@ if ($Viewer->permitted('users_mod') && (int)($_GET['userid'] ?? 0)) { $user = $Viewer; } $UserID = $user->id; -$ownProfile = $UserID === $Viewer->id(); +$ownProfile = $UserID === $Viewer->id; $imgTag = '%s'; @@ -113,7 +113,7 @@ View::show_header(($ownProfile ? 'My' : $user->username() . "'s") . ' notificati id(); + $torrentId = $torrent->id; $tgroup = $torrent->group(); $match = $tgroup->artistRole()?->matchName($filter['filter']->artistList()); ?> @@ -150,8 +150,8 @@ View::show_header(($ownProfile ? 'My' : $user->username() . "'s") . ' notificati } echo $Twig->render('bookmark/action.twig', [ 'class' => 'torrent', - 'id' => $tgroup->id(), - 'is_bookmarked' => $bookmark->isTorrentBookmarked($tgroup->id()), + 'id' => $tgroup->id, + 'is_bookmarked' => $bookmark->isTGroupBookmarked($tgroup), ]); ?>
    diff --git a/templates/bookmark/artist.twig b/templates/bookmark/artist.twig index 1e59ba5a1..16328511d 100644 --- a/templates/bookmark/artist.twig +++ b/templates/bookmark/artist.twig @@ -1,7 +1,7 @@ -{{ header(user.username ~ ' › Bookmarked artists', {'js': 'browse'}) }} +{{ header(user.username ~ ' › Bookmarked Artists', {'js': 'browse'}) }}
    -

    {{ user.id|user_url }} › Bookmarked artists

    +

    {{ user.id|user_url }} › Bookmarked Artists