]> git.mxchange.org Git - friendica-addons.git/blob - widgets/widget_friends.php
Update t() calls
[friendica-addons.git] / widgets / widget_friends.php
1 <?php
2
3 use Friendica\Core\L10n;
4
5 function friends_widget_name()
6 {
7         return "Shows profile contacts";
8 }
9
10 function friends_widget_help()
11 {
12         return "";
13 }
14
15 function friends_widget_args()
16 {
17         return [];
18 }
19
20 function friends_widget_size()
21 {
22         return ['100%', '200px'];
23 }
24
25
26 function friends_widget_content(&$a, $conf)
27 {
28         $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile`
29                         LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
30                         WHERE `user`.`uid` = %s AND `profile`.`is-default` = 1 LIMIT 1",
31                 intval($conf['uid'])
32         );
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(contact_block());
51         $o .= "<a href='".$a->get_baseurl().'/profile/'.$a->profile['nickname']."'>". L10n::t('Connect on Friendica!') ."</a>";
52         return $o;
53 }