- b2evolution CMS User Manual
- Installation / Upgrade
- Upgrade
- Instructions for specific versions
- Upgrade from 1.10.x to 2.0.x
Upgrade from 1.10.x to 2.0.x
Settings required after the Upgrade
- All your blogs will be assigned to the default skin again
- Go to Global Settings > Skins and install any third party/custom skin you want to use; you may also remove skins you don’t want to use
- Go to Blog Settings > Skin and pick the skin you want for each of your blogs
- Go to Blog Settings > Widgets and select the widgets/plugins you want to display in each blog’s sidebar
- Go to Blog Settings > Advanced for Blog #1 and enter the IDs of the blogs you want to aggregate. Blog #1 no longer needs to aggregate everything, nor does it actually need to aggregate anything at all ;) Note: Include blog #1 itself in the list if you have posted articles directly to blog #1.
- If you use scheduled tasks (and you should), go to Tools > Scheduler and delete your current recurring tasks (Antispam poll, hit pruning) as they will fail repeatedly. Re-add these jobs in 2.0. (This is now done automatically by the installer in version 2.0.2)
Blog 1 used to be called Blog All and aggregated all my other blogs. Where is Blog All now?
In versions prior to 2.x, blog 1 used to aggregate all posts from all blogs. When you upgrade that behaviour is off by default. You can now make ANY blog aggregate posts from any other blogs, so that’s a big improvement! Blog 1 is not special anymore.
But if you upgrade an existing installation to 2.0 or higher, you will now take a new approach to creating a page that aggregates posts.
Go to Blog Settings and select the blog you want to aggregate other posts into (in this case your blog n° 1), then select the Advanced sub-tab. There you will see a field for what blogs to aggregate. It is a comma-separated list of blogs, such as, 1,2,4,7,19. Enter your comma-separated blog numbers and save the changes.
One of the biggest benefits of this is that we can now show posts in all blogs EXCEPT the linkblog on our the blog we choose to serve as our aggregator.
Skins Upgrade
If you are using your own (custom) skin, you will need to operate some changes to make it work with version 2.0. The following should do the trick:
- Rename your main CSS file from whatever name it had to "style.css" which is the standard way of calling the main skin CSS file in b2evo 2.x.
- At the top of your CSS file, make sure you include at a minimum the following:
@import url("../../rsc/css/basic.css"); /* Import basic styles */
otherwise your toolbar will be all borked.
- Rename your main skin template
_main.php
toindex.main.php
. Then edit that file with the following changes:
- In version 2.0, initialization of the blog data is optimized depending on what we are about to display. An RSS skin would be different from an HTML skin. For general purpose skins, add this at the top of your main template:
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
if( version_compare( $app_version, '2.4.1' ) < 0 )
{ // Older 2.x skins work on newer 2.x b2evo versions, but newer 2.x skins may not work on older 2.x b2evo versions.
die( 'This skin is designed for b2evolution 2.4.1 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
}
// This is the main template; it may be used to display very different things.
// Do inits depending on current $disp:
skin_init( $disp );
// -------------------------- HTML HEADER INCLUDED HERE --------------------------
skin_include( '_html_header.inc.php' );
// Note: You can customize the default HTML header by copying the generic
// /skins/_html_header.inc.php file into the current skin folder.
// -------------------------------- END OF HEADER --------------------------------
Note: the above block also automagically includes the HTML header, so you can just delete anything up to and include the <body>
tag.
- In versions 1.x, posts contents were displayed by
<?php $Item->content() ?>
. In 2.0, this will fail miserably. use this instead:
<?php
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', array(
'image_size' => 'fit-400x320',
) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
?>
- In 1.x, links to pages in multipage posts were displayed by
<?php link_pages() ?>
. This is no longer needed as it is handled by the block above. You can delete that part.
- In 1.x, links to other pages in the list of posts posts were displayed by
<?php posts_nav_link() ?>
. In 2.0, this again will fail miserably. use this instead:
<?php
if( isset($MainList) )
{ // Links to list pages:
$MainList->page_links( '<p class="center">'.T_('Pages:').' <strong>', '</strong></p>' );
}
?>
- Replace the block that includes feedback, i-e the block looking like:
<?php
// ------------- START OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. -------------
$disp_comments = 1; // Display the comments if requested
$disp_comment_form = 1; // Display the comments form if comments requested
$disp_trackbacks = 1; // Display the trackbacks if requested
$disp_trackback_url = 1; // Display the trackbal URL if trackbacks requested
$disp_pingbacks = 1; // Display the pingbacks if requested
require $skins_path.'/_feedback.php';
// -------------- END OF INCLUDE FOR COMMENTS, TRACKBACK, PINGBACK, ETC. --------------
locale_restore_previous(); // Restore previous locale (Blog locale)
?>
With:
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array(
'before_section_title' => '<h4>',
'after_section_title' => '</h4>',
) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------
?>
- You can remove the line staring with:
$current_skin_includes_path =
Also replace
require $skins_path.'_dispatch.inc.php';
with
<?php
// -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------
skin_include( '$disp$', array(
'disp_posts' => '', // We already handled this case above
'disp_single' => '', // We already handled this case above
'disp_page' => '', // We already handled this case above
) );
// Note: you can customize any of the sub templates included here by
// copying the matching php file into your skin directory.
// ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------
?>
- Your current sidebar may or may not work with 2.0. Either way, you’ll probably want to delete it completely and replace it with the following container code: (you’ll then use the backoffice to choose which widgets and plugins should go into the sidebar):
<?php
// Display container contents:
$Skin->container( NT_('Sidebar'), array(
// The following (optional) params will be used as defaults for widgets included in this container:
// This will enclose each widget in a block:
'block_start' => '<div class="bSideItem $wi_class$">',
'block_end' => '</div>',
// This will enclose the title of each widget:
'block_title_start' => '<h3>',
'block_title_end' => '</h3>',
// If a widget displays a list, this will enclose that list:
'list_start' => '<ul>',
'list_end' => '</ul>',
// This will enclose each item in a list:
'item_start' => '<li>',
'item_end' => '</li>',
// This will enclose sub-lists in a list:
'group_start' => '<ul>',
'group_end' => '</ul>',
// This will enclose (foot)notes:
'notes_start' => '<div class="notes">',
'notes_end' => '</div>',
) );
?>
Additionally, please note that "Skintags" or "Skintag plugins" now fall under the category of "Widgets". Widgets can either be provided by the core or by a plugin.
- Some of the default widgets have slightly different params than before. Among which:
- title should no longer include markup
-
line_start
is replaced byitem_start
-
line_end
is replaced byitem_end
- On a related note, if you are including a list of blogs at the top of your skin, you can no longer do that like this:
<?php
// --------------------------- BLOG LIST INCLUDED HERE -----------------------------
require dirname(__FILE__).'/_bloglist.php';
// ------------------------------- END OF BLOG LIST --------------------------------
?>
You now need to add a widget container and later place the blog list widget into that container (you’ll do that in the admin interface > blog settings > widgets). Use this to insert a container on top of the skin:
- You may want to add a link to contact the blog owner through a form:
<?php
// Display a link to contact the owner of this blog (if owner accepts messages):
$Blog->contact_link( array(
'before' => '',
'after' => '. ',
'text' => T_('Contact'),
'title' => T_('Send a message to the owner of this blog...'),
) );
?>
- Ideally, you would include the standard headers and footers. This is not mandatory though. Check out the custom skin for guidance.