I added some “What is b2++?” blurb to the front page. Is there anything missing? What should I change to make it better? I’m targetting users and developers here (eh? yeah, that’s hard!), but I fear I’ve probably gone and confused any potential user!
Category Archives: b2
Referers in b2++
I’ve integrated part of the Nathan’s referer code into b2++. It’s in the form of a prefunction as it creates a global referers tag you can put into your site templates.
Currently it creates a different tag if you’re viewing a single post or a whole blog/category. This allows the template designer to use the postreferers
tag when listing referers to a single post, or use refererlinks
to list the site referers list. Add this code to your index.tpl to enable it:
{if $refererlinks != “”}
<blockquote>
Referers:
<ol>
{foreach from=$refererlinks item=link}
<li> <a href=”{$link.referingURL}”>{$link.baseDomain}</a> ({$link.visitTimes})
{/foreach}
</ol>
</blockquote>
{/if}
Flavour it to suit your own blog design. Substitute $postreferers for $refererlinks and put the same code into post.tpl to see single post refererers. The final b2++ 0.6 will have this in place, and all you’ll need to do is update your templates from the Template Chooser.
Update!
Because of the caching on this site many referers were lost, I changed the referer plugin into a Smarty insert plugin.
Insert functions are executed every time a page is loaded and because of the way they operate, I’ve had to hard-code the html it outputs for the time being.
Anyway, ignore the instructions above. If you want to record and display referers on your blog on this site, then add the following code to index.tpl (anywhere will do, but make sure there’s enough space for it!)
{insert name=”getreferer” mode=”index”}
Add the following to post.tpl if you want to show referers to individual posts too:
{insert name=”getreferer” mode=”post”}
There’s some problem with it as is though, sometimes the insert function doesn’t execute. I’ll have a look at why tomorrow.
Update 2
I still don’t know why insert functions didn’t work, that’s something I’ll have to bring up on the Smarty mailing list tomorrow. I reverted to recording every referer on each request, but the list of referers for any page is only updated when the page cache is updated.
b2 updates
I’ve updated this site to the latest release of b2++, you can take advantage of the new features by choosing another blog template from the “Template chooser”. Then go into b2options and enter your blo.gs ID. Your favourite blogs will then be listed, sorted by update time!
Even if you’ve no interest in blo.gs, the new release has a number of other updates you might like!
New b2++ snapshot
b2 and Blogrolling
Spitfire asked about blogrolling support in b2. I found Phil Ringnalda’s work on building a blo.gs parser and integrated it into b2++!
It’s not available here yet, but when it is, all you have to do to enable support for it is add the following to your blog template:
{blogroll blogID=”999″ blogteststring=”Somestring”}
I have the following in my template:
{blogroll blogID=”1927″ blogteststring=”Keith”}
Read Phil’s page above for a more detailed explanation of those parameters!
Lag when submitting with weblogs.com ping enabled.
A number of users have told me that posting to b2 is sometimes really slow. I suspected it was because b2 pings weblogs.com and blo.gs, and this post shows that it is a problem with weblogs.com
PHP Traveller documented a way for PHP to execute commands after a browser session/request is completed. It looks like a feature that isn’t very portable across PHP versions so probably not a reasonable solution for a publicly distributed application.
The ultimate Weblogging system, outlined
Mathew outlines his requirements for a weblog. Certainly worth reading, and contains lots of good ideas. Sam Ruby questions “the need for a database”, but I think it’s practically impossible to create a decent weblog or information storage/retrieval system without one. You’ll only end up implementing those functions of the database anyway, even if by hand, ftping files up to a server and changing links, etc.
b2++ – snapshot release
A new snapshot is available for download now. This release will hopefully catch when you don’t have mod_rewrite enabled sooner in the install process.
If b2++ works fine for you, you may want to download the data package as it adds the templatehelp.tpl file, missing from previous releases. (Thanks Jim for finding that one!)
B2Links – link organiser for b2, and other updates
I mentioned B2Links before but it’s been renamed. The one final feature missing from it is polling weblogs.com to see if each link has been updated in the last x minutes/hours. I might take a look at this next week!
On the b2++ front – I discovered a bug when new users register. Sometimes their blog template isn’t copied over properly. Just login (at the b2login.php url sent to you in the email) and choose another template. A fix will be in the next snapshot, maybe tonight.
I should also make more checks for mod_rewrite in the install process, as at least person had trouble with it. That should be a simple 3 line fix though!
Tim mailed me a long list of features he’d like to see in b2++, as well as suggesting a name change for the project as it’s diverging quite a bit from the original b2. Leave a comment if you have any ideas!
I’d also like to hear from b2 mod/hack authors as the plugin system of b2++ will make it quite easy for original b2 hacks to be incorporated and distributed. When I get around to Smartyising the backend, it’ll be much easier to add stuff there!
b2++ 0.5
New release last night! This one fixes more install bugs, adds plugin support and with the plugins I’ve been talking about here over the last few days! It’s probably better if you download the src and data packages, as there’s been a few updates to the templates. Go download it!