0

A way around page refreshes/back button problems with a simple concept

Posted by Tim on May 17, 2010 in .NET Framework, ASP.NET, News, Open Source, Uncategorized

The problem: You have a form in which the user fills out and clicks a “submit” button that validates their input, does some processing and output’s some results. The problem being the application needs to cater for page refreshes, back buttons and the case of the page being submitted more than once (latency/slow internet connection). [...]

Tags: , ,

 
0

Removing Test orders from Magento

Posted by Tim on March 28, 2010 in Magento, Open Source

If you want to do this manually and not pay (via a extension) then use the following script on your database.   Please make sure you back up your database first, I take no responsibility for the overall result, this script worked for me on version 1.4.0.1: SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_order`; TRUNCATE `sales_order_tax`; TRUNCATE `sales_order_datetime`; TRUNCATE [...]

Tags:

 
0

var _gaq undefined – Magento

Posted by Tim on March 1, 2010 in Open Source, PHP

I came across this javascript error when updating a instance of Magento to version 1.4 and Google Analytics “var _gaq is undefined” In the ga.php file located under /app/code/core/Mage/GoogleAnalytics/Block add the following line of code before _gaq.push javascript “var _gaq = _gaq || [];” – about line 179 This will remove the error.   I still [...]

Tags:

 
0

toolbar.phtml -> Magento 1.4 error

Posted by Tim on February 21, 2010 in Open Source

Came across this error in toolbar.phtml for Magento 1.4: Warning: Invalid argument suppplied for foreach() line 51. Fix is available from here (this is only a fix, it doesn’t solve the problem – The paging is removed). References: http://www.sonassi.com/knowledge-base/magento-1-4-install-errors/

Tags: ,

 
0

Enabling Sales Order Notification in Magento

Posted by Tim on February 8, 2010 in Open Source, PHP

Very helpful post there that enables sales order notifications to the shop admin email address.  Dont’s use the Bcc option System Configuration -> Sales menu, you have to send a copy of the email to another email address. References: http://nik.chankov.net/2009/10/28/adding-notification-when-new-order-arrives-magento/

Tags: ,

 
0

Bluehost wont allow gmail SMTP connections

Posted by Tim on January 12, 2010 in Open Source, PHP

According to bluehost, you cannot send emails through SMTP connections from web applications hosted on bluehost.   They only allow sending through their own SMTP servers. The problem I had was trying to send emails in Magento using GMAIL (Google Apps) using the code from this forum: http://www.magentocommerce.com/boards/viewthread/1073/ The work around is that I setup a [...]

Tags: , ,

 
0

JFactory::getDate() doesn’t automatically add offset

Posted by Tim on December 7, 2009 in Open Source, PHP

By default, calling JFactory::getDate() doesn’t automatically apply the timezone offset.   The default date/time is GMT. By using the following code, you can set the offset from the global joomla configuration file <?php $thisJApp = &JFactory::getApplication(); $thisJDate = JFactory::getDate(); $thisJDate ->setOffset($thisJApp ->getCfg(‘offset’)); echo $thisJDate->toFormat(“%A %d %b %Y”); ?> If you want to set the date from [...]

Tags: ,

 
1

Blocking IP Addresses on Linux Server

Posted by Tim on November 4, 2009 in Open Source, Uncategorized

Had some suspect IP addresses trying to attempt to login via the admin user in Moodle. Best thing to do is block the IP address to the server or even better the IP range (after doing a IP lookup to see where the IP address came from). References: http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/

Tags: ,

 
0

SimplePie Joomla Proxy Issue

Posted by Tim on June 19, 2009 in Open Source, PHP

The issue I had with a particular joomla site is that I could not load external RSS feeds.   The error was “Could not connect to {server}”.   RSS Feed load failed.   This was caused in the SimplePie.php class around line 6601. Steps to resolve: I enabled the cUrl extension in php.ini (running on a IIS platform) [...]

Tags: , ,

 
2

Limiting the number of text in textarea using JQuery

Posted by Tim on May 20, 2009 in Open Source

example: <textarea id=”id” maxlength=”255″></textarea> jQuery(‘textarea[maxlength]‘).keyup(function() { var max = parseInt(jQuery(this).attr(‘maxlength’)); if (jQuery(this).val().length > max) { jQuery(this).val(jQuery(this).val().substr(0, jQuery(this).attr(‘maxlength’))); } if (jQuery(this).parent().find(‘.charsRemaining’).length > 0) jQuery(this).parent().find(‘.charsRemaining’).html(‘You have ‘ + (max – jQuery(this).val().length) + ‘ characters remaining’); else jQuery(this).parent().append(‘<div class=”charsRemaining”>You have ‘ + (max – jQuery(this).val().length) + ‘ characters remaining</div>’); });

Tags:

Copyright © 2008-2010 Tim's CodeLab Blog All rights reserved.
Desk Mess Mirrored v1.7 theme from BuyNowShop.com.