* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: fiche.php,v 1.21 2004-11-17 10:12:44 x2000habouzit Exp $
+ $Id: fiche.php,v 1.22 2004-11-17 11:06:46 x2000habouzit Exp $
***************************************************************************/
u.libre, u.promo, c.uid IS NOT NULL, p.x, p.y
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON (u.user_id=a.id AND a.type='a_vie')
- INNER JOIN aliases AS a2 ON (u.user_id=a2.id AND a2.type='alias' AND a2.alias LIKE '%.%')
+ INNER JOIN aliases AS a2 ON (u.user_id=a2.id AND FIND_IN_SET('bestalias',a2.flags))
LEFT JOIN contacts AS c ON (c.uid = {$_SESSION['uid']} and c.contact = u.user_id)
LEFT JOIN geoloc_pays AS gp ON (gp.a2 = u.nationalite)
INNER JOIN sections ON(sections.id = u.section)
- LEFT JOIN photo as p ON(p.uid = u.user_id)".$where_clause."
- ORDER BY !FIND_IN_SET('epouse',a2.flags), LENGTH(a2.alias) LIMIT 1";
+ LEFT JOIN photo AS p ON(p.uid = u.user_id) ".$where_clause;
$result = $globals->db->query($reqsql);
update aliases set type='epouse' where type='epouse';
alter table aliases change column type type enum('a_vie','alias','homonyme','liste') not null;
alter table aliases add index (flags);
+
+ update aliases AS a
+left join aliases AS b ON(a.id=b.id and b.alias like '%.%' and length(b.alias)<length(a.alias))
+ set a.flags=CONCAT(a.flags,',bestalias')
+ where a.alias LIKE '%.%' and b.alias IS NULL;