| 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 |
|
|
| 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; |
| 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') { |
| 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) { |
| 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 |