Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions shrtr.module
Original file line number Diff line number Diff line change
Expand Up @@ -196,25 +196,29 @@ function shrtr_list_page() {

$header = array(t('ID'), t('User'), t('Original URL'), t('New URL'), t('Subbmitted'), t('Expire time'));
$rows = array();

while ($url = $urls->fetchAssoc()) {
$new_url = $base_url . '/shrtr/' . $url['alias'];
$row = array();
$row[] = $url['id'];
$row[] = $url['uid'];
$row[] = l($url['url'], $url['url']);
$row[] = l($new_url, $new_url);
$row[] = format_date($url['created']);
$row[] = format_date($url['expire']);
$rows[] = $row;

while ($url = $urls->fetchAssoc()) {
$new_url = $base_url . '/shrtr/' . $url['alias'];
$row = array();
$row[] = $url['id'];
if($url['uid'] == 0) {
$row[] = variable_get('anonymous', t('Anonymus'));
}
else{
$row[] = user_load($url['uid'])->name;
}
$row[] = $url['url'];
$row[] = l($new_url, $new_url);
$row[] = format_date($url['created']);
$row[] = format_date($url['expire']);
$rows[] = $row;
}

$content['table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);

return $content;
}

Expand All @@ -234,7 +238,7 @@ function shrtr_urls_admin() {
$row = array();
$row[] = $url['id'];
$row[] = $url['enabled'];
$row[] = $url['uid'];
$row[] = user_load($url['uid'])->name;
$row[] = l($url['url'], $url['url']);
$row[] = l($new_url, $new_url);
$row[] = format_date($url['created']);
Expand Down