ASPX HitCounter

12 10 2009

Had to rewrite my Hit Counter for ASPX.

dim authuser
dim pager
dim myconn
dim connstring
dim selecter
dim listy
dim bongo
dim inserter
dim listy1
dim sel
dim listy2
dim numb
dim writer
dim listy3
dim s1
dim s2
dim s3
dim s4
dim s5
dim s6
dim area51
dim area52
dim r1
dim r2

authuser = ChkEmailuserToCheck
pager = "home"

MyConn=Server.CreateObject("ADODB.Connection")
connstring="Provider=SQLOLEDB.1;Password=hedgehog;Persist Security Info=False;User ID=websrv;Initial Catalog=websrv;Data Source=yardibck"
MyConn.Open(connstring)

selecter = "select Count(authname) as countr from Names where authname ='" & authuser & "';"
listy = MyConn.Execute(selecter)
bongo = listy("countr").value

if bongo = 0 then

inserter = "Insert into Names (authname, logins, pager, dater) values ('" & authuser & "', '1', 'default', '" & now() & "');"
listy1 = MyConn.Execute(inserter)

else

sel = "select logins as logger from Names where authname = '" & authuser & "';"
listy2 = MyConn.Execute(sel)

numb = listy2("logger").value

numb = numb + 1

writer = "update names set logins = '" & numb & "', dater = '" & now() & "' where authname = '" & authuser & "';"
listy3 = MyConn.Execute(writer)

end if

s1 = "select count(dater) as dtr from names1 where datediff(d, dater, getdate()) = '0'"
s2 = MyConn.Execute(s1)
if s2("dtr").value = 0 then
s3 = "insert into names1 (dater, counter) values ('" & now() & "','1')"
s4 = MyConn.Execute(s3)
else

r1 = "select counter from names1 where datediff(d, dater, getdate()) = '0'"
r2 = MyConn.execute(r1)

area51 = r2("counter").value
area52 = area51 + 1
s5 = "update names1 set counter = '"& area52 & "';"
s6 = MyConn.execute(s5)

end if





ajax nested dropdown boxes

6 10 2009

// <![CDATA[
//globals
var first = "topic"; //id of first SELECT
var second = "callconsultant"; //id of second SELECT
var third = "fullname";
//
function sendRequest(url,params,HttpMethod) {
if(!HttpMethod) { //check if http method is defined, if not, set it to GET
HttpMethod="GET";
}
//
// initialize request object
req=null;
if(window.XMLHttpRequest){
req=new XMLHttpRequest; //mozilla/safari
} else if(window.ActiveXObject){
req=new ActiveXObject("Microsoft.XMLHTTP"); //internet explorer
}
//
//define callback handler
if(req) {
//
req.onreadystatechange=onReadyState;
req.open(HttpMethod,url,true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(params);
}
}
//
function onReadyState() {
//
var ready=req.readyState;
var data=null;
if(ready==4){ //check ready state
data=req.responseText; //read response data
var spliff = data.split(';')

var items = data.split(',');
var length = items.length;
for(var i = 1; i "Select topic first"
sendRequest('fetch.asp?topic='+el.options[selected].value);
ob2.disabled=0;
} else { //otherwise add the Select Topic First option and disable it
var childEl = document.createElement('option');
ob2.appendChild(childEl);
childEl.innerHTML = 'Select Date First';
ob2.disabled=1;
}
}

function clicked2() {
//
var el=document.getElementById(first);
var el1=document.getElementById(second);
var ob2=document.getElementById(third);
var selected1 = el.selectedIndex;
var selected2 = el1.selectedIndex;

//
while(ob2.hasChildNodes()) { //removes items from dropdown if some already exist
ob2.removeChild(ob2.firstChild);
}
if(selected2!= 0) { //if they choose something other than the first select-->"Select topic first"
var bob = 'fetch2.asp?topic='+el.options[selected1].value+'&fullname='+el1.options[selected2].value
sendRequest(bob);
ob2.disabled=0;
} else { //otherwise add the Select Topic First option and disable it
var childEl = document.createElement('option');
ob2.appendChild(childEl);
childEl.innerHTML = 'Select Date First';
ob2.disabled=1;
}
}





Boules in Logan

23 10 2008

I’ve just created a new website about building a Petanque Piste in Logan UT

http://mosaiclogan.blogspot.com/





4 08 2007

kifkif.jpg

Been working on the kif kif website a bit more.  Added a nice FavIcon to the site and finally fixed my google video bar problem.  The google .js files didn’t like that I had saved my html file as Unicode instead of UTF-8 in firefox.  Once I changed that it all worked again.  Pretty happy with the site to be very honest am deciding the best way to embed some mp3s at the current time.

http://kifkif.fft.googlepages.com/kif.htm 

Went to Paleo festival last week, saw both Rachid Taha and Tinariwen.  A great time was had by all.  They had a nice little nomad area set up with an earthen oven and nomad tents.  Christa bought a very cool blue shirt from one of the fellows.  Audrey loved it, especially all the Harira soup she ate at the Moroccan restaurant.  That’s right, they had a real restaurant at the festival, served in Tajines and everything.  Very impressed.

 http://www.paleo.ch/live/paleo/home/live/live_concerts.php?&day=20070728





loading…

21 07 2007

http://kifkif.fft.googlepages.com/kif.htm
Spent a bit more time working on the loading of the page. All the big blocks of images are now stuck in a function that gets called on page load, and I have a “loading…” on the top left page. It’s actually a number of layers of < div >’s that have different numbers of “…”’s in them. So it the page loads slowly you’ll see loading… loading…. loading….. etc. Then at the end of the onLoad function, there’s a blank < div > laid over the top of them. Works quite well.

I also added a statcounter and verfied the site in the google webmaster tool.





kifkif.fft.googlepages.com

19 07 2007

I’ve been working on a site for my friend Karim’s band Kif-Kif. Check it out at http://kifkif.fft.googlepages.com. I’ve spent some time using Javascript to make it a bit more like a “media” website. It’s all one page (with hidden div’s) so that when you click the links the music keeps playing. I also spent a bit of time using a pure CSS layout (inline) instead of tables.

My biggest issue was load time, so I stuck the loading of some of the pictures in innerHtml functions fired after onLoad . This means that you can click around while the pictures load in the background via javascript. I included a google Video Bar with a search for 2 videos that I made for Karim, and it seems to work pretty well. I’d love to have some time to make some more vids…





Checkbox Website

5 06 2007

OK, this is a first try posting some code from a very small website that I created. I was looking for a way to post install instructions (actually data update procedures) that were “editable” online. Since I’ve been messing about with XML and XSL lately, I thought it might be cool to drive it off of an XML file instead of a Database. I tried to keep it to a small number of files, I wound up with:

1. Default.asp – this is the main page (and only display page) but it’s actually a frame for the 2 xsl pages (one to display and one to enable editing).

2. Lister.xml – this is where all the actual content for the site is kept.

3. Lister.xsl – this is the XSL that transforms the XML file that allows you to check boxes but not to edit the steps.

4. Listerall.asp – asp page that edits the XML file for steps and details from input given by the listeredit.xsl page.

5. Listeredit.xsl – XSL that transforms the XML file and gives input fields to edit the list and details. Should be hidden from most users.

6. Xmlutil.asp – the famous MS XML includes.

I’m still doing all my transforms server side because it makes me happy. Think everything in this site is ASP and VBScript. I had a stylesheet that creates blocks in neat patterns (that’s why all the xtra divs are there), but wanted a gerneric version.

Because It’s difficult to post code within the blog (yes, I know it’s possible, just not easy), I’ll just link to RAR file of the 6 pages.

6 pages rolled into a RAR file





describe “modern german” style

8 05 2007




google webmaster central blog

19 04 2007

http://googlewebmastercentral.blogspot.com/

This is the Google WebMaster Blog, with lots of interesting information. Just came across this again from a post at TheReg about removing a link from google.





boat drinks…

16 04 2007

Rum Runner
Ingredients
1 oz. light rum
1/2 oz. Créme De Banana
1/2 oz. Blackberry Brandy
1/2 oz. grenadine
1/2 oz. orange juice
1/2 oz. pineapple juice
Float: 1/4 oz. 151 rum.

Preparation
Combine ingredients in Margaritaville blending jar.
Blend and pour into a 12 oz. glass.
Garnish with an orange and cherry.
Add float of 151 rum.

Hurricane
Ingredients
3/4 oz. light rum
3/4 oz. dark rum
3/4 oz. grenadine
1/2 oz. pineapple juice
1/2 oz. orange juice
Float: 1/4 oz. 151 rum.

Preparation
Combine ingredients in Margaritaville blending jar.
Blend and pour into a 12 oz. glass.
Garnish with an orange and cherry.
Add float of 151 rum.