vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - CMS Disabler (https://vborg.vbsupport.ru/showthread.php?t=230503)

Brother Malachi 01-14-2010 04:00 AM

Quote:

Originally Posted by Axel Foley (Post 1939832)
I don't need the CMS for my forum (not yet), so I simply did this:

1. Edited index.php in the forum root, commenting require('content.php'); and uncommenting require('forum.php');

2. Went to ACP->Plugins & Products->Manage Products and disabled the vBulletin CMS product.

Now the CMS disappeared, the button on the navbar too. ;)

Hope it helps someone else with my same need. I'll tag this mod and see how it evolves.

Do you understand the PURPOSE of this mod?
As of right now when the CMS is enabled EVERYONE sees it.
The purpose of this mod is to allow the admin to pick only CERTAIN USERGROUPS to see it...hence effectively disabling it :D

Your method TURNS off the cms. This method allows the admin to develop the cms without anyone actually knowing it is enabled.
Without this mod there is no built in way (in vb) to hide the cms from users if it is enabled.

Brother Malachi 01-14-2010 04:43 AM

Oh by the way, this mod doesn't work correctly.
In the adminCP options page for this mod it says:
"Enter user groups that you want to have access to your CMS.

Separate usergroups with a comma.
Example: 6,5"

However, it is not coded correctly to work w/ more than one usergroup so inputting more than usergroup id will beak the board.

is_member_of() requires you to input usergroup ids, not an array. So you can't use this:
Code:

<vb:if condition="is_member_of($vbulletin->userinfo, $vbulletin->options['cms_disabler_usergroups'])">

Here's what I did to fix the issue. In the plugin titled "CMS - Redirector" add the following to the top:
PHP Code:

// Generate an array w/ all the usergroups
$cms_disabler_usergroups explode(","$vbulletin->options['cms_disabler_usergroups']);

// Get rid of white spaces
function trim_value(&$value) { 
    
$value trim($value); 
}
array_walk($cms_disabler_usergroups'trim_value'); 



then replace this line:
PHP Code:

if (!is_member_of($vbulletin->userinfo$vbulletin->options['cms_disabler_usergroups'])) { 

with this line:
PHP Code:

if ( !in_array($vbulletin->userinfo['usergroupid'], $cms_disabler_usergroups) ) { 


Trek 01-14-2010 04:57 AM

Thanks for that fix, I'll try and get it into an updated release shortly. Just been pressed for time on other projects. But again, thank you!

Brother Malachi 01-14-2010 05:24 AM

No problem.

...i've actually been trying to figure out how to make the change to the template lol.
I guess with the new vb version you can't put in_array($bbuserinfo[usergroupid], $some_array) in a template. It keeps spitting out an error saying that $some_array isn't an array.

Brother Malachi 01-14-2010 05:34 AM

Ok, to fix the template replace
Code:

<vb:if condition="is_member_of($vbulletin->userinfo, $vbulletin->options['cms_disabler_usergroups'])">
with:
Code:

<vb:if condition="$cms_disabler">
then add a new plugin.
Hook location: global_start
Code:
PHP Code:

// Generate an array w/ all the usergroups
$cms_disabler_usergroups explode(","$vbulletin->options['cms_disabler_usergroups']);
$cms_disabler in_array($vbulletin->userinfo['usergroupid'], $cms_disabler_usergroups);
vB_Template::preRegister('vbcms_navbar_link',array('cms_disabler' => $cms_disabler)); 

and that should take care of it :)

Axel Foley 01-14-2010 02:16 PM

Quote:

Originally Posted by Brother Malachi (Post 1955123)
Do you understand the PURPOSE of this mod?
As of right now when the CMS is enabled EVERYONE sees it.
The purpose of this mod is to allow the admin to pick only CERTAIN USERGROUPS to see it...hence effectively disabling it :D

Your method TURNS off the cms. This method allows the admin to develop the cms without anyone actually knowing it is enabled.
Without this mod there is no built in way (in vb) to hide the cms from users if it is enabled.

Have you even bothered to read what I wrote in my post (#30)?

I explained that I was looking for a way to COMPLETELY disable the CMS, and I stumbled upon this mod but it was not exactly what I needed; since I thought that other people could have my same requirement I thought it was useful to post what I discovered.

I thanked the dev, and I explained why I posted those instructions; I really don't see why you wrote your post...completely useless.

Anyway...no problem...forums unfortunately are full of posts like yours. ;)

Take care.

radmoose 01-15-2010 01:40 AM

One item for the documentation.

Make sure you set vBCms Comments forum permissions to only allow the selected usergroups to have access to the comments as by default (at least in my case) everyone could see the comments.

Old-Git 01-20-2010 07:52 PM

Hi Brother Malachi, Re the user ID array. Thanks for the code update. I got around the problem quickly by setting the Moderators group as the group with access and then adding the mod groups as a secondary user group on the Admin's account. This way I get all my mods and my admins on the CMS. I guess I could also have set-up another user group called CMSviewers and then added that as a secondary group to everyone I wanted to see the CMS, probably a bit tidier and easier to delete when I'd finished. Either way it's allowed me to do what I needed to do....But thanks all the same for the code update, I really appreciate you getting this done and adding to the thread, it's certainly a much tidier way of doing it.

Rgds

Pete

sportsfroma2 05-25-2010 01:17 PM

now that my forums are all set for a little bit I have some time to finally work on the CMS thanks to this mod.. I used impex to port over all the stuff from the old CMS, but it wasn't a completely clean transfer. This mod allows me to begin formatting everything correctly at my pace so it doesn't inconvenience anyone else/nobody else needs to know anything is changing until it's ready for all to see :)

thanks a lot!

Boofo 05-25-2010 01:26 PM

Why not just disable the plugin for it?

sportsfroma2 05-25-2010 01:29 PM

Quote:

Originally Posted by Boofo (Post 2043164)
Why not just disable the plugin for it?

because that just killls the whole thing... doesn't allow you to work on the CMS while the plug-in is disabled.


pretty much this add-on allows us to put the CMS in a type of "maintenance mode" for a specific usergroup (ex: admins).. So Admins can see it to work on it, while everyone else just bypasses it automatically/wouldn't know the CMS exists

(useful for those of us upgrading to the suite from the forums only, for example)

Boofo 05-25-2010 01:35 PM

Good point. I hadn't thought of that. ;)

Trek, why not include the file and template edits in a readme file in the hack? That way they have it for future reference.

UpFriends 07-23-2010 06:25 PM

Great mod. Very helpful.

Lqd 09-14-2010 10:49 PM

Why not disable the CMS product? Isn't that a lot easier?

cagbaazee 09-21-2010 12:18 PM

just include forum.php in the site tab url of content management settings. its working perfect.

Trek 09-21-2010 06:12 PM

Quote:

Originally Posted by Lqd (Post 2098368)
Why not disable the CMS product? Isn't that a lot easier?

Quote:

Originally Posted by cagbaazee (Post 2101390)
just include forum.php in the site tab url of content management settings. its working perfect.

The reason why is that the mod still made the CMS available to admins or whoever so that they could get content added to the system, have it configured, look and feel, etc... all behind the scenes. If there are other better ways to do this now, go for it. The mod was written when vB was released and is no longer supported anyway.

barakuda 11-15-2010 02:05 PM

installed...thanks

gabs 04-19-2011 05:04 PM

Nice!
Thank you, just what I was looking for :)

cheers,
.g

togotutor 05-16-2011 06:51 PM

Installed, but need to test it.

Old-Git 07-18-2012 02:55 PM

Has the new Navigator Manager broken this addon?

EDIT: having just had a look, it would appear that the template ''vbcms_navbar_link', which is part of the dit process for this addon, has been deleted in the 4.2.0 upgrade.

BirdOPrey5 07-24-2012 09:42 PM

1 Attachment(s)
Since this is Re-Usable code here is an update for 4.2.0.

It also fixes a bug where for me at least it wasn't working with multiple allowed usergroups. Now it does.

I upped the version number to 2.0.

You can install like any other upgrade (allow overwrite = yes).

NO MANUAL EDITS NEEDED.

The OP can feel free to re-edit this code and/or put this in the first post.

Old-Git 07-25-2012 09:33 AM

Outstanding, thanks for taking this on BOP5, It's great to have this available for 4.2.0! Also, thanks for fixing the problem with multiple user groups. I had gotten around this by creating a CMS-Users usergroup and assinging to it only the people who needed to see it but it's nice that I now no longer need to do that!

Trek 07-25-2012 03:36 PM

I've updated the OP with the new XML and removed the manual edits in the installation instructions. Thanks BirdOPrey5 for updating/fixing the mod as I no longer support it/remember much about vB modding. =)

BirdOPrey5 07-25-2012 04:38 PM

You're Welcome but Just FYI the one I released is only for VB 4.2.0 and above, it won't work on older versions. I suggest you keep your original version available as well.


All times are GMT. The time now is 07:46 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.01290 seconds
  • Memory Usage 1,802KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)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
  • (24)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