b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Installation / Upgrade
  3. Upgrade
  4. Instructions for specific versions
  5. 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!

Created by fatimahnasra • Last edit by fplanque on 2020-06-09 00:25 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
    • New Installation
    • Upgrade
      • Manual Upgrade Procedure
      • Auto-Upgrade Procedure
      • After Installation / Upgrade
      • Automated Install / Upgrade
      • Upgrading Evoskins
      • Unexpected SQL Error during upgrade
      • Upgrading your database to UTF-8
      • Instructions for specific versions
        • To version 7.x
        • 2.x to 3.x
        • To version 6.x
        • Upgrade from 0.9.x to 1.8.x
        • 0.9.2 to 1.8
        • 1.6.x to 1.8.x
        • 1.8.x to 1.9.x
        • 1.6.x to 1.8.x
        • 1.10.x to 2.0.x
        • Upgrade from 0.9.x to 2.x
        • Upgrading from version 0.8.0
        • Upgrading from version 0.8.2
        • Upgrade from 0.9.x to 1.10.3 or 2.4rc2
        • Upgrade Skin from 1.6 to 1.8
        • Upgrade Skin from 0.9.2 to 1.8 Support Files
        • Upgrade Skin from 0.9.2 to 1.8 Head LineByLine
        • Upgrade Skin from 0.9.2 to 1.8 Head All
        • Upgrading from 0.9.x to 1.8.x
        • Upgrading from 0.9.x to 1.6 alpha
        • Upgrading from 0.9.0.x to 0.9.1
        • Upgrading from version 0.8.9
        • 0.9.x to 1.6-alpha
    • Configuration files
    • Advanced Setup
    • Migrating from Another System
    • Moving your b2evolution Site
    • FAQ & Troubleshooting (Installation / Upgrade)
    • Assumed User Skills
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Photo albums software

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque