View Full Version : Show Users using Style in Stylechooser
Andreas
09-03-2005, 10:00 PM
<font size="3">Show Users using Style in Stylechooser</font>
Description
This Hack shows the number of Users permanently using a Style in Stylechooser.
Details
1 Product XML with 2 Plugins
1 PHP Function File
Note: No queries or processing Overhead for normal Display!
History
1.0.0
Initial Version
1.0.1
Compatibiity Update for vBulletin 3.6
Xplorer4x4
09-04-2005, 04:37 PM
First install. :) Thanks Kirby. I been needing this.
Kirk Y
09-04-2005, 05:11 PM
Sweet idea!
* acidburn0520 licks the install button
Craigr
09-04-2005, 06:56 PM
Nice hack, installed and working : http://www.steven-seagal.net/forum/ :)
turksengel
09-04-2005, 07:13 PM
thx clicked install
Boofo
09-04-2005, 07:17 PM
Is there a way to add the vb_number_format for numbers over 999?
y2krazy
09-04-2005, 08:05 PM
Installed. ^^
One question, where would I go to edit that number to, let's say, change it to "(X Users)"? Thanks again!
Andreas
09-05-2005, 04:06 AM
@Boofo
That's not that easy, as the Text is hardcoded into stylecache.
If you use only one Thoustand Separator it will work fine if you just use vb_number_format(), but if you have several languages you will run into Problems.
To solv this you would have to remove the line that modifies the Title, cycle through the Chache upon each pageload and add the formatted Number there - but that adds some Overhead.
Or you can hack the function that buils the stylechooser - that would work without much Overhead, but has the drawback of requiring Fileedits.
@y2krazy
Sure. Take a look at functions_styleusers.php and change
$cache["$parentid"]["$idx"]['title'] .= ' (' . intval($styleusage["$style[styleid]"]) . ')';
to
$cache["$parentid"]["$idx"]['title'] .= ' (' . intval($styleusage["$style[styleid]"]) . ' Users)';
y2krazy
09-05-2005, 07:40 AM
@y2krazy
Sure. Take a look at functions_styleusers.php and change
$cache["$parentid"]["$idx"]['title'] .= ' (' . intval($styleusage["$style[styleid]"]) . ')';
to
$cache["$parentid"]["$idx"]['title'] .= ' (' . intval($styleusage["$style[styleid]"]) . ' Users)';
Actually, that didn't change a thing. ><
Andreas
09-05-2005, 08:08 AM
It does - change your Style in UserCP, hit save and you'll see.
y2krazy
09-05-2005, 01:23 PM
It does - change your Style in UserCP, hit save and you'll see.
Just tried it again, saved via the UCP, and it's still the same. Attachment included.
Andreas
09-05-2005, 02:24 PM
Normally that can't be. Send me a PM with an ACP and FTP Login and i'll take a look
Boofo
09-22-2005, 10:03 AM
Ok, new wrinkle. I have 19 members and they are all using the forum default style. But in the style chooser it shows 17 using that style and 0 using the other one. Any ideas?
Andreas
09-22-2005, 10:21 AM
Uh? That should not happen, where are those 2 missing members ...
SELECT styleid, COUNT(styleid) FROM user GROUP BY styleid
What does that tell?
Boofo
09-22-2005, 12:04 PM
ID - Count
----------
0 - 16
5 -1
6 -1
10 -1
But I deleted all styles except 2 of them. And rebuilt styles. Shouldn't it have reset?
Andreas
09-22-2005, 12:13 PM
No. It will fallback on runtime.
Hmm, I could try to make the query a bit more intelligent so it counts non-existing styles as default.
But currently this is working as designed - it tells you what's in the database ;)
Boofo
09-22-2005, 12:26 PM
How do I get it to show it right then?
Andreas
09-22-2005, 12:28 PM
UPDATE user SET styleid=0 WHERE styleid IN (doesnotexistanymore)
Boofo
09-22-2005, 12:39 PM
After running the query 2 times (for deleted styles 5 and 6) and rebuilding the styles, now it all looks right. ;)
Is there an easier way to do that if you ever delete another style?
Odysseus
09-22-2005, 12:44 PM
Wonderful, I've already been looking for this.
Thanks, Kirby!
Andreas
09-22-2005, 12:48 PM
@Boofo
Well .. as said, it would require putting more logic into the query.
Or report it as a bug @ .com ;)
Boofo
09-22-2005, 01:25 PM
@Boofo
Well .. as said, it would require putting more logic into the query.
Or report it as a bug @ .com ;)
Do you consider it a bug or would I be wasting my time?
And how would you actually report something like this? Since it is a mod/hack that found it, wouldn't that basically null and void and report I would make? ;)
Gizmo5h1t3
09-22-2005, 03:36 PM
installed, and works a treat
The Wise One
09-25-2005, 03:32 PM
very nice.
*installed
A very nice and useful hack. Thanks a lot. :)
TruthElixirX
09-25-2005, 11:38 PM
A very nice and useful hack. Thanks a lot. :)
I imported it as a product (Right to do it that way correct?)
and get this on my forum home: Warning: Unknown(/home/httpd/vhosts/supportcore.org/httpdocs/testvb/includes/functions_styleusers.php): failed to open stream: No such file or directory in /global.php(335) : eval()'d code on line 14
Fatal error: (null)(): Failed opening required '/home/httpd/vhosts/supportcore.org/httpdocs/testvb/includes/functions_styleusers.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/supportcore.org/httpdocs/testvb/global.php(335) : eval()'d code on line 14
Also when I go to my admincp I get it to. I ca'nt disable the product now. >.<...How do I disable all plugins?
Andreas
09-25-2005, 11:42 PM
Did you upload this file (functions_styleusers.php)?
It's necessary.
TruthElixirX
09-25-2005, 11:46 PM
Yeah. I uplaoded it but here is what happened.
I have a live 3.0.5 site and a test 3.5.0 RC3 site
* TruthElixirX clicks forum instead of /testvb
Just upladoed it to the wrong place.
Works a-okay now. Thanks a lot. :)
loonytune15
09-27-2005, 12:20 PM
installs.
Alien
09-28-2005, 07:13 AM
UPDATE user SET styleid=0 WHERE styleid IN (doesnotexistanymore)
Do I really use "(doesnotexistanymore)"? :) You lost me.
Boofo
09-28-2005, 07:51 AM
doesnotexistanymore = style ID number (that doesn't exist anymore)
Alien
09-28-2005, 07:52 AM
doesnotexistanymore = style ID number (that doesn't exist anymore)
Thanks Bob. :) I guess I'm as think as I drunk I am!
Snake
10-06-2005, 02:29 PM
Installed and works on 3.5.0. :P
slvr ralliart
11-10-2005, 03:53 AM
Thanks!!
I was wondering if you can somehow make something like vB.org has where on their postbit it says what style they are using.
slvr ralliart
11-11-2005, 05:11 PM
bump for my question
Andreas
11-11-2005, 05:58 PM
Yes it is possiblt to show that info - but not with this Hack.
weaver
11-11-2005, 06:19 PM
How do I set this to include only certain usergroup ids in the counts?
Andreas
11-11-2005, 06:46 PM
Not possible.
RoryF
11-13-2005, 07:40 AM
I have this installed in 3.5.1 but the problem is, it doesn't actually work. The moderator usergroup does not have access to any styles that i select at all, is there any possible way to fix it. Or is it safe to assume that this doesn't work in 3.5.1?
tassoman
11-13-2005, 08:39 AM
Could i set numbers visible only for admins?
Andreas
11-13-2005, 10:38 AM
@RoryF
I didn't test, but I don't see why I should not work with 3.5.1
slvr ralliart
11-13-2005, 09:58 PM
Yes it is possiblt to show that info - but not with this Hack.
would you plan on making a hack that shows the style a user is using in postbit?
theArchitect
11-26-2005, 09:38 PM
I know you are busy with Jelsoft, but any chance of this hack leaving beta?
Andreas
11-26-2005, 09:42 PM
It will never leave Beta, as most of my Hacks.
theArchitect
11-26-2005, 09:54 PM
It will never leave Beta, as most of my Hacks.
Sorry, from an english perspective that sentence kind of finished half way through.
"It will never leave Beta, as most of my hacks"
Aren't supported?
Aren't finished?
Won't be developed further?
look sexier if listed as in beta stage?
Bernd Glasstett
12-08-2005, 11:01 PM
Big problem here with a vbb 3.5.1: I installed the hack, but quick reply ceased to work properly. The reply was posted but didn't show upon most recent posts and it wasn't loaded into the page. When posting a new Thread simply took the php-page and offered it as a download to me. The thread was posted, but I wasn't subscribed automatically. Deinstalled the hack and it worked. Would be nice to have a fix.
satuk
01-20-2006, 08:18 AM
thank you
Andreas
01-20-2006, 01:54 PM
Sorry, from an english perspective that sentence kind of finished half way through.
"It will never leave Beta, as most of my hacks"
Aren't supported?
That's the reason :)
StarBuG
02-05-2006, 09:54 AM
Hi andreas
The Number of users who use any style is not updated
If I change the style even after a hard refresh I still show up as user on the old style
Any solution for that?
Ohiosweetheart
02-06-2006, 12:42 PM
I installed this on my 3.5.3 forum, works like a charm ;)
Andreas
02-06-2006, 11:24 PM
Hi andreas
The Number of users who use any style is not updated
If I change the style even after a hard refresh I still show up as user on the old style
Any solution for that?
Did you change it through profile.php?
Changing it through the Quick-Style Chooser doesn't change the numbers, as that is only a temporary change.
StarBuG
02-08-2006, 08:13 PM
Ups *doh*
Thank you, works great ;)
aciurczak
08-05-2006, 04:53 PM
Causes large errors in 3.6.0; will not be able to log back in to admncp without putting in the "no plugins" flag in your config.php file.
LadyHoney
08-05-2006, 06:40 PM
anyone using this successfully on 3.5.4 or 3.5.5?
aciurczak
08-07-2006, 02:22 AM
It worked just fine on my 3.5.4 board. It only broke when going to 3.6.0.
loonytune15
08-07-2006, 12:24 PM
Can this be updated to work for VB 3.6??
Stoebi
08-25-2006, 07:01 AM
Thx KirbyDE for update :)
Regards, Stoebi
Elsie
10-15-2006, 08:28 AM
just installed this on my v3.6.0 board and get this error:
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /global.php(341) : eval()'d code on line 23
goes away if i disable the plugin.
DrewzR/T
11-24-2006, 12:26 PM
Works on 3.6.2. Awesome been lookin for this for awhile. Thanks
Installs
StrifeX
12-25-2006, 06:32 PM
Very awesome, but do you know if this works with 3.6.x?
EDIT: looks like it will! :D
Xplorer4x4
03-25-2007, 02:18 PM
Andreas, if you ever get time to look into it I am getting several queries added on to each page when this hack is enabled. When i disabled it, it still works but the queries are no longer there.
deezelpope
03-28-2007, 02:09 PM
Installed and working beautifully on 3.6.4!:up: Thank you very much!:D
mgurain
09-26-2007, 11:38 AM
Is there a supported one for 3.6.8 ?
Installed this and works perfectly, but we had to change one line because it slowed our forum down.
Looks like this one:
if ($this->existing['styleid'] != $this->fetch_field['styleid'])
{
require_once(DIR . '/includes/functions_styleusers.php');
update_stylecache();
}
is called too often (I don't know where userdata_postsave is used, but it sounds like it's every time the users submit something somewhere). So even when $this->existing['styleid'] doesn't exist at all (=NULL), the function is called. I changed it to:
if ($this->existing['styleid']&&($this->existing['styleid'] != $this->fetch_field['styleid']))
{
require_once(DIR . '/includes/functions_styleusers.php');
update_stylecache();
}
..and our vB runs much smoother now. :)
dimab
07-30-2008, 06:37 PM
has anyone tried this on 3.7.x ?
dimab
08-06-2008, 12:13 PM
tested and works on 3.7.2
thanks!!
turbosatan
09-12-2008, 01:36 PM
i have this running on 3.7.3 pl1
i do havea question though. Why is it that if i goto manage product5s and disable this it still works?
i mean isnt that the whole point that when you disable something it stops working???
other than that minor issue its a great mod especially if you ahve multiple styles and your not sure if people are using them all or not. i found that there was almost no one with the different styles chozen so i will be sending an email out with the details as i am sure they will be interested in the options.
Alfa1
09-19-2008, 02:21 PM
Would be nice to see how many active users are using certain styles. I am certain that those using alternate styles than the default style will be mostly active users, while 99% of inactive users will probably be default style users.
gutelaune
11-02-2008, 06:30 PM
thanks, installed and working on 3.7.3
zombietom
02-28-2009, 12:14 PM
Installed and working good on 3.7.1 --thanks!
AshleyTwo
07-07-2009, 03:59 PM
I'm interested in this mod but it doesn't work on 3.8.1, it causes a PHP error once installed. Are you planning on updating this?
Thanks very much.
turbosatan
07-08-2009, 07:02 AM
that must be an issue on your forum because it works on my forum (http://www.thetattooforum.com) fine on 3.8.1
vijayninel
03-20-2010, 02:08 PM
working nicely in 3.8.4 :)
SorentoUltimate
03-20-2010, 03:36 PM
Thanks
work perfect in 3.8.4
Taurus1
07-28-2010, 11:55 AM
Awesome, works great in 3.8.6. Thanks!!
Markos
06-22-2011, 11:20 AM
works on 4.1,4 :D
furnival
02-07-2013, 08:24 PM
Is there any way to set this up so that only admins can view the numbers?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.