Previous Thread
Next Thread
Print Thread
Hop To
Joined: Apr 2008
Posts: 33
R
newbie
newbie
R Offline
Joined: Apr 2008
Posts: 33
I'd like to know which of our members have selected particular settings for a couple of preferences, specifically:

1) Who has the preferred stylesheet pref set to ubbthreads-dark

2) Who has the Do you wish to have the 'My Stuff' menu as a left navigation menu? pref set to yes

Am guessing I can run queries to come up with a list for each, but I have no idea what those queries might be. Am I on the right track, and if so could someone provide the queries?


Running UBB.threads 7.5.5 as of May 23 2010
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
1.
SQL Query
SELECT u.USER_ID, u.USER_DISPLAY_NAME 
FROM ubbt_USERS u, 
ubbt_USER_PROFILE up 
WHERE up.USER_ID=u.USER_ID 
AND up.USER_STYLE=2

.. assumes ubbthreads dark is 2 (you can replace as needed)

2.
SQL Query
SELECT u.USER_ID, u.USER_DISPLAY_NAME 
FROM ubbt_USERS u, 
ubbt_USER_PROFILE up 
WHERE up.USER_ID=u.USER_ID 
AND up.USER_SHOW_LEFT_MYSTUFF=1

3. also an easy way to check on style popularity is

SQL Query
SELECT 
CONCAT('[*][url=http://yoursite.com/ubbthreads/ubbthreads.php?ubb=previewskin&skin=',t2.STYLE_ID ,']',STYLE_NAME,'[/url]') AS Style, 
CONCAT('[color:red](',COUNT(t2.STYLE_NAME),')[/color]') as Count 
FROM ubbt_STYLES as t2, 
ubbt_USER_PROFILE as t1 
WHERE t1.USER_STYLE=t2.STYLE_ID 
GROUP BY t2.STYLE_ID 
ORDER BY t2.STYLE_NAME

replace 'yoursite.com/ubbthreads/' with the real path to your site..

the concat crapola just makes it easy to copy/paste the resulting recordset between a [list] ... tag for display in a post

smile


Joined: Apr 2008
Posts: 33
R
newbie
newbie
R Offline
Joined: Apr 2008
Posts: 33
Thanks, Sirdude!

Query #1 worked like a charm. With #2 I got this error:

Line#: 101
SQL Error: Unknown column 'u.USER.ID' in 'field list'
SQL Error #: 1054

I noticed that in #1 you used u.USER_ID so I gathered my courage ( laugh ) and substituted that for u.USER.ID in #2, like this:

SQL Query
SELECT u.USER_ID, u.USER_DISPLAY_NAME 
FROM ubbt_USERS u, 
ubbt_USER_PROFILE up 
WHERE up.USER_ID=u.USER_ID 
AND up.USER_SHOW_LEFT_MYSTUFF=1
Got believable results with that, so I guess I guessed right?


Running UBB.threads 7.5.5 as of May 23 2010
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yah.. i typed them up on the fly... laugh

good one! wink

Joined: Apr 2008
Posts: 33
R
newbie
newbie
R Offline
Joined: Apr 2008
Posts: 33
Nice to know my brain can figure out some stuff. grin

I ran #3 and at first thought the numbers couldn't be right, then realized that query must not count those who have their style pref set to "Always use default" (which in our case turns out to be most users).

Thanks again for your help. smile


Running UBB.threads 7.5.5 as of May 23 2010
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yes, you are correct.. it really only counts those users who cared to (or even knew HOW to) change their preference to a specific style wink

then i copy the query results (click, drag select with mouse, copy / paste into thread) between a list tag and :



is easily inserted into a post... i went further and made a custom island that updates with that stuff, but you get the idea wink

note: the actual links here point to 'yourdomain.com' style preview, so they will be broken.. this is conceptualizing only laugh


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Ruben), 802 guests, and 202 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)