]> git.mxchange.org Git - friendica.git/blobdiff - mod/notifications.php
Warnings removed
[friendica.git] / mod / notifications.php
index bee33fa6079e717f43543e95d105c1474234549f..e0f07118f733d7f75178be66f0b0c00ca29a04a3 100644 (file)
@@ -49,12 +49,12 @@ function notifications_post(&$a) {
                                        intval(local_user())
                                );
                        }
-                       goaway($a->get_baseurl(true) . '/notifications/intros');
+                       goaway('notifications/intros');
                }
                if($_POST['submit'] == t('Ignore')) {
                        $r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d",
                                intval($intro_id));
-                       goaway($a->get_baseurl(true) . '/notifications/intros');
+                       goaway('notifications/intros');
                }
        }
 }
@@ -79,37 +79,37 @@ function notifications_content(&$a) {
        $tabs = array(
                array(
                        'label' => t('System'),
-                       'url'=>$a->get_baseurl(true) . '/notifications/system',
+                       'url'=>'notifications/system',
                        'sel'=> (($a->argv[1] == 'system') ? 'active' : ''),
                        'accesskey' => 'y',
                ),
                array(
                        'label' => t('Network'),
-                       'url'=>$a->get_baseurl(true) . '/notifications/network',
+                       'url'=>'notifications/network',
                        'sel'=> (($a->argv[1] == 'network') ? 'active' : ''),
                        'accesskey' => 'w',
                ),
                array(
                        'label' => t('Personal'),
-                       'url'=>$a->get_baseurl(true) . '/notifications/personal',
+                       'url'=>'notifications/personal',
                        'sel'=> (($a->argv[1] == 'personal') ? 'active' : ''),
                        'accesskey' => 'r',
                ),
                array(
                        'label' => t('Home'),
-                       'url' => $a->get_baseurl(true) . '/notifications/home',
+                       'url' => 'notifications/home',
                        'sel'=> (($a->argv[1] == 'home') ? 'active' : ''),
                        'accesskey' => 'h',
                ),
                array(
                        'label' => t('Introductions'),
-                       'url' => $a->get_baseurl(true) . '/notifications/intros',
+                       'url' => 'notifications/intros',
                        'sel'=> (($a->argv[1] == 'intros') ? 'active' : ''),
                        'accesskey' => 'i',
                ),
                /*array(
                        'label' => t('Messages'),
-                       'url' => $a->get_baseurl(true) . '/message',
+                       'url' => 'message',
                        'sel'=> '',
                ),*/ /*while I can have notifications for messages, this tablist is not place for message page link */
        );
@@ -138,6 +138,8 @@ function notifications_content(&$a) {
                        $a->set_pager_itemspage(20);
                }
 
+               /// @todo Fetch contact details by "get_contact_details_by_url" instead of queries to contact, fcontact and gcontact
+
                $r = q("SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*, `fcontact`.`name` AS `fname`,`fcontact`.`url` AS `furl`,`fcontact`.`photo` AS `fphoto`,`fcontact`.`request` AS `frequest`,
                                `gcontact`.`location` AS `glocation`, `gcontact`.`about` AS `gabout`,
                                `gcontact`.`keywords` AS `gkeywords`, `gcontact`.`gender` AS `ggender`,
@@ -166,7 +168,7 @@ function notifications_content(&$a) {
                                                '$intro_id' => $rr['intro_id'],
                                                '$madeby' => sprintf( t('suggested by %s'),$rr['name']),
                                                '$contact_id' => $rr['contact-id'],
-                                               '$photo' => ((x($rr,'fphoto')) ? proxy_url($rr['fphoto']) : "images/person-175.jpg"),
+                                               '$photo' => ((x($rr,'fphoto')) ? proxy_url($rr['fphoto'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"),
                                                '$fullname' => $rr['fname'],
                                                '$url' => zrl($rr['furl']),
                                                '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
@@ -238,7 +240,7 @@ function notifications_content(&$a) {
                                        '$uid' => $_SESSION['uid'],
                                        '$intro_id' => $rr['intro_id'],
                                        '$contact_id' => $rr['contact-id'],
-                                       '$photo' => ((x($rr,'photo')) ? proxy_url($rr['photo']) : "images/person-175.jpg"),
+                                       '$photo' => ((x($rr,'photo')) ? proxy_url($rr['photo'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"),
                                        '$fullname' => $rr['name'],
                                        '$location' => bbcode($rr['glocation'], false, false),
                                        '$location_label' => t('Location:'),
@@ -250,7 +252,8 @@ function notifications_content(&$a) {
                                        '$gender_label' => t('Gender:'),
                                        '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''),
                                        '$activity' => array('activity', t('Post a new friend activity'), (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), t('if applicable')),
-                                       '$url' => zrl($rr['url']),
+                                       '$url' => $rr['url'],
+                                       '$zrl' => zrl($rr['url']),
                                        '$url_label' => t('Profile URL'),
                                        '$knowyou' => $knowyou,
                                        '$approve' => t('Approve'),
@@ -302,7 +305,7 @@ function notifications_content(&$a) {
                                                $notif_content .= replace_macros($tpl_item_likes,array(
                                                        //'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
                                                        '$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
-                                                       '$item_image' => $it['author-avatar'],
+                                                       '$item_image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
                                                        '$item_text' => sprintf( t("%s liked %s's post"), $it['author-name'], $it['pname']),
                                                        '$item_when' => relative_date($it['created'])
                                                ));
@@ -312,7 +315,7 @@ function notifications_content(&$a) {
                                                $notif_content .= replace_macros($tpl_item_dislikes,array(
                                                        //'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
                                                        '$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
-                                                       '$item_image' => $it['author-avatar'],
+                                                       '$item_image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
                                                        '$item_text' => sprintf( t("%s disliked %s's post"), $it['author-name'], $it['pname']),
                                                        '$item_when' => relative_date($it['created'])
                                                ));
@@ -327,7 +330,7 @@ function notifications_content(&$a) {
                                                $notif_content .= replace_macros($tpl_item_friends,array(
                                                        //'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
                                                        '$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
-                                                       '$item_image' => $it['author-avatar'],
+                                                       '$item_image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
                                                        '$item_text' => sprintf( t("%s is now friends with %s"), $it['author-name'], $it['fname']),
                                                        '$item_when' => relative_date($it['created'])
                                                ));
@@ -342,7 +345,7 @@ function notifications_content(&$a) {
                                                $notif_content .= replace_macros($tpl,array(
                                                        //'$item_link' => $a->get_baseurl(true).'/display/'.$a->user['nickname']."/".$it['parent'],
                                                        '$item_link' => $a->get_baseurl(true).'/display/'.$it['pguid'],
-                                                       '$item_image' => $it['author-avatar'],
+                                                       '$item_image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
                                                        '$item_text' => $item_text,
                                                        '$item_when' => relative_date($it['created'])
                                                ));
@@ -375,7 +378,7 @@ function notifications_content(&$a) {
                        foreach ($r as $it) {
                                $notif_content .= replace_macros($not_tpl,array(
                                        '$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],
-                                       '$item_image' => proxy_url($it['photo']),
+                                       '$item_image' => proxy_url($it['photo'], false, PROXY_SIZE_MICRO),
                                        '$item_text' => strip_tags(bbcode($it['msg'])),
                                        '$item_when' => relative_date($it['date'])
                                ));