I have just finished modifications in my first dasBlog macro. This macro will add a shout-box to the dasBlog (see it on the right side of this blog). I have tested it successfully with Firefox and IE 5.5+. This macro is written for new version of dasBlog (version 2.0 - supports .Net framework 2.0). If you want to add this custom macro to your dasBlog, make sure you are using new version dasBlog 2.0.

On the best part, this macro uses Ajax to update the entries. It can refresh itself after a specified interval using Ajax calls. You can disable this behavior if you don’t want to update it silently. I have used XML to store the entires in a file on the webserver. So there is no need to bother about database. To make the look and feel for more controlled and customizable, I have added CSS support to shoutbox.

Here are few steps that will help you to add this macro to your blog. But before download macro and extract the zip file on your hard-drive.

1. After extracting, copy aakashjain.dll into the bin directory of your blog.

2. Now, edit the web.config file of your dasBlog application to make the following changes.

    a) Uncomment or Add the following code in the <configuration>/<configSections> of web.config file.

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

   
    b) Add or uncomment the following lines under the <configuration>.

<newtelligence.DasBlog.Macros>
    <add macro="AJmacros" type="AakashJain.AakashJainMacros,AakashJain"/>
</newtelligence.DasBlog.Macros>

    c) Add  the following line under the <httpHandlers> section of web.config.

    

<add verb="*" path="aakashjain/shoutBoxHandler.aspx" type="AakashJain.ShoutBoxHandler,AakashJain"/>


   d) One more setting is to be done. We need to tell dasBlog about the XML file where our entries will be stored. For this you have to create a key under <configuration>

<appSettings>
    <add key="AakashJainShouts" value="~/content/aakashjainshouts.xml"/>
</appSettings>

The above piece of code add a key "AakashJainShouts" to specify the location of XML file in which all entries of shoutbox will be saved. I have chosen content directory to save the xml file in the code above. You can specify any directory on the webserver but make sure it should have write permission.

Now add the following line in your homeTemplate.blogtemplate file at a suitable place where you want shout-box to appear. (You can find this file in the current theme folder of your blog.)

<%AjShoutBox(max char,refresh interval,max entries)|AJmacros%>

Here is the description of each parameter,

max char (int) – Maximum number of characters allowed to enter in the message textbox of shoutbox. For name this is fixed to 30 characters.

refresh interval (int) – Enter the number of seconds when the shoutbox will update from new server. If you want to disable this feature enter anything less than 5.

max entries (int) – Maximum number of entries shown at a time in shout-box.

For instance - <%AjShoutBox(150,50,30)|AJmacros%>
(In this example shoutbox will be refreshed in 50 seconds, upto last 30 entries will be shown and only upto 150 characters can be entered in the message.)

Now lets move to style part of shoutbox. After the above settings you would like to apply some styles and colors to shoutbox to match with your blog theme. For this matter I have kept all style related code in a separate style-sheet (ajshoutbox.css). You can find this stylesheet in the download package. To attach this stylesheet to your blog enter the following lines with in the <head> section of your homeTemplate.blogtemplate file.

<link media="all" rel="stylesheet" type="text/css" href="images/shoutbox.css"></link>

(You can keep the stylesheet file in any directory on your web server but I'd recommend the image directory of dasBlog. Attribute "href" specified the path of CSS file.)

Ok, now this shoutBox is ready to run on your blog. If you have any comments or suggestions please feel free to post them here.

 

Posted on Sunday, December 23, 2007
comment Comments [0]

Leave your comment

Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Live Comment Preview

Navigation


Calendar Archives

<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Post Timeline
Calendar with Post


Tags Cloud of Tags

.Net (11) dasBlog (9) Geek Stuff (6) Google (3) Microsoft (10) Misc (11) Musings (21) News (15) Office Open XML (2) Personal (30) Technical (8) Tweaking (4) Windows (2)

External Favorites Blogroll

Last.Fm Recent Tracks

  1. Jack Johnson - Good People
  2. Michael Jackson - You Rock my World feat. Chris Tucker
  3. Salt-N-Pepa - Lets Talk About Sex
  4. Code Red - This Is Our Song
  5. Prince - Kiss
  6. John Mayer - Your Body Is a Wonderland
  7. Fanaa - mere haath mein

Aakash's Last.Fm Profile Powered by Audioscrobbler

Last.Fm Shoutbox

  1. AAKASH: hey vishal,, I am good thanks.. You you have been these days.. where r u now?
  2. VISHAL: Hi aakash, vishal here..how are u?
  3. ALI @: audio don't work on window xp sp3...and wifi dont work due to drivers
  4. ARJUN: hi
  5. SUREN @: thank u very much......
  6. ARVIND SHARMA @: HAPPY DIWALI
  7. ARVIND SHARMA @: HAPP DIWALI
  8. TES: test
  9. QUEEN: Radio Ga Ga Ga!
  10. VISHU: Great. Keep it up.
  11. HE HE: please update it
  12. SINTU: hi
  13. GOOD: good
  14. GOOG: goof
  15. JAYANT @: hii,when i connect internet in my compaq presario c700 my orkut site and youtube.com are hacked a msg is open with laughing sound and say u are hacked. pls... give me an solution for remove it.
  16. LLLAAAQ: i am using the A933tu presario lap. my problem is when i am connecting internet through my lap the data receiving is so slow.but when i connecting internet thru my pc its on its best speed.what is my problem?is there any solution? reply pls...
  17. SHAFI @: i want to install xp on comapq prsario a933tu . please tell me where i can find the audio drivers for the same
  18. VICKY: help me plz?
  19. VICKY: I have installed XP in Compaq Presario 707TU Laptop. I have configured audio as below. Install Microsoft UAA sp31994, then install High-definition audio driver sp33443. But I get the error message "Driver Installation Failed: Could not find the MEDIA device for this driver."
  20. VICKY: help me?
  21. VICKY: I have installed XP in Compaq Presario 707TU Laptop. I have configured audio as below. Install Microsoft UAA sp31994, then install High-definition audio driver sp33443. But I get the error message "Driver Installation Failed: Could not find the MEDIA device for this driver."
  22. TEST: Hi! Testing
  23. PIYUSH: how did you develop this?
  24. PSC_25: gr8....solved my problems in jiffy....thanx
  25. CHUCK NORRIS: This is a great plugin!
  26. PETER: Who are you?
  27. AAKASH: hi
  28. HARSH: very helpful...link 4 video driver hs expired..cud u pls giv a new link
  29. SURAJIT: You are realy intelegent person.
  30. DINESH @: thank you for your support

View Aakash Jain's profile on LinkedIn
Follow me
My Bookmarks


Powered by

newtelligence dasBlog 2.0.7226.0



Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Sign In