Connaître le nombre de spectateurs

I think I bought this up way back when I first started testing the platform.
Will there ever be a way to know how many people are subscribing (watching) a particular topic?

I am being asked for this information more often these days.

2 « J'aime »

This seems unlikely to ever be added as visible to non-administrators.

The freedom of individual users to choose how they want to consume the forum is important, and giving special consideration to Watching a topic by making the number visible to everyone is likely to create bad behavior patterns. (Number Go Up Syndrome is very powerful.)

You should be able to take a Data Explorer query that gets this data and mark it as runnable by moderators or employees, if that’s who the requests are coming from.

3 « J'aime »

We would never want this for non-admins. I will try this with the DE.

2 « J'aime »

Was this ability ever added to Discourse reporting?

Y a-t-il eu des mises à jour à ce sujet ?

Salut Tom,

Ceci n’a pas été ajouté comme rapport DE par défaut. Cependant, j’ai trouvé un sujet qui fournit une requête DE de base pour extraire ces informations, peut-être que cela vous sera utile :

2 « J'aime »

Salut Mark,

Merci. Donc, d’après cela, il semble que je ne puisse pas effectuer cette fonction au niveau du sujet. Est-ce correct ?

Tom,

Non, vous pouvez obtenir ces informations au niveau du sujet en remplaçant « topic » par « category » comme ceci :

SELECT 
  COUNT(topic_id)
FROM 
  topic_users 
WHERE 
  notification_level = 3

Encore une fois, il s’agit d’une requête très basique qui renvoie simplement un nombre total de spectateurs de… dans ce cas… tous les sujets. Si vous souhaitez spécifier un sujet particulier, vous pouvez l’ajouter à la clause WHERE, par exemple :

WHERE 
  notification_level = 3
  AND topic_id = 29
8 « J'aime »

C’est super !

Merci !

1 « J'aime »

C’est très utile, merci @MarkDoerr. J’ai modifié la requête pour rapporter les quatre niveaux de notification en une seule passe, et pour prendre un tableau de topic_id si nécessaire.
Le tableau de sortie complet n’est pas joli mais contient toutes les informations dont j’ai besoin.

edit : bien sûr, dès que j’ai posté, Discourse m’a gentiment montré six liens avec d’autres façons de résoudre ce problème ! Continuez à chercher !

SELECT 
  topic_id,
  notification_level,
  COUNT(CASE WHEN notification_level = 0 THEN topic_id END) AS Muted_0,
  COUNT(CASE WHEN notification_level = 1 THEN topic_id END) AS Normal_1,
  COUNT(CASE WHEN notification_level = 2 THEN topic_id END) AS Tracking_2,
  COUNT(CASE WHEN notification_level = 3 THEN topic_id END) AS Watching_3
FROM 
  topic_users 
WHERE 
  topic_id IN (9831, 9572, 9424, 7567) -- Ajoutez vos topic_ids ici
GROUP BY
  topic_id, notification_level
1 « J'aime »