- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrading from 1.6.x to 1.8.x
Upgrading from 1.6.x to 1.8.x
Skins
Most skin files are the same, however there are small differences in _main.php
.
If you only have small customizations to your 1.6 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 1.6 skin into an 1.8 skin, here are the changes you will need to apply to _main.php
:
Content Type
At the beginning of the file, locate this:
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
?>
and replace with this:
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
skin_content_header(); // Sets charset!
?>
Also locate this:
<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>
More info: skin_content_header(), skin_content_meta()
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! */ ?>
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()
For more information see the technical document for permanent_url(). Alternatively, you may want to use permanent_link() which can create a whole link, not just an URL, in a single call.
Author name
Locate:
$Item->Author->preferred_name();
and replace by:
$Item->author( '', '' );
More info: $Item->author()
Excluding stuff for static pages
Locate:
<?php if( !isset($generating_static) ) { ?>
and replace by:
<?php
if( empty($generating_static) && ! $Plugins->trigger_event_first_true('CacheIsCollectingContent') )
{ // We're not generating static pages nor is a caching plugin collecting the content, so we can display this block
?>
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 apply the same style to the preview button, just insert it like this:
input.submit,
input.preview,
input.reset {
Same for input.preview: hover