Gray's Matter
Justice Gray - North America's favorite metrosexual software consultant

I Wish These People Updated More Than Once a Year

In an enhancement that I'm pretty sure only one person was actually clamoring for, I've created a custom macro for DasBlog 1.8 that will display a picture on each post that is related to the user who created that post.  This allows for a small customization (a la Penny Arcade) to differentiate between posters.  Here are the instructions for its use:

1)  Download the zip file at the bottom of this post, and place the unzipped DLL into the /bin directory of your DasBlog installation.

2)  You'll need to uncomment or add the following text in the web.config file located in your DasBlog root directory:

<section name="newtelligence.DasBlog.Macros"
type="newtelligence.DasBlog.Web.Core.MacroSectionHandler, newtelligence.DasBlog.Web.Core" />

3)  Uncomment or add the following section to your web.config file (the default web.config I received with DasBlog had this section in it already, just commented out). 

<newtelligence.DasBlog.Macros>
<add macro="userimage" type="Codivation.DasBlog.Plugins.UserImageMacros,Codivation.DasBlog.Plugins"/> </newtelligence.DasBlog.Macros>

4)  Wherever you want to be placing this picture in your itemTemplate.blogtemplate file, add one of the following:

a)  <%UserImageControl(format)|userimage%> - format should be the file extension you're going to be using, be it .gifs, .jpgs, or otherwise.
b)  <%UserImageControlWithDimensions(format,x,y)|userimage%> - where format is the file extension,
x is the image width, and y is the image height.

5)  Place the image file you wish to represent that user in your binaries directory (this should be /content/binary).  Ensure that the name of the file is the same as the name of the user you want it associated with: (e.g if your user's name is "justicegray", make sure that the image file in the binaries directory is "justicegray.xyz", where "xyz" is the file extension you chose).

There are a couple of limitations with this; one is the restriction on the name of the file in step 5, while the second is that for multiple users, every user has to have the same file type: everybody has gifs or everybody has jpgs, etc.  Hopefully I'll be able to rectify this down the road in a future release!

Codivation.DasBlog.Plugins.zip (2.04 KB)

 

Monday, October 24, 2005 #
Comments [4]   DasBlog | Technical  | 
Tracked by:
The Angry Coder [Trackback]