MyBB Community Forums

Full Version: can't edit master theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well it seems in 1.2.1 I can't edit the master theme.

http://community.mybboard.net/showthread.php?tid=12994

You can read a thread about it there.  If this isn't a bug but instead a misconfiguration on my part I apologize but I have tested this on 3 versions of 1.2.1 and can't figure out HOW to edit the master style.  The only options I am given is "export theme".  I don't have this issue on my 1.1.8 forum.

Please advise asap as this is giving me tremendous problems with my custom themes.

OK...I have found the problem line area.

In admin/adminfunctions.php it's the function make_theme_list().

Line 1988
			if($theme['tid'] > 1)

Well this excludes the Maste theme. I know you don't want to delete master theme deleted or set as default so here is the fix.

Edit this:

			if($theme['tid'] > 1)
			{
				//echo "<option value=\"settings\">- $lang->edit_theme_settings</option>\n";
				echo "<option value=\"delete\">- $lang->del_theme</option>\n";
				if($setdefault)
				{
					echo "<option value=\"default\">- $lang->set_as_default</option>";
				}
				echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
				echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

			} 

Add instead make it this:

			if($theme['tid'] > 1)
			{
				//echo "<option value=\"settings\">- $lang->edit_theme_settings</option>\n";
				echo "<option value=\"delete\">- $lang->del_theme</option>\n";
				if($setdefault)
				{
					echo "<option value=\"default\">- $lang->set_as_default</option>";
				}
				echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
				echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

			} elseif ($theme['tid'] == 1) {



				echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
				echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";
			}


If mybb team has a better solution that would be great. I am hopeful you guys will correct this as you see fit. I also want to make it clear I am not just a whiner. I am here to help and I help a lot of members. I have no problems helping to fix a bug and not just identify them. Some members here think they know everything. I don't bother reporting bugs or problems unless it is one.

Anyways..I really hope in next update this is corrected permanently.
This is intentional.

You should never edit the master theme as it is what we revert on each upgrade to the default and how we add in support for new theme items.

It also serves as a backup in case something goes wrong with your themes and as a master for the inheritance system.
If you want to make your own "master" that you can change, just structure your themes like this:

MyBB Master Style
-- Your Master Style
---- Your theme 1
---- Your theme 2
---- Your theme 3

Then you will be able to edit "Your Master Style" and have all the changes inherited in your 3 "sub-themes"
I've learned that's a lot easier than uploading separate themes, having to deal with making sure all the plug ins and mods work with the new theme...nightmare! So I just create a theme from the master and then play with the settings! LOL...at least that way, I know that all my mods and plug ins will work! *major thumbs up*
Alright Chris..but this doesn't really make sense since it makes it impossible to alter certain css for the site...such as img .menu and a few others. Shouldn't a "revert" be enough to protect the Master theme? The revert code could be hard coded directly into the php so that it can't be tainted. The same could happen for a new theme based on master..it would use hard coded php instead.

I have made a handful of themes and as I make them with more complexity I need more control. Others are complaining as well about some of the limits to the theme and template editing..such as the rank images.

I seriously want you to consider what I am saying. I have only the interest of the project in mind and how it can be improved for all users, coders, and designers.
There are no more additional CSS Items in the Master Style then there are in the styles you can edit.

At least, none that I've noticed.
huh...I am not sure how much I have to continue saying the problem.  If I edit any theme..default or custom...it doesn't change if there is a MASTER theme css.  .menu is a perfect example.  Also it's not correct to have img css defined twice..that's just sloppy.  

Read the thread I linked to in my first post. It should explain the situation better.  And before you jump to conclusions about how it's SUPPOSE to work...try it yourself...you should see the exact same problem.  I have tested this on 3 different 1.2.1 installs.  

The ONLY way to edit .menu css is to actually rename the style in the template...the add the new style to your theme.  Of course this won't work exactly right for img style.  

This is frustrating that the MYBB team isn't getting what I am saying.

The way the master theme works is that it ALWAYS is added to the css no matter what.  So everything defined in the master is SET...and currently mybb admincp has no way to edit this.

Here is the current set of css from master.

img {
	border: none;
}

.clear {
	clear: both;
}

.hidden {
	display: none;
	float: none;
	width: 1%;
}

.float_left {
	float: left;
}

.float_right {
	float: right;
}

.menu ul {
	list-style: none;
	margin: 0;
}

.menu li {
          display: inline;
	padding-left: 5px;
}

.menu img {
	padding-right: 5px;
	vertical-align: top;
}

#panel .links {
	margin: 0;
	float: right;
}

.expcolimage {
	float: right;
	width: auto;
	vertical-align: middle;
}

img.attachment {
	border: 1px solid #E9E5D7;
	padding: 2px;
}

.pagenav {
	font-weight: bold;
}

.pagenavbit {
	padding-left: 3px;
}

.pagenavbit a {
	text-decoration: none;
}

.pagenavcurrent {
	font-weight: bold;
	padding-left: 3px;
}

hr {
	background-color: #000000;
	color: #000000;
	height: 1px;
	border: 0px;
}

#copyright {
	font: 11px Verdana, Arial, Sans-Serif;
	margin: 0;
	padding: 10px 0 0 0;
}

#debug {
	float: right;
	text-align: right;
	margin-top: 0;
}

.quote_header {
	background: #fff;
	border: 1px dashed #000;
	border-bottom: 0;
	color: #000;
	font-weight: bold;
	margin: 8px auto 0 auto;
	padding: 4px;
}

.quote_body {
	background: #fff;
	border: 1px dashed #000;
	border-top: 0;
	color: #000;
	padding: 4px;
	margin: 0 auto 8px auto;
}

.code_header {
	background: #fff;
	border: 1px dashed #000;
	border-bottom: 0;
	color: #000;
	font-weight: bold;
	margin: 8px auto 0 auto;
	padding: 4px;
}

.code_body {
	background: #fff;
	border: 1px dashed #000;
	border-top: 0;
	color: #000;
	padding: 4px;
	margin: 0 auto 8px auto;
	font-family: Monaco, Consolas, Courier, monospace;
	font-size: 12px;
}
.usercpnav {
	list-style: inside;
	padding: 0;
	margin: 0;
}

.usercpnav li {
	padding: 1px;
	font-size:11px
}

.usercpnav .pmfolders {
	/* PM folders on the UCP Nav menu */
}

.subforumicon {
	border: 0;
	vertical-align: middle;
}

.separator {
	margin: 5px;
	padding: 0;
	height: 0px;
	font-size: 1px;
	list-style-type: none;
}

form {
	margin: 0;
	padding: 0;
}

.popup_menu .popup_item_container {
	margin: 1px;
	text-align: left;
}

.popup_menu .popup_item {
	display: block;
	padding: 3px;
	text-decoration: none;
	white-space: nowrap;
}

.popup_menu a.popup_item:hover {
	text-decoration: none;
}

.autocomplete {
	text-align: left;
}

many of these don't matter...however I think .menu needs to be editable in order for custom themes to be created.

The big issue for me is this

.menu li {
          display: inline;
	padding-left: 5px;
}

Some people don't want to display this inline in their theme. Twice I have created a theme where I prefer it in a list instead.  Also for css there lists can be highly customized...it should be editable.

Also I notice quote, seperator and code are here...that's scary.
I understand what you want and everything.

The theme system works on the basis of CSS inheritance too.

If you want your links displayed in a list then add

.menu li {
display: block;
}

to the extra CSS section. I tried it here and it worked fine.

Essentially you need to override the CSS rules defined in the master section.

Why do we do this? To make sure you can't delete any of the CORE MyBB additional CSS items which are needed for the page to be generated.

Adding in the hard coded revert option (like it is) but still allowing editing presented problems: People complain to us that when they do a simple upgrade from one minor version to another (1.2.1 to 1.2.2 for example) they lose their theme because they've edited the master style. The same problem applies to major version upgrades - we never need now to revert your themes because we add the new things in to the master (overriding the old master) and your forum still works 100%.

Quote:Also it's not correct to have img css defined twice..that's just sloppy.
You mean having the extra CSS from the master and the current theme the same after you edit it once? That is a bug that I need to look in to - you're correct, in some cases the CSS ends up being duplicated.
Oh and as for the code/quote blocks, they'll be moved in to their own themes bit for 1.4. The primary point of the (default) master CSS is to define structural elements and no colour/font/size information for the page.
Chris Boulton Wrote:Oh and as for the code/quote blocks, they'll be moved in to their own themes bit for 1.4. The primary point of the (default) master CSS is to define structural elements and no colour/font/size information for the page.

This is good to hear and a step in the right direction. Thanks Chris for addressing this for me. Well..onto the next thing I guess.