-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bookmarks.template.php
101 lines (90 loc) · 3.38 KB
/
Bookmarks.template.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
<?php
function template_main()
{
global $context, $settings, $scripturl, $txt;
// Show the good or bad news, if any.
if (isset($context['bookmark_result']))
echo '
<div class="infobox" id="profile_success">
', $context['bookmark_result'], '
</div>';
// We know how to sprite these
$message_icon_sprite = array('clip' => '', 'lamp' => '', 'poll' => '', 'question' => '', 'xx' => '', 'moved' => '', 'exclamation' => '', 'thumbup' => '', 'thumbdown' => '');
// Let's get the show moving.
echo '
<h3 class="category_header">', $txt['bookmark_list'], '</h3>';
// Show the bookmarks, if any.
if (!empty($context['bookmarks']))
{
echo '
<form class="generic_list_wrapper" action="', $scripturl, '?action=bookmarks;sa=delete" method="post">
<table class="table_grid">
<thead>
<tr class="table_head">
<th style="width:50px;"></th>
<th class="grid33">', $txt['subject'], '</th>
<th class="nowrap">', $txt['started_by'], '</th>
<th class="centertext">', $txt['replies'], '</th>
<th class="centertext">', $txt['views'], '</th>
<th class="grid25">', $txt['latest_post'], '</th>
<th class="centertext">
<input type="checkbox" class="input_check" onclick="invertAll(this, this.form);" />
</th>
</tr>
</thead>
<tbody>';
foreach ($context['bookmarks'] as $topic)
{
// Show the topic's subject
echo '
<tr>
<td>
<p class="topic_icons', isset($message_icon_sprite[$topic['first_post']['icon']]) ? ' topicicon img_' . $topic['first_post']['icon'] : '', '">';
if (!isset($message_icon_sprite[$topic['first_post']['icon']]))
echo '
<img src="', $topic['first_post']['icon_url'], '" alt="" />';
echo '
</p>
</td>
<td>';
// Any new replies?
if ($topic['new'])
echo '<a class="new_posts" href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '">' . $txt['new'] . '</a> ';
// Show the board the topic was posted in, as well as a link to the profile of the topic starter
echo
$topic['first_post']['link'],
'<br />
<span class="smalltext"><i>', $txt['in'], ' ', $topic['board']['link'], '</i></span>
</td>
<td>', $topic['first_post']['member']['link'], '</td>
<td class="centertext">', $topic['replies'], '</td>
<td class="centertext">', $topic['views'], '</td>
<td>
<a href="', $topic['last_post']['href'], '">
<img class="floatright" src="', $settings['images_url'], '/icons/last_post.png" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
<span class="smalltext">
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</span>
</td>
<td class="centertext">
<input type="checkbox" name="remove_bookmarks[]" value="', $topic['id'], '" class="input_check" />
</td>
</tr>';
}
echo '
</tbody>
</table>
<div class="submitbutton">
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
<input class="button_submit" type="submit" name="send" value="', $txt['bookmark_delete'], '" />
</div>
</form>';
}
// Show a message saying there aren't any bookmarks yet
else
{
echo '
<div class="description">', $txt['bookmark_list_empty'], '</div>';
}
}