- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrade Skin from 0.9.2 to 1.8 Head LineByLine
Upgrade Skin from 0.9.2 to 1.8 Head LineByLine
This page shows a line by line description of the changes to the head generating portion of your _main.php file, and what you need to change to upgrade your skin from 0.9.2 to 1.8. If you do not have any custom tags in your personalized skin you can follow the all in one instructions instead of this page.
The first thing to do is change the line that stops people from accessing your _main.php page directly. In your existing skin find this bit immediately after the initial comments:
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Replace that section with this:
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
header( 'Content-type: text/html; charset='.$io_charset );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
A couple of lines later, in your existing skin, you will now remove the following line because you just added the new way of covering this detail:
<meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />
You can replace that line with the line that will include plugins for your head section. You should include this bit even if you’re not currently planning on using any head section plugins because you might want to later.
<?php $Plugins->trigger_event( 'SkinBeginHtmlHead' ); ?>
b2evolution has changed the way your "title" tag is generated, so you will need to change your skin to keep up with the times. In your existing skin find this section:
<title><?php
$Blog->disp('name', 'htmlhead');
single_cat_title( ' - ', 'htmlhead' );
single_month_title( ' - ', 'htmlhead' );
single_post_title( ' - ', 'htmlhead' );
arcdir_title( ' - ', 'htmlhead' );
last_comments_title( ' - ', 'htmlhead' );
?>
</title>
Now replace it with this section:
<title><?php
$Blog->disp('name', 'htmlhead');
request_title( ' - ', '', ' - ', 'htmlhead' );
?></title>
Next change the line that makes the base href tag. You need this to make relative links within b2evolution work properly. It is NOT used in the traditional way (to make linking to internal pages easier). Find the following line:
<base href="<?php skinbase(); // Base URL for this skin. You need this to fix relative links! ?>" />
Now replace it with this line:
<?php skin_base_tag(); /* Base URL for this skin. You need this to fix relative links! */ ?>
Next up is the generator tag. Be kind to open source: include the generator in your head section! Find this line:
<meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
Now replace it with this line:
<meta name="generator" content="b2evolution <?php echo $app_version ?>" /> <!-- Please leave this for stats -->
b2evolution now includes the option of blog or user specific style sheets. To take advantage of this you will need to add a little bit to the end of your head section. Find this:
<link rel="stylesheet" href="custom.css" type="text/css" />
</head>
Now replace it with this.
<link rel="stylesheet" href="custom.css" type="text/css" />
<?php
$Blog->disp( 'blog_css', 'raw');
$Blog->disp( 'user_css', 'raw');
?>
</head>
Now back to the page that cover the rest of _main.php from 0.9.2 to 1.8!