-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meta.php
39 lines (33 loc) · 917 Bytes
/
meta.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
<?php
$metas = [];
if (isset($state->x->feed)) {
$metas[$url . ($state->routeBlog ?? '/article') . '/feed.xml'] = 'RSS';
}
if (isset($state->x->sitemap)) {
$metas[$url . '/sitemap.xml'] = 'Sitemap';
}
if (isset($state->x->user)) {
$route = $state->x->user->route ?? '/user';
$route_secret = $state->x->user->guard->route ?? $route;
if (Is::user()) {
$metas[$url . $route_secret . '/' . $user->name . $url->query([
'exit' => $user->token,
'kick' => $url->path
])] = 'Exit';
} else {
$metas[$url . $route_secret . $url->query([
'kick' => $url->path
])] = 'Enter';
}
}
asort($metas);
if ($metas) {
echo '<h2>' . i('Links') . '</h2>';
echo '<ul>';
foreach ($metas as $k => $v) {
echo '<li>';
echo '<a href="' . eat($k) . '">' . i($v) . '</a>';
echo '</li>';
}
echo '</ul>';
}