MyBB Community Forums

Full Version: How do I see which themes are being used by which users?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I remember a plugin on a previous MyBB that allowed an admin to go into a section in the admin panel and see which users were using which themes.  I think it was called something like theme peek?  I can't find anything like that or any alternative for MyBB 1.8.  Is this feature built in now, and if so, how do I access it?  If it's not built in, how do I add it?
If you have a target user then:
Goto ACP > Users & Groups, Click on the targe user's username to open User edit panel, select "Account Settings" tab. Scroll down for the dropdown "Theme".

The already selected theme is being used by that user.
You can use any database administration tool as well (pypMyAdmin, adminer.php) and have a look into table mybb_users.
SELECT uid, username, style FROM mybb_users [ORDER BY style]
"style" contains the ID of activated theme, 0 is default theme.

Schöne Grüße Smile
[ExiTuS]
This might make an interesting plugin.
(2021-04-01, 10:34 PM)dragonexpert Wrote: [ -> ]This might make an interesting plugin.

For plugin purpose

SELECT u.uid, u.username, t.name FROM mybb_users u left join mybb_themes t on (u.style=t.tid)

Note: Theme name showing NULL means board's default theme.
Even better:
SELECT u.uid, u.username, IFNULL(t.name, 'Board Default') as theme FROM mybb_users u LEFT JOIN mybb_themes t ON (u.style=t.tid)


Or, may be:
SELECT u.uid, u.username, IFNULL(t.name, CONCAT((SELECT name FROM mybb_themes WHERE def=1),'*')) as theme FROM mybb_users u LEFT JOIN mybb_themes t ON (u.style=t.tid)

In the last one users using board default will have a * appended with the default theme name. Users using default theme by choice will not have the * at the end of theme name.

[Image: 113363776-692ad600-936f-11eb-92e2-89463fab7a2f.png]
(2021-04-01, 10:59 PM)effone Wrote: [ -> ]Even better:
SELECT u.uid, u.username, IFNULL(t.name, 'Board Default') as theme FROM mybb_users u LEFT JOIN mybb_themes t ON (u.style=t.tid)


Or, may be:
SELECT u.uid, u.username, IFNULL(t.name, CONCAT((SELECT name FROM mybb_themes WHERE def=1),'*')) as theme FROM mybb_users u LEFT JOIN mybb_themes t ON (u.style=t.tid)

In the last one users using board default will have a * appended with the default theme name. Users using default theme by choice will not have the * at the end of theme name.

[Image: 113363776-692ad600-936f-11eb-92e2-89463fab7a2f.png]




This looks perfect!  Now, I've never created a plugin before but I have edited quite a few of them with great success.  I'd like to try my hand at making this into a plugin, if that's ok?   Is there a really clear guide I can check out somewhere that would fill in the blanks for me between the SQL you wrote, and the default back bone coding it needs to run as a plugin?  Or perhaps some kind of plugin templates that would make it much easier visually to know what to do?