b2evolution is a tool that allows you to build your own website. This ranges from just a home page to a full featured site with multiple blogs, forums for your user community and structured content such as manuals or knowledge bases.
Additionally, b2evolution allows you to send newsletters to your user community and members can send private messages to each other.
Once b2evolution is installed on your web server (or web hosting account), it will easily let you build a website consisting of any combination you choose of blogs, pages, photo galleries, forums, online manuals and more. You have full control of how small or how complex you want your website to be. You can start small (for example a simple blog) and extend it later. You can also customize the look & feel of each section with a combination of Skins and Widgets.
As soon as you have set up a prototype of your site, b2evolution will let you enter content (blog posts, pages…) and upload media files (photos, videos…) to be included in your content. Your content can be edited and re-organized at any time.
Once your content is published, visitors can leave comments on any page you choose. If you’d like, you can also let your users register an account for themselves in order to build an online community, complete with user profiles, public forums and private messaging as well.
b2evolution also provides Server Side Analytics and includes powerful Antispam tools for dealing with undesirable visitors or users.
All of this stays very flexible and can be modified at any time. This is why we call b2evolution a CCMS: Content + Community Management System.
Everything described here happens on your own website and your own domain. Contrary to other website or blog building solutions, with b2evolution everything is under your control and yours only. If you don’t have a website/domain yet, you may easily get one from our hosting partners. (They will even offer 1-click installation of b2evolution on your site to get you started even faster.)
Another noticeable advantage of using b2evolution for building your website is that everything you will need is likely to be included. You won’t need to hunt down, select, buy and maintain third party plugins for advanced features. With b2evolution, everything you need is included, right out of the box.
And it’s 100% Free and Open Source. (View on GitHub)
Organize all your contents into a complete website
b2evolution is a very versatile Content Management System (CMS) designed to organize all kinds of contents: simple web pages, blog posts, photos, videos, downloadable files (PDF, ZIP…), manuals, forums, and more (you can define your own/custom types of content). Your contents can be then combined and organized into a complete website, or – if you choose so – spread across several smaller websites in parallel.
For example, you might start with a simple blog. You just need to type something and hit “Publish now!". It’s instantly on your website!
You might then add a photo gallery. Then, you might add a reference section about your area of expertise. Then, you might want to add a forum where your community can start discussing topics of their own. Or maybe you’d like your members to be able to create blogs of their own? Also possible!
b2evolution lets you start as small as you want and grow as big as you need.
b2evolution will present your content using a system of skins (aka themes), containers and widgets. For example, you might use a blog-type skin which brings styling around 5 main containers: a header, a navigation menu, a content area, a sidebar and a footer. Each of these containers contains customizable widgets. For example, the main area may show a combination of the following widgets in the order you decide: post title, date, author, teaser, attached images, categories, tags. You may reorder them, remove some, or add some. For example you could decide to add a download button for each post (if relevant).
The sidebar may contain any number of widgets related or not to the main content, such as a list of categories, recent posts or even ads.
The menu may be entirely customized to provide the navigation you need.
Once you have decided on the general layout of your content blocks/widgets, It is possible to change the look & feel of your website by customizing the existing skins (CSS3/HTML5) or using different skins entirely. You may also choose to use different skins for desktop, tablets and/or smartphones in order to provide an optimized experience for touch devices and/or small screens. Of course, you can also build custom skins of your own (PHP).
Social & Community features
b2evolution easily lets you add one or several forums to your website, allowing your members to discuss various topics among themselves.
But even if you don’t want a forums section on your website, there are many other social features you can take advantage of:
- You may allow your visitors to leave comments almost anywhere (even on info pages or on photo albums if you choose so). You may even allow them to attach files to their comments.
- You can rely on b2evolution’s extensive antispam features to keep your site spotless and clean… or you can limit some operations to members only.
- You can create member accounts for your users or allow your visitors to register themselves. For added convenience, they may also login with Facebook, twitter, etc. [b2evo v6].
- Members may have an editable profile page and may appear in the site directory.
- Members may communicate privately through private messages.
On the other end of the spectrum, you can go as far as allowing your members (or members of certain groups) to create and publish their own blogs on your site.
b2evolution can send email newsletters to your members. Actually, it can even send targeted email to subsets of your user base through its complete campaign management interface.
b2evolution also includes goal tracking and server-side analytics.
Registered users can have different permissions depending on the User Group you put them into or on the User Level they acquire.
You can entitle other users to create drafts in one area or your site and/or moderate comments in another. General permissions such as user management can also be assigned based on User Group permissions.
First, b2evolution is a self-hosted solution. This means that, at any-time, you are in full control over your domain and over your website’s data, privacy and intellectual property.
Second, compared to other self-hosted solutions, b2evolution is the most integrated you will find. No extra plugins or modules are required to build a full-featured website. This means that, any time you want to upgrade for better security or for new features, a single button press will upgrade everything at once. No plugin incompatibilities. No dependencies issues. b2evolution’s goal is to make the maintenance of a self-hosted website as simple as can be.
Compared to just-sign-up-and-build-your-site solutions, downloadable software like b2evolution gives you real and complete control over your website, including limitless customizability and extensibility.
Compared to other blog engines, b2evolution is designed from the ground up to handle multiple blogs. Additionally, b2evolution’s philosophy is to include everything you need right out of the box. You likely won’t need to search, select, install and maintain extra plugins.
Compared to other content management systems (CMS), b2evolution lets you build your site through the concept of assembling Collections. Each collection can be a Blog, a Photo Gallery, an Online Manual, a discussion Forum, or something you customize entirely.
Compared to other Forum/online community engines, b2evolution completely integrates your forums and user management with the rest of your site. If a user comments on a blog post or likes a photo in a gallery, he does so with the same account as he uses for posting on the forums. You have one central user base and permission management.
Compared to typical 3rd-party mailing list management solutions, b2evolution comes with its own fully integrated emailing engine which lets you send email campaigns to your most up-to-date user base. Your users’ email addresses and preferences will always be up to date. No more importing, synchronizing or missed opt-ins/opt-outs while dealing with a 3rd party email list manager. And of course, no need for users to sign up twice for email and for forums.
Your domain is your identity. You don’t want to let someone else decide what can or cannot appear on it (including ads…)
Unlike online blog tools or site builders, b2evolution runs on your very own domain and website. You are in full control. And your possibilities for customization are limitless.
b2evolution is designed to be set up quickly on any standard PHP/MySQL hosting account.
Why mix your cooking recipes and your travel photos with your more serious pro blog on your site if you could have them neatly separated into 3 different sections of your website?
b2evolution will let you run multiple blogs side by side, as different folders of a site, different subdomains or your domain… or even as completely separate domains if you wish so.
Unlike other blog tools, b2evolution lets you do all this with a single installation, a single database and a single web hosting account. This makes maintenance so much easier! No more week-ends spent upgrading all your blogs and sites separately!
Additionally, members of your site can sign in once and be recognized on all blogs/sections with the same user account.
Maybe your portfolio or even your vacation pictures would be much better organized as photo albums, rather than as a linear blog feed? b2evolution can handle photo albums.
How about adding a reference section on your web site? Content organized into a book-style hierarchy rather than by date? b2evolution can handle online manuals.
How about adding a forum for your visitors to start new discussion topics instead of just replying to your blog posts? b2evolution can handle forums too!
In addition to allowing public discussions in forums, your users can create user profiles and send private messages to each other.
This is all possible without additional plugins and without the need to integrate a third party solution.
Have you considered staying in touch with your users through email newsletters?
Unlike other solutions, b2evolution doesn’t require that you export your user’s emails and import them in a third party tool. You can create campaigns directly in b2evolution and target them at any subset of your users, using all the criteria available on your user profiles.
Plus your recipient base is always up to date since it’s based on your live user accounts and user profiles. If someone unsubscribes, no syncing is necessary. It does’t have to be complicated.
b2evolution delivers your emails too. b2evolution has a full built-in emailing engine, handling your email campaigns as well as your transactional messages (password confirmations, new reply notifications…) with complete support for delivery incident management (full Return-Path handling).
b2evolution also integrates server-side analytics and goal tracking.
Contrary to popular belief: plugins are not your friends! They break, they create incompatibilities, they create security holes (third party developers do not all code to the same standards) and they are a pain to keep up to date.
Having a plug-in framework is great, but it should be reserved for last-resort cases / cutting-edge implementations. We believe there is no reason to withhold common features from a full and clean integration into the system core.
Here are a few examples of features included in b2evolution that would require extra downloads and maintenance on other platforms:
- Total caching for best performance (page cache, block cache, client-side cache)
- Search Engine Optimization (SEO)
- Photo galleries
- Email campaign management
- Collaborative work / publishing workflows
- Advanced user permissions
- Server side analytics
- Efficient anti spam features
- And more…
As outlined above, unlike other solutions, b2evolution does not require any third-party plugins, themes or extensions to reach it’s full potential.
This means you can get your site up and running faster (you don’t need to hunt for anything, you don’t need to pay for additional features, you don’t need to deal with compatibility issues) but furthermore, it will save you a lot of time, effort and pain every time you try to update your site!
With b2evolution, everything gets updated at once, in one single swoop and without any compatibility issues.
There are multiple ways to customize your b2evolution website. Many of them are redundant, so you’re guaranteed to find one that fits the level of skills and effort you’re willing to put into it.
Here is a rough breakdown of customization options:
- You can easily switch skins for each blog/collection/section of your site;
- Most skins have settings to let you change the colors, fonts and graphics [extended in v6];
- Everything is displayed though widgets that can be reordered and reorganized at will [extended in v6];
- You can edit the CSS files of your skins;
- You can work with Sass (SCSS) [v6];
- Some skins are based on twitter bootstrap [v5.1];
- You can edit the PHP templates of your skins;
- You can create custom templates;
- You can create custom skins.
Any semi-popular website is a target of choice for spammers. They will send their robots and their low-cost employees to post comments with links to their sites (comment spam), create fake profile and engage legitimate users through private messages.
b2evolution has deployed an arsenal of counter-measures for all these nuisances.
Undesired activity may be blocked by keyword, IP, country and/or behavior. Users can also report suspect activity and we took care to make cleanup as seamless as possible (1-click AJAX deletes with possibility to undo in case of error).
b2evolution will run on almost any standard web server featured with the LAMP environment: Linux - Apache - MySQL - PHP. See requirements. Because this is the dominant platform for websites today, it means it’s a future proof choice for the long term. You are guaranteed to find a plethora of web hosting providers any time when you need one and any country where you’d like to host your site.
Because b2evolution is a single software package for your entire web site, with no added plugins required for most uses, it makes it extrelmely quick, easy and seemless to upgrade and keep up to date.
It can generally be done in 5 minutes at the push of a button. Then you go home and relax while others spend their week-end upgrading their sites one by one, trying to fix plugin/theme/extension incompatibilities along the way.
Members of b2evolution’s team have been dealing with web deployment, maintenance, performance and security issues since 1997.
Streamlining the upgrade process and minimizing the need for system administration is one of our top priorities.
b2evolution lets you focus on building a site, creating a community and developing your business rather than doing technical maintenance work.
Not just for a trial. Forever. No matter how such traffic or how many users you will get.
b2evolution is a true open source project. You can download it, use it, modify it, redistribute it freely. (GNU General Public License). You have the liberty to customize it to infinity.
Also, for open-source connoisseurs, we’re now on GitHub too.
Note: just to be clear: b2evolution is the free software you install on your website to give it all the features you need. You need to bring your own domain and your own webhosting. If you don’t have a domain or a web hosting account yet, we have a few recommendations for cheap web hosting solutions as well as quality web hosting solutions.
b2evolution includes all the features of traditional blog tools, and extends them with evolved features such as file & photo management, advanced skinning, multiple blogs support as well as detailed user permissions...
Install b2evolution once and use it for 2, 3, 10, 100 or even 1000 blogs at the same time. Each blog can live on a different page, in a different folder, or on a different domain... or you could also choose to display several blogs on the same page.
Install b2evolution once at the root of you web hosting plan, set up as many "alias domains" as your web host allows you to, and let b2evolution take care of running a different blog/site on every domain.
Multiple users and authors
Any user can be given permissions to read, write, moderate or fully customize any number of blogs. Complete and detailed permission management is included.
b2evo will show you activity graphs for each blog, including robots, RSS readers and browser hits broken down by referrers, searches, direct accesses, self-referred, etc. Also includes search keywords, user logins and more.
Effective combination of active and passive antispam measures ? including a community shared blacklist ? to block comment and referer spam.
In the occasional case wher b2evolution doesn't already include a feature you need, its advanced plugin framework allows you to extend the application with virtually any feature you may need... or simply install prebuilt plugins provided by the community.
Each blog can be sub-divided into categories and sub-categories to organize your posts by subject or theme. Posts can be assigned multiple categories, but even more: if you wish posts can be cross-posted among multiple blogs at once.
Localized in several languages
For example: submitters can post drafts, then assign them to an editor who in turn may assign them to reviewers for final approval and publication on the site. Actual workflow, permissions and statuses are all up to you.
Multiple post types support
With b2evolution you're not limited to writing in-flow blog posts, you can also write random pages that you can link in the menus (thanks to widgets) and access randomly.
You can also write intro posts for each blog or even for each category.
b2evolution also has a post type for podcasts which will automatically produce correctly formatted RSS feeds for podcasts.
b2evolution lets you attach files not onloy to posts, but also to comments. This way your users can easily post comments on blogs or in forums with pictures attached (can be configured).
Easy install & upgrade
b2evolution's installer will take care of almost everything. Basically, you only need to give it the name of a MySQL database and you're set. Upgrading is equally simple. Only heavy customizations may require special care when upgrading.
Users can create a profile with profile pictures as well as a number of custom fields that can be configured by administrators.
Each URL type can be configured. Each link type can be configured follow/no-follow. Each page can be configured index/no-index.
Posts/articles can have a
different from their
and additional meta tag info can be configured.
n be 301-redirected. Other 404's can have a custom error page or can also be redirected (301, 302, 303...)
WYSIWYG Editor or not
With b2evolution, authors have a choice or using a WYSIWYG editor (TinyMCE is included) or not. In that case other types of fast markup can be used: GM Code, BB Code, Markdown as well as WiKi-style markup, including quick WikiLinks.
Automatically post to twitter when a new post or article is published.
If you have a collection of texts in a text file, you can copy/paste it in the mass posting editor and it will automatically creat enew posts for you by recognizing posts, titles and paragraphs based on newlines/blank lines.
Server Side Analytics (SSA)
- RSS and Atom feed requests
- robot, crawler and spider activity
- spammer activity
- AJAX requests
- Incomplete pageloads (even if the user aborts loading the page, the view is counted)
- Multiple & sub-categories
- Photoblogs with thumbnail index -
- Featured posts - -
- Posts can have custom fields - -
- User comments
- Comment ratings -
- Comment avatars with gravatar support - - -
- Allowing/closing comments on a post by post basis
- Spam filtering
- Paged browsing
- Archives by Year, Month, Week or Day
- Archives by Category
- Weekly archives
- Category archives
- Tags and tag clouds -
- Keyword search (and / or / phrase)
- Multipage posts
- Extended "read more" posts
- Clean / keyword rich permalinks (no ? in URL)
- Per post lang attribute
- Author contact forms
- Standalone admin contact form
- Admin / backoffice including dashboard -
- Cross-post among multiple categories
- Cross-post among multiple blogs
- Draft posts
- Private posts
- Protected posts (reserved to members)
- Advanced rendering plugins
- Texturize plugin
- Smiley plugin
- XHTML input validator
- Drag & drop widget management - -
- File Manager
- Automatic thumbnail generation -
- Configurable thumbnail sizes - -
- Create posts from one or more images - -
- User / Group management
- Users can have custom fields - -
- Simple permission management -
- Advanced User / Group permissions
- Edit permissions can depend on user level -
- Plugins can define their own permissions - - -
- Messaging module- - - -
- jQuery as default JS/AJAX library
- EvoBar (toolbar) on all pages -
- Page level caching
- Block level caching
- Object level caching
- Security aware framework
- Plugin framework
- Plugins can have blog specific settings
- i18n/l10n toolkit
- Timezone difference handling
- RSS for posts
- RSS for comments
- Atom for posts
- Atom for comments
- RSS/Atom feeds for comments on individual posts
- b2 API
- Blogger API
- MetaWeblog API -
- MovableType API -
- WordPress API - - -
- Pre-optimized for search engines & advanced SEO settings -
- Canonical URLs and 301 redirects -
and fields handling - -
- Pinging of b2evolution.net
- Pinging of pingomatic
- AdSense plugin -
- Advanced plugin framework
- Integrated stats/analytics with Flash charts
- Goal tracking - -
- Integrated antispam
- Centralized spam blacklist
- Task scheduler for automatic maintenance
- Google Sitemaps
- User registration with email validation
- Optimized for iPhone - -
- Optimized for InnoDB data integrity - -
- Optimized for PHP 5 (still compatible with PHP 4) - - -
- Optimized for APC cache
- +++ V5 FEATURES!
b2evolution displays all the contents it manages through Skins (also commonly called Themes). Skins control the general HTML layout of the pages being displayed to the users. But skins also control the user experience. Skins are what makes a Photo Gallery, a hierarchical Manual and a Blog have different navigation experiences.
b2evolution comes with a selection of skins for multiple purposes (blogs, photo albums, online manuals, forums). Each skin can be customized through a settings screen (colors, etc.) If needed, additional skins can be easily downloaded and installed.
Skins display different kinds of pages. Each of those pages is broken down into containers. Then, in each containers you place widgets. Widgets can be just anything: the title of the website, the title of an article, the content of the article, a comment form, a list of related posts, a rotating ad area, a menu item, a calendar, a list of tags, etc.
The container/widget structure of b2evolution allow you to decide exactly what gets displayed where and in which order.
Newer versions of b2evolution display 100% of their contents through widgets that you can arrange and configure to your liking.
The b2evolution core as well as all its default skins are fully HTML 5 compliant.
You will especially notice the use of HTML 5 elements such as
Responsive Web Design
b2evolution’s back-office as well as all of its default skins are built using Responsive Web Design (RWD).
RWD ensures that the layout of HTML pages reflows nicely depending on the size of the viewing device. For example, on a mobile phone you typically don’t want to have a wide menu across the top of the screen, nor would you want a sidebar. On the contrary, you would want your content to make the best possible use of the constrained reading/viewing area of a small phone.
On a tablet device, you would have less space issue, yet you would still want to make sure all buttons and links are large enough to be touched with a finger and spaced far enough from each other in order not to miss tap the wrong link/button.
All this is automatically handled when you use b2evolution v6+ and matching skins.
All default b2evolution skins as well as the back-office are responsively built using the Bootstrap framework.
Furthermore, b2evolution widgets allow to be customized with CSS classes, which allows to use the bootstrap column/responsive classes in order to control the responsive layout of virtually anything that is displayed by b2evolution.
b2evolution’s back-office and default skins fully leverage the power of CSS 3.
Furthermore, we use Grunt to preprocess our code files, which allows us to write higher level code in LESS and SASS.
Here are a few guidelines describing the general design philosophy of b2evolution.
Adhering to Web Standards Whenever Possible
So, we try to comply to web standards as much as possible but when something just won't work as the majority would like it to, in a standard way, then we won't do any integrism about it.
Relying on Well-Supported Technologies
Furthermore, we take care in using versions of PHP & MySQL which are commonly available on a wide majority of web hosts.
Clean, Robust & Documented Code
Though b2evolution originally started as an evolution of b2/cafelog, we found out that the legacy codebase was unable to handle the scalability, security, functionality and versatily we were expecting from b2evolution.
So, little by little we rewrote the whole core of the application. Today b2evolution has barely more than its name left in common with its ancestors.
We are very vigilant in keeping the codebase clean.
The efforts put into cleaning up the code lead us to not integrate any further hacks into the application. If you want to add functionnality and make it publicly available, we suggest that you start by taking advantage of our plugin framework.
Did you know?
I'm discovering just how much I hate Wordpress. Why make templates so hard to use? @b2evolution is so much better.
– Naomi Guss (@pupsinmelb) September 11, 2013
This isn't about a bunch of promises of things to come. The development team delivers, period. And boy, do they deliver in style!
Soooo easy to set up!
My first site, I had a few template issues, but no issues with the software. B2Evolution is pretty neat so far. The second site took less than a day to work out and again, that was designing the template, getting that running and the blog set up was quick. Waaaay cooler than what i used to use before.
Anyway, thanks for the great software.
The backend is more configurable and powerful than WP. It's more like a CMS than a blog and it has several powerful features like multi-blogging and per-post enabling/disabling post filters (like smilies, smart quotes, auto-links and other code) etc.
Just check out a demo of b2evolution at demo.b2evolution.net. ;)
I just now installed b2e on my test server, and I must say I'm impressed. The installation went flawlessly and was impossibly easy to do, and I'm quite impressed by all of the configuration options. The configuration files are very easy to understand, too. I'm currently poking around to see what I found, but it took just a few seconds to import my 1500+ old posts into the new database. I'm extremely pleased and can't wait to see what I can do with it.
The "feature" b2 has and will always have over WP is stability. I can go about months without even checking on my b2 install that has over 1 mil unique visitors / month. It is more reliable.
About the community...
Wish all FLOSS project developers were half as obliging!
That was a quick response and it was dead-on accurate too. You solved my problem for me and the instructions you provided made the process easy. Thank you very much. I must say that this forum is a breath of fresh air.
Everyone is so nice here. ;)
Hi there, I'm new to b2evo but I just wanted to say thanks.
After going through the FAQ, I went sifting through the forum trying to answers to oddball questions that I still had. All throughout I've been reading your posts and I found it very refreshing to find someone who takes time out to respond without being sarcastic or degrading to newbies as I've seen on other sites.
Because of the thoroughness of your replies, I haven't had to post anything to the forum yet, I've always managed to find the answer.
– Adam (PM)
Thanks! to you and your team. Your product is SUPERB - head and shoulders above all the others. I say that for one simple reason - the comprehensive documentation makes the whole thing incredibly easy by explaining in simple terms what goes on, and how to customise it. Let your rivals take note. I am immensely impressed - very well done!!
– Jill C. (email)
Please send more! ;-)
We welcome your testimonials posted below. If you blogged about b2evolution, feel free to post a link below.
b2evolution is a strong evolution of it's ancestor: the b2 software.
Do you know what other project spawned from b2? WordPress!
Read on to learn how the lives of b2, b2evolution and WordPress are connected...
This is how François, the founder of b2evolution, described the birth of b2evolution at its beginning:
Having been sick of Blogger's famous bugs and outages for too long, I switched to Michel V's b2 in December 2002.
b2 was already a great blog tool at the time and the future looked even more promising! At that time version 0.6.1 had been released for almost two months and everybody was expecting a new release soon...
Unfortunately, that release never came!
Even worse: Michel V, the project maintainer and main developer virtually disappeared! We were literally worrying about what could have had happened to him. He didn't answer any emails either...
Time was passing by and, little by little, the b2 project started looking like a dead end. A few people had already created forks in an attempt to add features. One was b2++ but it was very complex to install at that time and felt really weird... at least to us and to a few others. Another one was WordPress which was announcing a few interesting things but hadn't actually released anything by then...
By the end of April 2003, I just couldn't stand it any longer... There was so much more I wanted from b2 and absolutely nothing had moved positively for more than 6 months!
I could have switched to another blog tool again, but for some reason I decided to give it a try and just started hacking in the features I thought I desperately needed. I recall my first goal was to support multiple blogs so I could move back home another blog I was still maintaining in Blogger!
A little bit to my own surprise, I actually enjoyed refreshing my PHP/MySQL knowledge and decided to immediately follow-up on this by implementing some other features I considered paramount: Latest comments, multiple categories, realtime statistics, comments on same page, performance optimization, and a few more...
By May 2003, when I realized I had been working almost three weeks non-stop on an evolution of b2, I started considering releasing it publicly.
Ironically... a couple of weeks later, Michel V. made a short comeback and proclaimed WordPress as the "new official branch, once they get a release out"... and so WordPress rushed out their long awaited release.
I was undecided for a while... Matt from WordPress kindly asked me to virtually take everything I had already done and rewrite it into WordPress. So far I had been doing this for fun, but doing it twice really didn't sound like fun any more. So I decided that was too much work for too little benefit.
I thought it was more productive to continue developing the b2evolution branch... and here it is. I'm quite happy with it. I hope you'll be too!
Enjoy! And don't forget to check back for new releases ;)
After a while, it became clear that b2evolution and WordPress would evolve in different directions.
WordPress would be more focused on aesthetics and little on code. Most sites running WordPress have found that they required to install numerous third-party plugins to get the results they wanted. As of today, they still require frequent security patches and updates in order to stay operational.
b2evolution would be more focused on having a strong solid framework to rely on for future developments. Most features needed for common websites have been integrated in order to be immediately available within b2evolution. The platform is generally regarded as being very stable and secure. (b2evolution no longer includes original code from b2. Everything has been rewritten in the period 2003-2008).