add total number of comments and favs to rankingpage
This commit is contained in:
@@ -176,10 +176,8 @@
|
||||
"font_default": "Standard",
|
||||
"theme": "Thema",
|
||||
"flash_section": "Flash",
|
||||
|
||||
"flash_bg": "Flash im Hintergrund abspielen",
|
||||
"flash_bg_hint": "Verhindert, dass Ruffle pausiert, wenn der Tab verlassen wird",
|
||||
|
||||
"notifications_section": "Benachrichtigungseinstellungen",
|
||||
"receive_system_notifications": "Systembenachrichtigungen erhalten",
|
||||
"receive_system_notifications_hint": "Benachrichtigungen über Erfolg/Fehler bei Hintergrund-Uploads umschalten. Kritische Moderationsaktionen werden immer angezeigt.",
|
||||
@@ -444,6 +442,8 @@
|
||||
"stat_sfw": "SFW-Inhalte",
|
||||
"stat_nsfw": "NSFW-Inhalte",
|
||||
"stat_deleted": "Gelöscht",
|
||||
"stat_comments": "Gesamt Kommentare",
|
||||
"stat_favs": "Gesamt Favoriten",
|
||||
"most_favorited": "Meiste Favs",
|
||||
"favs": "Favs",
|
||||
"top_xd": "Top xD-Score"
|
||||
@@ -692,4 +692,4 @@
|
||||
"replying_to": "Antwort an {user}",
|
||||
"reply": "Antworten"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,6 +448,8 @@
|
||||
"stat_sfw": "SFW content",
|
||||
"stat_nsfw": "NSFW content",
|
||||
"stat_deleted": "Deleted",
|
||||
"stat_comments": "Total Comments",
|
||||
"stat_favs": "Total Favorites",
|
||||
"most_favorited": "Most Favorited",
|
||||
"favs": "favs",
|
||||
"top_xd": "Top xD Scores"
|
||||
|
||||
@@ -444,6 +444,8 @@
|
||||
"stat_sfw": "SFW-inhoud",
|
||||
"stat_nsfw": "NSFW-inhoud",
|
||||
"stat_deleted": "Verwijderd",
|
||||
"stat_comments": "Totaal aantal reacties",
|
||||
"stat_favs": "Totaal aantal favorieten",
|
||||
"most_favorited": "Meest Gefavoriet",
|
||||
"favs": "favorieten",
|
||||
"top_xd": "Top xD-scores"
|
||||
|
||||
@@ -446,6 +446,8 @@
|
||||
"stat_sfw": "SFW-Inhalt",
|
||||
"stat_nsfw": "NSFW-Inhalt",
|
||||
"stat_deleted": "Gelöscht",
|
||||
"stat_comments": "Gesamtanzahl Kommentare",
|
||||
"stat_favs": "Gesamtanzahl Favoriten",
|
||||
"most_favorited": "Am häufigsten favorisiert",
|
||||
"favs": "Favoriten",
|
||||
"top_xd": "Beste xD-Punktestände"
|
||||
|
||||
@@ -22,6 +22,20 @@ export default (router, tpl) => {
|
||||
`;
|
||||
const stats = await lib.countf0cks();
|
||||
|
||||
const totalComments = +(await db`
|
||||
select count(*) as total
|
||||
from comments
|
||||
join items on comments.item_id = items.id
|
||||
where comments.is_deleted = false and items.active = true
|
||||
`)[0].total;
|
||||
|
||||
const totalFavs = +(await db`
|
||||
select count(*) as total
|
||||
from favorites
|
||||
join items on favorites.item_id = items.id
|
||||
where items.active = true
|
||||
`)[0].total;
|
||||
|
||||
const hoster = await db`
|
||||
with t as (
|
||||
select
|
||||
@@ -77,6 +91,8 @@ export default (router, tpl) => {
|
||||
hoster,
|
||||
favotop,
|
||||
xdtop,
|
||||
totalComments,
|
||||
totalFavs,
|
||||
tmp: null,
|
||||
session: (req.session && req.session.user) ? { ...req.session } : false,
|
||||
page_meta: {
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
<table class="stats-table clean-table">
|
||||
<tbody>
|
||||
<tr><td>{{ t('ranking.stat_total') }}</td><td>{{ stats.total }}</td></tr>
|
||||
<tr><td>{{ t('ranking.stat_comments') }}</td><td>{{ totalComments }}</td></tr>
|
||||
<tr><td>{{ t('ranking.stat_favs') }}</td><td>{{ totalFavs }}</td></tr>
|
||||
<tr><td>{{ t('ranking.stat_tagged') }}</td><td>{{ stats.tagged }}</td></tr>
|
||||
<tr><td>{{ t('ranking.stat_untagged') }}</td><td>{{ stats.untagged }}</td></tr>
|
||||
<tr><td>{{ t('ranking.stat_sfw') }}</td><td>{{ stats.sfw }}</td></tr>
|
||||
|
||||
Reference in New Issue
Block a user