ASP: Digg Style Pagination Script

This is ASP based pagination script, similiar to Digg.com pagination. The credit goes to Jason Coleman who written this script in PHP and I simply converted this into ASP. I have attached screenshot this will help you to see how it looks like.

Demo Digg Style Pagination Script

Download Script

Usage

Many people were asking how to add this code into our own projects. I have included the code, I hope this will help you in integrating this script.

<!–#include file=”pagination.asp” –>
<%
dim objcon, objrs, totalpages, page, numPerPage, countItem
set objcon=Server.CreateObject(“ADODB.Connection”)
set objrs=Server.CreateObject(“ADODB.RecordSet”)
countItem = 0
numPerPage = 5
objrs.cursorlocation = 3
if request(“page”) = “” then
page=1
else
page=cLng(request(“page”))
end if
objcon.open connectionString
objrs.open “SELECT * FROM Customers”, objcon,1,2
if objrs.EOF then
Response.Write(“<h2>Sorry! No Search Result Found</h2>”)
else
objRs.pageSize = numPerPage
totalpages = objRs.PageCount
objRs.absolutePage=page
while not objrs.EOF AND countItem < objRs.pageSize
Response.Write(“YOUR CODE GOES HERE”)
countItem = countItem + 1
objrs.movenext()
wend
ps = getPaginationString(page, objrs.RecordCount, numPerPage, 2, “demo.asp?yourcustomparams=PARAM&name=NAME&Search=Search”)
Response.Write(ps)
end if
‘always cleanup things
objrs.close()
objcon.close()
set objrs=nothing
set objcon=nothing
%>

Firefox 2.0 uninstalled

I uninstalled Mozilla Firefox 2.0 and switch back to Firefox 1.5 because the version 2.0 of the browser often stopped responding requiring me to force quit it.

I tried to clean install the browser by removing it with Appzapper, because I thought the problem could be caused by incompatible extensions. However, Firefox 2.0 kept on freezing even after the reinstallation.

So, I’m back to using Firefox 1.5 now

Reasons why I do not need Firefox 2.0:

  1. New theme and user interface

    Firefox 2.0 new default theme do look nicer but I prefer a browser that does not crash. The changes between the default theme of version 1 and 2 is not that much and I can always download and install a theme from Firefox add-ons.

  2. Phising protection

    I’m pretty good when it comes to identifying phising emails. I also have Google Toolbar for Firefox installed with Safe browsing option enabled. The built-in phising protection included in Firefox 2.0 is using Google anti-phising service.

    I also use OpenDNS as my DNS resolution service. OpenDNS offer phising protection that works with all browsers and operating systems.

  3. Resuming browser session

    I can use SessionSaver extension or Google Browser sync to restore my browsing sessions.

  4. Better tabs

    I find it annoying that Firefox open new window links as new tabs. If I want to open a link as new tab, I would right click and choose the option. Btw, I also find new window links annoying, find out why.

    I rarely use the tab close button because I use a faster way by pressing the close window keyboard shortcut. You can also install an extension called Tab X to add close button to each browser tab.

Things I’m missing out from Firefox 2.0

  1. Inline spellchecking — useful when I’m sending emails or posting blog entries/comments
  2. Client-side session and persistent storage
  3. JavaScript 1.7
  4. SVG-Text support

First IE7 security vulnerability

Secunia, the Danish computer security company, discovered the first vulnerability in Internet Explorer 7. The flaw can be exploited by malicious people to disclose potentially sensitive information.

The vulnerability is caused due to an error in the handling of redirections for URLs with the “mhtml:” URI handler. This can be exploited to access documents served from another web site.

Internet Explorer 7.0 with a fully patched Windows XP SP2 systems are vulnerable and the advisory is currently unpatched. You shouldn’t worry too much though since Secunia rated the advisory as less critical. It is less critical because the attacker have to lure you to visit the malicious site.

For those who wants to be extra careful, you can disable active scripting support to avoid any problem.

Google bought YouTube

Google has just bought YouTube for $1.65 billion in stock. YouTube is a video sharing web site which allows users to upload and share videos. The company was founded in February 2005 by Chad Hurley, Steve Chen, and Jawed Karim.

Following the acquisition, YouTube will operate independently. I wonder what will happen to Google Video? Are incoming traffic to video.google.com will get forwarded to youtube?