LowlyWorm:
Hi,
I made the modification to /var/www/includes/classes/template_func.php purely to see if everything else worked correctly by hiding that 4th param error.
Changed
function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false)
to
function get_template_dir($template_code, $current_template, $current_page, $template_dir = '', $debug=false)
I'd strongly advise against changing that particular file (other than for debugging purposes). The reason being is that is one of the core zencart files and it can possibly cause lots of unforeseen problems because lots of modules, perhaps all them them will be dependent on it.
It also means it'll need to be repatched any time zencart gets an upgrade.
LowlyWorm:
I'm not a PHP coder (only started looking through it yesterday), and all this dynamic typing scares me a little compared to strongly typed lanugages which I'm used to.
I could argue that if you are used to strongly typed lanquages, the PHP should be a PoP (piece of pxss) <grin>
LowlyWorm:
It seems much harder to tell what you are dealing with when you have a variable i.e. I have to look up to try and find what was assigned to it.. anyway, I'm getting side tracked about PHP!
LOL.
LowlyWorm:
I'm interested in what you mention about $ipath expanding, is that a feature of PHP where a variable can expand to fill more than one parameter? What type does the variable have to be?
Actually, 'expanding' was probably a poor choice of words, and not really correct.
Suppose we needed to pass two parameters to a function, we would typically use something like:
thisfunction(valueA, valueB)
Or in a strongly typed language
thisfunction(int integerA, string stringA)
What I have done (trying to avoid retyping the same thing in several different places) is to create a 3rd variable called $ipath (for IconPath)
that concats the two paramters to be passed to the function. In other words, using the examples above
$ipath = valueA + "," + valueB
or, strongly typed, it would be:
$ipath = "int " + integerA + "," + "string" + stringA
So now when I call the function, instead of
thisfunction(int integerA, string stringA) I am simply using
thisfunction($ipath)
In most cases/programs this technique would be useless/pointless, but since the icon path never changes during the programs execution it seemed like a practical thing to do.
When I said 'expansion' I was implying that the function being called wouldn't be seeing "$ipath" as a single parameter, it would be recieving it as two separate values ie, valueA, comma, valueB.
This clearly works on my system(s), but for some reason or another it isn't working on yours and at least two others (all windows based)
I think I'll take the 'safe' way in fixing this one and pass the parameters in the more traditional manner rather than saving a few bytes of typing (which has now been 'wasted' in trying to sort out what the heck has gone wrong).
Live and learn. (and frustate a few people in the process).
Cheers, and thanks heaps for all the debugging. I'll try to get an updated release out in the next few days, after I've figured out what the heck happened to the registered overseas parcels.
Rod
NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.
Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.