Completed my next dasBlog macro (LastFm Recent Tracks) and just uploaded a new page dedicated to dasBlog macro. Here are the list of dasblog macros that I have developed so far -
List of Last.Fm Recent Tracks
This macro will show a list of recent tracks that was listened by you and scrobbled by Last.fm. This macro is for only who have signed up at last.fm.
List of Last.Fm Top Artist
This macro will show the list of Top Artist that you listened to this week. Again, this macro is for only who have signed up at last.fm.
Show a Shoutbox
This macro will add a shoutbox to dasBlog. Features included-
XML Database – (All entries are stored in XML File. It can be kept under the content directory of blog)
Ajax Enabled – No Iframe or refreshing of whole page. Update shoutbox silently and regularly after specified interval.
Customizable CSS – I tried to make it very customizable. It can gel with any theme perfectly.
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.
b) Add or uncomment the following lines under the <configuration>.
c) Add the following line under the <httpHandlers> section of web.config.
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>
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.)
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.
(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.
Ado.Net provides much more than just retrieving and submitting data. We can create in memories representation of tables. This is not limited we can define the Parent and Child relation between those tables. My New article will show how to use Data Relation between two Data Tables to show the records on the basis of Master Child relationship.
Recent Comments