Creating A Custom Support Chat Icon From SmarterTracker
Recently I was tasked to create a notifier that smarterTracker support chat is online from inside flash. I quickly explored Tracker for any setting that would allow me to check on some script that would return either 1 for online and 2 for offline. To my dismay, after almost an hour of looking into the admin area, i found absolutely nothing. Tracker do provide a way to show the online/offline image using javascript and html. I started to dig down their code and checked what scripts where they checking and how are they doing the notifier.
Their trick puzzled me a bit. Its not quite obvious with just one look but with time i figured the secret out. They are returning a transparent gif, which for some odd reason is of the same filesize when it online and offline. They are returning for online a 1 pixel by 1 pixel transparent gif when online and a 1 pixel x 2 pixel image when offline. Since Flash is not my strong points i created a simple php file to check the returned image for its height and return it to flash.
PHP Script contents follow:
$domain = 'domain.com';
$port = 1234;
$config_id = 1;
if(strlen($port))
{
$domain .= ':'.$port;
}
$x = getimagesize("http://".$domain."/ChatScript.ashx?config=".$config_id."&refresh=1&time=".time());
echo $x[1];
And on the flash side of things on the first frame of your movie clip that shows the online and offline image.
stop();
x = setInterval(this, "checkData", 2000);
function checkData()
{
domain = 'domain.com';
var c:XML = new XML();
c.load("http://" + domain + "/status.php");
c.onData = function(data)
{
if(parseInt(data)== 1)
{
//online - modify this to fit your needs
onlinechat.gotoAndStop('online');
}
else
{
//offline - modify this to fit your needs
onlinechat.gotoAndStop('offline');
}
}
}
No More SPAM Comments
Ever since i started this, i have had more than 10,000 spam comments and only 3 valid ones, a mind numbing amount of spam which i had to sort out and mark each of the spam comments one by one. There was a time i had to sort through 3000 comments. And i can remember a time that i basically had to run some sql queries on the database to mark everything as spam. This is when i left this blog alone for about 2 months. I have looked into a solution but it seems nothing worked.
Then i found WPSpamFree, it very simple to install with the new WordPress 2.7. Its been 48 hours since i activated that plugin and it has blocked about 80 SPAM comments. Hopefully this ANTISPAM solution will hold. Right now it is such a relief to not get countless comment alert on my email and to spend hours sorting through all the comments. I think this is something that WordPress should come with by default to help newbies on dealing with the thousands of spammers out there.
Blog Upgraded to WordPress 2.7
It has been months since i last worked on this blog. And i have ignored the message on wordpress admin to upgrade, today i finally gave in and i like the new WordPress. From the look of it, it looks very polished and well though of. It seems much easier to user and faster (when i enabled use of Gears). There are a bunch of new features on the new release. On of the most exciting for me is the plugin installer and updater, it works awesome and is a very nice and makes for the convenient installing and upgrading. Its a very usefull feature and really does makes thing a lot easier.
I may need to scrap the photo gallery and code something better. I really dont like the way it is right now. Have to be off the keyboard as well and take a number of shots to update my photogallery. Its been a while since i last posted something new in there. Work has been strapped to a chair in my office for i think a year now. Hopefully i can get some updates into that area as well.
I think the new version also removed the lightbox for all images embedded on my post. I do however like the “Media Library” feature. Yet another thing that makes life a lot easier. I can only wish that install plugins on oscommerce could be as easy as how wordpress does it. Oscommerce does not even have the update notification feature even that would help a lot of people. The beauty of open source is that if you dont like how something works you can always grab the code and make it work your way, hopefully i can have enough time this year to work on my own release of Oscommerce. But for now will have to go Line By Line Day by Day and slowly but steady.
Trouble With Google Code SVN
It could just be my dual wan configuration messing up google code SVN Commit. For people trying to download my code for extOSC (as if there are any trying to download it
) Please download the zip file i have uploaded on the downloads tab on google code. For some reason i have to commit directory by directory otherwise the when i do the whole oscommerce code it present some sort of error message. Im still trying to sort out the error out.
ExtJS + Oscommerce = ExtOSC???
Recently I started work on making a more user friendly and responsive version of oscommerce. My plan is to add bits of AJAX to the admin area, add sort of live help, and rethink how the admin area is structured. Added to that im thinking of breaking up the script into four, one for the main file, one for the javascript code, one to contain the actions and the last one to contain php code that would serve data to the javascript. It would somehow make my life easier in developing code that would make oscommerce even greater than it is right now.
The ultimate goal is to release some sort of a branch of oscommerce added with essential contributions much like oscmax or oscreloaded with some modifications to make the learning curve for using oscommerce a bit easier. One area that needs a lot of work is the product options area, the one that comes with oscommerce is very complicated and is very hard for novices to get their minds around it.
After 48 hours of work, i have sort of finished the configuration area. I think it is a much faster way of working in the configuration area. Hopefully i will have the time and the resources to convert the rest of the admin area to the look and the feel of the finished configuration area.
You can download the code at Google Code. You can download my first release there. I do however suggest not using it for anything in production since it might have MAJOR vulnerabilities.




