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 from 0.9.x to 1.8.x

Upgrade from 0.9.x to 1.8.x

Make sure you start by following the general upgrade procedure.

Once the new version is installed, you may need the information below for fine tuning…

Stub files

Overall, stub files remain the same. However, since the file organization has changed a little, you will need to replace this:

require(dirname(__FILE__)."/b2evocore/_blog_main.php");

with this:


  require_once dirname(__FILE__).'/conf/_config.php';
  require $inc_path.'_blog_main.inc.php';

Skins

If you have only small customizations to your 0.9 skin, it may be easier to just take a default 1.8 skin and apply the modifications again.

Otherwise, if you want to evolve your 0.9.2 skin into an 1.8 skin, here are the changes you will need to apply…

Skin files

In the folder of your skin, you can delete the following files:

  • _archives.php
  • _calendar.php
  • _categories.php

The functionnality which was in these files is now handled by plugins. (The necessary plugins are shipped with b2evo 1.8).

Also, please make sure you use new versions of the following files (you could take the ones in the custom skin for example):

  • _arcdir.php
  • _bloglist.php
  • _feedback.php
  • _lastcomments.php
  • _linkblog.php
  • _profile.php

Since these files are rarely modified, we do not discuss changes in detail. If needed, please diff the files with their counterparts from the custom skin.

Skin’s _main.php

Here are the changes you will need to apply to _main.php:

First line

This is probably, the most important single change. Failing to do so will generate a blank page with the message "Please, do not access this page directly." when trying to access th blog. Many people have reported this "problem", but it is very esay to fix! Just find this line at the begining of your skin’s _main.php:

  if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );

and change it to:

  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

Content Type

Add the content type just after the line above, like this:


 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
 skin_content_header();	// Sets charset!
 ?>

Also locate this: (Note this line shouls be before the <title> tag)
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />
   <title>
and replace with this:
 <head>
   <?php skin_content_meta(); /* Charset for static pages */ ?>
   <?php $Plugins->trigger_event( 'SkinBeginHtmlHead' ); ?>
   <title>

Base tag

In the HEAD section, locate this:

  <base href="<?php skinbase(); /* Base URL for this skin. You need this to fix relative links! */ ?>" />

and replace with this:

  <?php skin_base_tag(); /* Base URL for this skin. You need this to fix relative links! */ ?>

Page title

Optional. Generating a clean title for your page has gotten easier. You could just use this:


  <title><?php
    $Blog->disp('name', 'htmlhead');
    request_title( ' - ', ' ', ' - ', 'htmlhead' );
  ?></title>

On the page, you could also generate an H2 title like this:


  <?php
    // ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
    request_title( '&lt;h2>', '&lt;/h2>' );
    // ------------------------------ END OF REQUEST TITLE -----------------------------
  ?>

Messages

B2evo 1.8 can display messages like "Your comment has been posted but it will only appear once it has been approved by a moderator". For these messages to appear, you will need to add this code somewhere on your page (presumably at the top, near the call to request_title()):


 <?php
   // ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------
   if( empty( $preview ) ) $Messages->disp( );
   // --------------------------------- END OF MESSAGES ---------------------------------
 ?>

You might want to look for request_title( ... ) and put the Messages code just before request_title()

Permalinks

Locate all occurences of:

 $Item->permalink()

and replace them with:

 $Item->permanent_url()

Author name

Locate:

 $Item->Author->preferred_name();

and replace by:

 $Item->author( '<strong>', '</strong>' );

Calendar

Locate this:


  <?php // -------------------------- CALENDAR INCLUDED HERE -----------------------------
  require( dirname(__FILE__).'/_calendar.php' );
  // -------------------------------- END OF CALENDAR ---------------------------------- ?>
And replace with this:
  <?php
    // -------------------------- CALENDAR INCLUDED HERE -----------------------------
    // Call the Calendar plugin:
    $Plugins->call_by_code( 'evo_Calr', array(	// Params follow:
        'block_start'=>'',
        'block_end'=>'',
        'title'=>'',			// No title.
      ) );
    // -------------------------------- END OF CALENDAR ----------------------------------
  ?>

Categories

Locate this:


  <?php // -------------------------- CATEGORIES INCLUDED HERE -----------------------------
  require( dirname(__FILE__).'/_categories.php' );
  // -------------------------------- END OF CATEGORIES ---------------------------------- ?>

and replace with this:


  <?php
    // -------------------------- CATEGORIES INCLUDED HERE -----------------------------
    // Call the Categories plugin:
    $Plugins->call_by_code( 'evo_Cats', array(	// Add parameters below:
      ) );
    // -------------------------------- END OF CATEGORIES ----------------------------------
  ?>

Archives

Locate this:


  <?php // -------------------------- ARCHIVES INCLUDED HERE -----------------------------
  require( dirname(__FILE__).'/_archives.php' );
  // -------------------------------- END OF ARCHIVES ---------------------------------- ?>

and replace with this:


  <?php
    // -------------------------- ARCHIVES INCLUDED HERE -----------------------------
    // Call the Archives plugin:
    $Plugins->call_by_code( 'evo_Arch', array(	// Add parameters below:
      ) );
    // -------------------------------- END OF ARCHIVES ----------------------------------
  ?>

Logging hits

Locate this:

  log_hit();	// log the hit on this page

and replace with this:

  $Hit->log();	// log the hit on this page

That’s it ;)

CSS

If your CSS file imports styles from the /rsc/ folder, be aware that these styles have now moved to /rsc/css/

Optionally, you may want to add the following styles to your custom CSS file:

Style for the messages:


 div.action_messages {
   margin: 0 2ex;
 }

Style for the comment preview button: input.preview
You probably already have a style for submit and reset like this:


 input.submit,
 input.reset {

If you want to appluy the same style to the preview button, just insert it like this:


 input.submit,
 input.preview,
 input.reset {

Same for input.preview:hover

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

No feedback yet

On this page

  • Stub files
  • Skins
  • Skin files
  • Skin’s _main.php
  • First line
  • Content Type
  • Base tag
  • Page title
  • Messages
  • Permalinks
  • Author name
  • Calendar
  • Categories
  • Archives
  • Logging hits
  • CSS

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
Complete website engine

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