Browse Source

Addressbook Fix. This code was suppose to allow the user to select
whether to have the fullname, nickname, ect... returned from the addressbook to
the the compose screen, but it was not working at all. Granted we do not have
an option for this yet either, but that will follow fairly quickly.

Thanks to William Bishop

Jimmy Conner 21 years ago
parent
commit
e46abc71b8
1 changed files with 4 additions and 6 deletions
  1. 4 6
      functions/addressbook.php

+ 4 - 6
functions/addressbook.php

@@ -213,12 +213,10 @@ class AddressBook {
 
 
     function full_address($row) {
     function full_address($row) {
         global $addrsrch_fullname, $data_dir, $username;
         global $addrsrch_fullname, $data_dir, $username;
-
-        if (($prefix = getPref($data_dir, $username, 'addrsrch_fullname') or
-            isset($addrsrch_fullname) and $prefix = $addrsrch_fullname)
-            and $prefix !== 'noprefix') {
-            $name = ($prefix === 'nickname') ? $row['nickname']
-                : $row['name'];
+        $prefix = getPref($data_dir, $username, 'addrsrch_fullname');
+        if (($prefix != "" || (isset($addrsrch_fullname) &&
+            $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') {
+            $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']);
             return $name . ' <' . trim($row['email']) . '>';
             return $name . ' <' . trim($row['email']) . '>';
         } else {
         } else {
             return trim($row['email']);
             return trim($row['email']);