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

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!

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.