How to run a php script with Drush

Create a file hello.php, save it in your Drupal root directory, then open your terminal, like Cygwin(If you are on windows). Then navigate to your Drupal root directory where all your projects are located:

cd /path/to/drupal

Once you are there do this:

drush scr ./hello.php

When you execute your php script, it will print Hello World!

The hello.php script should be something like:

<?php
echo "Hello World!";

You do not need to close your php script with ?>. Drush closes it automatically for you.

Having a good knowledge of Php is important, from here you can write advance scripts to maintain your Dupal projects with ease and do jobs that require little of your time.

This was just a demonstration to show you how to run a php script with Drush.

How to remove the annoying Blogger Navbar

Have you ever wanted to remove the Navbar from your Blogger-powered blog? Now you can, and it's quite easy.
Blogger Navbar
When you open a blog account from Blogger, and you are using one of the free templates provided by Blogger, the Navbar is there by default. However, if you are using a third party template, most of the time the navigation bar is removed by the designer.

Here's how to remove the Navbar.

1- Login to your Blogger account, then click on the name of your blog, then click on Layout option.
2- Now look for the Navbar text, then click the Edit link.
Remove Navbar
3- Once you click the Edit link, and the pop-up window opens(scroll down), then select the Off option and click the save button.
Blogger nabvar configuration
4 - Now go to your blog and you will see that the Navbar is gone!

You can easily enable the Blogger Navbar by following the same steps, just select the Navigation bar that fits your blog.

Fight spam with Mollom

Mollom spam statistics
Mollom is a free service offered by parent company Aquia. It does a nice work in stopping most spam, as you can see in the screenshot above. I was getting literally 4000+ spam attempts a day! After I installed it, the statistics went down day by day.

If you have a Drupal website and you are getting bombarded with spam in the comments section, contact page or webforms, I strongly recommend you install Mollom to minimize spam.

Mollom spamm logs
There will always be a few spam that will get through, but most will be stopped. The ones that get through, you can delete that in the comments page.

Download the Mollom module here for Drupal 6 or 7. I believe Mollom is also available for Wordpress, if you have a site built with Wordpress.

After you enabled the Mollom module, you will be asked to enter a Private Key and a Public Key, visit the Mollom page to get it - it's free. Follow the instructions to configure the module, then wait a day, check the Mollom statistics and the Drupal logs messages. You should be able to see the spam that's being blocked.

If you are getting a lot of unsolicited comments on your web page, Mollom is a great module for fighting spam, I recommend it.

How to change the contact page title

Contact page title

Have you ever wondered how to change the title of the contact page in Drupal 7? It sounds easy but it actually requires a bit of php code and it's only a few lines that we need to change the contact page title. Here's how to modify the contact title:

Open the template.php file, it should be under your active theme, in my case it's in (sites/all/themes/zen/template.php).
Place this code anywhere, after the

function YOURTHEME_form_contact_site_form_alter(&$form, &$form_state) {
  drupal_set_title('ADD YOUR TEXT HERE');
}

Where it says YOURTHEME, replace it with your active theme, in my case I use the zen theme, so the final code looks like this:

function zen_form_contact_site_form_alter(&$form, &$form_state) {
  drupal_set_title('Contact Me');
}

Save the template.php file, upload it under your current theme directory. Make sure you clear your cache to see the changes (configuration/development/performance).

The contact page title in Drupal has always been just Contact. The above snippet will allow you to have some more control over the title of the contact page. I am sure there are other ways to accomplish this, but I prefer this method.

It's time to do your taxes

StudioTax-Canadian Personal Income Tax Software
It's 2014 and this is the time of the month to start doing your taxes. The last day to report your income is April 30th, 2014. If you file your income later than April, Revenue Canada may chose to penalized you for late tax report.

Anyhow, if have never done your taxes by yourself before, this might be the year for you to give it a try. Save some money and file your taxes yourself. Here's a good program to do your personal taxes, for free. http://www.studiotax.com/en/

StudioTax is now CRA and Revenue Quebec certified for Netfile and printed returns.

As StudioTax states, it's mostly for personal use, regardless of your level of income.

StudioTax 2013 is the next version to prepare and file the 2013 (due by April 30, 2014) federal and provincial income tax returns including Quebec provincial returns.

Please note that this is strictly for Canadians only. Download it here: http://www.studiotax.com/en/?page=2

How to upgrade from Drupal 6 to Drupal 7

Drupal upgrade from 6 to 7
This site is running Drupal 7. It's been a long time since my last post, I know, anyhow, I just upgraded it a few days ago and I am still working out the details. The major part is over - the core modules.

But how did I do it? Well, I literally followed the steps described bellow, it's in the upgrade.txt file. Read it carefully and read it again and again.

Upgrading from Drupal 6 to 7 might be an overwhelming task, but trust me, it's not that bad. I went through it. What you need is a lot of patience - upgrading from one major version to another does require a lot of attention.

So if you are looking to upgrade your website from Drupal 6 to Drupal 7, read the upgrade.txt thoroughly. Here it is:

MAJOR VERSION UPGRADE
---------------------
To upgrade from a previous major version of Drupal to Drupal 7.x, after
following the instructions in the INTRODUCTION section at the top of this file:

1. Check on the Drupal 7 status of your contributed and custom modules and
   themes. See http://drupal.org/node/948216 for information on upgrading
   contributed modules and themes. See http://drupal.org/node/895314 for a list
   of modules that have been moved into core for Drupal 7, and instructions on
   how to update them. See http://drupal.org/update/modules for information on
   how to update your custom modules, and http://drupal.org/update/theme for
   custom themes.

   You may decide at this point that you cannot upgrade your site, because
   needed modules or themes are not ready for Drupal 7.

Create your own blog with my FREE Drupal installation

Free Drupal Blog
Have you ever wanted to start your very own blog but did not know how? Now you can! I will help you set it up for you and for free! One of the main reasons a lot of people do not start their blog is because they find it difficult set up. And when they hear terms like FTP, Modules, Themes, CPanel, Databases, and so on, they are completely discouraged to start their blog.

Many would be bloggers shy away from even attempting to start their blogs, again, because of the difficulty involved in setting it up. If you find yourself in this situation, you will be glad to hear about my FREE Drupal Blog Installation Service. Find out how to get your own FREE blog.

Firefox 4 slow? Make Firefox 4 faster

Make firefox faster
Firefox 4, the latest version of Mozilla Firefox, was too slow for me. The browser looked good in design, so I upgraded it(regreted it), but in terms of browsing, it was slow, especially when opening new tabs, and got slower when I had several tabs opened.

Here how to make Firefox 4 faster:

  1. Open a new tab in Firefox 4, type about:config. If you get a warning, just click the button.
  2. Then type network.http.pipelining in the Filter bar.
  3. Double click on network.http.pipelining, this will make the value to True.
  4. Same with network.http.pipelining.maxrequests, double click on it, now enter a value of 8 or 10.

Other changes you could make in order to make Firefox 4 run faster:
network.http.max-connections, change it to 100.
network.http.max-connections-per-server, change it to 20.
network.http.max-persistent-connections-per-server, change it to 8.

Restart your Firefox 4 browser, you will notice that Firefox 4 is a bit faster. Opening a new window or tab should be faster. Pages should load faster in Firefox 4 now. It worked for me!

Tags: 

Dear Domain Registry of Canada

Domain Registry Of Canada
Domain Registry of Canada, sounds like a huge company, or the body that manages all domains in Canada, however, this people just misguide the consumer. And their domain pricing is outrageous.

Let me tell you(Domain Registry of Canada/America or Liberty Domains) that I will not fall in your trap, nor I will ever ever pay $40/year bucks for registering a domain with you.

I am a reseller of domain names myself, and I can get you 3 domains for the same price you are charging your customers, and these includes all the perks and goodies.

Stop sending me unsolicited mails now!

Customizing a specific node in Drupal

Customize a page with Drupal
Here is a quick tutorial about customizing a single node in Drupal. There are many reasons you want to customize a node, could be a sponsors page, a product you are promoting, a splash page, just a few examples. You can see a working example of a node already customized here.

Our goal here is to remove the top part of the page, the left and side parts of the page. You can also remove bottom part of the page if you like. The node can be fully customized. At the end, you are left with just the page content.

I used the fusion theme in this example, you can achieve the same thing with any other theme.

1 - First create a page/story, or if you have one already, find its node ID(node/NODENUMBER)
2 - Open the file page.tpl.php
3 - Save It As page-node-NODENUMBER.tpl.php
4 - Remove the header Divs/header content
4 - Remove the left and right sidebars, in the Zen theme, they are called sidebar_first, sidebar_second. Remove the footer if you like.

Once you have modified the node, upload it to your current active theme. Then go to Site Configuration > Performance. Clear the cache.

Now go to the customized node. Just the content of the node shold be displayed. If it looks messed up - things are out of place, that means you have removed too much. Undo the changes, re-upload it. Keep modifying the template until you are happy with the results.

The Zen theme is easier to work with, I recommend it.

Pages

Subscribe to Hectorplus RSS