September 9th, 2010 by
Ken
I helped a friend install the H4h Affiliates module on his OS Commerce store after he ran into an issue where loading his site would return errors for missing files. The installation instructions were pretty good except for one step where the author provides an incorrect step.
The step where you have to add the following lines to your catalog/includes/configure.php
// H4H AFFILIATE PROGRAM
if (isset($Module) && $Module == 'Affiliate') {
define('DIR_WS_INCLUDES', '../includes/');
} else {
define('DIR_WS_INCLUDES', 'includes/');
}
// H4H AFFILIATE PROGRAM
The problem is, the author tells you to add these to the end of your configure.php file when you should actually be replacing your existing DIR_WS_INCLUDES definition line.
The issue with what is in the instructions is that you cannot redefine something that’s been defined already. So by placing the code at the end of the configure file, nothing actually happens so the path is then completely wrong when the affiliates code is run.
Posted in PHP |
No Comments »
January 6th, 2010 by
Ken
While I don’t quite understand how ASP.net master pages work, I did come across a client site using them. For some weird reason, Microsoft decided that if you were going to use master pages, they would go and wrap the entire page in an aspnetForm, preventing you from using your own forms on the site. Who’s the genius that came up with that idea?!
In any case, I had to find a workaround so I could drop in a reservation form of my own. After a bit of digging, I found a simple solution using Javascript to essentially override the form actions.
<script type="text/javascript">// <![CDATA[
function SubmitForm() {
var objForm = document.forms["aspnetForm"];
if (!objForm) {
objForm = document.aspnetForm;
}
objForm.__VIEWSTATE.value = "";
objForm.encoding = "application/x-www-form-urlencoded";
objForm.action = "http://www.yoursite.com/yourscript.asp";
objForm.submit();
}
// ]]></script>
Then, all you need to do is on your submit buttons/images/links, have it call the SubmitForm(); function.
The obvious downside to this is that you can only do one form per page unless you were submitting to your own script and ensure that you use unique field names… Not pretty I know, but it’s an option.
Posted in Development |
No Comments »
February 18th, 2008 by
Ken
So here’s something that had been a bit of a headache for me. I do my ColdFusion development on a local server on my laptop with debugging turned on. Now, when you make calls to a script, ColdFusion adds 2 links (and a bunch of javascript) to the bottom of each page. These 2 links are a huuuge pain when you use the Coldfusion pages for AJAX calls.
In my case, I was getting “div has no properties” errors in the Firefox error console.
What happens is, well. I don’t really know for sure, but I DO know how to fix it.
For any scripts that you’re going to use for AJAX GETs, start off with:
<cfsetting showdebugoutput=”no” />
And end with:
<cfabort />
This will save you a ton of headaches in the end. I don’t know why just the cfsetting doesn’t work but without the cfabort at the end, the links still appear.
Posted in Coldfusion, Development, jQuery |
No Comments »
May 17th, 2007 by
Ken
This is a neat addon I found while roaming through StumbleUpon today. Firebug is something every web developer should have. It helps out in multiple ways when debugging a page. It tracks load times, is a DOM inspector, allows real-time HTML, CSS and Javascript editing… It’s basically a debugging toolkit right in Firefox! Definitely makes things easier to track down when all you have to do is mouse over the area in question and Firebug takes you right to the code from where you can dig deeper into it’s inner workings… What CSS is applied here, HTML tag properties, it’s all there at your fingertips!
Posted in Design, Development, Software |
No Comments »
April 23rd, 2007 by
Ken
I’m not certain how many of you guys out there are programmers, let alone Coldfusion programmers… But I’ve had this problem for a while now and haven’t been able to figure this out so I’m reaching out to my readers to see if anyone has any ideas.
What I’m trying to do is build a templating system in Coldfusion where I would replace a variable with the contents of another processed Coldfusion file. So let’s say I have two files…
hello.cfm
<cfset message = "Hello World!" />
<cfoutput>#message#</cfoutput>
caller.cfm
<cfset bodyText = "this is some text from hello.cfm :: %hello%" />
<cfoutput>#bodyText#</cfoutput>
So what I want now is to replace %hello% with the output of hello.cfm so that in the end, I’ll get the output “this is some text from hello.cfm :: Hello World!
Hope someone out there will see this and have an answer or at least some ideas to get the juices flowing
Thanks!!
UPDATE: LOL, okay so I figured it out.
caller.cfm
<cfset bodyText = "this is some text from hello.cfm :: %hello%" />
<cfsavecontent variable="varHello">
<cfinclude template="hello.cfm" />
</cfsavecontent>
<cfset bodyText = replace(bodyText, "%hello%", varHello, "ALL") />
<cfoutput>#bodyText#</cfoutput>
Now I just need to make this cleaner so that I load just the files I need instead of all of them and assigning them to variables. Any comments would still be greatly appreciated!
Posted in Coldfusion, Development, How To |
No Comments »
February 15th, 2007 by
Ken
A friend of mine found this great addon for firefox called Split Browser which lets you split your web browser in any way you want. Side by side, above and below or a combination of the two!
What I really like is when I’m working on a website, and coupled with IETab, I can have one side show my site in an IE window and the other in Firefox instead of having to actually run both browsers.
There are a few bugs/features that still need to be worked out like tabbed browsing in new frames is disabled when Split Browser is running with a tab manager like Tab Mix Plus. Another is the lost ability to use bookmark keywords in new frames.
One feature I would like to see is an option or menu item which will allow me to automatically size my frames equally instead of having to do it manually.
In any case, I still think this extension is well worth it and any web developer would find it extremely useful when having to deal with IE and Firefox. Hopefully the developer will continue to work on this great addon and have these little bugs worked out in the next release!
Posted in Design, Development, Software |
No Comments »
December 7th, 2006 by
Ken
So for all you web developers out there, how many actually upgraded to IE7 when it came out? With a large number of people still using IE6, our jobs as designers and developers just got a little bit more harder. Once again we have ANOTHER browser version and its own quirks to deal with!!
Well, Microsoft saw this coming as well and decided to help us out delivering a Virtual PC virtual-machine image containing a copy of pre-activated Windows XP SP2, IE6 and the IE7 Readiness Toolkit.
While the image will only work up until April 1st, 2007, the IE team noted on their blog that “We hope to continue to provide these images in the future as a service to web developers.”
They continued to say “While we’ve released a VPC image today with Windows XP SP2, we’re also investigating creating other VPC images, for example IE5, IE5.5, IE6 and IE6 SP1, as well as versions of IE on different language operating systems.”
Sounds like a great idea to me! I wonder if they would be willing to provide an image with IE7? I never installed it when the update came around since I’m a firefox user…
Posted in Development, Software |
No Comments »
November 21st, 2006 by
Ken
This is a Firefox extension for all you Flash developers out there. The ever so aptly named Flash Switcher extension for Firefox does exactly as it says, allow you to change between every published version of Flash there is from version 2 to 9.0.16 or no Flash at all. See how backwards compatible your Flash applications are or how they perform under different situations.
Posted in Development, Software |
No Comments »