Drupal Blog

Reset drupal statistics - The Read counter

Here is a quick and easy way to reset the drupal statistics stored in the database with a couple of SQL queries.

You can reset the Total counters with:

UPDATE `node_counter` set `totalcount` = 0;

And the day counters with:

UPDATE `node_counter` set `daycount` = 0;

Important: You should keep a backup of the database before performing any actions.

Drupal: Accordions in custom module - How to

If you'd like some fancy accordion on your module's output, here is a short recipe:

1.Download jquery_update.
Make sure that your jquery version is minimum 1.3.+ after the installation. This is required for the jquery_ui 1.7.x in step 2. An easy way to check the jquery version is to visit the drupal status report page under /admin/reports/status

2. Download jquery_ui.
Install it according to the instructions in the documentation.

Translate <Any> in Views Exposed Filter

While trying to translate the <Any> string in Views, locale returned the error "unsupported HTML".

A quick workaround is to switch from <Any> to -Any-; There is an option available under the Views Tools tab just for that.

The string "-Any-" is translatable, so from this point on it is easy to search for the string "-Any-" in locale search. If it is not found, you would probably need to check that you typed Any in the search form (case sensitive!).

Once found, it is easy to enter the required translation.

Custom submitted by in tpl files

Here is a line of code to override Drupal's submitted by elements in node.tpl.php file.

<span class="submitted">

Draw circle overlay in all points in gmap from Radius in a CCK field | Dynamic gmap Macro in Views

Lately I needed to add a circle in every marker in a gmap provided by Views.

So in order to achieve this, I filled in the Macro textarea of the Style:Gmap settings of the View with the following code. But first, I added the field that contains the Radius value and excluded it from Display, to make the value available in the view result set. This value was in miles, so I made the conversion from km as well.

Recent Comments

Forward by Dries Buytaert, Founder and Project Lead, Drupal; CTO Acquia.

Order now from:

Managing Expectations Podcast with DrupalEasy

Author Interview http://tinyurl.com/8a8nxno

We provide the most Shiny Drupal Bits & Pixels

Since Drupal 4.x

© 2014 Konordo Limited
Drupal Services provider.
All rights reserved.

Reg Nr. 12301661F
VAT Nr. CY10301661D

M. Director: Konstantin Ordoulidis

 

Get in touch

  • Omirou 10, 3095, Limassol, Cyprus
  • +4917698807355
  • info [at] konordo [dot] com

Submit