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]

10/24/2005 12:34:01 PM (Mountain Daylight Time, UTC-06:00)
Can I create my own avatar? I think you told me but I forgot.

10/24/2005 1:01:50 PM (Mountain Daylight Time, UTC-06:00)
Well, an avatar for comments *could* be done if
a) you had a login on the site
b) I hacked the comment view box ascx
c) I were running this macro dll on my own blog, which I'm not (it's actually for a different blog entirely).

But at that point, aren't we just recreating community server?
-J
11/29/2005 9:42:08 PM (Mountain Standard Time, UTC-07:00)
This is exactly what I was looking for - only issue I have is that it writes out an extra slash in the image src...
i.e. img src="content/binary//admin.gif" Any chance you could fix this / post the code / tell me what I messed up?

Thanks!

Dave
8/28/2007 1:24:47 AM (Mountain Daylight Time, UTC-06:00)
按时地方
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):