Gray's Matter
Justice Gray - North America's Favorite Metrosexual Urban Legend
   by Justice~! DasBlog | Technical  

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)

 

Comments

#1 Anand  on 10/24/2005 6:34:01 PM

Anand

Can I create my own avatar?  I think you told me but I forgot.

Reply

#2 Justice  on 10/24/2005 7:01:50 PM

Justice

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

Reply

Dave

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

Reply

翻译公司

按时地方

Reply

翻译公司

exactly what I was looking for - only issue I have is that it writes out an extra slash in the image src...

Reply

Add comment

If you're going to leave a comment, please use your real name rather than a business name; otherwise it'll likely get blocked by my spam filter (or in the rare case it gets through, deleted by me manually). Thanks!


(will not be published)

  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading