Ich versuche herauszufinden, wie viele Benutzer entweder das dunkle oder das helle Thema verwenden. Für den Data Explorer habe ich folgenden Code zusammengestellt:
/* helles Thema */
SELECT COUNT(*)
FROM user_options
WHERE theme_ids[1] = 6
Soweit ich das beurteilen kann, wird die ID des Themas im Feld theme_ids und im Array-Element 1 gespeichert. Könnte das jemand bestätigen?
In unserer Einrichtung erscheint das dunkle Thema mit dem Wert 7 und das helle Thema mit dem Wert 6.
Wenn ich die Abfragen jedoch ausführe, erhalte ich 140 Personen, die das dunkle Thema nutzen, und 32, die das helle Thema nutzen. Da wir mehrere tausend Benutzer haben, scheint das etwas zu wenig zu sein. Ich vermute daher, dass meine zusammengestoppelte Abfrage falsch ist – oder werden diese Werte nur für Benutzer gespeichert, die das Thema explizit eingestellt haben, während diese Daten nicht gespeichert werden, wenn sie nur die Standardeinstellung verwenden?
Many thanks for the link, and the swift response! I’m pleased to see that I was looking at the right fields.
Just to confirm, is the data that is returned for only the users that have specifically set their theme, e.g. any users who haven’t set it wouldn’t be returned in the data set, so we could just assume that they are using the default theme?
Perfectly fine if this is the case, just want the clarification please
I checked with @Osama and indeed, the query would only show those who’ve set a theme in their preferences that’s different from the default on your site.
It also includes those who’ve changed back to the default theme after choosing some other non-default theme.
For all intents and purposes, all users that the query returns that use the default theme + any users that don’t show up can be counted as users that use the default theme.
The query will also return a breakdown of the number of users that chose any other user-selectable themes on your site.
Awesome, many thanks for the confirmation and info and thanks for @Osama who’s query looks better than mine - albeit I got the same results - but I’ll pinch that one