Sunday, January 24, 2010

OSCommerce Sucks!

For god sake, please rewrite it!

It such a old legacy code, with some noob trying to use Object programming with contructor which form "html" string.. what the hell?

Even the template wasn't using proper include file, with mixture of multiple include file which depend on each other to complete the proper tag! Why?? Tell me why!!?

And most of all, please create hooks!
This is the new way of doing things! so everyone can edit the function without having to hack your source code core! Ppl need to be able to update without such hassle!

Tuesday, January 19, 2010

mysqldump v2?

We have found this handy script done by Huang Kai @

But we needed more features. We needed a view dump as well.
And for some reason, utf8 was having issue with ' delimiter... so we have decided to convert it to " instead.

Here is the file:


Sunday, January 17, 2010

drupal cron for multiple sites

There are times when we have multiple site to maintain for our drupal based websites.
One way to do it is by doing a shell script.
But i would prefer to do it using php script instead:

runcron.php
------------------------

$aSites = array(
"http://xyz.com/cron.php",
"http://example.com/cron.php"
);
foreach( $aSites as $sSite ):
$sContent = file_get_contents($sSite);
echo "Retrieved: " . $sSite . "\r\n
";
echo substr($sContent,0, 100) . "...\r\n
";
endforeach;

-------------------
And setup the cron in cpanel:
php [path_to_your_php]/runcron.php
etc.: php /home/example.com/public_html/mydrupal/runcron.php > /dev/null

Hope this is helpful :)

Monday, January 11, 2010

php ereg is deprecated

Since php 5.3, a lot of functions has been deprecated.
One of the issue is oscommerce. These are the suggested replacement for the code:

ereg => preg_match
eregi => preg_match('/[existing]/i'...)
split => preg_split
ereg_replace => preg_replace

example for eregi:
eregi('^[a-z0-9]$', $char)
to
preg_match('/^[a-z0-9]$/i', $char);


hope it helps :)