]> git.mxchange.org Git - friendica.git/blob - src/Module/Itemsource.php
Revert logic change in query in NotificationsManager->setSeen
[friendica.git] / src / Module / Itemsource.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\Content\Text\HTML;
6 use Friendica\Core\L10n;
7 use Friendica\Core\Renderer;
8 use Friendica\Model;
9 use Friendica\Protocol\ActivityPub\Processor;
10 use Friendica\Protocol\Diaspora;
11
12 /**
13  * @author Hypolite Petovan <mrpetovan@gmail.com>
14  */
15 class Itemsource extends \Friendica\BaseModule
16 {
17         public static function content()
18         {
19                 if (!is_site_admin()) {
20                         return;
21                 }
22
23                 $a = self::getApp();
24
25                 if (!empty($a->argv[1])) {
26                         $guid = $a->argv[1];
27                 }
28
29                 $guid = defaults($_REQUEST['guid'], $guid);
30
31                 $source = '';
32                 $item_uri = '';
33                 $item_id = '';
34                 $terms = [];
35                 if (!empty($guid)) {
36                         $item = Model\Item::selectFirst(['id', 'guid', 'uri'], ['guid' => $guid]);
37
38                         $conversation = Model\Conversation::getByItemUri($item['uri']);
39
40                         $guid = $item['guid'];
41                         $item_id = $item['id'];
42                         $item_uri = $item['uri'];
43                         $source = $conversation['source'];
44                         $terms = Model\Term::tagArrayFromItemId($item['id'], [Model\Term::HASHTAG, Model\Term::MENTION, Model\Term::IMPLICIT_MENTION]);
45                 }
46
47                 $tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl');
48                 $o = Renderer::replaceMacros($tpl, [
49                         '$guid'          => ['guid', L10n::t('Item Guid'), $guid, ''],
50                         '$source'        => $source,
51                         '$item_uri'      => $item_uri,
52                         '$item_id'       => $item_id,
53                         '$terms'         => $terms,
54                 ]);
55
56                 return $o;
57         }
58 }