Add 'mark read' link to group list page.
This commit is contained in:
parent
bb486431b0
commit
3c22f952df
|
@ -58,6 +58,8 @@ echo '</td>';
|
|||
echo '<td width=100%></td></tr></table>';
|
||||
|
||||
flush();
|
||||
|
||||
// Unsubscribe from group
|
||||
if (isset($_GET['unsub'])) {
|
||||
if (isset($_COOKIE['mail_name'])) {
|
||||
if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
|
||||
|
@ -74,6 +76,17 @@ if (isset($_GET['unsub'])) {
|
|||
}
|
||||
}
|
||||
}
|
||||
// Mark group as read
|
||||
if (isset($_GET['mark_read'])) {
|
||||
if (isset($_COOKIE['mail_name'])) {
|
||||
if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
|
||||
$userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-articleviews.dat';
|
||||
$user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config'));
|
||||
$userdata[$_GET['mark_read']] = time();
|
||||
file_put_contents($userfile, serialize($userdata));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$newsgroups = groups_read($server, $port);
|
||||
echo '<div class="np_index_groups">';
|
||||
|
|
|
@ -691,6 +691,7 @@ function groups_show($gruppen)
|
|||
$groupdisplay .= '<a class="np_group_user_tools" href="index.php?unsub=' . urlencode($g->name) . '">(unsubscribe)</a>';
|
||||
if ($new) {
|
||||
$groupdisplay .= ' <a href="overboard.php?thisgroup=' . urlencode($g->name) . '&time=' . $userdata[$g->name] . '"><b>(new)</b></a> ';
|
||||
$groupdisplay .= ' <a class="np_group_user_tools" href="index.php?mark_read=' . urlencode($g->name) . '">(mark read)</a>';
|
||||
}
|
||||
$groupdisplay .= '</p';
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue