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

Diff of /contributions/modules/affiliates/affiliates.module

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

revision 1.1.4.5.2.14, Tue Apr 7 16:46:25 2009 UTC revision 1.1.4.5.2.15, Wed Apr 8 16:47:21 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: affiliates.module,v 1.1.4.5.2.13 2009/03/02 16:18:05 paulbooker Exp $  // $Id: affiliates.module,v 1.1.4.5.2.14 2009/04/07 16:46:25 paulbooker Exp $
3    
4  // Portions Copyright 2006 http://2bits.com  // Portions Copyright 2006 http://2bits.com
5  define ('AFFILIATE_BUTTONS_DIRECTORY_RELATIVE_FILES', '/affiliates');  define ('AFFILIATE_BUTTONS_DIRECTORY_RELATIVE_FILES', '/affiliates');
# Line 913  function affiliates_user($op, &$edit, &$ Line 913  function affiliates_user($op, &$edit, &$
913    switch ($op) {    switch ($op) {
914      case 'view':      case 'view':
915        $items = array();        $items = array();
916          $points = db_result(db_query("SELECT SUM(aa.points) AS points
917        if ($user->uid != $account->uid) {          FROM {affiliates} a, {affiliates_ads} aa
918          // someone else viewing their points          WHERE aa.ad_id = a.ad_id
919          $points = db_result(db_query("SELECT SUM(aa.points) AS points          AND a.user_id = %d", $account->uid));
920            FROM {affiliates} a, {affiliates_ads} aa        $affiliates[] = array(
921            WHERE aa.ad_id = a.ad_id              '#type' => 'user_profile_item',
922            AND a.user_id = %d", $account->uid));              '#title' => t('Affiliate points'),
923                '#value' => $account->name . " has earned " . number_format($points) . " points."
924          $items[] = array(            );
925            'title' => t('Affiliate points'),            if ($affiliates) {
926            'value' => $account->name . " has earned " . number_format($points) . " points.",              $affiliates['#type'] = 'user_profile_category';
927          );              $affiliates['#title'] = t('Affiliates');
928        }              $affiliates['#weight'] = 8;
929      return array(t('Affiliate') => $items);              $account->content['Affiliates'] = $affiliates;
930              }
931    }    }
932  }  }
933    

Legend:
Removed from v.1.1.4.5.2.14  
changed lines
  Added in v.1.1.4.5.2.15

  ViewVC Help
Powered by ViewVC 1.1.2