Posts

How to make jQuery Cycle2 plugin compatible with old Cycle plugin?

Malsup's Cycle2 plugin does not work with old Cycle plugin if both of them are used on the same page. It's because both these plugins use the same cycle() method name. In order to make both of them work on the same page, one of the plugin's cycle() method must be renamed. I tried this with Cycle 2 version 2.1.2 minified production js file and it seems to work fine. If you are using non-minified file, I think the steps will be pretty similar. Follow the steps below. Open up jquery.cycle2.min.js file and replace all "fn.cycle" with "fn.cycle2" and ".cycle(" with ".cycle2(". You don't need to change the class names, etc. If you are initialising the slideshow by invoking the cycle() method in your view or anywhere else, you will need to change the function call too, such as "$('.myslideshow').cycle2()". If you are using additional plugin files of Cycle2, perform find and replace as shown above on each of the ...

Deprecated: mysql_connect() error in Opencart 1.5.6.1

In my new xampp 1.8.3 installation, I installed Opencart 1.5.6.1 and received a deprecated warning message such as: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ....\system\database\mysql.php on line 6 The quick way to resolve this issue is by making a small change to the config.php and admin/config.php files. In both these config.php files, look for the line define('DB_DRIVER', 'mysql'); Modify the above line to define('DB_DRIVER', 'mysqli'); The new line will simply connect to the database from system/database/mysqli.php file.

PHPBB3 Error: Could not get style data

I moved PHPBB3 files and database from my windows localhost to Linux based remote server. After changing the settings in the remote server's config.php files, I got an error Could not get style data when trying to get to the forum. The reason for this error was that cache subdirectory was not writeable. Just chmod 777 cache and you should be fine.

Joomla: How to add module position within the module or component layout template?

In your site template, you can use something like this to load modules in certain positions: <jdoc:include name="position-0" type="modules" /> You can't use the above markup within the module or component layout template (we are talking about the php files inside /tmpl subdirectory of your module or component's view). But there is a workaround. Method 1: This is a straight Joomla code. You can use the following code to load modules within the module or component layout templates: <?php $document = &JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $position = 'position-0'; $options = array('style' => 'raw'); echo $renderer->render($position, $options, null); ?> This will load the modules that are assigned in "position-0" position. Method 2: There is another method using an extension if you don't want to write all those lines of code. You...

Step-by-step guide to transfering your web hosting to a new web host with domain transfer

If you are planning to move your website to a new host along with domain transfer, here are some easy tips to follow. First, allow plenty of time- at least a week before your hosting plan expires. You do not have to let your existing host know about your plan to move away from them. However, you have to be aware of the auto-renewal feature. Your existing host may have auto-renewal turned on in your account. What this does is - they auto renew your hosting and/or domain 7 to 14 days prior to the expiry date. If you are not sure, check with them if they have auto-renewal enabled in your account. If they have it enabled, request for the auto-renewal to be turned off. You can then take your time to transfer your hosting and/or domain. Backup everything from your existing web space - all files and folders inside the /public_html or /www folder and the databases.

MailChimp API V2.0 SSL error solution

I got this SSL error while trying to use MailChimp API V2.0 in my localhost. Fatal error: Uncaught exception 'Mailchimp_HttpError' with message 'API call to lists/list failed: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in C:\Installation\xampp\htdocs\mailchimp-test\Mailchimp.php:192 Stack trace: #0 C:\Installation\xampp\htdocs\mailchimp-test\mailchimp-api.php(16): Mailchimp->call('lists/list', Array) #1 {main} thrown in C:\Installation\xampp\htdocs\mailchimp-test\Mailchimp.php on line 192 To resolve this, you can try any of the methods below. Method 1: Download cacert.pem file from here: http://curl.haxx.se/docs/caextract.html Save the file in your PHP installation folder. I am using xampp. So I saved it in C:\Installation\xampp\php\cacert.pem Open your php.ini file and add this line: curl.cainfo="C:\Installation\xampp\php\cacert.pem...

MySQL: How to delete records by date

Delete records where date is less than a certain date: DELETE FROM `tablename` WHERE `date` < '2012-08-01'; You can also include intervals: DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 3 MONTH); DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 3 WEEK); DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 2 DAY);