FeedOnFeeds/view-action.php

48 lines
1.1 KiB
PHP
Raw Normal View History

2009-08-03 16:42:04 +04:00
<?php
/*
* This file is part of FEED ON FEEDS - http://feedonfeeds.com/
*
* view-action.php - marks selected items as read (or unread)
*
* Copyright (C) 2004-2007 Stephen Minutillo
* steve@minutillo.com - http://minutillo.com/steve/
*
* Distributed under the GPL - see LICENSE
*/
include_once("fof-main.php");
2015-09-18 15:48:05 +03:00
$items = [];
2009-08-03 16:42:04 +04:00
while (list ($key, $val) = each ($_POST))
{
$first = false;
if ($val == "checked")
2009-08-03 16:42:04 +04:00
{
$key = substr($key, 1);
$items[] = $key;
}
2009-08-03 16:42:04 +04:00
}
2014-12-10 01:34:17 +03:00
if (!empty($_REQUEST['deltag']))
2009-08-03 16:42:04 +04:00
{
fof_untag(fof_current_user(), $_REQUEST['deltag']);
2009-08-03 16:42:04 +04:00
}
2014-12-10 01:34:17 +03:00
elseif (!empty($_POST['feed']))
2009-08-03 16:42:04 +04:00
{
fof_db_mark_feed_read(fof_current_user(), $_POST['feed']);
2009-08-03 16:42:04 +04:00
}
else
{
if ($items)
{
if ($_POST['action'] == 'read')
fof_db_mark_read(fof_current_user(), $items);
elseif ($_POST['action'] == 'unread')
fof_db_mark_unread(fof_current_user(), $items);
elseif ($_POST['action'] == 'delete')
fof_db_delete_items(fof_current_user(), $items, !fof_is_admin());
}
2009-08-03 16:42:04 +04:00
header("Location: " . urldecode($_POST['return']));
}