Sunday, November 15, 2009

My latest favorite site

I found this really great site called moviesjojo.com. So, naturally, I decided to hack it and embed it as a part of my Pordl.com site.

Take a look at the Movies tab on Pordl.com.

Tuesday, October 6, 2009

Another IE8 breakthrough

Force IE8 to render pages as if it was IE7:



<head>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
</head>

This version will display in IE7 Standards Mode ( rather than Quirks Mode ); basically wreaking havoc on IE5 browser users.

Friday, October 2, 2009

Internet Explorer 8 float issues

In Internet Explorer 8 ( When IE8 is not in Compatability Mode ), I have discovered that if you put a Form tag inside another Form tag, it will push floats out in ways that previous IE browsers do not.

This happenes to me a lot when I build .NET sites with .master pages. The master page will have a form runat='server' tag. So, if you put a form tag on one of your content pages, it will mess up your floats.

Good thing most IE8 users use Compatability Mode.

Friday, September 18, 2009

Give Divs the same height with Javascript

I love divs, don't get me wrong. But, come on, height: 100% should work when you want it to; no excuses. If you have two-column, three-column, or other setup, where each column has borders or different backgrounds, you are screwed using CSS alone. Trust me, no hack will work on all browsers. Luckily, someone did the work for us and created a JavaScript that will do what CSS won't.



Paste this in the head of your page:



<script type="text/javascript" language="javascript">

/*
------------------------------------------------
PVII Equal CSS Columns scripts -Version 2
Copyright (c) 2005 Project Seven Development
www.projectseven.com
Version: 2.1.0
------------------------------------------------
*/
function P7_colH2(){ //v2.1.0 by PVII-www.projectseven.com
var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
for(i=1;i<dA.length;i+=2){dA[i+1].style.paddingBottom='';}for(i=1;i<dA.length;i+=2){
oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=1;i<dA.length;i+=2){oh=dA[i].offsetHeight;
if(oh<h){np=h-oh;if(!an&&dA[0]==1){P7_eqA2(dA[i+1].id,0,np);}else{
dA[i+1].style.paddingBottom=np+"px";}}}document.p7eqa=1;
document.p7eqth=document.body.offsetHeight;
document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT2(){ //v2.1.0 by PVII-www.projectseven.com
if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}
function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com
var c,e,el;if(document.getElementById){document.p7eqc=new Array();
document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
setInterval("P7_eqT2()",10);}
}
function P7_eqA2(el,p,pt){ //v2.1.0 by PVII-www.projectseven.com
var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);}
}
</script>



And this into your body tag:



<body onLoad="P7_equalCols2(0,'content_right','p','content_left','p')">



1 is for animation = yes. 0 for animation = no.

The content_right, content_left are the ids of the divs that need equal height.

The P stands for the tag used for the measurement. In this case I put a <p>%nbsp;</p> tag in the bottom of each div.

Enjoy

Make IE6 act like IE7 with JavaScript

I can't wait for IE6 to disappear. It should have happened years ago. However, apparently, it is still used by 18% of all internet surfers. Let's face it, Microsoft is a stupid conglomerant giant. But it isn't half as stupid as all those people still using IE5 and IE6. Upgrade your crap or throw it away. You are costing the world billions of dollars in web development hours.


Luckily, I came accross a great little script that does a real decent job telling IE6 browsers to display pages like IE7 browsers. I'll even give you the link. Yeah Me.


Click Here

Or copy and paste this code:

/* IE7/IE8.js - copyright 2004-2008, Dean Edwards */
(function(){IE7={toString:function(){return"IE7 version 2.0 (beta3)"}};var k=IE7.appVersion=navigator.appVersion.match(/MSIE (\d\.\d)/)[1];if(/ie7_off/.test(top.location.search)||k<5)return;var Q=bG();var C=document.compatMode!="CSS1Compat";var bm=document.documentElement,v,s;var bA="!";var G=":link{ie7-link:link}:visited{ie7-link:visited}";var cj=/^[\w\.]+[^:]*$/;function W(a,b){if(cj.test(a))a=(b||"")+a;return a};function bn(a,b){a=W(a,b);return a.slice(0,a.lastIndexOf("/")+1)};var bB=document.scripts[document.scripts.length-1];var ck=bn(bB.src);try{var H=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}var X={};function cl(a,b){try{a=W(a,b);if(!X[a]){H.open("GET",a,false);H.send();if(H.status==0||H.status==200){X[a]=H.responseText}}}catch(e){}finally{return X[a]||""}};if(k<5.5){undefined=Q();bA="HTML:!";var cm=/(g|gi)$/;var cn=String.prototype.replace;String.prototype.replace=function(a,b){if(typeof b=="function"){if(a&&a.constructor==RegExp){var c=a;var d=c.global;if(d==null)d=cm.test(c);if(d)c=new RegExp(c.source)}else{c=new RegExp(bb(a))}var f,g=this,h="";while(g&&(f=c.exec(g))){h+=g.slice(0,f.index)+b.apply(this,f);g=g.slice(f.index+f[0].length);if(!d)break}return h+g}return cn.apply(this,arguments)};Array.prototype.pop=function(){if(this.length){var a=this[this.length-1];this.length--;return a}return undefined};Array.prototype.push=function(){for(var a=0;a<arguments.length;a++){this[this.length]=arguments[a]}return this.length};var co=this;Function.prototype.apply=function(a,b){if(a===undefined)a=co;else if(a==null)a=window;else if(typeof a=="string")a=new String(a);else if(typeof a=="number")a=new Number(a);else if(typeof a=="boolean")a=new Boolean(a);if(arguments.length==1)b=[];else if(b[0]&&b[0].writeln)b[0]=b[0].documentElement.document||b[0];var c="#ie7_apply",d;a[c]=this;switch(b.length){case 0:d=a[c]();break;case 1:d=a[c](b[0]);break;case 2:d=a[c](b[0],b[1]);break;case 3:d=a[c](b[0],b[1],b[2]);break;case 4:d=a[c](b[0],b[1],b[2],b[3]);break;case 5:d=a[c](b[0],b[1],b[2],b[3],b[4]);break;default:var f=[],g=b.length-1;do f[g]="a["+g+"]";while(g--);eval("r=o[$]("+f+")")}if(typeof a.valueOf=="function"){delete a[c]}else{a[c]=undefined;if(d&&d.writeln)d=d.documentElement.document||d}return d};Function.prototype.call=function(a){return this.apply(a,bC.apply(arguments,[1]))};G+="address,blockquote,body,dd,div,dt,fieldset,form,"+"frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,p,"+"hr,applet,center,dir,menu,pre,dl,li,ol,ul{display:block}"}var bC=Array.prototype.slice;var cJ=/%([1-9])/g;var cp=/^\s\s*/;var cq=/\s\s*$/;var cr=/([\/()[\]{}|*+-.,^$?\\])/g;var bD=/\bbase\b/;var bE=["constructor","toString"];var Y;function z(){};z.extend=function(a,b){Y=true;var c=new this;ba(c,a);Y=false;var d=c.constructor;function f(){if(!Y)d.apply(this,arguments)};c.constructor=f;f.extend=arguments.callee;ba(f,b);f.prototype=c;return f};z.prototype.extend=function(a){return ba(this,a)};var bo="#";var Z="~";var cs=/\\./g;var ct=/\(\?[:=!]|\[[^\]]+\]/g;var cu=/\(/g;var D=z.extend({constructor:function(a){this[Z]=[];this.merge(a)},exec:function(g){var h=this,p=this[Z];return String(g).replace(new RegExp(this,this.ignoreCase?"gi":"g"),function(){var a,b=1,c=0;while((a=h[bo+p[c++]])){var d=b+a.length+1;if(arguments[b]){var f=a.replacement;switch(typeof f){case"function":return f.apply(h,bC.call(arguments,b,d));case"number":return arguments[b+f];default:return f}}b=d}})},add:function(a,b){if(a instanceof RegExp){a=a.source}if(!this[bo+a])this[Z].push(String(a));this[bo+a]=new D.Item(a,b)},merge:function(a){for(var b in a)this.add(b,a[b])},toString:function(){return"("+this[Z].join(")|(")+")"}},{IGNORE:"$0",Item:z.extend({constructor:function(a,b){a=a instanceof RegExp?a.source:String(a);if(typeof b=="number")b=String(b);else if(b==null)b="";if(typeof b=="string"&&/\$(\d+)/.test(b)){if(/^\$\d+$/.test(b)){b=parseInt(b.slice(1))}else{var c=/'/.test(b.replace(/\\./g,""))?'"':"'";b=b.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\$(\d+)/g,c+"+(arguments[$1]||"+c+c+")+"+c);b=new Function("return "+c+b.replace(/(['"])\1\+(.*)\+\1\1$/,"$1")+c)}}this.length=D.count(a);this.replacement=b;this.toString=bG(a)}}),count:function(a){a=String(a).replace(cs,"").replace(ct,"");return I(a,cu).length}});function ba(a,b){if(a&&b){var c=(typeof b=="function"?Function:Object).prototype;var d=bE.length,f;if(Y)while(f=bE[--d]){var g=b[f];if(g!=c[f]){if(bD.test(g)){bF(a,f,g)}else{a[f]=g}}}for(f in b)if(c[f]===undefined){var g=b[f];if(a[f]&&typeof g=="function"&&bD.test(g)){bF(a,f,g)}else{a[f]=g}}}return a};function bF(c,d,f){var g=c[d];c[d]=function(){var a=this.base;this.base=g;var b=f.apply(this,arguments);this.base=a;return b}};function cv(a,b){if(!b)b=a;var c={};for(var d in a)c[d]=b[d];return c};function i(c){var d=arguments;var f=new RegExp("%([1-"+arguments.length+"])","g");return String(c).replace(f,function(a,b){return b<d.length?d[b]:a})};function I(a,b){return String(a).match(b)||[]};function bb(a){return String(a).replace(cr,"\\$1")};function cK(a){return String(a).replace(cp,"").replace(cq,"")};function bG(a){return function(){return a}};var bH=D.extend({ignoreCase:true});var cw=/\x01(\d+)/g,cx=/'/g,cy=/^\x01/,cz=/\\([\da-fA-F]{1,4})/g;var bp=[];var cA=new bH({"<!\\-\\-|\\-\\->":"","\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/":"","@(namespace|import)[^;\\n]+[;\\n]":"","'(\\\\.|[^'\\\\])*'":bJ,'"(\\\\.|[^"\\\\])*"':bJ,"\\s+":" "});function cB(a){return cA.exec(a)};function bI(c){return c.replace(cw,function(a,b){return bp[b-1]})};function bJ(c){return"\x01"+bp.push(c.replace(cz,function(a,b){return eval("'\\u"+"0000".slice(b.length)+b+"'")}).slice(1,-1).replace(cx,"\\'"))};function cC(a){return cy.test(a)?bp[a.slice(1)-1]:a};var cD=new D({Width:"Height",width:"height",Left:"Top",left:"top",Right:"Bottom",right:"bottom",onX:"onY"});function A(a){return cD.exec(a)};var bK=[];function bq(a){cF(a);w(window,"onresize",a)};function w(a,b,c){a.attachEvent(b,c);bK.push(arguments)};function cE(a,b,c){try{a.detachEvent(b,c)}catch(ignore){}};w(window,"onunload",function(){var a;while(a=bK.pop()){cE(a[0],a[1],a[2])}});function R(a,b,c){if(!a.elements)a.elements={};if(c)a.elements[b.uniqueID]=b;else delete a.elements[b.uniqueID];return c};w(window,"onbeforeprint",function(){if(!IE7.CSS.print)new bw("print");IE7.CSS.print.recalc()});var bL=/^\d+(px)?$/i;var J=/^\d+%$/;var E=function(a,b){if(bL.test(b))return parseInt(b);var c=a.style.left;var d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b||0;b=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return b};var br="ie7-";var bM=z.extend({constructor:function(){this.fixes=[];this.recalcs=[]},init:Q});var bs=[];function cF(a){bs.push(a)};IE7.recalc=function(){IE7.HTML.recalc();IE7.CSS.recalc();for(var a=0;a<bs.length;a++)bs[a]()};function bc(a){return a.currentStyle["ie7-position"]=="fixed"};function bt(a,b){return a.currentStyle[br+b]||a.currentStyle[b]};function K(a,b,c){if(a.currentStyle[br+b]==null){a.runtimeStyle[br+b]=a.currentStyle[b]}a.runtimeStyle[b]=c};function bN(a){var b=document.createElement(a||"object");b.style.cssText="position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999";b.ie7_anon=true;return b};function B(a,b,c){if(!be[a]){F=[];var d="";var f=T.escape(a).split(",");for(var g=0;g<f.length;g++){o=m=x=0;S=f.length>1?2:0;var h=T.exec(f[g])||"if(0){";if(o){h+=i("if(e%1.nodeName!='!'){",m)}var p=S>1?bV:"";h+=i(p+bW,m);h+=Array(I(h,/\{/g).length+1).join("}");d+=h}eval(i(bX,F)+T.unescape(d)+"return s?null:r}");be[a]=_h}return be[a](b||document,c)};var bd=k<6;var bO=/^(href|src)$/;var bu={"class":"className","for":"htmlFor"};IE7._5=1;IE7._e=function(a,b){var c=a.all[b]||null;if(!c||c.id==b)return c;for(var d=0;d<c.length;d++){if(c[d].id==b)return c[d]}return null};IE7._f=function(a,b){if(b=="src"&&a.pngSrc)return a.pngSrc;var c=bd?(a.attributes[b]||a.attributes[bu[b.toLowerCase()]]):a.getAttributeNode(b);if(c&&(c.specified||b=="value")){if(bO.test(b)){return a.getAttribute(b,2)}else if(b=="class"){return a.className.replace(/\sie7_\w+/g,"")}else if(b=="style"){return a.style.cssText}else{return c.nodeValue}}return null};var bP="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";ba(bu,cv(bP.toLowerCase().split(","),bP.split(",")));IE7._a=function(a){while(a&&(a=a.nextSibling)&&(a.nodeType!=1||a.nodeName=="!"))continue;return a};IE7._b=function(a){while(a&&(a=a.previousSibling)&&(a.nodeType!=1||a.nodeName=="!"))continue;return a};var cG=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,cH=/(^|,)([^\s>+~])/g,cI=/\s*([\s>+~(),]|^|$)\s*/g,bQ=/\s\*\s/g;var bR=D.extend({constructor:function(a){this.base(a);this.sorter=new D;this.sorter.add(/:not\([^)]*\)/,D.IGNORE);this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},ignoreCase:true,escape:function(a){return this.optimise(this.format(a))},format:function(a){return a.replace(cI,"$1").replace(cH,"$1 $2").replace(cG,"$1*$2")},optimise:function(a){return this.sorter.exec(a.replace(bQ,">* "))},unescape:function(a){return bI(a)}});var bS={"":"%1!=null","=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};var bT={"first-child":"!IE7._b(e%1)","link":"e%1.currentStyle['ie7-link']=='link'","visited":"e%1.currentStyle['ie7-link']=='visited'"};var bv="var p%2=0,i%2,e%2,n%2=e%1.";var bU="e%1.sourceIndex";var bV="var g="+bU+";if(!p[g]){p[g]=1;";var bW="r[r.length]=e%1;if(s)return e%1;";var bX="var _h=function(e0,s){IE7._5++;var r=[],p={},reg=[%1],d=document;";var F;var m;var o;var x;var S;var be={};var T=new bR({" (\\*|[\\w-]+)#([\\w-]+)":function(a,b,c){o=false;var d="var e%2=IE7._e(d,'%4');if(e%2&&";if(b!="*")d+="e%2.nodeName=='%3'&&";d+="(e%1==d||e%1.contains(e%2))){";if(x)d+=i("i%1=n%1.length;",x);return i(d,m++,m,b.toUpperCase(),c)}," (\\*|[\\w-]+)":function(a,b){S++;o=b=="*";var c=bv;c+=(o&&bd)?"all":"getElementsByTagName('%3')";c+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){";return i(c,m++,x=m,b.toUpperCase())},">(\\*|[\\w-]+)":function(a,b){var c=x;o=b=="*";var d=bv;d+=c?"children":"childNodes";if(!o&&c)d+=".tags('%3')";d+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){";if(o){d+="if(e%2.nodeType==1){";o=bd}else{if(!c)d+="if(e%2.nodeName=='%3'){"}return i(d,m++,x=m,b.toUpperCase())},"\\+(\\*|[\\w-]+)":function(a,b){var c="";if(o)c+="if(e%1.nodeName!='!'){";o=false;c+="e%1=IE7._a(e%1);if(e%1";if(b!="*")c+="&&e%1.nodeName=='%2'";c+="){";return i(c,m,b.toUpperCase())},"~(\\*|[\\w-]+)":function(a,b){var c="";if(o)c+="if(e%1.nodeName!='!'){";o=false;S=2;c+="while(e%1=e%1.nextSibling){if(e%1.ie7_adjacent==IE7._5)break;if(";if(b=="*"){c+="e%1.nodeType==1";if(bd)c+="&&e%1.nodeName!='!'"}else c+="e%1.nodeName=='%2'";c+="){e%1.ie7_adjacent=IE7._5;";return i(c,m,b.toUpperCase())},"#([\\w-]+)":function(a,b){o=false;var c="if(e%1.id=='%2'){";if(x)c+=i("i%1=n%1.length;",x);return i(c,m,b)},"\\.([\\w-]+)":function(a,b){o=false;F.push(new RegExp("(^|\\s)"+bb(b)+"(\\s|$)"));return i("if(e%1.className&®[%2].test(e%1.className)){",m,F.length-1)},"\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]":function(a,b,c,d){var f=bu[b]||b;if(c){var g="e%1.getAttribute('%2',2)";if(!bO.test(b)){g="e%1.%3||"+g}b=i("("+g+")",m,b,f)}else{b=i("IE7._f(e%1,'%2')",m,b)}var h=bS[c||""]||"0";if(h&&h.source){F.push(new RegExp(i(h.source,bb(T.unescape(d)))));h="reg[%2].test(%1)";d=F.length-1}return"if("+i(h,b,d)+"){"},":+([\\w-]+)(\\(([^)]+)\\))?":function(a,b,c,d){b=bT[b];return"if("+(b?i(b,m,d||""):"0")+"){"}});var bY=/a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;var bZ=/\s*\{\s*/,ca=/\s*\}\s*/,cb=/\s*\,\s*/;var cc=/(.*)(:first-(line|letter))/;var y=document.styleSheets;IE7.CSS=new(bM.extend({parser:new bH,screen:"",print:"",styles:[],rules:[],pseudoClasses:k<7?"first\\-child":"",dynamicPseudoClasses:{toString:function(){var a=[];for(var b in this)a.push(b);return a.join("|")}},init:function(){var a="^\x01$";var b="\\[class=?[^\\]]*\\]";var c=[];if(this.pseudoClasses)c.push(this.pseudoClasses);var d=this.dynamicPseudoClasses.toString();if(d)c.push(d);c=c.join("|");var f=k<7?["[>+~[(]|([:.])\\w+\\1"]:[b];if(c)f.push(":("+c+")");this.UNKNOWN=new RegExp(f.join("|")||a,"i");var g=k<7?["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"]:[b];var h=g.concat();if(c)h.push(":("+c+")");n.COMPLEX=new RegExp(h.join("|")||a,"ig");if(this.pseudoClasses)g.push(":("+this.pseudoClasses+")");L.COMPLEX=new RegExp(g.join("|")||a,"i");L.MATCH=new RegExp(d?"(.*):("+d+")(.*)":a,"i");this.createStyleSheet();this.refresh()},addEventHandler:function(){w.apply(null,arguments)},addFix:function(a,b){this.parser.add(a,b)},addRecalc:function(c,d,f,g){d=new RegExp("([{;\\s])"+c+"\\s*:\\s*"+d+"[^;}]*");var h=this.recalcs.length;if(g)g=c+":"+g;this.addFix(d,function(a,b){return(g?b+g:a)+";ie7-"+a.slice(1)+";ie7_recalc"+h+":1"});this.recalcs.push(arguments);return h},apply:function(){this.getInlineStyles();new bw("screen");this.trash()},createStyleSheet:function(){this.styleSheet=document.createStyleSheet();this.styleSheet.ie7=true;this.styleSheet.owningElement.ie7=true;this.styleSheet.cssText=G},getInlineStyles:function(){var a=document.getElementsByTagName("style"),b;for(var c=a.length-1;(b=a[c]);c--){if(!b.disabled&&!b.ie7){this.styles.push(b.innerHTML)}}},getText:function(a,b){try{var c=a.cssText}catch(e){c=""}if(H)c=cl(a.href,b)||c;return c},recalc:function(){this.screen.recalc();var a=/ie7_recalc\d+/g;var b=G.match(/[{,]/g).length;var c=b+(this.screen.cssText.match(/\{/g)||"").length;var d=this.styleSheet.rules,f;var g,h,p,t,q,j,u,l;for(q=b;q<c;q++){f=d[q];var r=f.style.cssText;if(f&&(g=r.match(a))){p=B(f.selectorText);if(p.length)for(j=0;j<g.length;j++){l=g[j];h=IE7.CSS.recalcs[l.slice(10)][2];for(u=0;(t=p[u]);u++){if(t.currentStyle[l])h(t,r)}}}}},refresh:function(){this.styleSheet.cssText=G+this.screen+this.print},trash:function(){for(var a=0;a<y.length;a++){if(!y[a].ie7){try{var b=y[a].cssText}catch(e){b=""}if(b)y[a].cssText=""}}}}));var bw=z.extend({constructor:function(a){this.media=a;this.load();IE7.CSS[a]=this;IE7.CSS.refresh()},createRule:function(a,b){if(IE7.CSS.UNKNOWN.test(a)){var c;if(bf&&(c=a.match(bf.MATCH))){return new bf(c[1],c[2],b)}else if(c=a.match(L.MATCH)){if(!bY.test(c[0])||L.COMPLEX.test(c[0])){return new L(a,c[1],c[2],c[3],b)}}else return new n(a,b)}return a+" {"+b+"}"},getText:function(){var h=[].concat(IE7.CSS.styles);var p=/@media\s+([^{]*)\{([^@]+\})\s*\}/gi;var t=/\ball\b|^$/i,q=/\bscreen\b/i,j=/\bprint\b/i;function u(a,b){l.value=b;return a.replace(p,l)};function l(a,b,c){b=r(b);switch(b){case"screen":case"print":if(b!=l.value)return"";case"all":return c}return""};function r(a){if(t.test(a))return"all";else if(q.test(a))return(j.test(a))?"all":"screen";else if(j.test(a))return"print"};var N=this;function O(a,b,c,d){var f="";if(!d){c=r(a.media);d=0}if(c=="all"||c==N.media){if(d<3){for(var g=0;g<a.imports.length;g++){f+=O(a.imports[g],bn(a.href,b),c,d+1)}}f+=cB(a.href?cg(a,b):h.pop()||"");f=u(f,N.media)}return f};var bl={};function cg(a,b){var c=W(a.href,b);if(bl[c])return"";bl[c]=(a.disabled)?"":ci(IE7.CSS.getText(a,b),bn(a.href,b));return bl[c]};var ch=/(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;function ci(a,b){return a.replace(ch,"$1"+b.slice(0,b.lastIndexOf("/")+1)+"$2")};for(var P=0;P<y.length;P++){if(!y[P].disabled&&!y[P].ie7){this.cssText+=O(y[P])}}},load:function(){this.cssText="";this.getText();this.parse();this.cssText=bI(this.cssText);X={}},parse:function(){this.cssText=IE7.CSS.parser.exec(this.cssText);var a=IE7.CSS.rules.length;var b=this.cssText.split(ca),c;var d,f,g,h;for(g=0;g<b.length;g++){c=b[g].split(bZ);d=c[0].split(cb);f=c[1];for(h=0;h<d.length;h++){d[h]=f?this.createRule(d[h],f):""}b[g]=d.join("\n")}this.cssText=b.join("\n");this.rules=IE7.CSS.rules.slice(a)},recalc:function(){var a,b;for(b=0;(a=this.rules[b]);b++)a.recalc()},toString:function(){return"@media "+this.media+"{"+this.cssText+"}"}});var bf;var n=IE7.Rule=z.extend({constructor:function(a,b){this.id=IE7.CSS.rules.length;this.className=n.PREFIX+this.id;a=a.match(cc)||a||"*";this.selector=a[1]||a;this.selectorText=this.parse(this.selector)+(a[2]||"");this.cssText=b;this.MATCH=new RegExp("\\s"+this.className+"(\\s|$)","g");IE7.CSS.rules.push(this);this.init()},init:Q,add:function(a){a.className+=" "+this.className},recalc:function(){var a=B(this.selector);for(var b=0;b<a.length;b++)this.add(a[b])},parse:function(a){var b=a.replace(n.CHILD," ").replace(n.COMPLEX,"");if(k<7)b=b.replace(n.MULTI,"");var c=I(b,n.TAGS).length-I(a,n.TAGS).length;var d=I(b,n.CLASSES).length-I(a,n.CLASSES).length+1;while(d>0&&n.CLASS.test(b)){b=b.replace(n.CLASS,"");d--}while(c>0&&n.TAG.test(b)){b=b.replace(n.TAG,"$1*");c--}b+="."+this.className;d=Math.min(d,2);c=Math.min(c,2);var f=-10*d-c;if(f>0){b=b+","+n.MAP[f]+" "+b}return b},remove:function(a){a.className=a.className.replace(this.MATCH,"$1")},toString:function(){return i("%1 {%2}",this.selectorText,this.cssText)}},{CHILD:/>/g,CLASS:/\.[\w-]+/,CLASSES:/[.:\[]/g,MULTI:/(\.[\w-]+)+/g,PREFIX:"ie7_class",TAG:/^\w+|([\s>+~])\w+/,TAGS:/^\w|[\s>+~]\w/g,MAP:{1:"html",2:"html body",10:".ie7_html",11:"html.ie7_html",12:"html.ie7_html body",20:".ie7_html .ie7_body",21:"html.ie7_html .ie7_body",22:"html.ie7_html body.ie7_body"}});var L=n.extend({constructor:function(a,b,c,d,f){this.attach=b||"*";this.dynamicPseudoClass=IE7.CSS.dynamicPseudoClasses[c];this.target=d;this.base(a,f)},recalc:function(){var a=B(this.attach),b;for(var c=0;b=a[c];c++){var d=this.target?B(this.target,b):[b];if(d.length)this.dynamicPseudoClass.apply(b,d,this)}}});var cd=z.extend({constructor:function(a,b){this.name=a;this.apply=b;this.instances={};IE7.CSS.dynamicPseudoClasses[a]=this},register:function(a){var b=a[2];a.id=b.id+a[0].uniqueID;if(!this.instances[a.id]){var c=a[1],d;for(d=0;d<c.length;d++)b.add(c[d]);this.instances[a.id]=a}},unregister:function(a){if(this.instances[a.id]){var b=a[2];var c=a[1],d;for(d=0;d<c.length;d++)b.remove(c[d]);delete this.instances[a.id]}}});if(k<7){var U=new cd("hover",function(a){var b=arguments;IE7.CSS.addEventHandler(a,k<5.5?"onmouseover":"onmouseenter",function(){U.register(b)});IE7.CSS.addEventHandler(a,k<5.5?"onmouseout":"onmouseleave",function(){U.unregister(b)})});w(document,"onmouseup",function(){var a=U.instances;for(var b in a)if(!a[b][0].contains(event.srcElement))U.unregister(a[b])})}IE7.CSS.addRecalc("[\\w-]+","inherit",function(c,d){var f=d.match(/[\w-]+\s*:\s*inherit/g);for(var g=0;g<f.length;g++){var h=f[g].replace(/ie7\-|\s*:\s*inherit/g,"").replace(/\-([a-z])/g,function(a,b){return b.toUpperCase()});c.runtimeStyle[h]=c.parentElement.currentStyle[h]}});IE7.HTML=new(bM.extend({fixed:{},init:Q,addFix:function(){this.fixes.push(arguments)},apply:function(){for(var a=0;a<this.fixes.length;a++){var b=B(this.fixes[a][0]);var c=this.fixes[a][1];for(var d=0;d<b.length;d++)c(b[d])}},addRecalc:function(){this.recalcs.push(arguments)},recalc:function(){for(var a=0;a<this.recalcs.length;a++){var b=B(this.recalcs[a][0]);var c=this.recalcs[a][1],d;var f=Math.pow(2,a);for(var g=0;(d=b[g]);g++){var h=d.uniqueID;if((this.fixed[h]&f)==0){d=c(d)||d;this.fixed[h]|=f}}}}}));if(k<7){document.createElement("abbr");IE7.HTML.addRecalc("label",function(a){if(!a.htmlFor){var b=B("input,textarea",a,true);if(b){w(a,"onclick",function(){b.click()})}}})}var V="[.\\d]";new function(_){var layout=IE7.Layout=this;G+="*{boxSizing:content-box}";IE7.hasLayout=k<5.5?function(a){return a.clientWidth}:function(a){return a.currentStyle.hasLayout};layout.boxSizing=function(a){if(!IE7.hasLayout(a)){a.style.height="0cm";if(a.currentStyle.verticalAlign=="auto")a.runtimeStyle.verticalAlign="top";collapseMargins(a)}};function collapseMargins(a){if(a!=s&&a.currentStyle.position!="absolute"){collapseMargin(a,"marginTop");collapseMargin(a,"marginBottom")}};function collapseMargin(a,b){if(!a.runtimeStyle[b]){var c=a.parentElement;if(c&&IE7.hasLayout(c)&&!IE7[b=="marginTop"?"_b":"_a"](a))return;var d=B(">*:"+(b=="marginTop"?"first":"last")+"-child",a,true);if(d&&d.currentStyle.styleFloat=="none"&&IE7.hasLayout(d)){collapseMargin(d,b);margin=_9(a,a.currentStyle[b]);childMargin=_9(d,d.currentStyle[b]);if(margin<0||childMargin<0){a.runtimeStyle[b]=margin+childMargin}else{a.runtimeStyle[b]=Math.max(childMargin,margin)}d.runtimeStyle[b]="0px"}}};function _9(a,b){return b=="auto"?0:E(a,b)};var UNIT=/^[.\d][\w%]*$/,AUTO=/^(auto|0cm)$/;var applyWidth,applyHeight;IE7.Layout.borderBox=function(a){applyWidth(a);applyHeight(a)};var fixWidth=function(g){applyWidth=function(a){if(!J.test(a.currentStyle.width))h(a);collapseMargins(a)};function h(a,b){if(!a.runtimeStyle.fixedWidth){if(!b)b=a.currentStyle.width;a.runtimeStyle.fixedWidth=(UNIT.test(b))?Math.max(0,q(a,b)):b;K(a,"width",a.runtimeStyle.fixedWidth)}};function p(a){if(!bc(a)){var b=a.offsetParent;while(b&&!IE7.hasLayout(b))b=b.offsetParent}return(b||s).clientWidth};function t(a,b){if(J.test(b))return parseInt(parseFloat(b)/100*p(a));return E(a,b)};var q=function(a,b){var c=a.currentStyle["box-sizing"]=="border-box";var d=0;if(C&&!c)d+=j(a)+u(a,"padding");else if(!C&&c)d-=j(a)+u(a,"padding");return t(a,b)+d};function j(a){return a.offsetWidth-a.clientWidth};function u(a,b){return t(a,a.currentStyle[b+"Left"])+t(a,a.currentStyle[b+"Right"])};G+="*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";layout.minWidth=function(a){if(a.currentStyle["min-width"]!=null){a.style.minWidth=a.currentStyle["min-width"]}if(R(arguments.callee,a,a.currentStyle.minWidth!="none")){layout.boxSizing(a);h(a);l(a)}};eval("IE7.Layout.maxWidth="+String(layout.minWidth).replace(/min/g,"max"));function l(a){var b=a.getBoundingClientRect();var c=b.right-b.left;if(a.currentStyle.minWidth!="none"&&c<=q(a,a.currentStyle.minWidth)){a.runtimeStyle.width=a.currentStyle.minWidth}else if(a.currentStyle.maxWidth!="none"&&c>=q(a,a.currentStyle.maxWidth)){a.runtimeStyle.width=a.currentStyle.maxWidth}else{a.runtimeStyle.width=a.runtimeStyle.fixedWidth}};function r(a){if(R(r,a,/^(fixed|absolute)$/.test(a.currentStyle.position)&&bt(a,"left")!="auto"&&bt(a,"right")!="auto"&&AUTO.test(bt(a,"width")))){N(a);IE7.Layout.boxSizing(a)}};IE7.Layout.fixRight=r;function N(a){var b=t(a,a.runtimeStyle._c||a.currentStyle.left);var c=p(a)-t(a,a.currentStyle.right)-b-u(a,"margin");if(parseInt(a.runtimeStyle.width)==c)return;a.runtimeStyle.width="";if(bc(a)||g||a.offsetWidth<c){if(!C)c-=j(a)+u(a,"padding");if(c<0)c=0;a.runtimeStyle.fixedWidth=c;K(a,"width",c)}};var O=0;bq(function(){if(!s)return;var a,b=(O<s.clientWidth);O=s.clientWidth;var c=layout.minWidth.elements;for(a in c){var d=c[a];var f=(parseInt(d.runtimeStyle.width)==q(d,d.currentStyle.minWidth));if(b&&f)d.runtimeStyle.width="";if(b==f)l(d)}var c=layout.maxWidth.elements;for(a in c){var d=c[a];var f=(parseInt(d.runtimeStyle.width)==q(d,d.currentStyle.maxWidth));if(!b&&f)d.runtimeStyle.width="";if(b!=f)l(d)}for(a in r.elements)N(r.elements[a])});if(C){IE7.CSS.addRecalc("width",V,applyWidth)}if(k<7){IE7.CSS.addRecalc("min-width",V,layout.minWidth);IE7.CSS.addRecalc("max-width",V,layout.maxWidth);IE7.CSS.addRecalc("right",V,r)}};eval("var fixHeight="+A(fixWidth));fixWidth();fixHeight(true)};var bg=W("blank.gif",ck);var bh="DXImageTransform.Microsoft.AlphaImageLoader";var bx="progid:"+bh+"(src='%1',sizingMethod='%2')";var bi;var M=[];function by(a){if(bi.test(a.src)){var b=new Image(a.width,a.height);b.onload=function(){a.width=b.width;a.height=b.height;b=null};b.src=a.src;a.pngSrc=a.src;bz(a)}};if(k>=5.5&&k<7){IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/,function(a,b,c,d,f){d=cC(d);return bi.test(d)?"filter:"+i(bx,d,"crop")+";zoom:1;background"+(b||"")+":"+(c||"")+"none"+(f||""):a});IE7.HTML.addRecalc("img,input",function(a){if(a.tagName=="INPUT"&&a.type!="image")return;by(a);w(a,"onpropertychange",function(){if(!bj&&event.propertyName=="src"&&a.src.indexOf(bg)==-1)by(a)})});var bj=false;w(window,"onbeforeprint",function(){bj=true;for(var a=0;a<M.length;a++)ce(M[a])});w(window,"onafterprint",function(){for(var a=0;a<M.length;a++)bz(M[a]);bj=false})}function bz(a,b){var c=a.filters[bh];if(c){c.src=a.src;c.enabled=true}else{a.runtimeStyle.filter=i(bx,a.src,b||"scale");M.push(a)}a.src=bg};function ce(a){a.src=a.pngSrc;a.filters[bh].enabled=false};new function(_){if(k>=7)return;IE7.CSS.addRecalc("position","fixed",_6,"absolute");IE7.CSS.addRecalc("background(-attachment)?","[^};]*fixed",_2);var $viewport=C?"body":"documentElement";function _3(){if(v.currentStyle.backgroundAttachment!="fixed"){if(v.currentStyle.backgroundImage=="none"){v.runtimeStyle.backgroundRepeat="no-repeat";v.runtimeStyle.backgroundImage="url("+bg+")"}v.runtimeStyle.backgroundAttachment="fixed"}_3=Q};var _0=bN("img");function _1(a){return a?bc(a)||_1(a.parentElement):false};function _d(a,b,c){setTimeout("document.all."+a.uniqueID+".runtimeStyle.setExpression('"+b+"','"+c+"')",0)};function _2(a){if(R(_2,a,a.currentStyle.backgroundAttachment=="fixed"&&!a.contains(v))){_3();bgLeft(a);bgTop(a);_8(a)}};function _8(a){_0.src=a.currentStyle.backgroundImage.slice(5,-2);var b=a.canHaveChildren?a:a.parentElement;b.appendChild(_0);setOffsetLeft(a);setOffsetTop(a);b.removeChild(_0)};function bgLeft(a){a.style.backgroundPositionX=a.currentStyle.backgroundPositionX;if(!_1(a)){_d(a,"backgroundPositionX","(parseInt(runtimeStyle.offsetLeft)+document."+$viewport+".scrollLeft)||0")}};eval(A(bgLeft));function setOffsetLeft(a){var b=_1(a)?"backgroundPositionX":"offsetLeft";a.runtimeStyle[b]=getOffsetLeft(a,a.style.backgroundPositionX)-a.getBoundingClientRect().left-a.clientLeft+2};eval(A(setOffsetLeft));function getOffsetLeft(a,b){switch(b){case"left":case"top":return 0;case"right":case"bottom":return s.clientWidth-_0.offsetWidth;case"center":return(s.clientWidth-_0.offsetWidth)/2;default:if(J.test(b)){return parseInt((s.clientWidth-_0.offsetWidth)*parseFloat(b)/100)}_0.style.left=b;return _0.offsetLeft}};eval(A(getOffsetLeft));function _6(a){if(R(_6,a,bc(a))){K(a,"position","absolute");K(a,"left",a.currentStyle.left);K(a,"top",a.currentStyle.top);_3();IE7.Layout.fixRight(a);_4(a)}};function _4(a,b){positionTop(a,b);positionLeft(a,b,true);if(!a.runtimeStyle.autoLeft&&a.currentStyle.marginLeft=="auto"&&a.currentStyle.right!="auto"){var c=s.clientWidth-getPixelWidth(a,a.currentStyle.right)-getPixelWidth(a,a.runtimeStyle._c)-a.clientWidth;if(a.currentStyle.marginRight=="auto")c=parseInt(c/2);if(_1(a.offsetParent))a.runtimeStyle.pixelLeft+=c;else a.runtimeStyle.shiftLeft=c}clipWidth(a);clipHeight(a)};function clipWidth(a){var b=a.runtimeStyle.fixWidth;a.runtimeStyle.borderRightWidth="";a.runtimeStyle.width=b?getPixelWidth(a,b):"";if(a.currentStyle.width!="auto"){var c=a.getBoundingClientRect();var d=a.offsetWidth-s.clientWidth+c.left-2;if(d>=0){a.runtimeStyle.borderRightWidth="0px";d=Math.max(E(a,a.currentStyle.width)-d,0);K(a,"width",d);return d}}};eval(A(clipWidth));function positionLeft(a,b){if(!b&&J.test(a.currentStyle.width)){a.runtimeStyle.fixWidth=a.currentStyle.width}if(a.runtimeStyle.fixWidth){a.runtimeStyle.width=getPixelWidth(a,a.runtimeStyle.fixWidth)}a.runtimeStyle.shiftLeft=0;a.runtimeStyle._c=a.currentStyle.left;a.runtimeStyle.autoLeft=a.currentStyle.right!="auto"&&a.currentStyle.left=="auto";a.runtimeStyle.left="";a.runtimeStyle.screenLeft=getScreenLeft(a);a.runtimeStyle.pixelLeft=a.runtimeStyle.screenLeft;if(!b&&!_1(a.offsetParent)){_d(a,"pixelLeft","runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document."+$viewport+".scrollLeft")}};eval(A(positionLeft));function getScreenLeft(a){var b=a.offsetLeft,c=1;if(a.runtimeStyle.autoLeft){b=s.clientWidth-a.offsetWidth-getPixelWidth(a,a.currentStyle.right)}if(a.currentStyle.marginLeft!="auto"){b-=getPixelWidth(a,a.currentStyle.marginLeft)}while(a=a.offsetParent){if(a.currentStyle.position!="static")c=-1;b+=a.offsetLeft*c}return b};eval(A(getScreenLeft));function getPixelWidth(a,b){return J.test(b)?parseInt(parseFloat(b)/100*s.clientWidth):E(a,b)};eval(A(getPixelWidth));function _g(){var a=_2.elements;for(var b in a)_8(a[b]);a=_6.elements;for(b in a){_4(a[b],true);_4(a[b],true)}_7=0};var _7;bq(function(){if(!_7)_7=setTimeout(_g,0)})};var bk={backgroundColor:"transparent",backgroundImage:"none",backgroundPositionX:null,backgroundPositionY:null,backgroundRepeat:null,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none",borderLeftWidth:0,height:null,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,width:"100%"};IE7.CSS.addRecalc("overflow","visible",function(a){if(a.parentNode.ie7_wrapped)return;if(IE7.Layout&&a.currentStyle["max-height"]!="auto"){IE7.Layout.maxHeight(a)}if(a.currentStyle.marginLeft=="auto")a.style.marginLeft=0;if(a.currentStyle.marginRight=="auto")a.style.marginRight=0;var b=document.createElement(bA);b.ie7_wrapped=a;for(var c in bk){b.style[c]=a.currentStyle[c];if(bk[c]!=null){a.runtimeStyle[c]=bk[c]}}b.style.display="block";b.style.position="relative";a.runtimeStyle.position="absolute";a.parentNode.insertBefore(b,a);b.appendChild(a)});function cf(){var f="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");for(var g=0;g<f.length;g++){f[f[g]]=f[g-1]||"0.67em"}IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/,function(a,b,c,d){return b+(f[d]||d)});if(k<6){var h=/^\-/,p=/(em|ex)$/i;var t=/em$/i,q=/ex$/i;E=function(a,b){if(bL.test(b))return parseInt(b)||0;var c=h.test(b)?-1:1;if(p.test(b))c*=u(a);j.style.width=(c<0)?b.slice(1):b;v.appendChild(j);b=c*j.offsetWidth;j.removeNode();return parseInt(b)};var j=bN();function u(a){var b=1;j.style.fontFamily=a.currentStyle.fontFamily;j.style.lineHeight=a.currentStyle.lineHeight;while(a!=v){var c=a.currentStyle["ie7-font-size"];if(c){if(t.test(c))b*=parseFloat(c);else if(J.test(c))b*=(parseFloat(c)/100);else if(q.test(c))b*=(parseFloat(c)/2);else{j.style.fontSize=c;return 1}}a=a.parentElement}return b};IE7.CSS.addFix(/cursor\s*:\s*pointer/,"cursor:hand");IE7.CSS.addFix(/display\s*:\s*list-item/,"display:block")}function l(a){if(k<5.5)IE7.Layout.boxSizing(a.parentElement);var b=a.parentElement;var c=b.offsetWidth-a.offsetWidth-r(b);var d=(a.currentStyle["ie7-margin"]&&a.currentStyle.marginRight=="auto")||a.currentStyle["ie7-margin-right"]=="auto";switch(b.currentStyle.textAlign){case"right":c=d?parseInt(c/2):0;a.runtimeStyle.marginRight=c+"px";break;case"center":if(d)c=0;default:if(d)c/=2;a.runtimeStyle.marginLeft=parseInt(c)+"px"}};function r(a){return E(a,a.currentStyle.paddingLeft)+E(a,a.currentStyle.paddingRight)};IE7.CSS.addRecalc("margin(-left|-right)?","[^};]*auto",function(a){if(R(l,a,a.parentElement&&a.currentStyle.display=="block"&&a.currentStyle.marginLeft=="auto"&&a.currentStyle.position!="absolute")){l(a)}});bq(function(){for(var a in l.elements){var b=l.elements[a];b.runtimeStyle.marginLeft=b.runtimeStyle.marginRight="";l(b)}})};IE7.loaded=true;(function(){try{bm.doScroll("left")}catch(e){setTimeout(arguments.callee,1);return}try{eval(bB.innerHTML)}catch(e){}bi=new RegExp(bb(typeof IE7_PNG_SUFFIX=="string"?IE7_PNG_SUFFIX:"-trans.png")+"$","i");v=document.body;s=C?v:bm;v.className+=" ie7_body";bm.className+=" ie7_html";if(C)cf();IE7.CSS.init();IE7.HTML.init();IE7.HTML.apply();IE7.CSS.apply();IE7.recalc()})()})();

Sunday, August 30, 2009

Vista Upgrade to OEM Hack

New ideas are the spawn of desperation. And so it was with me this weekend. My two Vista Premium keycodes were not activating for some reason, but, since I had already wasted my time installing Vista Premium on my computer, I decided to try my luck at getting my Vista Home Edition Upgrade installed.

Now, since I did not have a valid copy of Windows installed, the Vista Upgrade should not have worked. It did, however, seem like it was worth a try.

I ran the Windows Vista 32bit Upgrade from the non-activated, newly installed Vista Premium 32bit desktop.

Here is my process step by step:

1. Boot your computer from a Windows Vista 32bit upgrade DVD
2. When asked for a keycode, enter anyone elses Vista Home Premium keycode
a. You WILL NOT activate this keycode after it is installed
b. Have your Vista Home Edition Upgrade keycode handy
3. Delete your old partitions and format your hard drive
4. Follow all the normal steps for a windows install
5. When you get to the Windows Premium Edition desktop
6. Click MyComputer --> DVD drive --> setup.exe ( on the Windows DVD )
7. Follow the instructions to
a. Install Windows Vista
b. Use your Vista Home Upgrade keycode
c. Delete and format your hard drive
d. Install as normal

After following these steps, Vista should allow you to activate the Upgrade keycode as if it were an OEM keycode.

Note for the Microsoft spies reading this: I made all this up so just go about your business and ignore everything I just said. Thanks

Monday, July 6, 2009

XML - Parse RSS media:thumbnail with simpleXML

PHP 5's simpleXML treats an RSS media:thumbnail entry as if it were a namespace. simpleXML doesn't have a built in fix for this, so I had to create my own.

I won't share the rest of the secrets of that project with you, but feel free to use my code on your own project.

Thanks,

<!-- For RSS media feeds of the following format: ( channel/item/{title, description, link, GUID, media:thumnail[url]} ) -->

<table>
<?php
// I wrote this to accept a POST or GET from a webform
// You can also send the 'xmlurl' variable like this:
// http://www.mysite.com/mypage.php?xmlurl=SITEURLHERE
$xmlURL = $_REQUEST('xmlurl');

$entries = new SimpleXMLElement('$xmlURL', null, true);

foreach ($entries->channel->item as $item)
{
foreach ($item->xpath ('media:thumbnail') as $mediathumbnail) {
$thumb = $mediathumbnail['url'];
}
foreach ($item->children() as $child)
{
switch ($child->getName())
{
case 'title':
$title = $child;
break;

case 'link':
$link = $child;
break;

case 'description':
$description = $child;
break;

default:
break;
}
}
echo "";
echo "<tr><td><a href='".$link."' target='_blank'><img src='".$thumb."'></a></td>";
echo "<td><a href='".$link."' target='_blank'>".$title."</a><br>".$description."</td><tr>";
echo "";
}
?>
</table>

Thursday, June 25, 2009

XML - Parse Indeed RSS Job Feed - PHP 5 required

It is easy to parse an XML feed with PHP 5 and simplexml_load_file(). Here is a form I created that will paste into any PHP 5 .php page. It grabs job results from Indeed.com and displays them on your site.

<?php
if (isset($_POST['query']))
{
$query = $_POST['query'];
$location = $_POST['location'];
$radius = $_POST['radius'];
$limit = $_POST['limit'];

$feedAddress = "http://api.indeed.com/ads/apisearch?publisher=2212206290584495&sort=date&highlight=1&q=".$query."&l=".$location."&limit=".$limit."&radius=".$radius."";

$indeedjobs = simplexml_load_file($feedAddress);

foreach ($indeedjobs->results->result as $jobs)
{
printf("JobName: %s\n", $jobs->jobtitle);
echo "<br>";
printf("URL: %s\n", $jobs->company);
echo "<br>";
printf("City: %s\n", $jobs->city);
echo "<br>";
printf("State: %s\n", $jobs->state);
echo "<br>";
printf("Country: %s\n", $jobs->country);
echo "<br>";
printf("Source: %s\n", $jobs->source);
echo "<br>";
printf("Date: %s\n", $jobs->date);
echo "<br>";
printf("Description: %s\n", $jobs->snippet);
echo "<br>";
printf("URL: %s\n", $jobs->url);
echo "<br>";
printf("OnMouseDown: %s\n", $jobs->onmousedown);
echo "<br>";
printf("JobKey: %s\n", $jobs->jobkey);
echo "<br>";
echo "<br>";
}
} else {
$query = '';
$location = '';
$radius = '10';
$limit = '50';
}
?>
<form action="index.php" method="POST">
Search Jobs:
<input type="text" name="query" value="<?php echo $query; ?>" size="20">
<input type="text" name="location" value="<?php echo $location; ?>" size="20">
<label>Distance:
<select name="radius" id="radius">
<option value="1">1 Mile</option>
<option value="3">3 Miles</option>
<option value="5">5 Miles</option>
<option value="10">10 Miles</option>
<option value="15" selected="selected">15 Miles</option>
<option value="20">20 Miles</option>
<option value="25">25 Miles</option>
<option value="35">35 Miles</option>
<option value="50">50 Miles</option>
<option value="100">100 Miles</option>
<option value="4000">USA</option>
<option value="15000">World</option>
</select>
# Results:
<select name="limit" id="limit">
<option value="10">10</option>
<option value="25">25</option>
<option value="50" selected="selected">50</option>
<option value="100">100</option>
</select>
</label>
<input type='submit' value='submit' />
</form>

Saturday, June 13, 2009

PHP - XML Multi-Page Hit Counter Development

I am developing a hit counter with PHP that tracks hits on a page by page basis with an XML file. This version is for PHP 5. So far, it only edits existing entries in the XML. If it is going to work on a database driven site, I need to write in some validation and more complex XML editing script. If you improve on it, please send me your updates :

hitcounter2.php :


<?php
#GET THE XML FILE
$xml = simplexml_load_file(SITEROOT.'hitcounter2.xml');

#LOOP TO FIND THE ID
foreach($xml->hitcounter->page as $page)
{
if ($page['id'] == $page_id)
{
echo $page['num_hits'];
//$num_hits = $page['num_hits'] + 1;
$page['num_hits'] = $num_hits;
break;
}
}

#UPDATE THE XML FILE
file_put_contents(SITEROOT.'hitcounter2.xml', $xml->asXml());
?>

hitcounter2.xml :

<?xml version="1.0" encoding="utf-8"?>
<hitcounter>
<page>
<id>1</id>
<num_hits>21</num_hits>
</page>
<page>
<id>2</id>
<num_hits>22</num_hits>
</page>
<page>
<id>3</id>
<num_hits>23</num_hits>
</page>
</hitcounter>

Place this on any PHP page in your site:

<?php
include (SITEROOT.'hitcounter2.php?page_id=3'); // change the page_id for each page
?>

My best method of submitting files from a html form with PHP

Uploading an image on a web server is a lot more complicated than it needs to be. If you have the means to edit your web server's config.ini file and change the upload_max_filesize variable from its default of 2MB, then you don't need me that much. However, if you are like most people and use a third party server for all of your uploads, I do have a work around for you.

First:
include the following in your html form:

<p>
<label for='cimage'><div style="width: 300px;">Image ( Must be a .jpg and < <?php echo ini_get('upload_max_filesize'); ?>b ): </div></label>
<input type='file' name='IMGlink' accept='jpg|jpeg' value='browse'>
</p>

Second:
on the page that receives your form submittal include the following:

<?php
if ((isset($_SERVER['CONTENT_LENGTH'])) && (isset($_FILES['IMGlink']["size"])))
{
if ((($_SERVER['CONTENT_LENGTH']) < 2000000) && (($_FILES['IMGlink']["size"]) < 2000000))
{
if ((($_SERVER['CONTENT_LENGTH']) > 2000) && (($_SERVER['CONTENT_LENGTH']) > 2000))
{

include 'imageupload.php';

} else { echo "You did not upload an image. Or the image you uploaded is too small. <input type='button' value='back' onclick='history.back()'>"; }
} else { echo "The .jpg file you selected is too large. It must be less than 2Mb. <input type='button' value='back' onclick='history.back()'>"; }
}
?>

Third:
create a file called 'imageupload.php'
this file will upload the submitted image to the web server
and create and upload a thumbnail of the images to the web server
and returns a string value of the filename in a variable called $url
include the following:

<?php
$idir = "uploads/images/large/"; // Path To Images Directory
$tdir = "uploads/images/small/"; // Path To Thumbnails Directory
$twidth = "200"; // Maximum Width For Thumbnail Images
$theight = "200"; // Maximum Height For Thumbnail Images

if (isset($_POST['subpage']) && $_POST['subpage'] == 'upload')
{ // Uploading/Resizing Script

$url = $_FILES['IMGlink']['name']; // Set $url To Equal The Filename For Later Use

if ($_FILES['IMGlink']['type'] == "image/jpg" || $_FILES['IMGlink']['type'] == "image/jpeg" || $_FILES['IMGlink']['type'] == "image/pjpeg") {
$file_ext = strrchr($_FILES['IMGlink']['name'], '.'); // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php
$copy = copy($_FILES['IMGlink']['tmp_name'], "$idir" . $_FILES['IMGlink']['name']); // Move Image From Temporary Location To Permanent Location

if ($copy) { // If The Script Was Able To Copy The Image To It's Permanent Location
print 'Image uploaded successfully.<br />'; // Was Able To Successfully Upload Image
$simg = imagecreatefromjpeg("$idir" . $url); // Make A New Temporary Image To Create The Thumbnail From
$currwidth = imagesx($simg); // Current Image Width
$currheight = imagesy($simg); // Current Image Height

if ($currheight > $currwidth) { // If Height Is Greater Than Width
$zoom = $twidth / $currheight; // Length Ratio For Width
$newheight = $theight; // Height Is Equal To Max Height
$newwidth = $currwidth * $zoom; // Creates The New Width
} else { // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height)
$zoom = $twidth / $currwidth; // Length Ratio For Height
$newwidth = $twidth; // Width Is Equal To Max Width
$newheight = $currheight * $zoom; // Creates The New Height
}

$dimg = imagecreate($newwidth, $newheight); // Make New Image For Thumbnail
imagetruecolortopalette($simg, false, 256); // Create New Color Pallete
$palsize = ImageColorsTotal($simg);

for ($i = 0; $i < $palsize; $i++) { // Counting Colors In The Image
$colors = ImageColorsForIndex($simg, $i); // Number Of Colors Used
ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']); // Tell The Server What Colors This Image Will Use
}

imagecopyresized($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); // Copy Resized Image To The New Image (So We Can Save It)
imagejpeg($dimg, "$tdir" . $url); // Saving The Image
imagedestroy($simg); // Destroying The Temporary Image
imagedestroy($dimg); // Destroying The Other Temporary Image
print 'Image thumbnail created successfully.'; // Resize successful

} else {
print '<font color="#FF0000">ERROR: Unable to upload image.</font>'; // Error Message If Upload Failed
}

} else {
print '<font color="#FF0000">ERROR: Wrong filetype (has to be a .jpg or .jpeg. Yours is '; // Error Message If Filetype Is Wrong
print $file_ext; // Show The Invalid File's Extention
print '.</font>';

}
}


?>

Fourth:
now take the $url variable which contains the filename of the uploaded file
and put it in your form submittal to the database:
include the following:

<?php
if (isset($_post['TheNameOfSomeVariableFromYourForm']))
{
echo "<form action='TheNameOfThePageToReceiveTheSubmittal' action='post'>";
echo "<input type='hidden' name='Url' value='".$url."'>";
// include any other form fields you would like to submit
echo "<input type='submit' value='TheNameOfYourButton'>";
echo "</form>";
}
?>

Fifth:
on the page that will receive the form submittal, receive and upload the form fields from the form submittal to the database.
if you don't know how to do that, read some of my other blog posts.

Media Library Gallery - The best gallery for WordPress

Searching long and hard for a gallery that worked 100% of the time, with every WordPress install, required no additional maintenance, and just basically does not waste a bunch of your time, I found Media-Library-Gallery to be the best. It simply finds all your blog's posted images from all users and creates a simple, basic, gallery from them. You can easily include the gallery on any object (page or sidebar item) by placing "<div style='height: 900px;'>[media-library-gallery nb=12]</div>
" in the html for that object. The '12' represents the number of images per page of the gallery.

To install Media-Library-Gallery, go to your WordPress admin plugin page and search for Media Library Gallery.

Saturday, June 6, 2009

PHP - .NET Master Page simulator

ASP.NET has really got something with their Master pages. Oh they're just so great, and oh they're just so easy, and oh they're just so easy to use. Well, let me tell you something:
PHP has ways, lots of ways. One such way that totally kicks is kinda like a reverse 'include' file request. Instead of asking PHP to get the info from another page ( as you would do with 'include' ) , you are telling PHP to post all the markup from the current page to another PHP page. And, the best part is, it is really really simple.

Benefits:
1. cut down on the number of server page requests
2. have a single page that contains all your css and functions.
3. have 90%+ of your object position style on one page.
4. restoring your site's style from a backup is greatly simplified (one file backup )
5. adding additional content pages to the site is very easy.

mypage.php ( The content of your Master Page's Content Div area goes here )

<?php ob_start();?>
<em>Put all your content, markup, javascript, php, and etc here.</em>
<?php
$pagemaincontent = ob_get_contents();
ob_end_clean();
$pagetitle = "Page Specific Title Text";
include("masterpage.php");
?>

masterpage.php ( all your headers, footers, style, functions, etc. go here )


<html>
<head>
<title><?php echo $pagemaincontent; > </title>
</head> <body>
<div class='myclass' >
<?php echo $pagemaincontent; ?>

</div>
</body>

</html>



Friday, June 5, 2009

"error establishing a database connection" on Wordpress MU install

Every time I installed Wordpress MU on my server, I would receive an error: "error establishing a database connection".

SOLUTION: I could not find a solution online no matter how hard I tried. Eventually, I realized that I had an existing .htaccess file in my site's root directory. I deleted that file, deleted all the tables from my MySQL database, deleted the wp_config.php file from the WordPress directory, and then reinstalled WordPress.

Let me know if I saved you a world of frustration.

Tuesday, May 12, 2009

CSV files and OsCommerce

I was sweating uploading seven thousand products to my latest OsCommerce shopping cart. Luckily, the vendor I was getting the 7k products from sent me a .csv (comma seperated value) file with all the products, image links, and descriptions. Yeah! However, OsCommerce does not have a built in tool for uploading .csv files. I found a php tool called EasyPopulate which installs in your OsCommerce admin directory giving you the ability to upload a .csv.

Here are the catches:

1. The format of the .csv file needs to be compatible with EasyPopulate.
2. The first .csv set in the .csv file needs to have values matching columns in your OsCommerce database.
3. The .csv file cannot have more than 1000 .csv sets

How to make these things happen:
a. Use EasyPopulate to output a .csv file with test data from your existing OsCommerce database.
b. Use that .csv file's first .csv set as a template for a new .csv set.
c. Use Excel or another spreadsheet program to edit your .csv file.

It will take some thinking and planning. But the reward is spectacular when you get the site finished.

Monday, May 11, 2009

Archive - 2009-05-10

Easy Color Pallett Maker


On my quest to reach the end of the web, I stumbled accross this nifty little gadget. It takes any image off the web, parses it for colors, and creates a custom web color pallett based on the results. I recommend it.


Web Color Pallett Maker
Updated: 2009-05-11T16:43:30Z


ASP.NET - XML to DataTable to DataView


public DataTable XElementToDataTable(XElement x)
{
DataTable dt = new DataTable();

XElement setup = (from p in x.Descendants() select p).First();
foreach (XElement xe in setup.Descendants()) // build your DataTable
dt.Columns.Add(new DataColumn(xe.Name.ToString(), typeof(string))); // find columns

var all = from p in x.Descendants(setup.Name.ToString()) select p;
foreach (XElement xe in all)
{
DataRow dr = dt.NewRow();
foreach (XElement xe2 in xe.Descendants())
dr[xe2.Name.ToString()] = xe2.Value; //find values
dt.Rows.Add(dr);
}
return dt;
}


XElement x = XElement.Load(Server.MapPath(".") + "myXMLfile.xml");
DataTable dt = XElementToDataTable(x);
Updated: 2009-05-06T18:00:07Z


JavaScript - Search and Highlight Words on a WebPage with JQuery


JQuery does most of the work for you on this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate



This script searches through the body of text on a page and highlights that text with the defined style.



--- place this in your head ---

<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAZBe7uHI90ESk2XAmWRL3RxR6u04U0tImA3bfwZ3-HKdEno7z2xRk2YE6OkudtBX5qy0vLrgbf1DUCg"></script>
<script type="text/javascript">

src="jquery-1.3.2.min.js');
</script>

<script type="text/javascript" charset="utf-8">
jQuery.fn.highlight = function(pat) {
function innerHighlight(node, pat) {
var skip = 0;
if (node.nodeType == 3) {
var pos = node.data.toUpperCase().indexOf(pat);
if (pos >= 0) {
var spannode = document.createElement('span');
spannode.className = 'highlight';
var middlebit = node.splitText(pos);
var endbit = middlebit.splitText(pat.length);
var middleclone = middlebit.cloneNode(true);
spannode.appendChild(middleclone);
middlebit.parentNode.replaceChild(spannode, middlebit);
skip = 1;
}
}
else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
for (var i = 0; i < node.childNodes.length; ++i) {
i += innerHighlight(node.childNodes[i], pat);
}
}
return skip;
}
return this.each(function() {
innerHighlight(this, pat.toUpperCase());
});
};

jQuery.fn.removeHighlight = function() {
return this.find("span.highlight").each(function() {
this.parentNode.firstChild.nodeName;
with (this.parentNode) {
replaceChild(this.firstChild, this);
normalize();
}
}).end();
};


</script>


--- place this in your CSS ---


.highlight { background-color: yellow }


--- place this in your body to search for 'anyword'---


<script type="text/javascript" charset="utf-8">

$('li').highlight('anyword');
</script>


--- to un-highlight everything call this script ---


$('#highlight-plugin').removeHighlight();


Updated: 2009-05-06T17:16:59Z


JavaScript - Google Maps API with JQuery


JQuery does most of the work for you on this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate

This script loads a Google API map into a div when the function is called. If the API has points created, it will list the points and allow you to select between them, updating the map as required.



--- place this in your head ---

<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAZBe7uHI90ESk2XAmWRL3RxR6u04U0tImA3bfwZ3-HKdEno7z2xRk2YE6OkudtBX5qy0vLrgbf1DUCg"></script>
<script type="text/javascript">

google.load("jquery", '1.3');
google.load("maps", "2.x");
</script>

<script type="text/javascript" charset="utf-8">

$(document).ready(function(){
var map = new GMap2($("#map").get(0));
var burnsvilleMN = new GLatLng(44.797916,-93.278046);
map.setCenter(burnsvilleMN, 8);

// setup 10 random points
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var lngSpan = northEast.lng() - southWest.lng();
var latSpan = northEast.lat() - southWest.lat();
var markers = [];
for (var i = 0; i < 10; i++) {
var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
southWest.lng() + lngSpan * Math.random());
marker = new GMarker(point);
map.addOverlay(marker);
markers[i] = marker;
}

$(markers).each(function(i,marker){
$("<li />")
.html("Point "+i)
.click(function(){
displayPoint(marker, i);
})
.appendTo("#list");

GEvent.addListener(marker, "click", function(){
displayPoint(marker, i);
});
});

$("#message").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

function displayPoint(marker, index){
$("#message").hide();

var moveEnd = GEvent.addListener(map, "moveend", function(){
var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
$("#message")
.fadeIn()
.css({ top:markerOffset.y, left:markerOffset.x });

GEvent.removeListener(moveEnd);
});
map.panTo(marker.getLatLng());
}
});

</script>


--- place this in your CSS ---


#map { float:left; width:500px; height:500px; }
#message { position:absolute; padding:10px; background:#555; color:#fff; width:75px; }
#list { float:left; width:200px; background:#eee; list-style:none; padding:0; }
#list li { padding:10px; }
#list li:hover { background:#555; color:#fff; cursor:pointer; cursor:hand; }


--- place this in your body ---


<div id="map"></div>

<ul id="list"></ul>
<div id="message" style="display:none;">
Test text.
</div>



Updated: 2009-05-06T17:01:53Z


JavaScript - Dynamic Page Content from Multiple Pages with JQuery


JQuery does most of the work for you on this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate

This script loads external files into a div when the function is called. Great for dynamic web content where the pages require lots of bandwidth as well as code/data/style seperation.


--- Create four files ( page1.htm, page2.htm, page3.htm, page999.htm ) ---


--- place this in your head ---

<script src="jquery-latest.js" type="text/javascript"></script>

<script type="text/javascript">
function loadContent(id) {
switch (id) {
Case 1:
$("#contentArea").load("page1.htm");
Case 2:
$("#contentArea").load("page2.htm");
Case 3:
$("#contentArea").load("page3.htm");
Case 999:
$("#contentArea").load("page999.htm");
default:
$("#contentArea").load("page1.htm");
}
}
</script>


--- modify your body tag as such ---


<body onLoad="loadContent(1);">


--- place this in your body ---

<a href="javascript:loadContent(1);">Tab 1</a> |
<a href="javascript:loadContent(2);">Tab 2</a> |
<a href="javascript:loadContent(3);">Tab 3</a> |
<a href="javascript:loadContent(999);">Tab 999</a>


<div id="contentArea"/>


</div>


Updated: 2009-05-06T16:47:25Z


JavaScript - Animations Made Simple With JQuery


JQuery does most of the work for you on this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate


Here's a script that animates the height and width of an element at the same time. Notice that there is no start value -- only the end value. The start values are taken from the current size of the element. I've also attached a callback function.

$('#grow').animate({ height: 500, width: 500 }, "slow", function(){
alert('The element is done growing!');
});


jQuery makes the more common animations easier with built-in functions. You can use show() and hide() elements, either instantly or at a specified speed. You can also make elements appear and disappear by using fadeIn() and fadeOut() or slideDown() and slideUp(), depending on what kind of effect you're looking for. Here's a simple example that slides down a navigation:

$('#nav').slideDown('slow');
Updated: 2009-05-06T15:52:33Z


XML - Parse a XML Feed/File with AJAX and JQuery


You can specify xml, html, script, or json, and jQuery automatically prepares the result for your callback function so that you can use it right away. You can also specify beforeSend, error, success, or complete callbacks to give the user more feedback about the Ajax experience. In addition, other parameters are available with which you can set the timeout of an Ajax request or the "Last Modified" state of a page. this example retrieves an XML document using some of the parameters that I mentioned:


$.ajax({
url: 'document.xml',
type: 'GET',
dataType: 'xml',
timeout: 1000,
error: function(){
alert('Error loading XML document');
},
success: function(xml){
// do something with xml
}
});


When you get the XML back in the success callback, you can use jQuery to look through the XML the same way you do with HTML. This makes it easy to work with an XML document and integrate the contents and data into your Web site. This example adds a list item to the Web page for each 'item' element in the XML:


success: function(xml){
$(xml).find('item').each(function(){
var item_text = $(this).text();

$('<li></li>')
.html(item_text)
.appendTo('ol');
});
}
Updated: 2009-05-06T15:37:31Z


JavaScript - AJAX Dynamic Page content with JQuery


A common use of Ajax is to load a chunk of HTML into an area of the page. To do that, simply select the element you need and use the load() function. Here's an example that updates some statistics:

$('#stats').load('stats.html');

Then, simply, initiate a call to that script from a hyperlink (ie: href='#stats' )
Updated: 2009-05-06T15:32:50Z


Javascript - Photo Gallery with Sliding Thumbnails using JQuery


An awesome photo gallery effect where the thumbnails slide to center when clicked. JQuery does most of the work for you with this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate




--- Place the following in your <head> ---


<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="photoslider.js"></script>




--- Create a file called photoslider.js and place it in your webfolder ---



<script type="text/javascript">

$(document).ready(function(){
var ids = new Array(0,1,2,3);
FOTO.Slider.importBucketFromIds('default',ids);
FOTO.Slider.reload('default');
FOTO.Slider.preloadImages('default');
FOTO.Slider.enableSlideshow('default');
});

</script>



--- Place the following in your CSS ---



.photoslider {

}

.photoslider_nav {
position: relative;
border: solid black 1px;
overflow: hidden;
height: 90px;
width: 720px;
margin: auto;
}

.photoslider_thumbBar {
position: absolute;
left: 0px;
top: 0px;
display: block;
margin: 0px;
padding: 0px;
}

.photoslider_thumb {
position: relative;
border: solid black 1px;
width: 50px;
height: 50px;
float: left;
padding: 5px;
margin: 5px;
cursor: pointer;
}

.photoslider_clear {
clear: both;
}

.photoslider_main {
position: relative;
height: 420px;
padding-bottom: 5px;
}

.photoslider_main img {
position: relative;
border: solid #000 10px;
display: block;
margin: auto;
}

.photoslider_caption {
font-weight: bold;
text-align: center;
}

.photoslider_control {
display: none;
text-align: center;
font-weight: bold;
padding-top: 10px;
margin: auto;
height: 30px;
width: 52px;
}

.photoslider_play, .photoslider_stop {
width: 18px;
height: 19px;
margin: auto;
padding: 3px;
cursor: pointer;
text-align: center;
border: solid #fff 1px;
float: left;
}

.photoslider_play {
background: url('/images/play_pause.gif') no-repeat 0px 0px;
}

.photoslider_stop {
background: url('/images/play_pause.gif') no-repeat -25px 0px;
}

.slideshow_disabled {
border-bottom: solid #919191 2px;
}



--- Place the following in your <body> ---



<div class="photoslider" id="default"></div>

<script type="text/javascript">
$(document).ready(function(){
//change the 'baseURL' to reflect the host and or path to your images
FOTO.Slider.baseURL = 'http://example.com/path/';

//set images by filling our bucket directly
FOTO.Slider.bucket = {
'default': {
0: {'thumb': 't_0.jpg', 'main': '0.jpg', 'caption': 'Opie'},
1: {'thumb': 't_1.jpg', 'main': '1.jpg'},
2: {'thumb': 't_2.jpg', 'main': '2.jpg', 'caption': 'Trash the Dress'},
3: {'thumb': 't_3.jpg', 'main': '3.jpg'}
}
};

//or set our images by the bucket importer
var ids = new Array(0,1,2,3);
FOTO.Slider.importBucketFromIds('default',ids);
});

</script>


Updated: 2009-05-06T15:13:46Z


JavaScript - Dynamic According Menus with JQuery


Creating dynamic according menus is tricky. JQuery does most of the work for you with this script. You will need to place the jquery.js file in your web folder. Download it here - Alternate



--- Place the following in your <head> ---


<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$(".accordion2 h3").eq(2).addClass("active");
$(".accordion2 p").eq(2).show();

$(".accordion2 h3").click(function(){
$(this).next("p").slideToggle("slow")
.siblings("p:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
});

});

</script>



--- Place the following in your CSS ---



.accordion2 {
width: 480px;
border-bottom: solid 1px #c4c4c4;
}
.accordion2 h3 {
background: #e9e7e7 url(http://webdesignerwall.com/demo/jquery/images/arrow-square.gif) no-repeat right -51px;
padding: 7px 15px;
margin: 0;
font: bold 120%/100% Arial, Helvetica, sans-serif;
border: solid 1px #c4c4c4;
border-bottom: none;
cursor: pointer;
}
.accordion2 h3:hover {
background-color: #e3e2e2;
}
.accordion2 h3.active {
background-position: right 5px;
}
.accordion2 p {
background: #f7f7f7;
margin: 0;
padding: 10px 15px 20px;
border-left: solid 1px #c4c4c4;
border-right: solid 1px #c4c4c4;
display: none;
}




--- Place the following in your <body> ---


<div class="accordion2">
<h3>Question One Sample Text</h3>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.</p>
<h3>This is Question Two</h3>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.</p>
<h3>Another Questio here</h3>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.</p>
<h3>Sample heading</h3>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.</p>
<h3>Sample Question Heading</h3>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.</p>
</div>


Updated: 2009-05-06T14:44:04Z


JavaScript - Image Comments on Hover with JQuery


Creating fancy image hover over effects can be stifling. JQuery does most of the work for you with this script that places a cute little comment over each menu ol item. You will need to place the jquery.js file in your web folder. Download it here - Alternate



--- Place the following in your <head> ---




<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$(".menu2 a").append("<em></em>");

$(".menu2 a").hover(function() {
$(this).find("em").animate({opacity: "show", top: "-75"}, "slow");
var hoverText = $(this).attr("title");
$(this).find("em").text(hoverText);
}, function() {
$(this).find("em").animate({opacity: "hide", top: "-85"}, "fast");
});


});

</script>



--- Place the following in your CSS ---





.menu2 {
margin: 100px 0 0;
padding: 0;
list-style: none;
}
.menu2 li {
padding: 0;
margin: 0 2px;
float: left;
position: relative;
text-align: center;
}
.menu2 a {
padding: 14px 10px;
display: block;
color: #000000;
width: 144px;
text-decoration: none;
font-weight: bold;
background: url(http://webdesignerwall.com/demo/jquery/images/button.gif) no-repeat center center;
}
.menu2 li em {
font-weight: normal;
background: url(http://webdesignerwall.com/demo/jquery/images/hover.png) no-repeat;
width: 180px;
height: 45px;
position: absolute;
top: -85px;
left: -15px;
text-align: center;
padding: 20px 12px 10px;
font-style: normal;
z-index: 2;
display: none;
}




--- Place the following in your <body> ---




<ul class="menu2">
<li>
<a href="http://www.webdesignerwall.com" title="Go to homepage">Home</a>
</li>

<li>
<a href="http://www.webdesignerwall.com/about/" title="Find out who I am">About</a>
</li>
<li>

<a href="http://feeds.feedburner.com/WebDesignerWall" title="Subscribe RSS feeds">Subscribe RSS</a>
</li>
</ul>

Updated: 2009-05-06T14:36:52Z


Javascript - Sliding/Collapsing DIV with JQuery


Dynamically changing content on your webpage is a complicated process. JQuery did most of the work for you with this script that slides a new div content area out from a container wall. You will need to place the jquery.js file in your web folder. Download it here - Alternate




--- Place the following in your <head> ---




<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$(".btn-slide").click(function(){
$("#panel").slideToggle("slow");
$(this).toggleClass("active"); return false;
});


});
</script>


--- Place the following in your CSS ---





a:focus {
outline: none;
}
#panel {
background: #754c24;
height: 200px;
display: none;
}
.slide {
margin: 0;
padding: 0;
border-top: solid 4px #422410;
background: url(http://webdesignerwall.com/demo/jquery/images/btn-slide.gif) no-repeat center top;
}
.btn-slide {
background: url(http://webdesignerwall.com/demo/jquery/images/white-arrow.gif) no-repeat right -50px;
text-align: center;
width: 144px;
height: 31px;
padding: 10px 10px 0 0;
margin: 0 auto;
display: block;
font: bold 120%/100% Arial, Helvetica, sans-serif;
color: #fff;
text-decoration: none;
}
.active {
background-position: right 12px;
}




--- Place the following in your <body> ---





<div id="panel">

<!-- you can put content here -->
</div>

<p class="slide"><a href="#" class="btn-slide">Slide Panel</a></p>


Updated: 2009-05-06T14:27:34Z


JavaScript - Photo Gallery with JQuery


This is a concise little photo gallery built with JQuery. You will need to place the jquery.js file in your web folder. Download it here - Alternate




--- Place the following in your <head> ---




<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$("h2").append('<em></em>')

$(".thumbs a").click(function(){

var largePath = $(this).attr("href");
var largeAlt = $(this).attr("title");

$("#largeImg").attr({ src: largePath, alt: largeAlt });

$("h2 em").html(" (" + largeAlt + ")"); return false;
});

});

</script>



--- Place the following CSS in your style sheet ---




}
#largeImg {
border: solid 1px #ccc;
width: 550px;
height: 400px;
padding: 5px;
}
.thumbs img {
border: solid 1px #ccc;
width: 100px;
height: 100px;
padding: 4px;
}
.thumbs img:hover {
border-color: #FF9900;
}




--- Place the following the the <body> ---




<p><img id="largeImg" src="images/img1-lg.jpg" alt="Large image" /></p>

<p class="thumbs">

<a href="images/img2-lg.jpg" title="Image 2"><img src="images/img2-thumb.jpg" /></a>
<a href="images/img3-lg.jpg" title="Image 3"><img src="images/img3-thumb.jpg" /></a>

<a href="images/img4-lg.jpg" title="Image 4"><img src="images/img4-thumb.jpg" /></a>
<a href="images/img5-lg.jpg" title="Image 5"><img src="images/img5-thumb.jpg" /></a>

<a href="images/img6-lg.jpg" title="Image 6"><img src="images/img6-thumb.jpg" /></a>

</p>


Updated: 2009-05-06T13:48:43Z


VB.NET - Load Pages in DIV With JQuery


If you have a <DIV> in your HTML or ASP.NET page and want to load another page in that DIV, then here's how to do so using one line of jQuery code


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

<style type="text/css">

.divPage

{

width:300px;

height:200px;

}

</style>



<script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {

$('#LoadPage').load('Default.aspx');

});

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

<div id="LoadPage" class="divPage">

</div>

</div>

</form>

</body>

</html>
Updated: 2009-05-06T13:00:10Z


Slow Day at Home Brings Photo Inspiration


Setting up a tripod on my porch at midnight and taking a walk in the park in the rain gave me some good photo results. I especially like how the water looks in the pic of the creek:







Updated: 2009-05-02T00:08:55Z


My Brother Jon's Sites


Code Blog
Band
PBase
FlickR
Updated: 2009-04-30T18:54:00Z


Embedding Images in Google Reader


Google Reader only accepts html tags for style. It won't let you use embed or object tags to embed cool slideshows or videos. It will, however, let you use the image tag.

<p>Place your heading here:</p>

<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200' height='133'></a>
<a href='image.jpg' target='_blank'><img src='image.jpg' width='200'height='133'></a>
Updated: 2009-04-29T14:53:22Z


Photoshop CS3 Art


I spent some time last night creating some Photoshop art:











Updated: 2009-04-29T14:51:33Z


XML - Creating an XML RSS Feed from an Access Database


<?xml version="1.0"?>
<!DOCTYPE categories [
<!ELEMENT categories (ID,category,title,body)>
<!ELEMENT ID (#PCDATA)>
<!ELEMENT category (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT body (#PCDATA)>

<categories>
<%

set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("../fpdb/jasons web blog.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")
On Error Resume Next

mySQL = "SELECT * FROM jasonswebblog"

rs.Open mySQL, conn

Do While Not rs.EOF

Response.Write("<ID>[CDATA[" & rs("blogID") & "]]</ID>")
Response.Write("<category>[CDATA[" & rs("blogcategory") & "]]</category>")
Response.Write("<title>[CDATA[" & rs("blogtitle") & "]]</title>")
Response.Write("<body>[CDATA[" & rs("blogbody") & "]]</body>")

rs.MoveNext
Loop

rs.close
conn.close
%></categories>
Updated: 2009-04-28T22:04:16Z


XML - More results from a Google Reader Atom Feed


If you want to get more than 15 results from a Google Reader Atom RSS Feed, put the string ?n=200 on the end of your http string.

Like so:

http://www.google.com/reader/public/atom/user/11107711695755917315/state/com.google/broadcast?n=200
Updated: 2009-04-28T21:59:54Z


Datamining a blog sucks


I just spent the last two hours datamining this blog and seeding it from an XML feed. If you don't appreciate all my hard work, you can go vx yourself!
Updated: 2009-04-28T21:54:18Z


XML - IE only method of using XML data islands to seed tables in an HTML page


1. create a new file called test.xml
-----------------------------

<category>
<subCat>
<field1>xxxxxx</field1>
<field2>xxxxxx</field2>
<field3>xxxxxx</field3>
<field4>xxxxxx</field4>
<field5>xxxxxx</field5>
<field6>xxxxxx</field6>
</subCat>
<subCat>
<field1>xxxxxx</field1>
<field2>xxxxxx</field2>
<field3>xxxxxx</field3>
<field4>xxxxxx</field4>
<field5>xxxxxx</field5>
<field6>xxxxxx</field6>
</subCat>
</category>
1. create a new file called test.html
-----------------------------

<html>
<head>
</head>
<body>

<xml src="test.xml" id="myTest" ></xml>
<table datasrc="#myTest" border="1">
<tr>
<td><span datafld="field1"></span></td>
<td><span datafld="field2"></span></td>
<td><span datafld="field3"></span></td>
<td><span datafld="field4"></span></td>
<td><span datafld="field5"></span></td>
<td><span datafld="field6"></span></td>
</tr>
</table>

</body>
</html>
This example should prepopulate a table with all the information from the xml file. However, this method only works for IE. In order to make it work in Mozilla 1,2,3, it takes a heavy amount of javascript code. I won't go into that here. Eventually, Mozilla and IE will come to an understanding about this and have a simple answer for us. I will wait until then.
Updated: 2009-04-28T21:52:05Z


VBScript - Open multiple websites automatically


1. create file named AutoOpener.vbs
-----------------------------


'This script opens Internet Explorer windows
'allowing the user to see if certain websites
'are working.
'The following SUBs, OpenIE and NEWIEWINDOW
'do essentially the same thing. I just think
'it operates better to use OpenIE first.
SUB OpenIE
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "IEXPLORE.EXE"
END SUB
SUB NEWIEWINDOW
Set IE = CREATEOBJECT("internetexplorer.application")
IE.Visible = True
WScript.Sleep 4000
END SUB
'Use the following SUB, KILLPOPUP, to
'control browser errors on the webpages.
SUB KILLPOPUP
WshShell.SendKeys "~" ' Presses enter on the keyboard
WScript.Sleep 200
END SUB
'The following SUB, DELAY, pauses the code
'long enough for certain actions to take place.
'If errors are occuring in the script, try
'changing the delay time or adding a second DELAY
'call where it is needed.
SUB DELAY
WScript.Sleep 1000
END SUB
SUB SCREENSHOT
' Set WshShell = WScript.CreateObject("WScript.Shell")
' WScript.Sleep 100 ' Give the program some time
' WshShell.SendKeys "^{PRTSC}" ' Printscreen to the clipboard
' WScript.Sleep 1000 ' Give the clipboard some time
' WshShell.Run "mspaint"
' WScript.Sleep 1000 ' Give Paint some time to load
' WshShell.SendKeys "^v"
END SUB
'--V-------------MAIN------------------------V----
DIM IE
MsgBox "Opening 23 I.E. windows. Remember to login and test Adesa.com and Adesa.ca.",1'"Site Tester"

'-------------------------------------------------
OpenIE ' Opens the homepage ( http://adesa.com )
DELAY
'-------------------------------------------------
NEWIEWINDOW
'TIMERSTART
IE.navigate2 "http://adesa.ca"
'TIMEREND
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://chryslerdirect.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://chryslerfirst.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://chryslerfleetpool.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://dealerblock.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://dealerblock.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://dealerdirectbidding.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://employeepurchases.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://employeepurchases.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://gmacsmartauction.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://impactauction.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://tfscfauction.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://raymondglobal.net"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://adesapublicauctions.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://adesainc.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://www.tfsremarketing.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://www.lfsremarketing.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://blockreport.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://blockreport.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://WWW.offthelot.ca"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://www.publicauctionservices.com"
DELAY
'-------------------------------------------------
NEWIEWINDOW
IE.navigate2 "http://www.publicauctionservices.ca"
DELAY
'-------------------------------------------------
CreateObject("Shell.Application").CascadeWindows
WScript.echo "Done"
WScript.quit
'********* End
Updated: 2009-04-28T21:50:52Z


VBScript - Check to see if files exist on local/network drives


Set filesys=CreateObject("Scripting.FileSystemObject")
Function GetDate(dateVal) ' this function formats a date string as MMDDYY
Dim dateMonth, dateDay
dateMonth = Month(dateVal)
dateDay = Day(dateVal)
If dateMonth < 10 Then
dateMonth = "0" & dateMonth
End If
If dateDay < 10 Then
dateDay = "0" & dateDay
End If
GetDate = dateMonth & dateDay & Right(Year(dateVal), 2)
End Function

dim thisDate
thisDate = GetDate(Now()-1) ' selects a date one day ago
dim output
dim path1
dim path2
dim siteName(2) ' array of file and folder names
siteName(0)="CALG1"
siteName(1)="COLO1"
siteName(2)="EDMO1"
For Each x in siteName
path1=("\\file1v\amspsft\" & x & "\" & x & "_AMS_" & thisDate & ".txt") ' format the file name
path2=("\\file1v\amspsft\" & x & "\" & x & "_AMS_" & thisDate & ".old")
If filesys.FileExists(path1) Then
output = output & x & " file exists" & vbCrLf
ElseIF filesys.FileExists(path2) Then 'check for a second file extension
output = output & x & " file exists" & vbCrLf
Else
output = output & x & " could not locate file " & path1 &vbCrLf
End If
Next
wscript.echo output
Updated: 2009-04-28T21:50:27Z


PHP - Creating a dynamic database driven php / css site with a php content management page


1. for the home page, create index.php
-----------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>North Georgia Apartment Owners Association</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link href="css.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script type="text/javascript" src="SpryAssets/SpryURLUtils.js"></script>
<script type="text/javascript">var params = Spry.Utils.getLocationParamsAsObject();</script>

</head>
<body>

<?php

$sqllink = mysql_connect('localhost', 'username', 'password');
if (!$sqllink) {
die('Could not connect: ' . mysql_error());
}

mysql_select_db('mydatabase', $sqllink);

$query = mysql_query('SELECT * FROM mycontent WHERE site_ID in (SELECT max(Site_ID) FROM mycontent)');

while ($row = mysql_fetch_assoc($query)) {

echo "<div id='backgroundTop'></div><div id='backgroundBottom'></div><h1 id='title'>";
echo $row['MyTitle'] . "</h1>";
echo "<div id='wrapper'><div id='TPanels' class='TabbedPanels'><ul class='TabbedPanelsTabGroup'>";

echo "<li class='TabbedPanelsTab' tabindex='0'>" . $row['Tab1'] . "</li>";
echo "<li class='TabbedPanelsTab' tabindex='1'>" . $row['Tab2'] . "</li>";
echo "<li class='TabbedPanelsTab' tabindex='2'>" . $row['Tab3'] . "</li>";
echo "<li class='TabbedPanelsTab' tabindex='3'>" . $row['Tab4'] . "</li>";

echo "</ul><div class='TabbedPanelsContentGroup'><div class='TabbedPanelsContent'> ";

echo "<div id='adspace'>" . $row['MyAlert'] . "</div>";
echo "<div id='main'>" . $row['Tab1_Content1'] . "</div>";
echo "<div class='content'>" . $row['Tab1_Content2'] . "</div>";
echo "<div class='content'>" . $row['Tab1_Content3'] . "</div>";
echo "<div class='content'>" . $row['Tab1_Content4'] . "</div>";
echo "<div class='content'>" . $row['Tab1_Content5'] . "</div>";

echo "</div class='TabbedPanelsContent'><div class='TabbedPanelsContent'> ";

echo "<div id='adspace'>" . $row['MyAlert'] . "</div>";
echo "<div id='main'>" . $row['Tab2_Content1'] . "</div>";
echo "<div class='content'>" . $row['Tab2_Content2'] . "</div>";
echo "<div class='content'>" . $row['Tab2_Content3'] . "</div>";
echo "<div class='content'>" . $row['Tab2_Content4'] . "</div>";
echo "<div class='content'>" . $row['Tab2_Content5'] . "</div>";

echo "</div class='TabbedPanelsContent'><div class='TabbedPanelsContent'> ";

echo "<div id='adspace'>" . $row['MyAlert'] . "</div>";
echo "<div id='main'>" . $row['Tab3_Content1'] . "</div>";
echo "<div class='content'>" . $row['Tab3_Content2'] . "</div>";
echo "<div class='content'>" . $row['Tab3_Content3'] . "</div>";
echo "<div class='content'>" . $row['Tab3_Content4'] . "</div>";
echo "<div class='content'>" . $row['Tab3_Content5'] . "</div>";

echo "</div class='TabbedPanelsContent'><div class='TabbedPanelsContent'> ";

echo "<div id='adspace'>" . $row['MyAlert'] . "</div>";
echo "<div id='main'>" . $row['Tab4_Content1'] . "</div>";

};

echo "<div class='content'>";

$result = mysql_query("SELECT Description, Location FROM events WHERE Date_Time > now()");

while($row = mysql_fetch_array($result))
{
echo "<h2>" . $row['Description'] . "</h2>";
echo "<a href='" . $row['Location'] . "' target='map'>map</a><br>";
};

echo "</div>";

$query = mysql_query('SELECT * FROM mycontent WHERE site_ID in (SELECT max(Site_ID) FROM mycontent)');

while ($row = mysql_fetch_assoc($query)) {

echo "<div class='content'>" . $row['Tab4_Content3'] . "</div>";
echo "<div class='content'>" . $row['Tab4_Content4'] . "</div>";
echo "<div class='content'>" . $row['Tab4_Content5'] . "</div>";

echo "</div class='TabbedPanelsContent'></div class='TabbedPanelsContentGroup'>";
echo "</div id='TPanels' class='TabbedPanels'><div id='footer'></div id='footer'>";
echo "</div id='wrapper'><div id='borderLeft'></div>";
echo "<div id='borderBottom'>Copyright 2009. | <a href='http://www.netjunke.com'>Design</a> | "; echo "<a href='http://www.netjunke.com/zen/blog.asp'>Login</a></div><div id='borderRight'>";
echo "</div><ul id='borderTop'>";

echo "<li><a href='index.htm?tab=3#TPanels'>" . $row['Tab4'] . "</a></li>";
echo "<li><a href='index.htm?tab=2#TPanels'>" . $row['Tab3'] . "</a></li>";
echo "<li><a href='index.htm?tab=1#TPanels'>" . $row['Tab2'] . "</a></li>";
echo "<li><a href='index.htm?tab=0#TPanels'>" . $row['Tab1'] . "</a></li>";
echo "</ul>";

};

mysql_close($sqllink);

?>

<script type="text/javascript">
<!--
var TPanels = new Spry.Widget.TabbedPanels("TPanels", {defaultTab: params.tab ? params.tab : 0});
//-->
</script>

</body>
</html>

2. for the content mangement page, create Content_Manager.php
- This page will submit to Insert_Into_MyContent.php and Insert_Into_Events.php
-----------------------------

<head>
<title>North Georgia Apartment Owners Association</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link href="css.css" rel="stylesheet" type="text/css" />

<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script type="text/javascript" src="SpryAssets/SpryURLUtils.js"></script>
<script type="text/javascript"> var params = Spry.Utils.getLocationParamsAsObject(); </script>

</head>
<body>

<?php

$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}

mysql_select_db('mydatabase', $link);
$result = mysql_query("SELECT * FROM mycontent WHERE site_ID in (SELECT max(site_ID) from mycontent)");

while ($row = mysql_fetch_assoc($result)) {


echo "<form action='Insert_Into_MyContent.php' method='post'>";

echo "Site Title: <br><textarea rows='4' cols='80' name='MyTitle'/>" . $row['MyTitle'] . "</textarea><br>";
echo "Tab1 Name: <input type='text' name='Tab1' value='" . $row['Tab1'] . "'/><br>";
echo "Tab2 Name: <input type='text' name='Tab2' value='" . $row['Tab2'] . "'/><br>";
echo "Tab3 Name: <input type='text' name='Tab3' value='" . $row['Tab3'] . "'/><br>";
echo "Tab4 Name: <input type='text' name='Tab4' value='" . $row['Tab4'] . "'/><br>";
echo "Alert: <br><textarea rows='4' cols='80' name='MyAlert'/>" . $row['MyAlert'] . "</textarea><br>";
echo "Tab1 Content1: <br><textarea rows='10' cols='80' name='Tab1_Content1'/>" . $row['Tab1_Content1'] . "</textarea><br>";
echo "Tab1 Content2: <br><textarea rows='10' cols='80' name='Tab1_Content2'/>" . $row['Tab1_Content2'] . "</textarea><br>";
echo "Tab1 Content3: <br><textarea rows='10' cols='80' name='Tab1_Content3'/>" . $row['Tab1_Content3'] . "</textarea><br>";
echo "Tab1 Content4: <br><textarea rows='10' cols='80' name='Tab1_Content4'/>" . $row['Tab1_Content4'] . "</textarea><br>";
echo "Tab1 Content5: <br><textarea rows='10' cols='80' name='Tab1_Content5'/>" . $row['Tab1_Content5'] . "</textarea><br>";
echo "Tab2 Content1: <br><textarea rows='10' cols='80' name='Tab2_Content1'/>" . $row['Tab2_Content1'] . "</textarea><br>";
echo "Tab2 Content2: <br><textarea rows='10' cols='80' name='Tab2_Content2'/>" . $row['Tab2_Content2'] . "</textarea><br>";
echo "Tab2 Content3: <br><textarea rows='10' cols='80' name='Tab2_Content3'/>" . $row['Tab2_Content3'] . "</textarea><br>";
echo "Tab2 Content4: <br><textarea rows='10' cols='80' name='Tab2_Content4'/>" . $row['Tab2_Content4'] . "</textarea><br>";
echo "Tab2 Content5: <br><textarea rows='10' cols='80' name='Tab2_Content5'/>" . $row['Tab2_Content5'] . "</textarea><br>";
echo "Tab3 Content1: <br><textarea rows='10' cols='80' name='Tab3_Content1'/>" . $row['Tab3_Content1'] . "</textarea><br>";
echo "Tab3 Content2: <br><textarea rows='10' cols='80' name='Tab3_Content2'/>" . $row['Tab3_Content2'] . "</textarea><br>";
echo "Tab3 Content3: <br><textarea rows='10' cols='80' name='Tab3_Content3'/>" . $row['Tab3_Content3'] . "</textarea><br>";
echo "Tab3 Content4: <br><textarea rows='10' cols='80' name='Tab3_Content4'/>" . $row['Tab3_Content4'] . "</textarea><br>";
echo "Tab3 Content5: <br><textarea rows='10' cols='80' name='Tab3_Content5'/>" . $row['Tab3_Content5'] . "</textarea><br>";
echo "Tab4 Content1: <br><textarea rows='10' cols='80' name='Tab4_Content1'/>" . $row['Tab4_Content1'] . "</textarea><br>";
echo "Tab4 Content2: <br><textarea rows='10' cols='80' name='Tab4_Content2'/>" . $row['Tab4_Content2'] . "</textarea><br>";
echo "Tab4 Content3: <br><textarea rows='10' cols='80' name='Tab4_Content3'/>" . $row['Tab4_Content3'] . "</textarea><br>";
echo "Tab4 Content4: <br><textarea rows='10' cols='80' name='Tab4_Content4'/>" . $row['Tab4_Content4'] . "</textarea><br>";
echo "Tab4 Content5: <br><textarea rows='10' cols='80' name='Tab4_Content5'/>" . $row['Tab4_Content5'] . "</textarea><br>";

echo "<input type='submit' /></form>";


}


echo "<form action='Insert_Into_Events.php' method='post'>";

echo "<hr>The following form is used to add a new event to the event calendar:<hr>Description: <br><textarea rows='4' cols='80' name='Description'/></textarea><br>";
echo "Location: <br><textarea rows='4' cols='80' name='Location'/>Place the web http address for a Google Map here</textarea><br>";
echo "Date and Time: <br><input type='text' name='Date_Time' value='2009-12-31 24:60:60'/><br>";

echo "<input type='submit' /></form>";


mysql_close($link);

?>

</body>
</html>

3. Create the form submittal action script pages, Insert_Into_MyContent.php and Insert_Into_Events.php
-----------------------------

<?php

echo $_REQUEST['MyTitle'];


$link = mysql_connect('localhost', 'username', 'password');

mysql_select_db("mydatabase", $link);

$query = "INSERT INTO MyContent
(Date_Time, Tab1, Tab2, Tab3, Tab4, MyTitle, MyAlert, Tab1_Content1, Tab1_Content2, Tab1_Content3, Tab1_Content4, Tab1_Content5, Tab2_Content1, Tab2_Content2, Tab2_Content3, Tab2_Content4, Tab2_Content5, Tab3_Content1, Tab3_Content2, Tab3_Content3, Tab3_Content4, Tab3_Content5, Tab4_Content1, Tab4_Content2, Tab4_Content3, Tab4_Content4, Tab4_Content5 ) VALUES(NOW(), '$_POST[Tab1]', '$_POST[Tab2]', '$_POST[Tab3]', '$_POST[Tab4]', '$_POST[MyTitle]', '$_POST[MyAlert]', '$_POST[Tab1_Content1]', '$_POST[Tab1_Content2]', '$_POST[Tab1_Content3]', '$_POST[Tab1_Content4]', '$_POST[Tab1_Content5]', '$_POST[Tab2_Content1]', '$_POST[Tab2_Content2]', '$_POST[Tab2_Content3]', '$_POST[Tab2_Content4]', '$_POST[Tab2_Content5]', '$_POST[Tab3_Content1]', '$_POST[Tab3_Content2]', '$_POST[Tab3_Content3]', '$_POST[Tab3_Content4]', '$_POST[Tab3_Content5]', '$_POST[Tab4_Content1]', '$_POST[Tab4_Content2]', '$_POST[Tab4_Content3]', '$_POST[Tab4_Content4]', '$_POST[Tab4_Content5]') ";


if (!mysql_query($query,$link))
{
die('Error: ' . mysql_error());
}
echo "1 record added";

mysql_close($link);
?>

-----------------------------------------------------

<?php

$link = mysql_connect('localhost', 'username, 'password');

mysql_select_db("mydatabase", $link);

$query = "INSERT INTO events
(Date_Time, Description, Location) VALUES('$_POST[Date_Time]', '$_POST[Description]', '$_POST[Location]')";

if (!mysql_query($query,$link))
{
die('Error: ' . mysql_error());
}
echo "1 record added";

mysql_close($link);
?>

4. Create the SpryAssets and Images folders, SpryTabbedPanels.js, SpryURLUtils.js, and css.css files,
Updated: 2009-04-28T21:48:19Z


PHP - Create a MySQL database and tables with PHP


<?php

$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';


$query = 'CREATE DATABASE mydatabase';
$result = mysql_query($query);

mysql_select_db('mydatabase') or die('Cannot select database');

$query = 'CREATE TABLE events( '.
'Event_ID INT NOT NULL AUTO_INCREMENT, '.
'Date_Time datetime NOT NULL default "0000-00-00 00:00:00", '.
'Description VARCHAR(255) NOT NULL, '.
'Location VARCHAR(50) NOT NULL, '.
'PRIMARY KEY(Event_ID))';

$result = mysql_query($query);

$query = 'CREATE TABLE MyContent( '.
'Site_ID INT NOT NULL AUTO_INCREMENT, '.
'Date_Time datetime default "0000-00-00 00:00:00", '.
'Tab1 VARCHAR(10) NOT NULL, '.
'Tab2 VARCHAR(10) NOT NULL, '.
'Tab3 VARCHAR(10) NOT NULL, '.
'Tab4 VARCHAR(10) NOT NULL, '.
'MyTitle VARCHAR(255) NOT NULL, '.
'MyAlert VARCHAR(255) NOT NULL, '.
'Tab1_Content1 text NOT NULL, '.
'Tab1_Content2 text NOT NULL, '.
'Tab1_Content3 text NOT NULL, '.
'Tab1_Content4 text NOT NULL, '.
'Tab1_Content5 text NOT NULL, '.
'Tab2_Content1 text NOT NULL, '.
'Tab2_Content2 text NOT NULL, '.
'Tab2_Content3 text NOT NULL, '.
'Tab2_Content4 text NOT NULL, '.
'Tab2_Content5 text NOT NULL, '.
'Tab3_Content1 text NOT NULL, '.
'Tab3_Content2 text NOT NULL, '.
'Tab3_Content3 text NOT NULL, '.
'Tab3_Content4 text NOT NULL, '.
'Tab3_Content5 text NOT NULL, '.
'Tab4_Content1 text NOT NULL, '.
'Tab4_Content2 text NOT NULL, '.
'Tab4_Content3 text NOT NULL, '.
'Tab4_Content4 text NOT NULL, '.
'Tab4_Content5 text NOT NULL, '.
'PRIMARY KEY(Site_ID))';

$result = mysql_query($query);

mysql_close($link);
?>
Updated: 2009-04-28T21:46:43Z


PHP - Insert test data into a MySQL database with PHP


<?php

$link = mysql_connect('localhost', 'username', 'password');

mysql_select_db("mydatabase", $link);

$query = 'INSERT INTO events
(Date_Time, Description, Location) VALUES(NOW(), "Description Test", "Location Test" ) ';
$result = mysql_query($query);

$query = 'INSERT INTO MyContent
(Date_Time, Tab1, Tab2, Tab3, Tab4, MyTitle, MyAlert, Tab1_Content1, Tab1_Content2, Tab1_Content3, Tab1_Content4, Tab1_Content5, Tab2_Content1, Tab2_Content2, Tab2_Content3, Tab2_Content4, Tab2_Content5, Tab3_Content1, Tab3_Content2, Tab3_Content3, Tab3_Content4, Tab3_Content5, Tab4_Content1, Tab4_Content2, Tab4_Content3, Tab4_Content4, Tab4_Content5 ) VALUES(NOW(), "Tab1 Test", "Tab2 Test", "Tab3 Test", "Tab4 Test", "MyTitle Test", "MyAlert Test", "Tab1_Content1 Test", "Tab1_Content2 Test", "Tab1_Content3 Test", "Tab1_Content4 Test", "Tab1_Content5 Test", "Tab2_Content1 Test", "Tab2_Content2 Test", "Tab2_Content3 Test", "Tab2_Content4 Test", "Tab2_Content5 Test", "Tab3_Content1 Test", "Tab3_Content2 Test", "Tab3_Content3 Test", "Tab3_Content4 Test", "Tab3_Content5 Test", "Tab4_Content1 Test", "Tab4_Content2 Test", "Tab4_Content3 Test", "Tab4_Content4 Test", "Tab4_Content5 Test") ';
$result = mysql_query($query);

mysql_error();

mysql_close($link);
?>
Updated: 2009-04-28T21:46:11Z


PHP - Send an email requesting to add an email to a mailing list


1. from any page in your web, add this form
-----------------------------

<form method="post" action="sendmail.php">
Email:
<input name="email" type="text">
<input value="Submit" type="submit">
</form>

2. create file named sendmail.php
-----------------------------

<?php $email = $_POST['email'] ;?>
<b><?php mail( "bluemoongiftsonline@gmail.com", "-- Add me to your mailing list --", "Please add my email address to your mailing list. Thank you.", "$email" );?>
</b><?php print "Congratulations! You will now receive our newsletter.";?>
<br><?php print "Please know that we will not distribute your email to anyone else for any reason.";?>
<br><br><?php print "Thank you."; ?>
Updated: 2009-04-28T21:45:39Z


PHP - Send an email from a web page


1. from any page in your web, add this form
-----------------------------

<form method="post" action="sendmail.php">
Email:
<input name="email" type="text">
<input name="subject" type="hidden" value="Place an email subject here">
<textarea name="message" type="text" rows="10" cols="30"></textarea>
<input value="Submit" type="submit">
</form>

2. create file named sendmail.php
-----------------------------

<?php $email = $_POST['email'] ;?>
<?php $subject = $_POST['subject'] ;?>
<?php $message = $_POST['message'] ;?>
<b><?php mail( "bluemoongiftsonline@gmail.com", "$subject", "$message", "$email" );?>
</b><?php print "Congratulations! You have sent your message.";?>
<br><?php print "Please know that we will not distribute your email to anyone else for any reason.";?>
<br><br><?php print "Thank you."; ?>
PHP - Password Protect a Single Web Page
if($_GET['password'] == "Password123")
{
$code1
}
else
{
echo "wrong pasword";
}
NOTE: The variable name 'password' can come from a form submittal, http ? link, cookie, or session.
PHP - Instantiate a Variable if the Variable Does Not Exist
if (!isset($_GET['variable']))
{
$code1
}
else
{
$code2
}
NOTE: The variable name 'variable' can come from a form submittal, http ? link, cookie, or session.
Updated: 2009-04-28T21:45:08Z


Javascript - Tell a webform to redirect after submitting to a 3rd party site


1. place the following in the head of the form page:
<script language="JavaScript">
<!--
function FormRedirect(){
setTimeout('this.document.location.href = "thankyou.htm"',499);}
//-->
</script>
If you are having issues with the timeout setting (if you changed it to above 499) on the third party server, do not exceed 499 milliseconds
2. place the following in the <form> tag:
onsubmit="FormRedirect()
Updated: 2009-04-28T21:32:58Z


Javascript - Make an iframe transparent and have absolute position on the page


1. put this code in the body of a page (not iframe page)
---------------------------------------

<iframe src="my_iframe_page.asp" name="iframe1" width="400" height="500" frameborder="0" allowtransparency="true" style="position:absolute; top:125; right:15" marginwidth="1" marginheight="1" scrolling="no"></iframe>

---------------------------------------
2. put this code in the head of all pages displayed in the iframe
---------------------------------------

<style type="text/css">
Body { Background: transparent; }
</style>
Updated: 2009-04-28T21:32:30Z


Javascript - A Drop Down Box that Automatically Redirects the Browser to one of the Options


<FORM ACTION="">
<select name="jumpto" onChange='window.location.href= this.form.jumpto.options[this.form.jumpto.selectedIndex].value'>
<option selected>Change template...</option>
<option value="page1.html" target="iframe_main">home</option>
<option value="page2.html" target="iframe_main">services</option>
<option value="page3.html" target="iframe_main">shop</option>
<option value="page4.html" target="iframe_main">about us</option>
</select>
</FORM>
Javascript - Gradient Image from Javascript and CSS alone
http://www.netjunke.com/zen/blog files/gradient_demo.htm
<div style='width:400px;'>
<script type="text/javascript">

var gradient_color='333300';
var gradient_color_dec;
var gradient_counter=1;
var vertical_position=0;
var horizontal_position=0;

while (gradient_counter<=255)
{
document.write("<div style='background-color: #" + gradient_color);
document.write("; width: 100%; height: 4px; top: " + vertical_position);
document.write("px; left: " + horizontal_position);
document.write("px;'></div>");

gradient_color_dec=parseInt(gradient_color,16);
gradient_color_dec=gradient_color_dec+1;
gradient_color=gradient_color_dec.toString(16);

gradient_counter=gradient_counter+1;
vertical_position=vertical_position+1;
}
</script>
</div>
Updated: 2009-04-28T21:31:50Z


VB.NET - Config File for GoDaddy.com


NOTE: GoDaddy does not come with .NET activated on your Windows server account. Follow these instructions to activate .NET on your GoDaddy Windows server account: 1. logon to GoDaddy.com. 2. Go to your hosting account manager. 3. Click manage your site. 4. Go to content --> Add on languages. 5. Click on ASP 2.0/3.0/3.5. 6. Wait for 24 hours. 7. follow steps 1-3 again. 8. go to content--> IIS settings. 9. Create a new virtual directory. 10. give it Anonymous access and set it as your application root. 11. upload your web.config and .aspx files to this directory.
1. create a file called web.config
----------------------------

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation
defaultLanguage="c#"
debug="true"
/>
<customErrors mode="Off"/>
<authentication mode="Windows" />
<authorization>
<allow users="*" />
</authorization>
<trace
enabled="false"
requestLimit="10"
pageOutput="false"
traceMode="SortByTime"
localOnly="true"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

</system.web>
</configuration>
Updated: 2009-04-28T21:26:38Z


VB.NET - Very simple 'dynamic web form content' using tabs


1. create a file called multiview_demo.aspx
-----------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>MultiView Demo</title>
<link rel="stylesheet" href="style.css" />
<script runat="server" language="VB">
Sub SwitchView0(s as Object, e as EventArgs)
myMultiView.ActiveViewIndex = 0
End Sub
Sub SwitchView1(s as Object, e as EventArgs)
myMultiView.ActiveViewIndex = 1
End Sub
Sub SwitchView2(s as Object, e as EventArgs)
myMultiView.ActiveViewIndex = 2
End Sub
</script>
</head>
<body>

<form runat="server">
<div id="menu_container">
<div id="menu_tab">
<asp:LinkButton id="myButton1" Text="Switch View 1" runat="server" OnClick="SwitchView0" /></div id="menu_button">
<div id="menu_tab">
<asp:LinkButton id="myButton2" Text="Switch View 2" runat="server" OnClick="SwitchView1" /></div id="menu_button">
<div id="menu_tab">
<asp:LinkButton id="myButton3" Text="Switch View 3" runat="server" OnClick="SwitchView2" /></div id="menu_button">
</div id="menu_container">
<asp:MultiView ID="myMultiView" runat="server"
ActiveViewIndex="0">
<asp:View ID="firstView" runat="server">
<div class="dynamic_container">Everything you see here is occuring on one webform</div class="dynamic_container">
</asp:View>
<asp:View ID="secondView" runat="server">
<div class="dynamic_container">Some of the html code is hidden while other code is shown</div class="dynamic_container">
</asp:View>
<asp:View ID="thirdView" runat="server">
<div class="dynamic_container">You can use fancy tab shaped image backgrounds instead of the ugly colors above.</br>You can add more tabs or take some away with very easy to understand modifications of the code.<br>You can easily style any aspects of the tabs, menu, or container with CSS.<br>You can place the buttons anywhere on the page that you want (vertically, horizontally, scattered, embedded in text, or nested in an imageMap )<br>It can be used to create an image slideshow.<br>...Really, the possibilities are endless.</div class="dynamic_container">
</asp:View>
</asp:MultiView>
</form>
</body>
2. Create a file called style.css
-----------------------------

@charset "utf-8";
/* CSS Document */
#menu_container {
height: 25px;
width: auto;
background-color: transparent;
padding: 0px;
margin: 0px;
}
#menu_tab {
background-color: silver;
border: 2px coral solid;
text-align: center;
padding: 5px;
margin: 0px;
width: 140px;
float: left;
}
.dynamic_container {
position: absolute;
top: 150px;
left: 100px;
}
button {
color: blue;
background-color: yellow;
}
body {
background-color: #669900;
}


NOTE: If you want this control to be pretty, you should replace the boring buttons I provided with tab shaped images. Use a different image of the same size but different color for an added mouseover, onclick, or active tab effect.
Updated: 2009-04-28T21:25:30Z


CSS - DIVs with Absolute Position


1. create a file called mytest.html
2. insert the following code between the <body> tags
-----------------------------

<div id="navigation">
<a href="page1.html"> Link 1 </a> <br />
<a href="page2.html"> Link 2 </a> <br />
<a href="page3.html"> Link 3 </a>
</div>

3. create a file called mytest.css
4. insert the following code
-----------------------------

#navigation {
position: absolute; left: 50px; top: 100px; margin-left: 10px;margin-top: 10px;
border : dashed 1px #000000;
background : #c0c0c0;
padding : 4px;
width: 100px;
height: 400px;}
Updated: 2009-04-28T20:47:07Z


CSS - Make a DIV Semi-Transparent


1. create a file called mytest.html
2. insert the following code between the <body> tags
-----------------------------

<div id="navigation">
<a href="page1.html"> Link 1 </a> <br />
<a href="page2.html"> Link 2 </a> <br />
<a href="page3.html"> Link 3 </a>
</div>

3. create a file called mytest.css
4. insert the following code
-----------------------------
#navigation
{
filter:alpha(opacity=60);
-moz-opacity: 0.6; /*for older firefox browsers*/
opacity: 0.6;
}
Link to a Stylsheet
4. place the following between the <head> tags of your document
-----------------------------
<link rel="stylesheet" href="mystyle.css" />
Make a DIV Transparent
1. create a file called mytest.html
2. insert the following code between the <body> tags
-----------------------------

<div id="navigation">
<a href="page1.html"> Link 1 </a> <br />
<a href="page2.html"> Link 2 </a> <br />
<a href="page3.html"> Link 3 </a>
</div>

3. create a file called mytest.css
4. insert the following code
-----------------------------
#navigation
{
filter:alpha(opacity=0);
-moz-opacity: 0.0; /*for older firefox browsers*/
opacity: 0.0;
}
Updated: 2009-04-28T20:46:39Z


CSS - Make an Image Change Transparency on Hover


1. create a file called mytest.html
2. insert the following code between the <body> tags
-----------------------------

<img src="myimage.jpg" class="mouseoverimage">

3. create a file called mytest.css
4. insert the following code
-----------------------------
.mouseoverimage
{
filter:alpha(opacity=40);
-moz-opacity: 0.4; /*for older firefox browsers*/
opacity: 0.4;
}
.mouseoverimage:hover
{
filter:alpha(opacity=100);
-moz-opacity: 1.0; /*for older firefox browsers*/
opacity: 1.0;
}
Define Hyperlink Colors
1. add the following to your CSS page
-----------------------------
a {font-family:Georgia,serif; font-size:large}
a:link {color: #FF0000} /* unvisited link */
a:visited {color: #00FF00} /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
a:active {color: #0000FF} /* selected link */
Change Text, Paragraphes, etc on Hover
1. add the following to your html page
-----------------------------
<div id="box">
<p onmouseover="this.className = 'onHover'" onmouseout="this.className='offHover'">
This is example #1...blah, blah.
</p>
</div>
2. add the following to your CSS page
-----------------------------
#box p:hover { /* the p: tag refers to the <p> tag on the html page.*/
/* change this for <img>,<ul>,<font>, etc */
background: #dd0;
}
.onHover {
background: #dd0;
height: 1%; /* Holly Hack */
}

.offHover {
background: #cc0;
}
NOTE: Two different methods are defined here because one method works with IE and the other with Mozilla
Updated: 2009-04-28T20:46:05Z


CSS - Center Aligned DIV Regardless of Window Size or Display Resolution


1. the following CSS center aligns a DIV
-----------------------------
#container {
background-color: transparent;
width: 700px;
position: absolute;
height: auto;
left: 50%;
top: 100px;
margin-left: -350px;
}
2. My Example: Create a new page called Default.html
-----------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="Default.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Center Aligned DIV</title>
</head>

<body class=body>

<div id=container>
<div id=leftColumn>
<div class=box>
<div class=boxHeader>head fklj f </div>
<div class=boxBody>
body dlfkjsdlfjkds'fkj fkdjafka
lfjdsafjkasfj'kasf f fs usufu sh fs f sfh sf ids fhds fis </div>
</div>

<div class=box>
<div class=boxHeader>head fklj f </div>
<div class=boxBody>
body dlfkjsdlfjkds'fkj fkdjafka
lfjdsafjkasfj'kasf f fs usufu sh fs f sfh sf ids fhds fis </div>
</div>
</div>


<div id=rightColumn>
<div class=box>
<div class=boxHeader>head fklj f </div>
<div class=boxBody>
body dlfkjsdlfjkds'fkj fkdjafka
lfjdsafjkasfj'kasf f fs usufu sh fs f sfh sf ids fhds fis </div>
</div>

<div class=box>
<div class=boxHeader>head fklj f </div>
<div class=boxBody>
body dlfkjsdlfjkds'fkj fkdjafka
lfjdsafjkasfj'kasf f fs usufu sh fs f sfh sf ids fhds fis </div>
</div>
</div>
</div>

</body>
</html>

3. Create a new page called Default.css
-----------------------------
@charset "utf-8";
/* CSS Document */

.boxHeader {
height: 25px;
width: auto;
background-color: #CCCCCC;
padding: 5px;
margin: 0px;
clear: both;
}
.boxBody {
height: auto;
width: auto;
background-color: #666666;
padding: 5px;
margin: 0px;
clear: both;
}
.box {
padding: 5px;
height: auto;
width: auto;
background-color: transparent;
margin: 0px;
clear: right;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
#container {
background-color: transparent;
width: 700px;
position: absolute;
height: auto;
left: 50%;
top: 100px;
margin-left: -350px;
}

#rightColumn {
width: 200px;
padding: 0px;
background-color: transparent;
right: 0px;
float: right;
}
#leftColumn {
width: 500px;
padding: 0px;
left: 0px;
float: left;
}
.body {
background-color: #669900;
}
Updated: 2009-04-28T20:44:58Z


CSS - Background image changes dynamically on window resize


NOTE: The image you use for the top (first) layer must be a gif with a portion of the image transparent. You should be able to see through the top image to the image below. When you drag to resize the window, the images will move at different speeds and change the appearance of the background. Depending on the images you create, this effect will either be really cool or really lame.
#layer0 {
background-color: transparent;
height: 140%;
width: 140%;
position: absolute;
background-image: url(images/circles0.gif);
margin-left: -20%;
margin-top: -20%;
}
#layer1 {
background-color: transparent;
height: 110%;
width: 110%;
position: absolute;
background-image: url(images/circles0.gif);
margin-left: -5%;
margin-top: -5%;
}
Updated: 2009-04-28T20:43:33Z


ADO - ASP DELETE (or any query) from Access Database


<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("fpdb/Inventory_Devices.mdb"))


iDeviceID = Request.QueryString("DeviceID")
sSQL = "DELETE FROM Devices WHERE DeviceID = " & iDeviceID

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = oConn
rs.Source = sSQL
rs.Open


Set rs = Nothing
oConn.Close
Set oConn = Nothing
%>
Updated: 2009-04-28T20:38:55Z


ADO - ASP Edit/Delete Access Database records - with form submittals


1. Create an asp page called Edit_Record_List.asp that will send the Record ID to be edited/deleted to the edit/delete form pages
-------------------------------------------------------------------------------------------------------
<table width="600">
<tr>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/jasons web blog.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT blogID, blogtitle, blogcategory FROM jasonswebblog"
rs.Open mySQL, conn

do until rs.EOF
blogID = rs.Fields("blogID")
Response.Write("<td width=75><a href='Edit_Record_Form.asp?blogID=" & blogID & "'>" & " Edit </a></td>")
Response.Write("<td width=75><a href='Delete_Record_Form.asp?blogID=" & blogID & "'>" & " Delete </a></td>")
for each x in rs.Fields
Response.Write("<td width=150>" & x.value & "</td>")
next
rs.MoveNext
Response.Write("</tr><tr>")
loop

rs.close
conn.close
%>
</tr></table>

2. Create a self-populated form page called Edit_Record_Form.asp with all the editable fields of the record and sends those to an edit action page
-------------------------------------------------------------------------------------------------------
<form method="post" action="Edit_Record_Action.asp">
Record ID= <%=request("BlogID")%><br>

<%

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("/fpdb/jasons web blog.mdb")

Set rs = Server.CreateObject("ADODB.recordset")
On Error Resume Next

strSQL = ("SELECT * FROM jasonswebblog WHERE blogID = " & request("blogID") )

rs.open strSQL, conn

rs.MoveFirst
WHILE NOT rs.EOF
Response.Write("<input type='hidden' name='blogID' value='" & rs("blogID") & "' /><br />")
Response.Write("<input type='text' name='blogtitle' value='" & rs("blogtitle") & "' /><br />")
Response.Write("<textarea rows='25' cols='10' name='blogbody' />" & rs("blogbody") & "</textarea><br />")
Response.Write("<input type='text' name='blogcategory' value='" & rs("blogcategory") & "' /><br />")
rs.MoveNext
WEND

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing
strSQL = " "

%>
<br /><input type='submit' value='Submit' />
</form>

3. Create a page called Edit_Record_Action.asp that will take the form fields from the form page and update them in the database
-------------------------------------------------------------------------------------------------------
<%
' Response.write(Request.Form("blogID")) & "<br>"
Response.write("Title: <br>" & Request.Form("blogtitle")) & "<br>"
Response.write("Body: <br>" & Request.Form("blogbody")) & "<br>"
Response.write("Catagory: <br>" & Request.Form("blogcategory")) & "<br>"

set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/jasons web blog.mdb") & ";"

mySQL = "UPDATE jasonswebblog SET "
mySQL = mySQL & "blogtitle='" & Request.Form("blogtitle") & "', "
mySQL = mySQL & "blogbody='" & Request.Form("blogbody") & "', "
mySQL = mySQL & "blogcategory='" & Request.Form("blogcategory") & "' "
mySQL = mySQL & "WHERE blogID = " & Request.Form("blogID") & ""
on error resume next

conn.Execute mySQL

if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record edited!</h3>")
end if

conn.close

%>

4. Create a page called Delete_Record_Form.asp that will take the record ID from the list page and put it in a form submittal
-------------------------------------------------------------------------------------------------------
If you are sure you want to <br><font color="red">DELETE THIS RECORD FOREVER</font>, <br>press submit. <br>Otherwise, use your browser's BACK button.

<form method="post" action="Delete_Record_Action.asp">

<input type="hidden" name="blogID" value="<%=request("blogID")%>" size="25">
<br /><input type='submit' value='Submit' />
</form>
5. Create a page called Delete_Record_Action.asp that will take the record ID from the form page and delete it from the database
-------------------------------------------------------------------------------------------------------
<%

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("/fpdb/jasons web blog.mdb")

Set rs = Server.CreateObject("ADODB.recordset")

strSQL = ("DELETE * FROM jasonswebblog WHERE blogID = " & request("blogID") )

conn.execute(strSQL)



conn.Close
Set conn = Nothing
strSQL = " "

%>

Your record has been deleted.
ADO - ASP INSERT form submittal to Access Database with error report.
<%
Response.write(Request.Form("personal_name")) & "<br>"
Response.write(Request.Form("email")) & "<br>"
Response.write(Request.Form("password")) & "<br>"
Response.write(Request.Form("about_me")) & "<br>"
' Response.write(Request.Form("verified")) & "<br>"
' Response.write(Request.Form("blocked")) & "<br>"

set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

mySQL = "INSERT INTO Account "
mySQL = mySQL & "(personal_name, email, password, about_me, Verified, Blocked) "
mySQL = mySQL & "VALUES ('" & Request.Form("personal_name") & "', '"
mySQL = mySQL & Request.Form("email") & "', '"
mySQL = mySQL & Request.Form("password") & "', '"
mySQL = mySQL & Request.Form("about_me") & "', '"
mySQL = mySQL & Request.Form("Verified") & "', '"
mySQL = mySQL & Request.Form("Blocked") & "')"

on error resume next

conn.Execute mySQL

if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if

conn.close

%>
Updated: 2009-04-28T20:38:36Z


ADO - ADODB SELECT from Access Database


<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT personal_name FROM Account WHERE Account_ID = "
mySQL = mySQL & Request("Account_ID")

rs.Open mySQL, conn

do until rs.EOF
for each x in rs.Fields
Response.Write("<h2>" & x.value & "</h2>")
next
rs.MoveNext
loop

rs.close
conn.close
%>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT about_me FROM Account WHERE Account_ID = "
mySQL = mySQL & Request("Account_ID")

rs.Open mySQL, conn

do until rs.EOF
for each x in rs.Fields
Response.Write("<h4>" & x.value & "</h4>")
next
rs.MoveNext
loop

rs.close
conn.close
%>


<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT personal_name FROM Account WHERE (email = '"
mySQL = mySQL & Session("email") & "' AND password = '"
mySQL = mySQL & Session("password") & "' )"

rs.Open mySQL, conn

do until rs.EOF
for each x in rs.Fields
Response.Write("<h4>" & "<a href='Posting_New1.asp'>Post a new listing</a>" & "<br><a href='Posting_Edit1.asp'>Edit a listing</a>" & "<br><a href='Account_Edit1.asp'>Edit my profile</a><br><br>")
next
rs.MoveNext
loop

rs.close
conn.close
%>
Updated: 2009-04-28T20:37:53Z


ADO - ADODB SELECT "Best Version" for Access Database


<%

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("/fpdb/for_sale_cars.mdb")

Set rs = Server.CreateObject("ADODB.recordset")
On Error Resume Next

strSQL = "SELECT title, price, location, body, email FROM Posting WHERE Posting_ID = "
strSQL = strSQL & request("Posting_ID") & " AND active = 'On'"

rs.open strSQL, conn

rs.MoveFirst
WHILE NOT rs.EOF
Response.Write("<b><h1>" & rs("title") & "</h1></b>")
Response.Write("<b>$" & rs("price") & ".00</b>")
Response.Write(" " & rs("location") & "<br/><hr>")
Response.Write(rs("body") & "<br/><hr>")
Session("email_to") = rs("email")
rs.MoveNext
WEND

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing
strSQL = " "

%>
Updated: 2009-04-28T20:37:27Z


ADO - ASP SELECT from Access Database with Table


<table width=680>
<h5><tr>
<td width=480><b>Title</b>
<td width=100><b>Price $</b>
<td width=200><b>Catagory</b>
<td width=100>
</tr>
<h5><tr>

<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT title, price, catagory, active FROM Posting WHERE Account_ID = "
mySQL = mySQL & Request("Account_ID")

rs.Open mySQL, conn

do until rs.EOF
for each x in rs.Fields
Response.Write("<td>" & x.value & "</td>")
next

rs.MoveNext
Response.Write("</tr><tr>")
loop

rs.close
conn.close
%>
</tr></table>
Updated: 2009-04-28T20:37:04Z


ADO - ASP SELECT from Access Database with table - passes parameters to another asp page


<table width="1550">
<p style="margin-top: 0; margin-bottom: 0">
<td width=400>
<p style="margin-top: 0; margin-bottom: 0"><b>Title</b>
<td width=100>
<p style="margin-top: 0; margin-bottom: 0"><b>Price $</b>
<td width=550>
<p style="margin-top: 0; margin-bottom: 0"><b>Location</b>
<td width=100>
<h5 style="margin-top: 0; margin-bottom: 0"><tr>
<td width=400>
<p style="margin-top: 0; margin-bottom: 0">
</tr></h5>
<h5><tr>
<%
set conn=server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=" & Server.MapPath("/fpdb/for_sale_cars.mdb") & ";"

set rs = Server.CreateObject("ADODB.recordset")

mySQL = "SELECT price, location, Posting_ID, title FROM Posting WHERE catagory = '"
mySQL = mySQL & Request("catagory") & "' AND active = 'Active'"
rs.Open mySQL, conn

do until rs.EOF
Post_ID = rs.Fields("Posting_ID")
titletemp = rs.Fields("title")
Response.Write("<td><a href='PostingPage.asp?Posting_ID=" & Post_ID & "'>" & titletemp & "</a></td>")
for each x in rs.Fields
Response.Write("<td>" & x.value & "</td>")
next
rs.MoveNext
Response.Write("</tr><tr>")
loop

rs.close
conn.close
%>
</tr></h5></table>
Updated: 2009-04-28T20:36:25Z


ASP - Parse a Hulu XML RSS feed and put it in your webpage


----------------------------------------------------------------------------------------------------------
<font color="green">Insert the following code in your .ASP page:
The RSS feed style can be controlled with a CSS page
----------------------------------------------------------------------------------------------------------

<%
' change the RSSURL variable to the exact URL of the RSS Feed you want to pull
RSSURL = "http://www.hulu.com/feed/queue/smailliwnosaj"

Dim objHTTP ' this object is used to call the RSS Feed remotely
Dim RSSURL,RSSFeed ' these variables hold the URL and Content for the RSS Feed
Dim xmlRSSFeed ' this variable hold the XML data in a DOM Object
Dim objItems,objItem, objChild ' these variables are used to temporarily hold data from the various RSS Items
Dim title,description,link ' these are local variables that will hold the data to be displayed
Dim OutputHTML_1,OutputHTML_2,OutputHTML_3 ' these variables will hold the HTML that was converted from the RSS Feed

' this code requests the raw RSS/XML and saves the response as a string <RSSFeed>
Set objHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHTTP.open "GET",RSSURL,false
objHTTP.send
RSSFeed = objHTTP.responseText

' this code takes the raw RSSFeed and loads it into an XML Object
Set xmlRSSFeed = Server.CreateObject("MSXML2.DomDocument.4.0")
xmlRSSFeed.async = false
xmlRSSFeed.LoadXml(RSSFeed)

' this code disposes of the object we called the feed with
Set objHTTP = Nothing

' this is where you determine how to display the content from the RSS Feed

' this code grabs all the "items" in the RSS Feed
Set objItems = xmlRSSFeed.getElementsByTagName("item")

' this code disposes of the XML object that contained the entire feed
Set xmlRSSFeed = Nothing

' loop over all the items in the RSS Feed
For x = 0 to objItems.length - 1
' this code places the content from the various RSS nodes into local variables
Set objItem = objItems.item(x)
For Each objChild in objItem.childNodes
Select Case LCase(objChild.nodeName)
Case "title"
title = objChild.text
Case "link"
link = objChild.text
Case "description"
description = objChild.text
End Select
Next
' Here are some various display samples.
OutputHTML_1 = OutputHTML_1 & "<a href=" & link & ">" & title & "</a><br />" & description & ""
OutputHTML_2 = OutputHTML_2 & "<a href=""" & link & """>" & title & "</a><br />"
OutputHTML_3 = OutputHTML_3 & "<a href=""" & link & """>" & title & "</a><hr />"
Next
%>
<%=OutputHTML_1%>
Updated: 2009-04-28T20:27:20Z


ASP - Display all image files (with thumbnails) from a web folder


----------------------------------------------------------------------------------------------------------
I commented out items that discriminate what type of file to be displayed
Create a folder called 'My_Images' in the webroot
Inside 'My_Images', create two folders called 'thumbnails' and 'large'
Place a thumbnail version of an image in the 'thumbnails' folder, and a full size one with the same file name in the 'large' folder
----------------------------------------------------------------------------------------------------------

<center>
<%
Response.Buffer = True
%>

<%
' File System Object
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")

' "My_Images" Folder
Dim folder
Set folder = fso.GetFolder(Server.MapPath("My_Images/thumbnails/"))

If folder.Size > 0 Then
For Each file In folder.Files
// If left(file.name, 9) = request("ID") Then
Response.Write "<a href='My_Images/large/" & file.Name & "' target=_blank>"
Response.Write "<img height=100 border=0 src='My_Images/thumbnails/" & file.Name & "'></a> "
Response.Write ""
// Else
// End If
Next

Else
Response.Write "<ul><li type=""circle"">No Files Uploaded.</ul>"
End If

%>

</center>
Updated: 2009-04-28T20:25:50Z


ASP - Send email from a web page on an ASPupload compatible Windows IIS Server


----------------------------------------------------------------------------------------------------------
Create a page called mail_send.asp
From another web page, make a form that sends the following
fields: email_from, body
and sets a session cookie for: email_to
----------------------------------------------------------------------------------------------------------

<%
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "RE: Your Posting on HoosierTopics.com"
myMail.From = request.form("email_from")
myMail.To = Session("email_to")
myMail.HTMLBody = request.form("body")
myMail.Send
set myMail = nothing
%>
<%

Session("email_to")="DeleteThisCookie"

response.write("<b>From:</b> " & request.form("email_from") & "<br><br>")
response.write("<b>Message:</b> " & request.form("body") & "<br><br>")
%>
Updated: 2009-04-28T20:25:06Z


ASP - Password protect web pages


----------------------------------------------------------------------------------------------------------
1. create file named logon.asp
----------------------------------------------------------------------------------------------------------

<html>
<head>
<title>Logon Form</title>
<%

Username="Admin"
Password="Password"

Validated = "OK"
if Strcomp(Request.Form("User"),Username,1)=0 AND Request.Form("password") = Password then
'Set the validation cookie and redirect the user to the original page.
Response.Cookies("ValidUser") = Validated
'Check where the users are coming from within the application.
If (Request.QueryString("from")<>"") then
Response.Redirect Request.QueryString("from")
else
'If the first page that the user accessed is the Logon page,
'direct them to the default page.
Response.Redirect "inv_index.asp"
End if
Else
' Only present the failure message if the user typed in something.
If Request.Form("User") <> "" then
Response.Write "<h3>Authorization Failed.</h3>" & "<br>" & _
"Please try again.<br> <br>"
End if
End if
%>
</head>
<body bgcolor="#FFFFFF">
<FORM ACTION=<%Response.Write "Logon.asp?"&Request.QueryString%> method="post">
<h3>Logon Page for MyPage.asp</h3>
<p>
Username:
<INPUT TYPE="text" NAME="User" VALUE='' size="20"></INPUT>
Password:
<INPUT TYPE="password" NAME="password" VALUE='' size="20"></INPUT>
<INPUT TYPE="submit" VALUE="Logon"></INPUT>
</FORM>
</body>
</html>

----------------------------------------------------------------------------------------------------------
2. add this to top of every protected page
----------------------------------------------------------------------------------------------------------

<%
Validated = "OK"
if Request.Cookies("ValidUser") <> Validated then
'Construct the URL for the current page.
dim s
s = "http://"
s = s & Request.ServerVariables("HTTP_HOST")
s = s & Request.ServerVariables("URL")
if Request.QueryString.Count > 0 THEN
s = s & "?" & Request.QueryString
end if
'Redirect unauthorized users to the logon page.
Response.Redirect "Logon.asp?from=" &Server.URLEncode(s)
End if
%>
Updated: 2009-04-28T20:24:20Z


2009-04-04
I learned that Microsoft SQL Server 2008 is far, far


2009-04-04




I learned that Microsoft SQL Server 2008 is far, far harder to configure on a Windows machine than MySQL Server. I spent a good day not getting SQL Server to work, trying everything under the sun. I got as far as getting an ODBC connection set up on the machine, but could never get PHP to work with it. There is probably something in that PHP for IIS 7.0 is still in its infancy. Anyway, I decided to use MySQL instead. Bam!!! On the first install, it worked like a charm. Combine that with the fact that MySQL Server has a built in command-line tool that makes testing and updating your server a cinch.
Well, I have officially made my decision on what is the best SQL server, MySQL hands down.




2009-03-24



Vicki and I took the kids on a spring break road trip to South Carolina. On the way down, we stopped at the Mammoth Caves and Fall Creek Falls. Vickis mom, dad, bros and sis met us down there. We stayed at the Berkely Country Club Estates in Blanton, Hilton Head, SC at Vickis Aunt Diana and Uncle Jim Georges house. They had an alligator in their front pond. We did an ocean fishing excursion. I caught a few fish off of a reef 15 miles out but Jim Steen caught the only keepers. We had a fancy dinner at the country club, spent a day at the health club, rode bikes on the beach, went on a catered dolphin tour ( the dolphins came right up to the boat ), and played volleyball on the beach. On the way back, we toured the Biltmore Estate in Asheville, NC. Fun week.












2009-03-02



It turns out the Three Geeks and a Mouse did actually pay me for my time. Though, it took them quite a long time to do it. I have no choice but to give 3GAAM a semi for not getting the check in the mail sooner. Sorry, Bill Carson.




2009-02-20



I ran an audio/video presentation for Vince Poscente. He is known for going from being a 26 year old nobody to (in just four years) shattering the world downhill speed skiing record at the winter olympics. He held the record for a while. But, now he is a full-time motivational speaker. This time, he spoke to the Young Presidents Organization of Indiana.




2009-02-01



I uploaded about two thousand web templates. View them here: Web Templates




2009-01-12




Working all this week at the Adesa Auction plant in Carmel, IN, doing Network Monitoring Support. 40 hours




2009-01-11



Did a one-day PC tech job for Three Geeks and a Mouse out of Texas. They needed a tech for a home PC support role. 1.75 hours. TGAAM have very bad reps for not paying their techs. I will post an update if they screw me for my $130




2009-01-10



Worked all week at the Adesa Auction plant in Kansas City, MO, moving PCs from their old site to their new. 88 hours.




2008-12-25



Christmas was totally awesome. More presents than I have ever seen under a tree. The kids were all treated really well. Friends remembered us. And to top it all off. I surprised Vicki when I asked her to marry me ( sunset in front of some really cool art sculptures at DePauw ).





2008-12-19



I spent the afternoon integrating a CMS to keep track of hours and expenses for clients and to generate personalized invoices for each. It turned out awesome. Here is a sample of the invoice page:

Invoice




2008-11-24





Thanksgiving was great! Kaelis dad, Jeramiah, flew in for a surprise visit, I almost hospitalized myself from food overdose, and we came together as a family without anyone getting grounded. Awesome.


I learned that Microsoft SQL Server 2008 is far, far harder to configure on a Windows machine than MySQL Server. I spent a good day not getting SQL Server to work, trying everything under the sun. I got as far as getting an ODBC connection set up on the machine, but could never get PHP to work with it. There is probably something in that PHP for IIS 7.0 is still in its infancy. Anyway, I decided to use MySQL instead. Bam!!! On the first install, it worked like a charm. Combine that with the fact that MySQL Server has a built in command-line tool that makes testing and updating your server a cinch.
Well, I have officially made my decision on what is the best SQL server, MySQL hands down.

Updated: 2009-04-28T19:12:56Z