vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Restrict style to Usergroup (https://vborg.vbsupport.ru/showthread.php?t=82410)

Andreas 06-01-2005 10:00 PM

Restrict style to Usergroup
 
Description
This hack allows you to restrict the usage of styles to certain usergroups.

Hack Details
Files to Edit = 4
Queries to Run = 1
Difficulty = Medium

History
0.1 Initial Version
0.2 Fixed a typo in the query, thanks to nexialys
0.3 Fixed a Bug which caused Problems with Primary Usergroups

Developed and tested with 3.0.7, but should work with all 3.0.x-Versions.

Corriewf 06-02-2005 06:01 PM

This would go good in conjuction with subscription services.

Andreas 06-02-2005 06:06 PM

That's possible.
Create an additional usergroup, restrict usage of your premium styles for this usergroup and then create a subscription which adds the user to this usergroup.

dsboyce8624 06-02-2005 06:39 PM

I'm looking for soomething like this where if I have multiple sytles, but only want me to see them (because I'm working on them) only I see the chooser box.

Anything like that around?

Corriewf 06-02-2005 06:44 PM

Quote:

Originally Posted by dsboyce8624
I'm looking for soomething like this where if I have multiple sytles, but only want me to see them (because I'm working on them) only I see the chooser box.

Anything like that around?

Ok so how many admins do you have? If the answer is one then Kirby is your hero.

nexialys 06-02-2005 06:45 PM

KirbyDE, the query is having an error... VACHAR instead of VARCHAR.. ;)

great hack !

Andreas 06-02-2005 06:51 PM

I hate typos ;)
Thanks, fixed.

GoTTi 06-02-2005 08:53 PM

FINALLY
thanks kirb.

moley 06-02-2005 10:34 PM

thanks a lot.

Andreas 06-02-2005 11:13 PM

Would be nice to know if it does what it is meant do do - lol.

Brent H 06-03-2005 12:17 AM

Installed and working great :D

defi 06-03-2005 02:21 AM

I LOVE YOU KIRBY!
Okay, maybe not love but thanks!

dsboyce8624 06-03-2005 01:59 PM

Quote:

Originally Posted by corriewf
Ok so how many admins do you have? If the answer is one then Kirby is your hero.

Does that mean this will do what I need since it's only me?

Andreas 06-03-2005 03:07 PM

If you are the only user in Usergroup Administrators - yes.

Freezerator 06-04-2005 06:57 AM

Great hack!

Tnx!

dsboyce8624 06-04-2005 03:01 PM

Quote:

Originally Posted by KirbyDE
If you are the only user in Usergroup Administrators - yes.

Then I love Kirby too!

In a nice hetero male bonding sort of way. :nervous:

Andreas 06-04-2005 03:04 PM

I don't want to sound ungraceful, but i'd prefer a woman to love me ;)

dsboyce8624 06-04-2005 03:12 PM

Quote:

Originally Posted by KirbyDE
I don't want to sound ungraceful, but i'd prefer a woman to love me ;)

Well, at least I qualified it. That way it didn't sound dirty.

Corriewf 06-04-2005 06:14 PM

Aww man I just thought about how I am going to take your nice hack and turn it dirty....

NAKED GIRLS SKIN!

YES!

dsboyce8624 06-04-2005 07:18 PM

Quote:

Originally Posted by corriewf
Aww man I just thought about how I am going to take your nice hack and turn it dirty....

NAKED GIRLS SKIN!


YES!

ROFLMFAO!!!!!

Corriewf 06-04-2005 07:51 PM

Quote:

Originally Posted by dsboyce8624
ROFLMFAO!!!!!


Dude im not joking either... Already working on it.... Oh the gif new post icons is sweet!

dsboyce8624 06-04-2005 07:58 PM

Quote:

Originally Posted by corriewf
Dude im not joking either... Already working on it.... Oh the gif new post icons is sweet!

When it's ready for prime time let me know. Love to have a look.

Corriewf 06-05-2005 01:08 AM

Quote:

Originally Posted by dsboyce8624
When it's ready for prime time let me know. Love to have a look.

Well its done for right now.... Great for a few laughs.

Corriewf 06-05-2005 01:11 AM

Lets just say that they are motivated to post a long post......

brianstevz 06-05-2005 01:29 AM

I love this hack. It's exactly what I was looking for. Thanks for sharing your work.

What I did on my board was to add a style to subscribers that doesn't include ad's now. Hopefully this will encourage a little more donations.

Barakat 06-05-2005 03:50 AM

thanks a lot

GoTTi 06-08-2005 03:51 PM

when i select a user group for the style to be used on, the style is not showing up anymore. any ideas?

GoTTi 06-08-2005 03:56 PM

yea as soon as i select a usergroup to be able to select the style, it just removes itself from the drop down.

using vb 3.0.0

Andreas 06-08-2005 04:02 PM

I am not sure if this does work with 3.0.0 ...

If you set a Style to be only usable for Usergroup X, then only Usergroup X will see the Style in the Style-Selector Dropdown in UserCP or the Quick Style-Chooser at the bottom of each page.
This is how it should work.

Corriewf 06-08-2005 04:18 PM

Quote:

Originally Posted by Da_GoTTi
yea as soon as i select a usergroup to be able to select the style, it just removes itself from the drop down.

using vb 3.0.0


Did you also set it for admins to view.

I have an additional usergroup set up for my style.

between worlds 06-25-2005 11:50 AM

Works great. Thank you.

GoTTi 06-25-2005 05:21 PM

ive checked the box for the admins to view and it removed it from the drop down.

when i select a box for any usergroup to be able to use the style, i loose it in the drop down, but if i have it activated for all to see, the style shows in the drop down.

nighteyes 06-27-2005 09:30 AM

Same problem here. Once I've selected the style, it completely vanishes from the drop-down menu..... even if I change to a different style.... it doesn't re-appear and I can't re-select it from the menu.

OK edit. This appears to only take into consideration secondary usergroups. I create a styles usergroup and anyone who is in this as secondary can see the additional styles in the dropdrown menus.

Andreas 06-27-2005 09:38 AM

Strange. Does work just fine for me and I cannot reproduce the problem.

@nighteyes
Which Version do you use?
If you don't mind, pease send me a PM with an ACP and FTP account for your site so I can take a look at what is going wrong.

nighteyes 06-27-2005 09:44 AM

See above edit Kirby. Is this the way it's supposed to work? :)

Andreas 06-27-2005 09:48 AM

No, but there was a bug in the instructions.

PHP Code:

$ugarray array_merge(array($bbuserinfo['userid']), explode(','$bbuserinfo['membergroupids'])); 

should have been
PHP Code:

$ugarray array_merge(array($bbuserinfo['usergroupid']), explode(','$bbuserinfo['membergroupids'])); 

instead.
Does it also work with primary usergroups when you change this?

nighteyes 06-27-2005 10:29 AM

Yep that fixes the problem. Thanks for posting a fix so quickly. :)

87accordlxi 06-27-2005 01:23 PM

This may be a dumb question, but what does editing global.php do? When I edited it, it kept giving me parse errors so I reverted to a saved backup of the file. The hack still works.

Andreas 06-27-2005 01:27 PM

Without the global.php edit Users can still use any Style (that has User Select = Yes).
If you get parse errors, you did not make the edit correctly - check again.

87accordlxi 06-27-2005 01:38 PM

I see. They cannot select a restricted style from the dropdown menu, but they can still type the direct url of the board with that style and see it. Like http://www.mysite.com/index.php?s=&styleid=10 if Style #10 was restricted.

This is the parse error I keep getting. The edits for global.php are not very hard and i've tried it 4 or 5 times and still keep getting the error.

Quote:

Parse error: parse error, unexpected '=' in /home2/geez/public_html/global.php on line 283


All times are GMT. The time now is 05:51 AM.

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.01491 seconds
  • Memory Usage 1,791KB
  • 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
  • (2)bbcode_php_printable
  • (10)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