/[drupal]/contributions/modules/membership/membership.module
ViewVC logotype

Diff of /contributions/modules/membership/membership.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Sun Feb 17 16:50:46 2008 UTC revision 1.1.2.1, Tue May 6 09:00:44 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: membership.module,v 1.1 2008/02/17 16:50:46 boobaa Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 197  function theme_membership_list_form($for Line 197  function theme_membership_list_form($for
197  function membership_expire($uid) {  function membership_expire($uid) {
198    global $user, $base_url;    global $user, $base_url;
199    $member = user_load(array('uid' => $uid));    $member = user_load(array('uid' => $uid));
200      // TODO: check whether the user exists and/or has membership info.
201    $roles = user_roles(TRUE);    // XXX: wouldn't it be faster without TRUE?    $roles = user_roles(TRUE);    // XXX: wouldn't it be faster without TRUE?
202    $variables = array(    $variables = array(
203      '!member'   => check_plain($member->name),      '!member'   => check_plain($member->name),
# Line 400  you have just been removed from the !rol Line 401  you have just been removed from the !rol
401    }    }
402  }  }
403    
404    function membership_views_tables() {
405      $handler = views_handler_field_dates();
406      unset($handler['views_handler_field_since']);
407      $table = array(
408        'name' => 'membership',
409        'join' => array(
410          'left' => array(
411            'table' => 'node',
412            'field' => 'uid',
413          ),
414          'right' => array(
415            'field' => 'uid',
416          ),
417        ),
418        'fields' => array(
419          'expires' => array(
420            'name' => t('Membership: Expires'),
421            'field' => 'expires',
422            'help' => t('Displays expiration date of author\'s membership.') .' '. t('The option field may be used to specify the custom date format as it\'s required by the date() function.'),
423            'handler' => $handler,
424            'option' => 'string',
425            'sortable' => TRUE,
426          ),
427        ),
428      );
429      $tables['membership'] = $table;
430      return $tables;
431    }
432    
433  // vim: set ft=php syntax=php expandtab ts=2 sw=2 autoindent smartindent:  // vim: set ft=php syntax=php expandtab ts=2 sw=2 autoindent smartindent:

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2