</td>
<td class="columnID columnUserID">{@$user->userID}</td>
<td class="columnIcon"><p class="framed">{@$user->getAvatar()->getImageTag(24)}</p></td>
- <td class="columnTitle columnUsername">{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>{else}{$user->username}{/if}</td>
+ <td class="columnTitle columnUsername">{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>{else}{$user->username}{/if}{if MODULE_USER_RANK && $user->getUserTitle()} <span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>{/if}</td>
{foreach from=$columnHeads key=column item=columnLanguageVariable}
- <td class="column{$column|ucfirst}">{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</td>
+ <td class="column{$column|ucfirst}{if $columnStyling[$column]|isset} {$columnStyling[$column]}{/if}">{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</td>
{/foreach}
{event name='columns'}
<dd>
<label><input type="checkbox" name="columns[]" value="email" {if "email"|in_array:$columns}checked="checked" {/if}/> {lang}wcf.user.email{/lang}</label>
<label><input type="checkbox" name="columns[]" value="registrationDate" {if "registrationDate"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.registrationDate{/lang}</label>
+ <label><input type="checkbox" name="columns[]" value="lastActivityTime" {if "lastActivityTime"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.lastActivityTime{/lang}</label>
+ <label><input type="checkbox" name="columns[]" value="profileHits" {if "profileHits"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.profileHits{/lang}</label>
+ <label><input type="checkbox" name="columns[]" value="activityPoints" {if "activityPoints"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.activityPoint{/lang}</label>
+ {if MODULE_LIKE}
+ <label><input type="checkbox" name="columns[]" value="likesReceived" {if "likesReceived"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.like.likesReceived{/lang}</label>
+ {/if}
{event name='searchDisplayColumns'}
</dd>
</dl>
public $columnHeads = array();
/**
- * list of available columns
+ * list of selected columns
* @var array<string>
*/
- public $columns = array('email', 'registrationDate');
+ public $columns = array('email', 'registrationDate', 'lastActivityTime', 'profileHits', 'activityPoints', 'likesReceived');
+
+ /**
+ * applies special CSS classes for selected columns
+ * @var array
+ */
+ public $columnStyling = array(
+ 'registrationDate' => 'columnDate',
+ 'lastActivityTime' => 'columnDate',
+ 'profileHits' => 'columnDigits',
+ 'activityPoints' => 'columnDigits',
+ 'likesReceived' => 'columnDigits'
+ );
/**
* list of column values
/**
* @see \wcf\page\SortablePage::$validSortFields
*/
- public $validSortFields = array('email', 'userID', 'registrationDate', 'username');
+ public $validSortFields = array('email', 'userID', 'registrationDate', 'username', 'lastActivityTime', 'profileHits', 'activityPoints', 'likesReceived');
/**
* @see \wcf\page\IPage::readParameters()
'hasMarkedItems' => ClipboardHandler::getInstance()->hasMarkedItems(ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user')),
'url' => $this->url,
'columnHeads' => $this->columnHeads,
- 'columnValues' => $this->columnValues
+ 'columnValues' => $this->columnValues,
+ 'columnStyling' => $this->columnStyling
));
}
$this->columnValues[$user->userID][$column] = DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::DATE_FORMAT);
break;
+ case 'lastActivityTime':
+ if ($user->{$column}) {
+ $this->columnValues[$user->userID][$column] = DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::DATE_FORMAT) . ' ' . DateUtil::format(DateUtil::getDateTimeByTimestamp($user->{$column}), DateUtil::TIME_FORMAT);
+ }
+ break;
+
+ case 'profileHits':
+ case 'activityPoints':
+ case 'likesReceived':
+ $this->columnValues[$user->userID][$column] = StringUtil::formatInteger($user->{$column});
+ break;
+
default:
if (isset($this->options[$column])) {
if ($this->options[$column]->outputClass) {
*/
protected function readColumnsHeads() {
foreach ($this->columns as $column) {
+ if ($column == 'likesReceived') {
+ $this->columnHeads[$column] = 'wcf.like.likesReceived';
+ continue;
+ }
+ if ($column == 'activityPoints') {
+ $this->columnHeads[$column] = 'wcf.user.activityPoint';
+ continue;
+ }
+
if (isset($this->options[$column]) && $column != 'email') {
$this->columnHeads[$column] = 'wcf.user.option.'.$column;
}