Useful CodeLets

Drupal: Reset admin password

This CodeLet will create hash for your admin password. You can provide the string for password and the CodeLet will generate the hash. You can then copy this hash and add in password field in the users table. The code has to be put in index.php of your Drupal installation and the order of the code is important.

Drupal: Taxonomy tree with image

This CodeLet creates a tiled dispay of taxonomy block with child terms. If you use taxonomy image module, you can select the preset and taxonomy on block configuration page. The CodeLet then fetches all the tree along with their images and display in tile in the block.

Drupal: Recycle Ubercart coupons

This CodeLet recycles coupons created using Ubercart coupon module. The CodeLet chooses a coupon randomly from the available active coupons and send an email with coupon details to respective users. The coupon is remain active uintil defined period and then expires. This CodeLet, when cron runs, activates those coupons and those can be used again.

Drupal: Country dependant city dropdowns

This Codlet allows you to load state and city dropdown fields from country you select.
It works as follow:

1. select country, states dropdown will be loaded from country.
2. select state, city dropdown will be loaded from state you select.

Ex. selected country is 'INDIA' you get states dropdown depend on INDIA,

Set user password using RULES

This CodeLet allows to set the user password during Rule execution, the following process can be used.

a) create user entity ($newuser)
b) set a rules variable $password (use PHP code to generate a random string)
c) execute custom PHP which looks like

This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.

Drupal: Programmatically manage members of sub groups

This CodeLet let you Programmatically manage members of sub groups. also you can add sub group.
you can inviter/remove peoples of sub groups. Invitation will be sent by email.
after installation of this CodeLet you must have to pass the group gid on query string,
Ex. yourdomain/subgroups/$gid.

CodeLet Dependencies:
1-Organic groups ( og )
2-Subgroups for Organic groups ( og_subgroups )
3-OG Invite People ( og_invite_people ).

Drupal: Last Login details

This CodeLet will store user's login history and creates a block. Admin can place this block on user pages or on pages. Future ammendments to this code will allow to use the stored login details to be displayed using a theme function.
This CodeLet will be submitted to community soon.