MyBB Community Forums

Full Version: where can you remove the header link showthread.css from
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I want to remove the link to the showthread.css, since I dont want more than one css file per page (I've already placed the showthread styles in the global.css).

I've found:
{$stylesheets}
in: Template Sets » Default Templates » headerinclude

But removing this will also remove the global css.

Where is $stylesheets defined?
$stylesheets is actually a collection of many style sheets.

If you want to remove some thing, you can either remove them from showthread templates located in : ACP > Templates > Showthread Templates > showthread
Yes thanks, as mentioned, I only want to remove the showthread.css from $stylesheets (when its referenced).

I dont think editing the showthread template will be useful here since the css links are inlcuded as part of the {$headerinclude}

showthread template defines:

<head>
<title>{$thread['subject']}</title>
{$headerinclude}
</head>

and $headerinclude is defined in the ungroup templates as "headerinclude":

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
{$stylesheets} // <<<<<<<<<< this line here!!!
{$newpmmsg}

But the problem is, its only part of the $stylesheets that I want to remove.
I believe $stylesheets is a query/ dependant included string and includes showthread.css only when the page its called from showthread.php.

It doesn't seem to be possible to remove showthread.css from the Admin CP, but if I can find which php file $stylesheets is defined in, I should be able to work from there.

Cheers.

Okay, I think I ran into a red herring finding $stylesheets defined in themes.php

But I also found it in global.php defined as:

foreach($theme['stylesheets'][$stylesheet_script][$stylesheet_action] as $page_stylesheet){
				if($already_loaded[$page_stylesheet]){continue;}
				if($page_stylesheet!="cache/themes/theme2/showthread.css"){ // hack to ignore showthread.css
					$stylesheets .= "<link type=\"text/css\" rel=\"stylesheet\" href=\"{$mybb->settings['bburl']}/{$page_stylesheet}\" />\n";
					$already_loaded[$page_stylesheet] = 1;
				}
			}
my hack was just to wrap this in a condition to ignore the "cache/themes/theme2/showthread.css"

This hack does the trick for me, unless there's a more graceful way of achieving this