Archive for the ‘CMS’ Category.
January 15, 2012, 10:48 am
The view results count is stored in the view object and you can display it by adding a PHP header or footer to your view. In order to have PHP in views you need the module Views PHP, so install it first then add a header or footer with this code.
January 9, 2012, 1:54 pm
This is a quick and easy solution to send an email from Drupal using PHP, i.e a custom module. you will do it in 2 steps (I assume your module is called “mod”): Define mod_mail() (implementing hook_mail() ), this function will prepare the email Send the email using drupal_mail() Define mod_mail() /** * Implementation of [...]
December 24, 2011, 11:30 am
We used to get the files directory using file_directory_path() in Drupal 5 and 6, the function was removed with Drupal 7 but you can still get the files public directory like this: echo variable_get(‘file_public_path’, conf_path() . ‘/files’); // Output: sites/default/files
December 23, 2011, 8:48 pm
This is how I get the current path and/or alias in Drupal: After this code has been executed: $path will hold the internal drupal path $alias will hold that path alias if the path in the url is actually an alias, otherwise FALSE; $path_from_url = isset($_GET['q']) ? $_GET['q'] : ”; $path = drupal_get_normal_path($path_from_url); if($path === [...]
October 31, 2011, 6:13 pm
The error looks like: c.widget is not a function Or: d.widget is not a function I get this error when I do theming or module development for Drupal. Basically this tells you that the file jquery.ui.widget.js is missing. check the code you were writting and add that file to Drupal like this: drupal_add_js(‘misc/ui/jquery.ui.widget.min.js’);
September 19, 2011, 10:46 pm

In this tutorial I’m gonna show you how to calculate and display properly the age from a date CCK field the simplest way. The method I’m about to show you doesn’t need the Views module and if you use Views you’ll find that it’s totally compatible without adding any PHP code. Requirements Before starting I [...]
September 28, 2010, 3:04 am
$body_classes variable and how it’s used By default, Drupal provides Drupal themes coders with a variable $body_classes which contains a list of space separated keywords that you can use to style your page depending on different factors including the user status (logged in or not), the page he is viewing (frontpage, node, page, story…). Make [...]
August 19, 2010, 3:45 am

Here is a small… yes, a small function for displaying a paged navigation in your WordPress powered blog without using any plugin. The function is self-explaining, it accepts one optional parameter, the number of links to show without counting the previous and next buttons. It accepts your language The first, previous, next and last buttons [...]
May 5, 2010, 12:14 pm

Hello, I found your website on a WordPress forum. Currently I am rebuilding a website in wordpress that is in English and Farsi. I am using the Qtranslate and a theme called suffusion which supports RTL. The theme does come a rtl.css which moves everything to the right which is great. The problem I am [...]
January 22, 2010, 2:03 pm

How can I detect the current WordPress version? Log in to your admin Dashboard and scroll to the bottom of the page, you’ll find your version number on the rightmost spot of the footer. Or you can view the source of one of the pages of your blog and look for the meta generator tag: [...]