• Avail guidance to develop Drupal modules & Drupal themes
  • Share and get review of your code
  • Get Access to free CodeBooks and ThemeBooks
  • Drupal 5, 6 and 7 covered

Userpoints Meter

0 Points /1000 Points

Drupal Date field: Calculate weekdays

in Project codes

This CodeLet calculates the weekdays and eliminates weekends from the calculation. This CodeLet creates all the days from a start date to end date from a date field and keeps only weekdays. Some of the statmenete in this CodeLet reflects the project specific requirements. This CodeLet is work for a Drupal 7.x date field having end date enabled. The CodeLet takes only start date and end date in form of array as argument.

Drupal computed field: Override Computed field

in Project codes

This CodeLet overrides the computed field and calculates the value programmatically. So you don't have to provide the code in 'Calculate value' on field configuration page. The syntax to override the computed field is as follow:

Drupal 6.x: computed_field_FIELD-NAME_compute($node, $field, &$node_field)
Drupal 7.x : computed_field_YOUR_FIELD_MACHINE_NAME_compute(&$entity_field, $entity_type, $entity, $field, $instance, $langcode, $items)

Drupal ubercart coupon: Send and Recycle ubercart coupons

in Project codes

This CodeLet will pick an inactive coupon created with UC coupons module randomly and generate new coupon code. This coupon can then be send via email using simplenews module. This CodeLet uses three tokens for coupons:

Coupon code: [coupon-code]
Coupon name: [coupon-name]
Coupon value: [coupon-value]

These tokens can also be placed in newsletter subject field.
When a new code is generated and the coupon is get activated, coupon's 'valid from' and 'valid until' values changes to current time and one week later respectively. When the coupon expires, on next cron runs, it will be inactive and be available to be picked again randomly.

The advantage of this CodeLet is, you don't have to add coupons manually each time few of the used up or expired. They get 'recycled'

Donate userpoints on Drupal node page

in Project codes

This CodeLet will display a userpoint donation form. User can donate points to the author of the node right from the node page. This CodeLet donates 'tip' to admin for the nodes admin has created. You can further customize this CodeLet to meet your requirement. With this CodeLet, you will also get a block which you can place any where on the site. The CodeLet uses userpoint-donate module's permissions.

Message on Drupal pages

in Project codes

This CodeLet allow you to display a message on every page.
This is a Drupal 7.x CodeLet which has introduced a new Drupal hook_page_build.

Syndicate content

Advertise here

Recent comments