| 1 |
<?php |
<?php |
| 2 |
//$Id$ |
//$Id: topichubs_contributors.module,v 1.1 2009/03/03 23:51:06 febbraro Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_topichubs_plugins(). |
* Implementation of hook_topichubs_plugins(). |
| 6 |
*/ |
*/ |
| 7 |
function topichubs_contributors_topichubs_plugins() { |
function topichubs_contributors_topichubs_plugins() { |
| 8 |
return array( |
return array( |
| 9 |
'contributors' => array( |
'contributors' => array( |
| 10 |
'title' => 'Top Contributors', |
'title' => 'Top Contributors', |
| 11 |
'description' => 'Users that have authored the most stories in this Topic Hub', |
'description' => 'Users that have authored the most stories in this Topic Hub', |
| 12 |
'handler' => 'topichubs_plugin_contributors', |
'handler' => 'topichubs_plugin_contributors', |
| 13 |
), |
), |
| 14 |
); |
); |
| 15 |
} |
} |
| 16 |
|
|
| 17 |
/** |
/** |
| 18 |
* Provide the form settings |
* Provide the form settings |
| 19 |
* return the form |
* return the form |
| 20 |
*/ |
*/ |
| 21 |
function topichubs_contributors_topichubs_plugins_settings() { |
function topichubs_contributors_topichubs_plugins_settings() { |
| 22 |
$form = array(); |
$form = array(); |
| 23 |
$options = array(); |
$options = array(); |
| 24 |
|
|
| 25 |
$result = db_query("SELECT uid, name from {users}"); |
$result = db_query("SELECT uid, name from {users}"); |
| 26 |
|
|
| 27 |
while($item = db_fetch_object($result)) { |
while($item = db_fetch_object($result)) { |
| 28 |
$options[$item->uid] = $item->name; |
$options[$item->uid] = $item->name; |
| 29 |
} |
} |
| 30 |
|
|
| 31 |
$form['topichubs_contrib_ignore'] = array( |
$form['topichubs_contrib_ignore'] = array( |
| 32 |
'#type' => 'select', |
'#type' => 'select', |
| 33 |
'#title' => t('Ignore the following'), |
'#title' => t('Ignore the following'), |
| 34 |
'#options' => $options, |
'#options' => $options, |
| 35 |
'#multiple' => true, |
'#multiple' => true, |
| 36 |
'#default_value' => variable_get('topichubs_contrib_ignore', 1), |
'#default_value' => variable_get('topichubs_contrib_ignore', 1), |
| 37 |
'#description' => t('Selected Users will not appear as contributors'), |
'#description' => t('Selected Users will not appear as contributors'), |
| 38 |
); |
); |
| 39 |
|
|
| 40 |
return $form; |
return $form; |
| 41 |
} |
} |