Posts

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);

Concrete5: Unable to get permission key for read

C5 version 5.6.0.2. I was creating a block. It wasn't finished. While I was tweaking the code, I got this error: Unable to get permission key for read. The CCM bar disappeared and I was unable to go back to the homepage. After searching through the forums, I am still unable to find a perfect solution at the time of this writing. If you get this error, you can try the following: Go directly to your dashboard such as http://localhost/site/dashboard Go to Cache and Speed Settings Turn off Basic Cache and Overrides Cache Clear Cache See if you can access your homepage now. If it still doesn't work, uninstall the block you are working on. You can then reinstall it again. That worked for me!

Concrete5: Using "key" as table field name gives MySQL error

Image
Tested in v5.6.0.2. When you are writing table schema for a block in db.xml and have field name as "key", this generates MySQL syntax error while trying to install a package. Just rename the field name to something else. I think it's because "key" already represents a primary key attribute and using the same name again in field name somehow causes conflict.

Wordpress: Dynamically watermark all the uploaded images

I found a nice solution to dynamically watermark all the uploaded images in Wordpress. I'm not going to repost the solution here. Here is the link: http://dolcepixel.com/how-to-watermark-all-your-uploaded-images/ . You can also download a zip file that includes the image, php file and htaccess code.