| 1 |
<?php |
<?php |
| 2 |
// $Id: affiliates.module,v 1.1.4.5.2.12 2009/02/09 13:49:32 paulbooker Exp $ |
// $Id: affiliates.module,v 1.1.4.5.2.13 2009/03/02 16:18:05 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'); |
| 33 |
function affiliates_perm() { |
function affiliates_perm() { |
| 34 |
//The view own stats permission isn't currently used. Leaving it here for future reference though. |
//The view own stats permission isn't currently used. Leaving it here for future reference though. |
| 35 |
// return array('administer affiliates', 'view own affiliate stats', 'affiliate click'); |
// return array('administer affiliates', 'view own affiliate stats', 'affiliate click'); |
| 36 |
return array('administer affiliates', 'affiliate click'); |
return array('administer affiliates', 'affiliate click', 'affiliate view'); |
| 37 |
} |
} |
| 38 |
|
|
| 39 |
function affiliates_menu() { |
function affiliates_menu() { |
| 113 |
|
|
| 114 |
$items['aff'] = array( |
$items['aff'] = array( |
| 115 |
'page callback' => 'affiliates_click', |
'page callback' => 'affiliates_click', |
| 116 |
'access arguments' => array('access content'), |
'access arguments' => array('affiliate click'), |
| 117 |
'type' => MENU_HIDE, |
'type' => MENU_HIDE, |
| 118 |
); |
); |
| 119 |
|
|
| 120 |
$items['affiliates/top_users'] = array( |
$items['affiliates/top_users'] = array( |
| 121 |
'title' => t('Top Affiliates'), |
'title' => t('Top Affiliates'), |
| 122 |
'page callback' => 'affiliates_top_users', |
'page callback' => 'affiliates_top_users', |
| 123 |
'access arguments' => array('access content'), |
'access arguments' => array('affiliate view'), |
| 124 |
'type' => MENU_HIDE, |
'type' => MENU_HIDE, |
| 125 |
); |
); |
| 126 |
|
|
| 127 |
$items['affiliates/top_climbers'] = array( |
$items['affiliates/top_climbers'] = array( |
| 128 |
'title' => t('Top Affiliate Climbers'), |
'title' => t('Top Affiliate Climbers'), |
| 129 |
'page callback' => 'affiliates_top_climbers', |
'page callback' => 'affiliates_top_climbers', |
| 130 |
'access arguments' => array('access content'), |
'access arguments' => array('affiliate view'), |
| 131 |
'type' => MENU_HIDE, |
'type' => MENU_HIDE, |
| 132 |
); |
); |
| 133 |
|
|
| 134 |
$items['affiliates'] = array( |
$items['affiliates'] = array( |
| 135 |
'title' => t('Affiliates Home'), |
'title' => t('Affiliates Home'), |
| 136 |
'page callback' => 'affiliates_list', |
'page callback' => 'affiliates_list', |
| 137 |
'access arguments' => array('access content'), |
'access arguments' => array('affiliate view'), |
| 138 |
); |
); |
| 139 |
drupal_add_js(drupal_get_path('module', 'affiliates'). '/affiliates.js'); |
drupal_add_js(drupal_get_path('module', 'affiliates'). '/affiliates.js'); |
| 140 |
return $items; |
return $items; |