PDA

View Full Version : Number of users using style


Spyke
11-30-2004, 03:14 PM
hi,

I was just wondering if this mod was made or if someone could throw it together if it wouldn't be to hard to make.

I know that there's a "what style each user is using" type mod already made where it shows the users style in the post bit. But what i'd like i for it to just show the number of users who use that specific style from the style chooser. I've seen it on a couple other forums so i know that it is around somewhere.

For example

Style 1 (3)
Style 2 (67)
Style 3 (1)
Style 4 (143)

etc.

Thanks!

Andreas
11-30-2004, 03:38 PM
SELECT count( user.styleid ) AS count, title FROM user LEFT JOIN style ON ( style.styleid = user.styleid ) GROUP BY user.styleid

title=NULL means using board default

Spyke
11-30-2004, 04:46 PM
ok thanks.

Does it mean that no user is using the style if it doesn't show anything? Just asking because one of the styles wasn't listed.

Is there anyway to get those numbers showing in the skin chooser, beside the respectable style, in the forums footer?

Thanks again.

Spyke
12-01-2004, 04:27 PM
*bump*

Andreas
12-01-2004, 09:50 PM
Hmm, doesn't such a hack already exist?
I think i saw it somewhere ...

Spyke
12-01-2004, 11:13 PM
I searched but couldn't find one other then the one that shows which style you're using in the postbit.

If it's out there, anyone want to show me in the right direction?

Thanks.

Cloud-Warrior
12-02-2004, 09:59 AM
This might help, I wrote it for a DHTML menu:


$styleslist = "";

$stylesets = $DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user
LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid ORDER BY style.title");
if (!isset($bbuserinfo['realstyleid'])) {
$bbuserinfo['realstyleid'] = $bbuserinfo['styleid'];
}
while ($thisset = $DB_site->fetch_array($stylesets)) {
if ($bbuserinfo['realstyleid'] == $thisset['styleid']) {
$selected = "selected";
} else {
$selected = "";
}
$thisstyleid = $thisset['styleid'];
$thisstylename = $thisset['title'];
$thisstylecount = $thisset['count'];
$styleslist .= "$thisstylename ($thisstylecount Users) $selected\n";
}

Spyke
12-02-2004, 06:06 PM
Anyone want to put that peice of code in perspective for me and give me some instructions on where to put it or what to replace? :D

Thanks.