b2 Cafelog Resource Center

Last updated: 3rd of July 2013
Here to provide for your b2 hacks and files need. Serving the community since 2004. Disclaimer: I don't take responsibility for what you do with these files, I simply host them. More info: Cafelog.com

I've migrated from b2 to the latest Wordpress. Stay tuned for a how-to on doing this yourself, which I highly recommend. I'll keep the b2CRC site up for reference though.

b2 Community Board closing January 2008: after 3 years of support, hacks and feedback/requests, Mike decided to put the b2 message board to sleep. Finally. I am not going to be hosting any message board myself, since the number of users and level of activity are decreasing steadily. I will, however, keep hosting these files and hacks for as long as it takes. b2 was great and until I find a replacement, sigg3.net will be running b2.

Last additions: b2Links, Extra Options, b2fullarchives and latest post hack by Mike Little; and b2 image validation for comments by Michael Park
Please help us keep the community alive by registering:) Or seek out WordPress

The new b2 message board is here: http://board.michaelpark.net [Closed January 2008]

Archived threads from cafelog.com:
The b2 message board was hacked in March 2005 ago due to the lack of a critical update of phpbb2. Some of the old posts have been mirrored by Archive.org, but alot of great user content was lost.
Installation issues [24.05.04]
How to? [02.03.05]
Hacks [28.02.05]
Feature requests [02.03.05]
Site showcase [02.04.05]
Feedback [08.11.04]
Tip: Remove &sid=[numbers] from the query (in the address field) when browsing!

Purpose of this page

First off, if you're looking for a blogging tool and thought about going b2, think again! b2 is superceeded by Wordpress with which it is more likely to get support and more recent hacks as well. Wordpress has since version 1.5 become more of a total system than just a blog too! Then why do I use b2? Well, I've scripted it around to suit my needs, but if I'd started fresh today I'd go wordpress! Still, alot of hosts are lagging behind and are still providing b2 as blog-feature, so I don't fear a decline of new people using it for quite some time.

Getting alot of e-mails and Private Messages on the b2 message board concerning files and where to download them, I finally decided to do something about it and make this page. This page should be viewed as a supplement to the b2 message board from which it originates. I don't take any honor for putting up this page, I didn't make any of the hacks, I simply combined links and thread posts into this index. Why? To cut down on the number of repeated noob questions that has been answered several times before.

On a side-note I'd like to point out that if you're looking for a multi-blog and more user-friendly multi-user blog system that is still developing, with an active support forum too, you should consider checking out b2 evolution.

The essentials

The b2 cafelog blogging tool:
b2 v. Last official version
b2 v. (20030625)
b2 v.0.6.2 (20030524)
b2 v.0.6.1 (20021104)
10 tips to improve your fresh installation!
..you got another version(s) zipped? Send it!

Other necessary stuff:
The b2 readme | mirror (Everyone should read this)
Security fix (Note: I got hacked because I didn't do this!)
b2 ANTI-SPAM Four simple mods to eliminate comment spam!
b2 ANTI-SPAM tutorial For those who're still not convinced
EditPad Lite Free text-edior (Recommended above Notepad)

If you want to have a 88x31 button instead of the regular text-link, feel free to use mine, but please save it to your own server:

b2 button

Frequent issues

Ascending/Descending order suddenly changed or chaotic

I want to make my own template, but how to do it?
Solution: http://www.cafelog.com/board/viewtopic.php?t=420 [archived]
Mirror: files/b2_temp_easy.txt
by Nessahead

Template Tutorial
by Lindsey at Farandaway.org

I can't login...
Solution: http://cafelog.com/board/viewtopic.php?t=4769 [archived]
Mirror: files/b2_login_fix.txt
by Cyberian 75 with others
If it is your first login and you didn't get the admin pass, check the DB tables.

Updates/Comments not showing...
Solution: http://cafelog.com/board/viewtopic.php?t=5500 [archived]
Mirror: files/b2_refresh_fix.txt
by Jaleco

I want to have b2 in a seperate directory, but it doesn't work..
Solution: http://cafelog.com/board/viewtopic.php?t=2014 [archived]
Mirror: files/b2_sep_dir.txt
by Joshua Clinard and Nessahead

Gzip Compression Issue in Wordpress/b2
(Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice)
Solution: Weblogtoolscollection.com Gzip compression issue
by Mark

Hacks / Modifications

These hacks are all found @ the hacked b2 message board and copyright (if registered) belongs to the respected creators of the hacks. Note that hacks are not part of the official release and might mess up things if you don't follow the instructions. Tip: Read and read again. DO NOT REQUEST INFORMATION ON HOW AND WHY to me, because I didn't write them and don't use most of them. If you feel that something is missing, give me a wink at the board.

The title of the hack leads to the hack, be it a .txt file, .zip file or a webpage.
The source is where I got it from.
b2 All Comments by Stevem

It is useful to have a list of all the comments on your blog in case there is some old spam to weed out or you want IP addresses to add to the blacklist. The b2allcomments.php will list all the comments (from new to old) and also allow you to quickly delete them.

Source: http://cafelog.com/board/viewtopic.php?t=5893 [archived]
Mirror: files/b2allcomments.txt
Avert Bots by Cyberian75

This one-step modification of b2comments.post.php hinders externally executed (spam) scripts to flood your blog comments.

Source: http://cafelog.com/board/viewtopic.php?p=25578 [archived]
Mirror: files/avert_bots.txt
n Days/Months/Years ago today... by Cyberian75

This simple hack put up links to the posts you've made nth days, months and/or years ago today.

Source: http://board.michaelpark.net/viewtopic.php?t=25
Mirror: files/xago.txt
b2blacklist - Comments Blacklist by Michael H. Park

With this hack, you can easily ban specific IPs that leave junk comments from your administrative page. You can also manage them from a seperate "blacklist" page (like the catagory page).
Uses a seperate database table to store/retrieve banned IPs.

Source: http://cafelog.com/board/viewtopic.php?t=5849 [archived]
Mirror: files/blacklist.txt
b2 Commenter plugger by Dodo

This hack is for those posters who like to plug their commenters. This hack is easy to setup and very easy to use. The script lists all the distinct commenters of certain entry or numerous entries as you request. See the screenshot!

Source: files/b2commenter.zip
Credits: Krissy for files and screenshot. There's another tutorial at brokenlove.org
b2comments - Notify me/Subscription (FINAL) by Michael H. Park

"This hack/modification is for comments on a post but not all posts. It uses a new field in the comments table in your database to turn on and off the comment notification of a particular post a user subscribes to."

Source: http://cafelog.com/board/viewtopic.php?t=2042 [archived]
Mirror: files/b2_comnotify.txt
Convert friends' names to links (automatically) by annia

A simple hack of the smiley converter script which makes it work as an auto converter for your friends' names, automatically turning them into links based on an array.

Source: http://cafelog.com/board/viewtopic.php?t=1145 [archived]
Mirror: files/b2friendsnames.txt
b2customfields 2 by Mystis

"b2customfields enables the webmaster to add custom fields to each post. [The possibilities range from something] as basic as adding a field called 'music', in which you can put the song that you were listening to at the time of your post, to something as complex as a photoblog. b2customfields takes full advantage of b2's templating system."

Upgrading from version 1 [archived]

Source: http://www.cafelog.com/board/viewtopic.php?t=3375 [archived]
Thanks to Mikey! (http://www.forever-alone.net)
b2 (QUICK) backup by Stevem

This hack will download a file containing a copy of the database with the contents of your blog.

Source: http://cafelog.com/board/viewtopic.php?t=3154 [archived]
b2 daily quotes by dhtmlshock.com (©dhtmlshock.com)

This three-step javascript will add a daily quotation on your blog based on the day of the month. By keeping the quotes in an individual file CHMOD 766, you can easily update through the b2 "edit template" page. Click link above for the b2-friendly version, or the source link below for the original version.
For a live example, see www.sigg3.net

Source: http://dhtmlshock.com/scrollers/DailyTip/
b2 full archive A more extensive archive for b2, listing all posts under categories. Visitors can select category and timeframe. See live example here (the centre panel).

Source: http://zed1.com/fullarchives.php.txt
b2Links by Mike Little

Source: http://zed1.com/b2links/ | .zip
/me like in IRC by Doc.Fusion

If you write something begginning with '/me' it will turn out in as in IRC.
/me is happy to show you this stupid hack
* Doc.Fusion is happy to show you this stupid hack

Source: http://www.cafelog.com/board/viewtopic.php?t=3243 [archived]
b2 Extra Options by Mike Little

It's not as polished as b2links, but it eventually became the options feature in WordPress. What b2customfields is per post, b2extraoptions is for the whole blog. Source: http://zed1.com/b2extraoptions/ | .zip
b2 smilies hack 2.2 by Benjy

This hack adds smilies to b2edit.php and, if you want, your comments as well..

Source: http://cafelog.com/board/viewtopic.php?t=3663 [archived]
Mirror: files/b2smilies_22.zip
b2stats by GamerZ (mods by Sh0ck)

An addon to B2 which diplays b2 stats. It gets database info such as top commenters, most popular posts etc. The file is customizeable.
Simply download the phps file, then rename it to dot php before uploading. It should reside in the same folder as b2.

Source: http://licklinux.com/cafelog/viewtopic.php?t=40
Mirror: files/b2stats.phps
b2 group by Alex King.org

This hack lets you group a selection of posts on a single page. One use for this is to give your an URL you can link to if you've blogged while on a trip and want to have all of your trip posts grouped together on a single page.

Source: Alexking.org Software/b2hacks
Mirror: files/b2group_1.0.zip
b2 ministats by Kiin

Outside the b2-loop it echos (#) Posts and (#) Comments. That's all it does. I'm using it at my index page.

Source: http://board.michaelpark.net/viewtopic.php?p=124
Mirror: files/ministats.txt
b2 to LiveUpdate hack

Hack for parallell updating of a LiveJournal when b2 is updated.
Included by default in b2 v0.6.1. (see your b2config.php file)

Source: http://licklinux.com/cafelog/viewtopic.php?t=32
Mirror: files/liveupdate.zip
Thanks to imLissy for additonal, readable instructions (http://www.silvercpu.com)
Image validation for comments by Cyberian75

Add image validation to your comments to defeat spambots. This hack creates images of random 4 digit numbers to input when you want to post a comment. Renders Word verifier OBSOLETE.

Source: www.michaelpark.net/b2hacks/imgvalidate.txt
Mirror: files/b2imgval.txt
Improved Search by Cyberian75

Improves the b2 search "engine" and allows for search for exact matches. Seperate words with spaces.

Source: http://cafelog.com/board/viewtopic.php?t=5924 [archived]
Latest Post by category and random by Mike Little

Extract the latest post by category. Output is the date, the post title as a link to the full story and optionally the full or partial contents.

Source: http://zed1.com/latest_post.php.txt
Link Rel="Bookmark" easy hack by Sh0ck

This is good to add to your page, because it creates an easy navigation for those running text-based browsers, like Lynx. It gives the user a list of your 10 most recent articles in the top of the page. It gives your site an additional accessibility feature. It will not be visible to normal, graphical browsers.

The output: <link rel="bookmark" href="http://www.url.to.posts" title="title of post">
Source: http://cafelog.com/board/viewtopic.php?t=5757 [archived]
Mirror: files/b2_lynx.txt
URL hack by ncyoung.com

This simple Apache rewrite and forwarding code by ncyoung.com and Michael Park gives a nicer permanent link to your posts.
http://www.cafelog.com/permaLink/106 or http://www.cafelog.com/entry/1100 etc.
Source: http://ncyoung.com/entry/86
Mirror: files/nice_url.txt
b2 Word Verifier (for the comments) [OBSOLETE] by Cyberian75

This hack is OBSOLETE. Please use image validation instead (look above).
Have your commenters type in the first word of your post to comment with this hack.

Source: http://cafelog.com/board/viewtopic.php?t=5948 [archived]
Mirror: files/b2word_verif.txt

Tips and tricks

Again I would like to refer to the b2 readme, since the b2-loop commands and external b2 commands can be tweaked to do alot more than your average default setup. Here are a few I've fooled around with, but if you got one of your own, feel free to let me know!

Simple way to output php info by PHP.net

Just paste the following code into a .php file, upload it to your server and run it.
// Show all information

This file outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment (if compiled as a module), the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.
Note: For security reasons you should delete it after use or set user restrictions (e.g. chmod, password).

Source: The PHP Manual
Userimages in the b2-loop by Sigg3

Just create image files (in this case .gif's) and upload to a dir (in this case /images/). The tags for calling this can be done in two ways:
1) by USER ID (1 for admin, 2 for 2nd user etc. See the Team page.)
2) by USER LOGIN (or nick, this is easier to remember)

Let's say we go for option 2). User mamabear has a 'mamabear.gif' and user papabear has a 'papabear.gif' in the /images/ folder. To call it place this command in the b2-loop where you want the picture to show. <img src="images/<?php the_author_login() ?>.gif" border="0" alt="<?php the_author_login() ?>"> When user papabear has posted, the parsed tag will be: <img src="images/papabear.gif" border="0" alt="papabear"> In option 1) replace <?php the_author_login() ?> with <?php the_author_ID() ?>, and the gif's must be named 1.gif, 2.gif etc.

If you've got nice tables in the loop, this can make for a professional look:)

Using this mod to prevent spam!
This can also be done to prevent some amounts of SPAM by using the e-mail tag! Use either a similar picture for everyone (e.g e-mail.gif) or use the method above with one pic for each user. Then you just place this command where you want it to show: <a href="mailto:<?php the_author_email() ?>"><img src="e-mail.gif" border="0" alt="E-mail <?php the_author_login() ?>"></a> And I'm sure you can find numerous of other uses for these wonderful tags:)

Source: http://www.cafelog.com/readme.html
Defining design by the Category using CSS by Sigg3

Want different designs for each category? There are many ways to do this, but maybe the easiest is cascading stylesheets (CSS). If you combine some features of CSS1&2 and information from the b2 readme, you can make some really nifty, interactive differences when browsing your blog.
I did this with my GCP Group Blog.

My html: <div id="postsbkg">
<!-- // b2 loop start -->
<div class="cat<?php the_category_ID() ?>">
post stuff
<!-- // b2 loop end -->

and in my CSS: /* The CSS b2 category 'hack' by Sigg3.net */
/* Remember that a class can't begin with a numeral! */
.cat1, .cat2, .cat3, .cat4 {
margin: 0px;
padding: 2px;
border: 2px;
border-style: outset;
.cat1 {background-color: #FF9999; border-color: #FF0000;}
.cat2 {background-color: #FFCC33; border-color: #FF9900;}
.cat3 {background-color: #99FFCC; border-color: #00CC66;}
.cat4 {background-color: #CCCCFF; border-color: #9999FF;}
With these settings you can use the postsbkg for positioning and some styling, and the first part of the CSS above to define the look of all .catX classes, while the specific differences are done through the .catx individually. You can in fact have the posts show up entirely different by the category.

Source: http://cafelog.com/board/viewtopic.php?t=5986


This page wouldn't have been anything without the people of the b2 Cafelog Message Board who has provided me with suggestions, files and numerous challenges in between boring office work.

Michel V, the creator of b2 who has now gone to Wordpress.

Michael Park, for his dedication and willingness to write free code:)

Stevem, for great support when a noob's in distress

Echolalia, for older versions

And thanks to all the ones that I didn't mention.