Recent Topics

lock skin?

Started by on Feb 27, 2005 – Contents updated: Feb 27, 2005

Feb 27, 2005 23:32    

How do I lock users into the skin I want them to use? I went into each of my blogs and set the default skin. I also unchecked "allow skin switching" for each blog. However, the list of alternate skins still shows up in each blog, and users can still switch skins. Is there another change I need to make?

Feb 28, 2005 00:02

If you go into your _main.php file in the skin folder you are using you can find the part in the sidebar that looks something like:

<?php if( ! $Blog->get('force_skin') )
	{	// Skin switching is allowed for this blog: ?>
		<div class="bSideItem">
			<h3><?php echo T_('Choose skin') ?></h3>
			<ul>
				<?php // ------------------------------- START OF SKIN LIST -------------------------------
				for( skin_list_start(); skin_list_next(); ) { ?>
					<li><a href="<?php skin_change_url() ?>"><?php skin_list_iteminfo( 'name', 'htmlbody' ) ?></a></li>
				<?php } // ------------------------------ END OF SKIN LIST ------------------------------ ?>
			</ul>
		</div>
	<?php } ?>

Try commenting it out or just removing it. I think that should get the job done.

Feb 28, 2005 00:07

Take a look at each skin's _main.php file in the area where skins can be selected. You could just delete the whole block, but then you lose the option to allow changing later on. I suggest you make sure each _main.php looks like this:

	<?php if( ! $Blog->get('force_skin') )
	{	// Skin switching is allowed for this blog: ?>
		<div class="bSideItem">
			<h3><?php echo T_('Choose skin') ?></h3>
			<ul>
				<?php // ------------------------------- START OF SKIN LIST -------------------------------
				for( skin_list_start(); skin_list_next(); ) { ?>
					<li><a href="<?php skin_change_url() ?>"><?php skin_list_iteminfo( 'name', 'htmlbody' ) ?></a></li>
				<?php } // ------------------------------ END OF SKIN LIST ------------------------------ ?>
			</ul>
		</div>
	<?php } ?>


It's the first and last line that make the back office switch work.

Funny thing about this: someone can type in the correct URL and get a new skin, but it won't hold beyond the page they're looking at. That's the way it is for me anyway - I just tested it a bit. I use a skin for each blog, but can get a different skin by typing. When I click a link in the blog I go back to the skin my back office tells the blog to use.

EDIT: first two lines and the last line.

Feb 28, 2005 00:17

Thanks for the tip. I gave that a try. Unfortunately that didn't solve the problem. All of the extra skin choices are still there. I'm a little hesitant to delete the code in case I decide at some point that I want to use it.

I'm also a little confused. Since I've told each blog not to allow skin switching, why would I have to comment out or delete this section? Does that mean that the setting in the admin controls simply doesn't work? (Obviously it isn't working for me, but are other users having to resort to delete code to prevent the skin switcher from showing up?)

Thanks for your help.

Feb 28, 2005 00:23

If you wrap the skin switching block with the first two line and last line of EdB's example, the backoffice option will work.

Feb 28, 2005 00:45

Thanks, EdB! That did the trick.

Feb 28, 2005 08:42

and what you could do, it to replace 1 line in the stubfile :

# Now, select the default skin you want to display for this blog.
# This setting refers to a subfolder name in the '/skins' folder 
# $default_skin = 'fplanque2002';
# You can *force* a skin with this setting:
$skin = 'fplanque2002';

You can *force* a skin this way.


Form is loading...

Photo gallery software – This forum is powered by b2evolution CMS, a complete engine for your website.