DNN (Dotnetnuke) module development in 10 easy steps

· 0 comments

When I was about to launch my web application, I found myself in front of a daunting task of creating support pages for the website. It is difficult for solo acts like me to think about content for Privacy policy, Terms of Use, Copyright as well as support facilities like forums, feedback, faq and even plain and simple help pages. I’m no web designer too. Dotnetnuke has allowed me to do all these and in less than a day I was able to get it up and running with most of the support pages in place. Having have to worry only about content, in a few more days, the rest of the pages are there too.

Now, what about my pre-existing web pages? I need to convert them to Dotnetnuke modules. Looking around there were very limited resources on the internet on how to go about this. Even forums don’t contain that much information. I’ve downloaded documents for Dotnetnuke Module Development but they were more geared toward re-distributing these modules. Thus too complicated and time consuming for my needs. I might as well create the support pages myself in plain html or .aspx. I just need a quick and simple way to convert my web forms to Dotnetnuke modules.

After a substantial time of tinkering, I was finally able to do it and narrow down DNN Module Development to 10 easy steps. I’m putting it here so that those of you on the same predicament might have use for it and spare yourself the wasted hours trying to figure it out.

To begin,

1. Locate the DesktopModules Folder under you DNN website.
2. Create a under folder it and name it HelloWorld.



3. Right-click the said folder and click Add New Item
4. Select Web User Control and Name it HelloWorldModule.ascx



5. Replace class declaration to inherit from DotNetNuke.Entities.Modules.PortalModuleBase instead of System.Web.UI.UserControl
6. Import the namespaces DotNetNuke and DotNetNuke.Entities.Modules
7. Now let’s do something simple, drag and drop a Label control in the design view of your User Control.
8. On your code behind, create a page load event and add Label1.text = “Hello World!”

You user control’s html should now look like this.


<%@ Control Language="VB" AutoEventWireup="false" CodeFile="HelloWorldModule.ascx.vb" Inherits="DesktopModules_DNNSchool_HelloWorldModule" %>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>


And your code-behind class like this


Imports DotNetNuke
Imports DotNetNuke.Entities.Modules
Partial Class DesktopModules_DNNSchool_HelloWorldModule
Inherits DotNetNuke.Entities.Modules.PortalModuleBase

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label1.Text = "Hello World!"
End Sub
End Class


9. Login to your DNN website and go to Host > Module Definitions. Locate “Import Module Definition” link and click
10. From Control dropdown, locate DesktopModules/HelloWorld/HelloWorldModule.ascx and click Import Control



Your first Dotnetnuke Module is now available in the Module dropdown in the Control Panel. Congratulations!



Go ahead and to a page. You’ll see your new Dotnetnuke module declaring it’s existence to the world.




Just repeat steps 2-7 if you want to create more Modules. Probably step 1 too if your want a “cooler” folder name. Then just code as you would any other Web User Control or a Web form for that matter in Visual Studio.

Find IP Address Location By Country in ASP.Net

· 0 comments

Being able to tell on-the-fly which country your visitors come from is a big boon. The applications are numerous. You can use it to extend your security by limiting to certain countries only. Or perhaps you want present a different page or ad per country. Or you just want to automatically select the country in the dropdown of your forms.

Fortunately, thanks to MaxMind, this is all free and easy. Here are 5 simple steps:


1. Download API files and extract
2. Copy CountryLookup.vb to you App_Code folder or Class Library
3. Download Database and extract
4. Copy GeoIP.dat and place it on your website.
5. Start using it.

Dim _UserIPAddress As String = Me.Page.Request.UserHostAddress
Dim _IPDataPath As String = Me.Page.Server.MapPath("data/GeoIP.dat") 'relative path to the Geo IP Database.
Dim _CountryLookup As CountryLookup = New CountryLookup(_IPDataPath)
Dim _CountryName As String = _CountryLookup.LookupCountryName(_UserIPAddress)
Response.Write(_CountryName)


C# API is also available here as well as other programming languages. APIs also come with country flag images which you can use to create cool user interfaces.


Free counter and web analytics in real-time

· 0 comments

Google analytics is awesome. However, a 24-hour wait time is just too long for someone who has just started a website. Its reports are also very broad and probably more appropriate for big websites with thousands of hits a day. I needed to do my tracking in real time so that I could get information about my visitors immediately. Where they are coming from, what pages they are viewing and what’s stopping the website from getting conversions. That way I could make corrections in an instant.

So I did a quick search on Google for “real time website tracking”. On the first page, I only found one that’s free and immediately available. And that is StatCounter. Others were either on free trial or available only through paid subscription or on beta or by invitation only. * I realized while writing this blog entry that I should have typed “free real time website tracking” instead but then...I already found what I want.

I’ve been using it the past couple of days and I find really helpful. My website is a free web based personal finance software. So conversion for me means registrations and signups. Knowing what pages my visitors are viewing tells me what their specific needs and requirements are. The pages they exit from gives me a clue what I needed to add or remove. In summary here’s how I find StatCounter:

The good:

1. Immediately available, free and not a trial offering.
2. Tracks visitors in real time
3. Detailed information of each individual visits – where they come from, who referred them, what they are viewing, which pages they exited.
4. Has blocking cookies to ignore your own visits.

The bad:

1. Up to 500 detailed logs per website only.
Old logs get overwritten when this is used up. If you want more you need to pay. However, who wants to keep track of each of those 500 recent visits? As for me, I only need the last few.

2. Reports are not as good and numerous as Google Analytics.

My recommendations:

Use both Statcounter and Google Analytics. I would liken it to a war (pardon the comparison). Soldiers on the field need immediate feedback and information of the ongoing battle. While generals on HQ need to know how the war is progressing. These two, for those who are looking for a free service, is an amazing combination.


Search Optimization - Using the right keywords

· 0 comments

Maybe you're too cheap or simply can’t afford an SEO product to help you optimize your site for the right keywords. But if you want to drive traffic to your website, search engine optimization is a must. Using the right keywords is very important. Fortunately, there’s Google to help you with that. And it’s free too.

Simply go to Google’s keyword tool facility for AdWords.




For the keywords, just type in the first few words that comes to you mind about your website or blog. It could be your website’s theme, popular subjects or description. Once you hit the “Get keyword ideas” button, you’ll be presented with a list of related words and the volume of searches per month.





Simply pick from the list and use those words as often as you can on your website’s content, title, keywords (META) and description (META). You must remember though that the more popular the keywords or phrases are, the more websites will compete for them. So choose wisely.


OpenDNS - Filtering your child's web surfing for Free

· 0 comments

My daughter is old enough to know how to use the computer. She would usually just use it for playing web-based games. Initially, we would just place a shortcut on the desktop and she would just click it. If she gets bored with them, she would ask us to look for more games and we would paste the shortcut on the desktop again. It was ok for a while but kids being kids it was later proving to be a bother. So we taught her how to use Google. Now she just searches for the games she wants. Awesome! Convenient.

However, this brings the danger of her accidentally surfing sites which have adult content. Thus began my quest for parental controls and internet filtering solutions. There were a couple of them that I tried but I was looking for something that was free. Something that I myself couldn’t hack if I didn’t know the password.

I finally settled with OpenDNS.

Not only that I have an internet filter, I also have a reliable and fast DNS which is great because both my ISP’s DNS’ often crank up. You don’t even have to use their filters to avail of the DNS service. Having a reliable and secure DNS is good enough.

Now let’s continue with internet filtering….

In summary, the steps that you need to take are

1) Configure your network
2) Register for an OpenDNS account
3) Configure your account to set filters.
4) Tell OpenDNS your IP Address.

In Step 1, OpenDNS pretty much has that covered. I could never write it better myself or give better instructions. There are 3 ways you can configure your network to use OpenDNS – 1. Your computer, 2. Your router and, 3. Your DNS Server (for techies only). I would recommend #2 – configuring your router. OpenDNS has instructions for setting up commonly used or popular routers. If your router is not there, post a comment below and I’ll try to help you figure it out.

Step 2 is a no-brainer. Register for an account here. After registering for an account, you will be sent a confirmation email. Make sure you open your mail first and confirm the account. After that, you will be automatically logged in. If not, go ahead and login with the username and password you used in registration.

Step 3 tells OpenDNS what to filter for when a request for an internet address is made. First you need to create a ‘Network’. On the top menu, hit the networks tab or go to this address.

You will notice that your IP address is already placed on the form. If it’s not your IP Address or you don’t know you IP address, don’t worry about. Step 4 will take care of that.





Go ahead and click “Add This Network”.

A popup will then appear like the one below.



Type in a name and click ‘Done’. You may now begin setting up filters for your network.

Note: If you entering an IP address that is not on the current network you are using, you will be issued an email again to confirm your network. Make sure you open this email on a computer on the network you are adding and click the link in the confirmation email.

To setup the filters, hit the Settings Tab on the top menu or go to this address.

You will automatically be presented with a quick configuration. For most parents, ‘Moderate’ should probably enough. At least for young parents, you can still have a little but clean fun. The ‘High’ setting is probably more appropriate for office or company networks where you don’t want employees to waste time and bandwidth on social networking sites and others. If you want more control, you can go to ‘Custom’ and tick on the checkboxes.

Step 4 tells OpenDNS that it’s you making the request or that the request is coming from your network. If you have a static IP Address, you can ignore this step altogether. But if you’re like most home users, chances are you have a Dynamic IP address. For this one, you need an Updater.

When I was setting up mine about a year ago, they don’t have an Updater of their own. You have to use third-party updaters and from my experience, it was either too technical or they simply don’t work. I had to summon my programming skills and created my own updater. Recently, they’ve gotten their act together and came up with their own updater -- too bad for me, I would have loved to showcase my own updater :-).

You can download it here.

Once downloaded, launch the file and proceed with the setup. No special steps to perform here. Just click Next until you ‘Finish’. After the installation, you will be presented with a setup wizard. Likewise a no-brainer. Just put in your username and password on the first tab (Updater), hit ‘Refresh’ and you’re good to go!

Wait 3-5 minutes and try going to porn sites. Your browser should now be blocked.



IAM Flash Shield - Active Protection Against Removable Drive Viruses

· 0 comments

Recently, I released a cleanup program for viruses that spread itself through USB Flash Drives. At the moment, it only has 2 signatures – the 2 variants of the Aikelyu virus. I would add more when I get my hands on more specimens.

I am a bit surprised how widespread these infections are. I would attribute that to the increasing popularity USB Flash Drives and how easily new variants and imitations can be created. Anti-virus companies will definitely have a hard time catching up. As a matter of fact, some popular anti-viruses still can’t detect some of them. Or maybe, they just choose to ignore them. These viruses after all are more of an annoyance rather than a threat to data integrity.

I am a firm believer of the saying “Prevention is better than cure.” Rather than having the most comprehensive cleaner for every single flash drive virus out there, it’s better not get yourself infected at all. The preventive steps to manually detect and delete these viruses are simple. However, over time they can be drag.

And so, I spent the weekend building a simple utility to detect viruses lurking in your usb flash drive. It’s usually just there waiting to be activated when you use autoplay or by double clicking the drive’s shortcut in My Computer. It is an indiscriminate scan. Whenever autorun.inf points to a script or executable, it will prompt you if you recognize the script or the program. If you don’t recognize it, clicking yes would delete it. If it doesn’t find any it will prompt you that it didn’t so you can safely start using your removable drive.

There’s only a few hours of work built into this utility so don’t expect amazing stuff. But it does the job. Scans are done on program startup and every time you insert a removable drive in the computer. During first run, it will also lodge itself on the startup programs list so that it gets activated every time you log in to our computer.

In the future, I will add more functionality by integrating IAM Flash Clean. Maybe an auto updater. Or maybe you can make suggestions in the comments below. Hopefully, I have enough free time to do all that.

I called it IAM Flash Shield. You may download this active resident protection against removable usb flash drive viruses here.



IAM Flash Shield

· 0 comments

Note: This software is offered to you FREE, "AS IS" and without any warranties. Use at your own risk.

IAM Flash Shield 1.01

Features:

- Scans Removable / USB Flash Drives for hidden programs / scripts in autorun.inf
- Prompts for user action when a possible virus is found.
- Automatically detects newly inserted removable / usb flash drives.
- Automatically scans removable /usb flash drives when this program starts.
- Prompts user if removable / usb flash drive is safe to use.
- Starts automatically on Windows logon (This software adds itself to Startup Programs).

Requirements:

This software is written using the .Net Framework 2.0. Download and install before using this software.


Instructions:

1. Download the software by click the link above.
(Don't use a download manager. Files are small anyway.)
2. Unzip to any folder.
3. Double click IAMFlashShield.exe. An icon will appear on your task bar to show that it is running.



Flash Drive Viruses (Aikelyu / deadly-c.vbs / pooh.vbs)

· 0 comments

Flash drive based viruses have been on the rise recently. Most are harmless but no less annoying. I do get exposed to a lot personal computers as my job requires me to do onsite maintenance of my programs. I get exposed to them a lot and even got infected once.

Sadly, most of these seem to have been written by fellow Filipinos (or at least some variants) and most occurrences seem to be localized here in the Philippines. This probably explains why these escape the eyes of some large anti-virus companies.

The most recent one I’ve encountered is Deadly-c.vbs. It seems like a variant of the Aikelyu virus. Looking around the internet, it also occurs as pooh.vbs. It propagates itself in all writable drives except the floppy disk and during windows startup it calls Internet explorer and shows an html file containing the irritable words “f%%k you-->this is jayker felling----->PogitosGwaposAmigosGarantisadosGalantis Kaayos!!”.

This time I finally decided to deal with it. I’m a VB programmer myself and this one being written in vbscript I can read and look at what it does. So it’s fairly easy to come up with a cleanup program. I named it IAMFlashClean and I’m hoping make it clean other viruses of the same kind as I encounter them.

You can download the IAMFlashClean Aikelyu virus cleaner here should anyone would want to use it.



IAM Flash Clean

· 0 comments

Note: This software is offered FREE, "AS IS" and without any warranties. Use at your own risk.

IAMFlashClean 1.00

Virus Signatures:
- Aikelyu (Deadly-c.vbs)
- Aikelyu (pooh.vbs)

Requirements:

This software is written using the .Net Framework 2.0. Download and install before using this software.


Instructions:
1. Download the software by click the link above.
(Don't use a download manager. Files are small anyway.)
2. Unzip to any folder.
3. Double click IAMFlashClean.exe to begin cleaning.
4. A reboot may be required after cleaning.


If you want active protection against flash drive viruses, trojans and worms consider using IAM Flash Shield.