]> git.mxchange.org Git - friendica-addons.git/blob - widgets/widget_friends.php
Merge pull request #4 from fabrixxm/master
[friendica-addons.git] / widgets / widget_friends.php
1 <?php
2
3 function friends_widget_name() {
4         return "Shows profile contacts";
5 }
6 function friends_widget_help() {
7         return "";
8 }
9
10 function friends_widget_args(){
11         return Array();
12 }
13
14 function friends_widget_content(&$a, $conf){
15
16         $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.* FROM `profile` 
17                         LEFT JOIN `user` ON `profile`.`uid` = `user`.`uid`
18                         WHERE `user`.`uid` = %s AND `profile`.`is-default` = 1 LIMIT 1",
19                         intval($conf['uid'])
20         );
21         if(!count($r)) return;
22         $a->profile = $r[0];
23
24         $o = "";
25         $o .= "<style>
26                 .f9k_widget {font-size: 0.8em;}
27                 .f9k_widget #contact-block { overflow: hidden; height: auto; }
28                 .f9k_widget .contact-block-h4 { float: left; margin: 0px; }
29                 .f9k_widget .allcontact-link { float: right; margin: 0px; }
30                 .f9k_widget .contact-block-content { clear:both; }
31                 .f9k_widget .contact-block-div { display: block !important; float: left!important; width: 50px!important; height: 50px!important; margin: 2px!important;}
32                 
33         </style>";
34         $o .= _abs_url(contact_block());
35         $o .= "<a href='".$a->get_baseurl().'/profile/'.$a->profile['nickname']."'>". t('Connect on Friendika!') ."</a>";
36         return $o;
37 }