vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Show Users using Style in Stylechooser (https://vborg.vbsupport.ru/showthread.php?t=95637)

Andreas 09-03-2005 10:00 PM

Show Users using Style in Stylechooser
 
<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
PHP Code:

$cache["$parentid"]["$idx"]['title'] .= ' (' intval($styleusage["$style[styleid]"]) . ')'

to
PHP Code:

$cache["$parentid"]["$idx"]['title'] .= ' (' intval($styleusage["$style[styleid]"]) . ' Users)'


y2krazy 09-05-2005 07:40 AM

Quote:

Originally Posted by KirbyDE
@y2krazy
Sure. Take a look at functions_styleusers.php and change
PHP Code:

$cache["$parentid"]["$idx"]['title'] .= ' (' intval($styleusage["$style[styleid]"]) . ')'

to
PHP Code:

$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

Quote:

Originally Posted by KirbyDE
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 ...

[sql]SELECT styleid, COUNT(styleid) FROM user GROUP BY styleid[/sql]

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

Quote:

Originally Posted by KirbyDE
@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

ged 09-25-2005 03:37 PM

A very nice and useful hack. Thanks a lot. :)

TruthElixirX 09-25-2005 11:38 PM

Quote:

Originally Posted by ged
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:
Code:

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

[high]* TruthElixirX clicks forum instead of /testvb
[/high]

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

Quote:

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

Quote:

Originally Posted by Boofo
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?


All times are GMT. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02098 seconds
  • Memory Usage 1,799KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete