May 07

As you may have read before, I've been having a real hard time with spambots picking up and exploiting this site's open comment system. It was getting ridiculous to the tune of over 900 spam comments per week.

 

I finally had enough and decided to put in my "Ghetto Captcha" on the site. 

It was actually very easy to implement, and I'm going to post the code here in hopes of helping other BlogEngine.NET users combat spammers.

Basically what you need to do is change the CommentView.ascx (control) design-view code to bypass the default post validation and insert an intermediate javascript validation.

 

Step 1: Add the new text field:

<input type="checkbox" id="cbNotify" style="width: auto" tabindex="7" />
<label for="cbNotify" style="width:auto;float:none;display:inline"><%=Resources.labels.notifyOnNewComments %></label><br /><br />
What is the name of this blog? <input type="text" id="captchaTest" />  <=== ADD THIS
<input type="button" id="btnSaveAjax" value="<%=Resources.labels.saveComment %>" onclick="return preTest()" tabindex="7" />    <== change onclick
<asp:HiddenField runat="server" ID="hfCaptcha" />

 

 

Step 2: Add the new preTest() javascript

function preTest()
{
    if(document.getElementById("captchaTest").value == "futurepr0n")
    {
        return BlogEngine.validateAndSubmitCommentForm();
    }
    return false;
}

Step 3: There is no step 3

 

SO that's it! Spammers be gone, and very little code change.

 

I realize it's hard to follow code like this out of context, so I've attached the source code for the CommentView.ascx that we're using on this site. Hopefully you can use it to your advantage!

 

CommentView.ascx (6.85 kb)

Tags: | |
Apr 27

 

OK.. by now I'm sure you'll have read the news surronding Gizmodo editor Jason Chen and his property seized by California's Rapid Enforcement Allied Computer Team. All I can say about it is that's pretty rediculous if you ask me. I don't understand why, with all the attention surronding the leak of the recent iphone v4, that they would want to associate themselves with something like this. Only thing I can understand about it is regarding the sales of current iphones (which by the way seem to have no problems selling as reported in Apple's most recent earnings statement), however it seems a tad - how do you say - dick-headish? Maybe thats just me.. but for all the positive things going for Apple's finances and all the negative things coming from troubled developers from working within their closed systems or having applications approved - it seems like maybe not the smartest time to bring any more news that makes you guys seem like the most evil fucking corporation that you seem to be.

Tags: |
Feb 24

I've decided to release an interim version of TGH to help those in desperate need to switch phone audio modes in addition to media audio modes. For those who haven't kept up, the previous version was only able to toggle the media audio output.

You can only toggle between headset (non-bluetooth) and front speaker at the moment. Also, note that after one phone call, the audio mode will RESET to whatever mode it was at before. I'm still trying to work out why this is happening and to see if there's anything non-intrusive that I can do to prevent this.

com.palm.futurepr0n.theghastlyheadset_0.0.2_all.ipk (32.87 kb)

Tags:
Feb 18

If you're one of the many (including me) who struggle daily with having their phones get stuck in headset mode, this may be your lucky day. After a final frustrating encounter with this problem, which required me to once again clean out the headset with alcohol, I decided to do something about it. Long story short, I created an app.

 

The Ghastly Headset (derived from the fact the Pre thinks there's a headset that isn't there... a ghost headset) is fairly limited and approximately 3 hours in its infancy. It has three main functions:

 

  1. Show the current audio mode (either speaker, headset or headset w/ mic)
  2. Force headset mode
  3. Force speaker mode
I've tested the application and the forcing of the audio seems to persist across applications (thank god), however I'm unable to fully test with a stuck Pre because I just fixed mine! So that's where I need you, loyal beta testers. I need people with stuck Pre handsets to see if forcing speaker mode will actually work. Toggling the headset (if it's not stuck) will reset the audio mode to whichever you want it to be.



 

Please download and let me know any feedback you have either here or on the PreCentral official forum post!


 

com.palm.futurepr0n.theghastlyheadset_0.0.1_all.ipk (32.38 kb)

Tags: | | |
Feb 05

As part of one of my latest projects, I had to venture into the land of jQuery. It wasn't long before I realized how powerful the platform was, and even shorter before I started browsing for plugins that I could leverage to add that extra layer of polish to my project.

This is when I found Galleria, a powerful gallery plugin, with the extra-sexy feature of creating thumbnails for you. "Great," I thought, "this will fit perfectly into my website!" Wrong.

"Exception thrown and not caught, Line: 2799" - AGHHHHH!

Due to my ignorance about jQuery, I struggled trying to get it to work. I'm not a newcomer to javascript, even with complex javascript thanks to webOS, but this plugin was just NOT working. It took me a good hour or two before I realized there was probably some incompatibility between jQuery versions, and shortly after I discovered the plugin only worked with up to 1.2.6. This was a problem for me, because a lot of my plugins required 1.3.X, and the newest version was 1.4.1. Googling the interwebs, I also found that other people suffered from the same problem as me but no working solution was ever created.

Fear no more! I have fixed Galleria to work with jQuery 1.4.1. I used the underrated javascript debugger built in Visual Studio 2005 to locate the incompatibilities and resolve them. Those were:

  • @rel need to be changed to rel (no @)
  • The thumbnail preview was attempting to parse an image that didn't exist, so now a check is made to ensure a URL is present
  • There was an extra quotation mark on the same line

All in all, very simple changes. I think this goes without saying, but I'll say it anyway: I take no responsibility for any problems you may have with the jQuery I have attached. Any charity you wish to show for the plugin should be directed at the official developers for their hard work. I want none of it!

If you are lazy like me, and I suspect you are, you probably just skipped to the end of this article to find the download link. Well here you go:

FIXED jquery.galleria.zip (4.46 kb)