]> git.mxchange.org Git - friendica.git/commitdiff
Code reworks: replaced hardcoded network text with the corresponding constants.
authorMichael Vogel <icarus@dabo.de>
Sat, 11 Apr 2015 20:14:56 +0000 (22:14 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 11 Apr 2015 20:14:56 +0000 (22:14 +0200)
include/acl_selectors.php
include/conversation.php
include/text.php
mod/contacts.php
mod/dfrn_confirm.php
mod/photos.php
mod/profperm.php

index 668544b0bcf8df71afd51cc7628a466078157e4c..1e43431612b79787a8e59165eca8232955903f16 100644 (file)
@@ -78,19 +78,19 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
                if(x($options,'networks')) {
                        switch($options['networks']) {
                                case 'DFRN_ONLY':
-                                       $networks = array('dfrn');
+                                       $networks = array(NETWORK_DFRN);
                                        break;
                                case 'PRIVATE':
                                        if(is_array($a->user) && $a->user['prvnets'])
-                                               $networks = array('dfrn','mail','dspr');
+                                               $networks = array(NETWORK_DFRN,NETWORK_MAIL,NETWORK_DIASPORA);
                                        else
-                                               $networks = array('dfrn','face','mail', 'dspr');
+                                               $networks = array(NETWORK_DFRN,NETWORK_FACEBOOK,NETWORK_MAIL, NETWORK_DIASPORA);
                                        break;
                                case 'TWO_WAY':
                                        if(is_array($a->user) && $a->user['prvnets'])
-                                               $networks = array('dfrn','mail','dspr');
+                                               $networks = array(NETWORK_DFRN,NETWORK_MAIL,NETWORK_DIASPORA);
                                        else
-                                               $networks = array('dfrn','face','mail','dspr','stat');
+                                               $networks = array(NETWORK_DFRN,NETWORK_FACEBOOK,NETWORK_MAIL,NETWORK_DIASPORA,NETWORK_OSTATUS);
                                        break;
                                default:
                                        break;
@@ -182,10 +182,10 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
        }
 
        if($privmail) {
-               $sql_extra .= " AND `network` IN ( 'dfrn', 'dspr' ) ";
+               $sql_extra .= " AND `network` IN ( NETWORK_DFRN, NETWORK_DIASPORA ) ";
        }
        elseif($privatenet) {
-               $sql_extra .= " AND `network` IN ( 'dfrn', 'mail', 'face', 'dspr' ) ";
+               $sql_extra .= " AND `network` IN ( NETWORK_DFRN, NETWORK_MAIL, NETWORK_FACEBOOK, NETWORK_DIASPORA ) ";
        }
 
        $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : "");
index 20b54728c9c5c7509f14cf01e9fe1b56c76b735f..a6ea4da810f634a03edd860cf7cb40d57fd57f3c 100644 (file)
@@ -908,7 +908,7 @@ function like_puller($a,$item,&$arr,$mode) {
 
        if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
                $url = $item['author-link'];
-               if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
+               if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
                        $url = $a->get_baseurl(true) . '/redir/' . $item['contact-id'];
                        $sparkle = ' class="sparkle" ';
                }
index 8ce54b3c6786c130a6c93e5e72402e855946418b..fd5ae0a2b67e646ca652465ce1449de51ba41625 100644 (file)
@@ -920,7 +920,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
        if($redirect) {
                $a = get_app();
                $redirect_url = $a->get_baseurl() . '/redir/' . $contact['id'];
-               if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === 'dfrn')) {
+               if(local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) {
                        $redir = true;
                        $url = $redirect_url;
                        $sparkle = ' sparkle';
index 95b1944dc871f697f159409f98b77bd782f8bc49..4a0d34a4675419eb3e5deb638c873dc61770714c 100644 (file)
@@ -33,7 +33,7 @@ function contacts_init(&$a) {
                        $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
                                '$name' => $a->data['contact']['name'],
                                '$photo' => $a->data['contact']['photo'],
-                               '$url' => ($a->data['contact']['network'] == 'dfrn') ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url']
+                               '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url']
                        ));
                        $follow_widget = '';
        }
@@ -681,7 +681,7 @@ function contacts_content(&$a) {
                                default:
                                        break;
                        }
-                       if(($rr['network'] === 'dfrn') && ($rr['rel'])) {
+                       if(($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
                                $url = "redir/{$rr['id']}";
                                $sparkle = ' class="sparkle" ';
                        }
index f1ce296d901c727ca338040733b5284779641483..1cc258853b9b52e154cfc1b795d93bb089ebd2dc 100644 (file)
@@ -340,7 +340,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                                `pending` = 0,
                                `duplex` = %d,
                                `hidden` = %d,
-                               `network` = 'dfrn' WHERE `id` = %d
+                               `network` = '%s' WHERE `id` = %d
                        ",
                                dbesc($photos[0]),
                                dbesc($photos[1]),
@@ -351,6 +351,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                                dbesc(datetime_convert()),
                                intval($duplex),
                                intval($hidden),
+                               dbesc(NETWORK_DFRN),
                                intval($contact_id)
                        );
                }
index 003bcd915089175db61253bb7ef4d83a52e2fd64..f8bba01b00cd0de593986470127ed752e86c681d 100644 (file)
@@ -1628,7 +1628,7 @@ function photos_content(&$a) {
 
 
                                        if(local_user() && ($item['contact-uid'] == local_user())
-                                               && ($item['network'] == 'dfrn') && (! $item['self'] )) {
+                                               && ($item['network'] == NETWORK_DFRN) && (! $item['self'] )) {
                                                $profile_url = $redirect_url;
                                                $sparkle = ' sparkle';
                                        }
index 444f7a5eabf2a49003dff5c3eaf2447ea4e79ce5..077f695bea14c15be10f592258847bcd6e3d1198 100644 (file)
@@ -37,7 +37,8 @@ function profperm_content(&$a) {
 
        if(($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) {
                $r = q("SELECT `id` FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `self` = 0
-                       AND `network` = 'dfrn' AND `id` = %d AND `uid` = %d LIMIT 1",
+                       AND `network` = '%s' AND `id` = %d AND `uid` = %d LIMIT 1",
+                       dbesc(NETWORK_DFRN),
                        intval($a->argv[2]),
                        intval(local_user())
                );
@@ -130,10 +131,11 @@ function profperm_content(&$a) {
        $o .= '<h3>' . t("All Contacts \x28with secure profile access\x29") . '</h3>';
        $o .= '</div>';
        $o .= '<div id="prof-all-contacts">';
-               
-               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 
-                       AND `network` = 'dfrn' ORDER BY `name` ASC",
-                       intval(local_user())
+
+               $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0
+                       AND `network` = '%s' ORDER BY `name` ASC",
+                       intval(local_user()),
+                       dbesc(NETWORK_DFRN)
                );
 
                if(count($r)) {