| 1 |
<?php |
<?php |
| 2 |
// $Id: indexpage.module,v 1.8.2.6.2.21 2009/07/17 18:45:49 nancyw Exp $ |
// $Id: indexpage.module,v 1.8.2.6.2.22 2009/07/18 01:17:49 nancyw Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 187 |
} |
} |
| 188 |
|
|
| 189 |
// Index by users section. |
// Index by users section. |
| 190 |
$rows = array(); |
if ($show_users) { |
| 191 |
$sql = _indexpage_check_status("SELECT n.uid, COUNT(n.uid) as count FROM {node} n WHERE n.type='%s'") .' GROUP BY n.uid'; |
$rows = array(); |
| 192 |
$users = db_query($sql, $type); |
$sql = _indexpage_check_status("SELECT n.uid, COUNT(n.uid) as count FROM {node} n WHERE n.type='%s'") .' GROUP BY n.uid'; |
| 193 |
while ($u = db_fetch_object($users)) { |
$users = db_query($sql, $type); |
| 194 |
$account = user_load(array('uid' => $u->uid)); |
while ($u = db_fetch_object($users)) { |
| 195 |
$rows[] = array( |
$account = user_load(array('uid' => $u->uid)); |
| 196 |
theme('username', $account, array('picture' => TRUE, 'homepage' => FALSE)), |
$rows[] = array( |
| 197 |
l($u->count, "indexpage/$type/user/$u->uid", array('attributes' => array('title' => t('Show the content this user contributed')))), |
theme('username', $account, array('picture' => TRUE, 'homepage' => FALSE)), |
| 198 |
); |
l($u->count, "indexpage/$type/user/$u->uid", array('attributes' => array('title' => t('Show the content this user contributed')))), |
| 199 |
} |
); |
| 200 |
if ($rows) { |
} |
| 201 |
$header = array(t('User Name'), t('Count')); |
if ($rows) { |
| 202 |
$fieldset = array( |
$header = array(t('User Name'), t('Count')); |
| 203 |
'#title' => t('Users who have created !name content', array('!name' => $name)), |
$fieldset = array( |
| 204 |
'#description' => t('User names link to the user profile; the counts link to a list of titles by that user.'), |
'#title' => t('Users who have created !name content', array('!name' => $name)), |
| 205 |
'#collapsible' => TRUE, |
'#description' => t('User names link to the user profile; the counts link to a list of titles by that user.'), |
| 206 |
'#collapsed' => (count($rows) > variable_get('indexpage_maxresults', 10)), |
'#collapsible' => TRUE, |
| 207 |
'#value' => theme('table', $header, $rows), |
'#collapsed' => (count($rows) > variable_get('indexpage_maxresults', 10)), |
| 208 |
); |
'#value' => theme('table', $header, $rows), |
| 209 |
$output .= '<div class="indexpage-users">'. theme('fieldset', $fieldset) .'</div>'; |
); |
| 210 |
|
$output .= '<div class="indexpage-users">'. theme('fieldset', $fieldset) .'</div>'; |
| 211 |
|
} |
| 212 |
} |
} |
| 213 |
|
|
| 214 |
// Index by taxonomy terms section. |
// Index by taxonomy terms section. |