Merge pull request #775 from annando/twitter-notice
[friendica-addons.git/.git] / widgets / widget_friends.php
1 <?php
2
3 use Friendica\Content\Text\HTML;
4 use Friendica\Core\L10n;
5
6 function friends_widget_name()
7 {
8         return "Shows profile contacts";
9 }
10
11 function friends_widget_help()
12 {
13         return "";
14 }
15
16 function friends_widget_args()
17 {
18         return [];
19 }
20
21 function friends_widget_size()
22 {
23         return ['100%', '200px'];
24 }
25
26
27 function friends_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
35         if (!count($r)) {
36                 return;
37         }
38         
39         $a->profile = $r[0];
40
41         $o = "";
42         $o .= "<style>
43                 body {font-size: 0.8em; margin: 0px; padding: 0px;}
44                 #contact-block { overflow: hidden; height: auto; }
45                 .contact-block-h4 { float: left; margin: 0px; }
46                 .allcontact-link { float: right; margin: 0px; }
47                 .contact-block-content { clear:both; }
48                 .contact-block-div { display: block !important; float: left!important; width: 50px!important; height: 50px!important; margin: 2px!important;}
49
50         </style>";
51         $o .= _abs_url(HTML::contactBlock());
52         $o .= "<a href='".$a->getBaseURL().'/profile/'.$a->profile['nickname']."'>". L10n::t('Connect on Friendica!') ."</a>";
53         return $o;
54 }