- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrading from version 0.8.2
Upgrading from version 0.8.2
This man page refers to b2evolution version: 0.8.6
As always, it is very wise to do a backup of your current website / blog / database (depending on what you already have) before starting to install something new.
Upgrading templates or skins from 0.8.2
It is important that you understand that the following instructions apply only to upgrading skins or templates from version 0.8.2 to 0.8.6. If you use different versions, there will probably be some changes. The best technique for you to know what needs to be changed from one version to another is using a diff tool (like WinMerge) in order to see precisely what has change from a skin version to another.
Location of the default templates:
In many skins, some feature templates will actually call the default template for this feature. For example, the _archives.php template included the following statement at the bottom:
include dirname(__FILE__).'/../../_archives.php';
With this new version, the default templates have moved from the base folder to the skins folder. Thus, you should replace the above line with the following:
require get_path('skins').'/_archives.php';
The important change is get_path('skins').'/ , changing include to require is optional but makes debugging easier.
You'll need to make similar changes in the following templates: _blogroll.php, _categories.php, _feedback.php, _lastcomments.php, _stats.php.
If you are not using skins but direct templates, you will need to put this calls into your main template.
Either way, do not forget to copy the new default templates to your skins directory. You should also erase the old ones from your base directory.
Note: If you are using customized templates, please use a diff tool (like WinMerge) to check out modifications since your previous version.
New templates
Some new features require new files. You should probably copy the files _bloglist.php and _profile.php to your skin folder.
Main file (_main.php) or main template
Quite a bunch of new features:
- . Security improvement. Replace the following line from the search form:
<input type="text" name="s" size="30" value="<?php echo $s ?>" class="SearchField" />
with:
<input type="text" name="s" size="30" value="<?php echo htmlspecialchars($s) ?>" class="SearchField" />
- . Security improvement again. Replace the lines:
<meta name="description" content="<?php bloginfo('shortdesc', 'htmlhead'); ?>" />
<meta name="keywords" content="<?php bloginfo('keywords', 'htmlhead'); ?>" />
with:
<meta name="description" content="<?php bloginfo('shortdesc', 'htmlattr'); ?>" />
<meta name="keywords" content="<?php bloginfo('keywords', 'htmlattr'); ?>" />
- . This version now supports user profile editing from the blog page. To enable this copy the _profile.php file to your skin folder as told above and enable it by replacing the following block:
<?php // ---------------- START OF INCLUDES FOR LAST COMMENTS, STATS ETC. ----------------
.
.
.
// ------------------- END OF INCLUDES FOR LAST COMMENTS, STATS ETC. ------------------- ?>
with:
<?php // ---------------- START OF INCLUDES FOR LAST COMMENTS, STATS ETC. ----------------
switch( $disp )
{
case 'comments':
// this includes the last comments if requested:
require( dirname(FILE).'/_lastcomments.php' );
break;
case 'stats':
// this includes the statistics if requested:
require( dirname(FILE).'/_stats.php');
break;
case 'arcdir':
// this includes the archive directory if requested
require( dirname(FILE).'/_arcdir.php');
break;
case 'profile':
// this includes the profile form if requested
require( dirname(FILE).'/_profile.php');
break;
}
// ------------------- END OF INCLUDES FOR LAST COMMENTS, STATS ETC. ------------------- ?>
You will also need a link for the user to access the profile form. Actually, we have a whole set of new links. Here is how to roll them in. Replace these two old links:
<li><a href="<?php echo $pathserver?>/b2login.php">Login</a></li>
<li><a href="<?php echo $pathserver?>/b2register.php">Register</a></li>
with these five new ones:
<?php
user_login_link( '<li>', '</li>' );
user_register_link( '<li>', '</li>' );
user_admin_link( '<li>', '</li>' );
user_profile_link( '<li>', '</li>' );
user_logout_link( '<li>', '</li>' );
?>
- . Locales support: Replace the line:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
with:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang() ?>" lang="<?php locale_lang() ?>">
- . Charset. Replace the line:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
with:
<meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset() ?>" />
- . The blog list that you may have at the top of your page is now handled by an external template. Replace the block:
<?php // ---------------------------------- START OF BLOG LIST ----------------------------------
.
.
.
} // --------------------------------- END OF BLOG LIST --------------------------------- ?>
with:
<?php // --------------------------- BLOG LIST INCLUDED HERE -----------------------------
require( dirname(FILE)."/_bloglist.php");
// ---------------------------------- END OF BLOG LIST --------------------------------- ?>
and don't forget to copy the _bloglist.php file to your skin folder as told above.
- . Localization support. If you want strings to be localized, you will need to enclose them in T_(...). For example, replace the lines:
case 'comments': echo " - Last comments"; break;
case 'stats': echo " - Statistics"; break;
case 'arcdir': echo " - Archive Directory"; break;
with:
case 'comments': echo ' - ', T_('Last comments'); break;
case 'stats': echo ' - ', T_('Statistics'); break;
case 'arcdir': echo ' - ', T_('Archive Directory'); break;
You will need to change this is several places of your template to have it fully internationalized. If needed, please use a diff tool to identify them all.
_calendar.php
You can remove the line:
$Calendar->set( headerabbrlenght, 3 ); // length of the shortened weekday
It is not used any longuer. The short forms for weekdays are now defined in the language files.
New template features
Check out the custom skin and copy out the features you want ;-)