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