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