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)
-   -   Force Style to Certain Usergroup(s) and/or User(s) (https://vborg.vbsupport.ru/showthread.php?t=108623)

Mosh 02-21-2006 10:00 PM

Force Style to Certain Usergroup(s) and/or User(s)
 
Hack Support

This hack is now discontinued - this means that while it will remain available for download and use, there will be no further updates, nor will support be provided as the thread is no longer monitored.

Please click Mark as Installed if you are using this hack.


vBulletin Version Compatibility

This hack has be tested with v3.5.8. This has not been tested with earlier versions, but should work.


What Does This Hack Do?

This hack allows you to force a style to certain usergroup(s), secondary usergroup(s), and/or certain user(s).

Background

This is inspired by the hack - Restrict Style to Usergroup(s) by Andreas.
I asked about a mod to restrict styles to certain usergroups and ended up using Andreas's hack, but did not do the job exactly as I need it, see scenario below to see why did not.

Scenario

The setup on my forums is that I use the default style as the parent to all my other styles which makes modifying the templates easy for me, I wanted to use a child style as the standard style for visitors and members, but not have them have a choice of the default template at all, but as soon as you logged out you were presented with the default template that you did not want guests to see.

Solution

I created this hack to rectify that and it works in harmony with Andreas's hack.


Installation Instructions

Instructions and upgrade instructions are in the attachment.

Note: No screenshots are needed, so are not provided.


Version History

v1.02 - Tuesday 28th February 2006
-- Final release
-- Fixed: Plugin typo

v1.01 - Thursday 23rd February 2006
-- Added: Secondary Usergroups permissions

v1.00 - Thursday 23rd February 2006
-- Initial Release


Show Your Appreciation

Although not required, if you have enjoyed the benefits of this hack, and would like show your appreciation for my efforts, then please feel free to click on the Support Developer link and donate any amount you feel is appropriate.

RoryF 02-22-2006 02:58 PM

Exactly what i need. Thankyou for making this hack :D. Well done :).

WAR 02-22-2006 06:34 PM

Just to clarify, you said that this works just fine in conjunction with Andreas' Restrict Style to Usergroup(s) hack without any conflict?

Also: Does this work with secondary usergroups as well?

Mosh 02-22-2006 09:24 PM

Quote:

Originally Posted by WAR
Just to clarify, you said that this works just fine in conjunction with Andreas' Restrict Style to Usergroup(s) hack without any conflict?

Also: Does this work with secondary usergroups as well?

Yes, no conflicts at all.

Not in it's current state, but I will put that in, in a bit for you :)

Mosh 02-22-2006 10:36 PM

Now Zip file has now been updated to deal with Secondary Usergroups.

christianjunk 02-27-2006 11:12 AM

Hi!

There's an error in your code:

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
        <plugin active="1" product="vbulletin">
                <title>Force Styles for Selected Usergroups</title>
                <hookname>style_fetch</hookname>
                <phpcode><![CDATA[if (in_array($vbulletin->userinfo['usergroupid'], array(a,b,c)) || (in_array($vbulletin->userinfo['membergroupids'], array(d,e,f)))
{
$styleid = 8;
}]]></phpcode>
        </plugin>
</plugins>

You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian

Mosh 02-27-2006 01:09 PM

Quote:

Originally Posted by christianjunk
Hi!

There's an error in your code:

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
        <plugin active="1" product="vbulletin">
                <title>Force Styles for Selected Usergroups</title>
                <hookname>style_fetch</hookname>
                <phpcode><![CDATA[if (in_array($vbulletin->userinfo['usergroupid'], array(a,b,c)) || (in_array($vbulletin->userinfo['membergroupids'], array(d,e,f)))
{
$styleid = 8;
}]]></phpcode>
        </plugin>
</plugins>

You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian

Thanks for noticing that typo :) updated the zip file.

ToyotaDiesel 04-19-2006 01:09 PM

.......

ToyotaDiesel 04-19-2006 05:20 PM

I have secondary usergroups that i can't get it to work with.

for instance:

Works with Usergroup 12 and 2, not with 17, 24, and 29.

Is there a cap on usergroup id#s?

Thanks

ToyotaDiesel 04-19-2006 05:52 PM

I cannot get it to work with a usergroupid higher than 12. (my usergroups jump from 12 to 17 btw)

Works on 12. down.

Doesnt work on 17, up.

(I'm trying secondary usergroups btw)


All times are GMT. The time now is 11:37 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.01088 seconds
  • Memory Usage 1,741KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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