BrianJubal

removing the preview button (and delete button)

  1. function sitehelper_form_alter($form_id, &$form) {
  2.    global $user;
  3.    switch ($form_id) {
  4.       case 'linfo_node_form':
  5.       if($user->uid != '1') {
  6.          unset($form['preview']);

Manually created Views

  1. function sitehelper_views_tables() {
  2. // view created from email column in users table
  3.   $table = array(
  4. // name of table
  5.     'name' => 'users',
  6.     'provider' => 'internal',

looping through CCK Matrix to provide a view for each field

  1.   foreach (array(1,2,3,4) as $matrixrow) {
  2.     foreach (array(1,2) as $matrixcol) {
  3.       $matrixindex = $matrixrow.'_'.$matrixcol;
  4.       $table = array(

Fix for Alter code look right? (come back to #drupal-support if you want to talk more)

  1. function chatblock_update_1() {
  2.   db_query("ALTER TABLE {chatblock} MODIFY timestamp BIGINT( 14 ) NULL DEFAULT NULL");
  3. }

Using hook_form_alter to fill in cck fields automatically and then hiding them from users

  1. function sitehelper_form_alter($form_id, &$form) {
  2.    global $user;
  3.    switch ($form_id) {
  4.  
  5.    // Only do this for the review type's form
  6.    case 'minfo_node_form':

put this in your template.php in your theme

  1. function _phptemplate_variables($hook, $vars) {
  2.   if ($hook == 'page') {
  3.  
  4.     if (arg(0) == 'user') {
  5.       $vars['tabs'] = str_replace('Edit</a>', 'Account</a>', $vars['tabs']);
  6.     }
Syndicate content