b2 template changer

I’ve just about finished a template changer. I just need some templates to throw in there!
You can download the default template to see what a template looks like and if you’re handy with the ol’ html skills you might think about contributing a design? With each author’s permission designs will be distributed with the b2-smarty package, and placed under the GPL. If you don’t want it included just say so. Here’s an email I sent to a few guys working on designs as we speak.

index.tpl is the main page. b2userslist also uses it to render it’s content.
post.tpl renders a single post. index.php calls this template file multiple times and the output is printed in index.tpl via the variable {$content}

popup-end.tpl and popup-top.tpl are generic top/end files that appear on each popup. I may eventyually seperate out index.tpl into a top and end too.
Probably should do it soon though..

b2commentspopup.tpl is the main comments popup.
b2comments.tpl is the file that renders each comment.
b2commentheader.tpl should have been dumped and replaced with an {if}{/if} statement in b2commentspopup.tpl – empty it if you want as I’ll probably get rid of it in the future.

b2pingbackpopup.tpl – main pingback popup page. This shows how I’ll finally get rid of b2commentheader.tpl using an if-else.
b2pingbackpopups.tpl – individual pingback renderer.

b2trackbackpopup.tpl – as b2pingbackpopup.tpl above.
b2trackbackpopups.tpl – as b2pingbackpopups.tpl above.

b2rss2*.tpl should probably be left alone because they render xml..

site.css is the css style sheet. On the blogs site this is accessed from index.tpl by calling it “templates/site.css” because mod_rewrite rewrites that as /username/templates/site.css


b2-smarty mod 0.2

The 0.2 release of my b2 mod is now available for download! Changelog is on the download page and it’s well worth a look!


New release of b2-smarty almost ready!

I should be able to upload a new version of my modified b2 tomorrow sometime. The tarball is ready for uploading, but it needs just a bit more testing.
This one has all the updates seen on this site so it’ll be well worth a look!


Nice looking URLs in b2, part 2

Not ugly URLs, like this one, are now working here. It took quite a bit of hacking and use of mod_rewrite but it appears to be ok now.
The number of mod_rewrite rules in the .htaccess file has gone up, mostly to avoid the problem of css styling disappearing. This line takes care of it:

RewriteRule ^(.*)archives(.*)/templates/(.*) /users/$1/templates/$3 [L]


Nice looking URLs in b2

This is next on my TODO list. I’ll have to seperate some code from redirect.php to share with the “archives” file so it may not be very easy.


How to Log In with Safari ? the Solution

Mark Twomey already mentioned this to me, but here’s a solution I have now implemented so Safari users can login here. Adding “/” to the setcookie() commands is a security risk however as other blogs will have access to your login credentials. Unless you can modify the code on the server it’s impossible to take advantage of that however, another advantage of using Smarty!


b2 Hacks

I added Calendar Plus by Alex King to the site. Simply add {$calendar} to your blog template, and see the b2 readme for info on styling it.



Want to blog from your Java powered phone? Here’s a midlet that’ll blog to your b2 weblog. I tried to install it on my phone, but it failed unfortunately. Or not, considering Vodafone charge 20c/kb for GPRS..


Blog updates

Couple of b2 updates today.

  1. Enabled image uploads.
  2. Fixed mod_rewrite so that css and images are delivered directly. Makes them more cacheable.

Rev Jim on b2/Smarty

Someone noticed our work here! Thank you Rev. Jim for the review!
Right now the code is ugly, I simply strapped Smarty on top of b2 in about a week of coding. My initial intention was to make my changes as non-intrusive as possible but that’s not really possible. Michel made a really good job of seperating a large portion of the PHP code from the templates and that made my job so much easier.
I hadn’t thought of the ugly url issue much, but that can be solved reasonably easily through mod_rewrite and/or php.
Making the templates more flexible should be easy too. I was originally going to do so, but I’m wary creating new files on the server so I just listed the ones that could be edited instead. Another requested feature was to go back to the default template, or maybe even offer multiple templates! A version-controlled templating system appeals to the developer in me too!
There’s a few major things to do:

  1. Make URLs nicer.
  2. Reintroduce “Team” logins again, and make it a configurable option in the options web page. I need to document the difference between Team logins and creating a new blog. That will confuse people.
  3. More flexible template system.
  4. Work out how to handle image uploads nicely. That’ll probably come through using a username/images/ folder or something.
  5. Finish integrating Smarty into b2.