Powered by MediaWiki
Personal tools

Upgrade Skin from 1.6 to 1.8

From b2evolution manual

Jump to: navigation, search

If you already have a personalized skin that works with b2evolution 1.6 and you now want to upgrade it to work with 1.8, then this guide shows you how. Luckily, there's not much to it.

Contents

[edit] Head plugin hook

There's a new plugin hook that allows plugins to add code to the head of the skin (for adding css or javascript). Add the line right after the opening head tag:

Code: NEW head plugin hook code
<head> <?php $Plugins->trigger_event( 'SkinBeginHtmlHead' ); ?>

[edit] Permalinks

Permalinks work differently than they used to. You now have some more choices on how to create the links. This is how it used to be done:

Code: OLD permalink code
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"> <img src="img/icon_minipost.gif" alt="Permalink" width="12" height="9" class="middle" /></a>

The easiest way to upgrade it is just to change $Item->permalink() to $Item->permanent_url(). But, if you're using the standard icon and you want your code to look more clean, then change it to look like this:

Code: NEW permalink code
$Item->permanent_link( '#icon#' );

That one little function replaces the whole block of code from before.

[edit] Author name

The function to output the author name has changed. It used to be like this:

Code: OLD author code
$Item->Author->preferred_name()

And now it's like this:

Code: NEW author code
$Item->author()

[edit] View count

When the view count feature was added in 1.6, it looked like this:

Code: OLD view count code
$Item->views(); echo ' '.T_('views');

That didn't look so good when the post had been viewed once and it read "1 views." So, the views method now outputs the number and the word (with proper pluralization):

Code: NEW view count code
$Item->views();

[edit] _feedback.php

There are a lot of changes to the _feedback.php file (too many to list here). If you're still dragging along a customized _feedback.php file from an earlier version, then it's probably time to just grab the stock 1.8 file and recustomize it.