]> git.mxchange.org Git - friendica-addons.git/blob - widgets/widget_friendheader.php
Update obsolete App::getBaseUrl calls to DI::baseUrl
[friendica-addons.git] / widgets / widget_friendheader.php
1 <?php
2
3 use Friendica\Content\Text\HTML;
4 use Friendica\Core\L10n;
5 use Friendica\DI;
6
7 function friendheader_widget_name()
8 {
9         return "Shows friends as a bar";
10 }
11 function friendheader_widget_help()
12 {
13         return "";
14 }
15
16 function friendheader_widget_args()
17 {
18         return [];
19 }
20
21 function friendheader_widget_size()
22 {
23         return ['780px','140px'];
24 }
25
26
27 function friendheader_widget_content(&$a, $conf)
28 {
29         $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
30                         LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
31                         WHERE `user`.`uid` = %s AND `profile`.`is-default` = 1 LIMIT 1",
32                 intval($conf['uid'])
33         );
34         if (!count($r)) {
35                 return;
36         }
37
38         $a->profile = $r[0];
39
40         $o = "";
41         $o .= "<style>
42                 body {font-size: 0.8em; margin: 0px; padding: 0px;}
43                 #contact-block { overflow: hidden; height: auto; }
44                 .contact-block-h4 { float: left; margin: 0px; }
45                 .allcontact-link { float: right; margin: 0px; }
46                 .contact-block-content { clear:both; }
47                 .contact-block-div { display: block !important; float: left!important; width: 50px!important; height: 50px!important; margin: 2px!important;}
48
49         </style>";
50         $o .= _abs_url(HTML::contactBlock());
51         $o .= "<a href='".DI::baseUrl()->get().'/profile/'.$a->profile['nickname']."' target=new>". L10n::t('Get added to this list!') ."</a>";
52
53         return $o;
54 }