New Comment System

by filip 17. February 2012 12:13

The blog now uses a new comment system - Disqus.

I upgraded to BE v2.5, and found various instructions on how to move to Disqus... including these.

There was one problem, however. The instructions state that on post.aspx, JavaScript needs to change to the following:

<script type="text/javascript">
    var disqus_title = '<%=Post.Title %>';
    var disqus_identifier = '<%= Post.Id.ToString() %>';
    var disqus_url = '<%= Post.AbsoluteLink %>';
    var disqus_developer = '<%= BlogEngine.Core.BlogSettings.Instance.DisqusDevMode ? 1 : 0 %>';
    (function () {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://<%=BlogEngine.Core.BlogSettings.Instance.DisqusWebsiteName %>';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);

However, that is not accurate and will result in errors.  The correct code needs to reference Page, and not Post.

<script type="text/javascript">
    var disqus_title = '<%=Page.Title %>';
    var disqus_identifier = '<%= Page.Id.ToString() %>';
    var disqus_url = '<%= Page.AbsoluteLink %>';
    var disqus_developer = '<%= BlogEngine.Core.BlogSettings.Instance.DisqusDevMode ? 1 : 0 %>';
    (function () {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://<%=BlogEngine.Core.BlogSettings.Instance.DisqusWebsiteName %>';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);

If the above is not changed, the blog will throw the following error:

page.aspx(14): error CS0120: An object reference is required for the non-static field, method, or property 'BlogEngine.Core.Post.Title.get'

One more change needs to be done if the above takes place. In archive.aspx.cs, the following line:

comments.InnerHtml = string.Format("<span><a href=\"{0}#disqus_thread\">{1}</a></span>", post.PermaLink, Resources.labels.comments);

needs to change to:

comments.InnerHtml = string.Format("<span><a href=\"{0}#disqus_thread\">{1}</a></span>", post.AbsoluteLink, Resources.labels.comments);

The change above will allow the Archive to correctly display the number of comments and reactions to each post.

Tags: , , ,

Web Development

Change combobox background color in AS3

by filip 8. November 2011 11:30

I needed to change the background color of the text region of a flash combobox - using AS3 at runtime.

Styles for some reason were not working.  The solution was to directly address the textfield property and change its background color.  Here's an example:

cbo.textField.textField.background = true;
cbo.textField.textField.backgroundColor = 0xDEDE29;

Tags: ,

Web Development

Using QR codes as signatures and avatars

by filip 4. November 2011 14:44

Just created my new sig using Google's QR code API ( ).  It creates the codes with error correction (there are some settings that you can use to modify this), so its possible to actually delete a part of it and enter your own image/text in the middle of the QR code.

I had to play around a little with my name in the middle.  If it is not aligned properly on the QR code or if it covers the wrong area, the code won't be recognized. QR Code QR Code
75x75   100x100



Network Issue - Could not connect to WHS via name, only IP

by filip 15. October 2011 00:39

Just ran into a strange issue after upgrading my home network. I got a switch that all devices in my home network are connected to (dumb switch - it al hooks up to a Cisco E2000 for ips).  Anyways... after switching everything over to this new setup, I ran into two issues.

First, my gigabit network was no longer gigabit, even though all lights on the switch indicated that it was gigabit.  Network properties in connected computers also indicated gigabit speeds,  but actual file transfers were at fast ethernet speeds.

Second, I could no longer connect to my WHS via windows explorer from my Win 7 Pro machine, when typing in the computer name (eg: \\server).  It was like the computer didn't exist on the network.  However, the server would respond to pings.  I could do a nslookup, and everything worked correctly.  Also, I could type in my server ip in windows explorer, and it worked (eg: \\

I then ran into this forum:

The suggestion is to run the following command in the command prompt: netsh int ip reset c:\resetlog.txt

Running the command on my Win 7 Pro box fixed the issue (after a restart). I could now transfer at gigabit speeds, and the name resolved properly in windows explorer.

I guess something was wrong with my TCP/IP stack, and this fixed the issue.  I still have no clue how it got messed up in the first place, and exactly what was wrong.


Create Custom Ringtones in Windows Phone 7

by filip 29. September 2011 11:14

The first thing you'll need to create a custom ringtone in WP7 is an MP3 file.  This file must be 40 seconds or shorter (and 1MB or smaller in size).  If your MP3 is too large, you can use a program like Audacity to crop it.

After you have your MP3 file the correct size, you'll need to open Zune and make sure that the MP3 is listed in your music collection. Find it in the collection, right click on the MP3, and click on "Edit".  This should bring up a window with the MP3 properties.  The only real important thing here is that the genre of the song must be changed to Ringtone.  See the image below. 


After updating the genre to Ringtone, click the OK button, and then sync the MP3 to your phone.

Finally, on the phone, go to Settings -> ringtones+sounds, and click on the Ringtone selector.  The ringtone you created should now be at the top of this list in the "Custom" section.

Tags: , , ,


Bloodforge Band

Looking for the Bloodforge band site? Click here.

About Filip Stanek

Death Note Pic I'm a developer at ACG in Cincinnati, OH. I like ASP.NET, Flash, and other web technologies, & enjoy playing chess, video games, etc.

Currently playing:


Month List