/[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.4 by kbahey, Sat Mar 8 19:36:48 2008 UTC revision 1.1.4.5 by paulbooker, Thu Oct 23 08:58:03 2008 UTC
# Line 20  function affiliates_help($section) { Line 20  function affiliates_help($section) {
20      case 'admin/modules#description':      case 'admin/modules#description':
21        return t('A module that allows affiliate click-throughs to be tracked.');        return t('A module that allows affiliate click-throughs to be tracked.');
22      case 'admin/settings/affiliates':      case 'admin/settings/affiliates':
23        return t('<p>$Revision: 1.1.4.3 $ $Date: 2007/04/14 04:58:18 $</p>A module that allows affiliate click-throughs to be tracked.');        return t('<p>$Revision: 1.1.4.4 $ $Date: 2008/03/08 19:36:48 $</p>A module that allows affiliate click-throughs to be tracked.');
24    }    }
25  }  }
26    
# Line 97  function affiliates_menu($may_cache) { Line 97  function affiliates_menu($may_cache) {
97        'access' => user_access('access content'),        'access' => user_access('access content'),
98        'type' => MENU_HIDE,        'type' => MENU_HIDE,
99      );      );
100    
101        $items[] = array(
102          'path' => 'affiliates',
103          'title' => t('Affiliates Home'),
104          'callback' => 'affiliates_list',
105          'access' => user_access('access content'),
106        );
107    }    }
108    
109    return $items;    return $items;
# Line 460  function _get_top_users_page() { Line 467  function _get_top_users_page() {
467    
468    $output = theme('table', $header, $rows);    $output = theme('table', $header, $rows);
469    
470    cache_set(AFFILIATE_TOP_USERS_PAGE, $output);    cache_set(AFFILIATE_TOP_USERS_PAGE, 'cache', $output);
471  }  }
472    
473  function _get_top_users_block($type = 'total') {  function _get_top_users_block($type = 'total') {
# Line 493  function _get_top_users_block($type = 't Line 500  function _get_top_users_block($type = 't
500    
501    $output = theme('table', array(), $rows);    $output = theme('table', array(), $rows);
502    
503    cache_set(AFFILIATE_TOP_USERS_BLOCK . $type, $output);    cache_set(AFFILIATE_TOP_USERS_BLOCK . $type, 'cache', $output);
504  }  }
505    
506  function _create_summary_data($limit = 5) {  function _create_summary_data($limit = 5) {
# Line 512  function _create_summary_data($limit = 5 Line 519  function _create_summary_data($limit = 5
519    
520    // Populate it with the users and total clicks    // Populate it with the users and total clicks
521    db_query("INSERT INTO {affiliates_summary}    db_query("INSERT INTO {affiliates_summary}
522      SELECT a.user_id, SUM(aa.points), 0      SELECT a.user_id, SUM(aa.points) as lp, 0
523      FROM {affiliates} a, {affiliates_ads} aa      FROM {affiliates} a, {affiliates_ads} aa
524      WHERE aa.ad_id = a.ad_id      WHERE aa.ad_id = a.ad_id AND a.user_id != 0
525      GROUP BY a.user_id      GROUP BY a.user_id
526        ORDER BY lp DESC
527      LIMIT %d", $limit);      LIMIT %d", $limit);
528    
529    // Some SQL wizardry to update the period    // Some SQL wizardry to update the period

Legend:
Removed from v.1.1.4.4  
changed lines
  Added in v.1.1.4.5

  ViewVC Help
Powered by ViewVC 1.1.3