Alter the comment submit button form in Drupal 7

Submitted by hector on Thursday, June 9th, 2016

Quick function that you can place in your template.tpl.php file to change, alter the value of the submit button. Drupal themes come with different values of the submit button, like Save, Post, Send, Submit.

Some Drupal themes allow you to change the value of the submit button via their settings, however If you need to change the submit button value, here;s the code to do it.

Drupal 7 only:

function YourTheme_form_comment_form_alter(&$form, $form_state, $form_id) {
    $form['actions']['submit']['#value'] = t('Submit Text');

This code works only for the comment form.


* * *

Reload or refresh your Cygwin terminal

Submitted by hector on Wednesday, January 6th, 2016

When you make changes to your .bashrc or bash_profile file, like adding an Alias, you want those changes to take effect immediately. You can do so by refreshing(sourcing) your terminal, like so: source ~/.bashrc, this will work in Linux.

However, if you are on windows and you have Cygwin running as your terminal, and you would like to source your terminal, well, for some unknown reason, when you do source ~/.bashrc, nothing happens, the changes you did to your .bashrc file are not working.

To solve this issue, do this on your Cygwin terminal, starting with the dot:

. ~/.bashrc
. ~/bash_profile
. ~/.bash_aliases

* * *

Unable to send or receive MMS on Wind Mobile Canada

Submitted by hector on Saturday, March 28th, 2015

If you are a Wind Mobile customer and you are having issues sending and receiving emails or sending text messages with pictures, here are the proper settings to solve your issue. This worked for me, after doing some trouble shooting and Googling. This should work with Android version 4.x

Go to Settings
Tap More
Choose Mobile Network and Settings
Tap Access Point Names
(Make sure that you have MMS WIND listed, if not, then just add it, Name it MMS WIND.)
MMS Proxy:
MMS Port: 8080
These is very important
APN protocol, should be: IPv4/IPv6
APN roaming protocol: IPv4/IPv6

By default, Wind Mobile has it as IPv4 only, making these changes should solve your MMS issues. You may want to shut down your phone in order for the changes to take effect.

* * *

How to run a php script with Drush

Submitted by hector on Saturday, June 7th, 2014

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:

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

Submitted by hector on Saturday, March 15th, 2014

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

Submitted by hector on Thursday, March 13th, 2014

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.

* * *