Considering you configured your VoIP Drupal with one of the providers, here is the sample code snippet that sends "Hello world" SMS:
$number = '+1234567890123'; //Number to send SMS to. Must be in E.164 format.
$call = new VoipCall();
$text = 'Hello from VoIP Drupal';
Pretty cool, right?
Drupal 7 comes with jquery cookie plugin which can be find under
This plugin can be used to check if user is logged in or not directly from Jquery. We do that by checking if the cookie DRUPAL_UID exists and its value is not equal to 0.
Since I didn't find a good tutorial for theming the Drupal login page I wrote one here.
Getting a page template for the user login page should be as easy as copying your page.tpl.php file and renaming it to page--user-login.tpl.php. Problem is when I tested this It didn't run on /user but only on /user/login page. To get the same template file to run on both you must add to your template.php:
Today I am going to show you how to create a small module that submits results of Drupal user registration form to Hubspot. For those who doesn't know, HubSpot provides advanced targeting marketing and lead nurturing features. You can read more about it at their website: http://www.hubspot.com/
We will call our module hubspot_user.module. First of all we need to create admin configuration form where you can enter three things:
But, how to identify a form? Give an id attribute in the form tag:
If you are looking for a way to check if a file exists in Amazon S3 bucket using Amazon S3 PHP library, then probably this may help you.
Simplest way is to use function getObjectInfo()
//initiate the class
$s3 = new AmazonS3();
$info = $s3->getObjectInfo($bucket, $filename);
//File doesn't exists
This function will return FALSE if $filename doesn't exists in Amazon S3 bucket.
If you are working everyday with Drupal module development you know how frustrating can be that each time you open a module file its show in plaintext instead of in PHP format. Well there is a easy solution, open up your Notepad++ and go to Settings -> Style Configurator.
Depending on which language color syntax you want for the file extension, under Language, select the language.
Select php under Language.
So in previous blog post we talked about saving image to byte array in order to pass it to backend SOAP service. But how about retrieving such image from backend?
Well the logic is similar, so considering you have the byte array returned from SOAP, you will create new php file named image.php:
Recently I worked on integration between Drupal CMS with backend SOAP service and encountered a problem with saving image to the backend. The backend required image to be passed as byte array. Googling around I was suprised to find out answers like "I don't think PHP has such low level control..." or "change your backend service...". Eventually after not finding anything useful I decided to tackle the issue myself and soon I came up with a solution which is actually very easy.