forked from minutils/feed-on-feeds
-
Notifications
You must be signed in to change notification settings - Fork 1
/
items.php
136 lines (104 loc) · 3.47 KB
/
items.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/*
* This file is part of FEED ON FEEDS - http://feedonfeeds.com/
*
* items.php - displays right hand side "frame"
*
*
* Copyright (C) 2004-2007 Stephen Minutillo
* [email protected] - http://minutillo.com/steve/
*
* Distributed under the GPL - see LICENSE
*
*/
include_once("fof-main.php");
include_once("fof-render.php");
if($_GET['how'] == 'paged' && !isset($_GET['which']))
{
$which = 0;
}
else
{
$which = $_GET['which'];
}
$order = $_GET['order'];
if(!isset($_GET['what']))
{
$what = "unread";
}
else
{
$what = $_GET['what'];
}
if(!isset($_GET['order']))
{
$order = $fof_prefs_obj->get("order");
}
$how = $_GET['how'];
$feed = $_GET['feed'];
$when = $_GET['when'];
$howmany = $_GET['howmany'];
$title = fof_view_title($_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany'], $_GET['search']);
$noedit = $_GET['noedit'];
?>
<ul id="item-display-controls-spacer" class="inline-list">
<li class="orderby">[new to old]</li>
<li class="orderby">[old to new]</li>
<li><a href="javascript:flag_all();mark_read()"><strong>Mark all read</strong></a></li>
<li><a href="javascript:flag_all()">Flag all</a></li>
<li><a href="javascript:unflag_all()">Unflag all</a></li>
<li><a href="javascript:toggle_all()">Toggle all</a></li>
<li><a href="javascript:mark_read()">Mark flagged read</a></li>
<li><a href="javascript:mark_unread()">Mark flagged unread</a></li>
<li><a href="javascript:show_all()">Show all</a></li>
<li><a href="javascript:hide_all()">Hide all</a></li>
</ul>
<br style="clear: both"><br>
<p><?php echo $title?></p>
<ul id="item-display-controls" class="inline-list">
<li class="orderby"><?php
echo ($order == "desc") ? '[new to old]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=desc\">[new to old]</a>" ;
?></li>
<li class="orderby"><?php
echo ($order == "asc") ? '[old to new]' : "<a href=\".?feed=$feed&what=$what&when=$when&how=$how&howmany=$howmany&order=asc\">[old to new]</a>" ;
?></li>
<li><a href="javascript:flag_all();mark_read()"><strong>Mark all read</strong></a></li>
<li><a href="javascript:flag_all()">Flag all</a></li>
<li><a href="javascript:unflag_all()">Unflag all</a></li>
<li><a href="javascript:toggle_all()">Toggle all</a></li>
<li><a href="javascript:mark_read()">Mark flagged read</a></li>
<li><a href="javascript:mark_unread()">Mark flagged unread</a></li>
<li><a href="javascript:show_all()">Show all</a></li>
<li><a href="javascript:hide_all()">Hide all</a></li>
</ul>
<!-- close this form to fix first item! -->
<form id="itemform" name="items" action="view-action.php" method="post" onSubmit="return false;">
<input type="hidden" name="action" />
<input type="hidden" name="return" />
<?php
$links = fof_get_nav_links($_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany']);
if($links)
{
?>
<center><?php echo $links ?></center>
<?php
}
$result = fof_get_items(fof_current_user(), $_GET['feed'], $what, $_GET['when'], $which, $_GET['howmany'], $order, $_GET['search']);
$first = true;
foreach($result as $row)
{
$item_id = $row['item_id'];
if($first) print "<script>firstItem = 'i$item_id'; </script>";
$first = false;
print '<div class="item shown" id="i' . $item_id . '" onclick="return itemClicked(event)">';
fof_render_item($row);
print '</div>';
}
if(count($result) == 0)
{
echo "<p><i>No items found.</i></p>";
}
?>
</form>
<div id="end-of-items"></div>
<script>itemElements = $$('.item');</script>