Skip to Content Skip to Menu

Avatar Gallery (was Avatar Matrix) beta released

  • Raj
  • Raj
  • OFFLINE
  • Posts: 191
  • Thanks: 0
  • Karma: 30
16 years 10 months ago #50995 by Raj
Unfortunately, the [value] thing is already hard to explain to people, and not everyone understands it, so I'm reluctant to make it even more complex.

Raj

Please Log in or Create an account to join the conversation.

  • dpk
  • dpk
  • OFFLINE
  • Posts: 25
  • Thanks: 0
  • Karma: 3
16 years 9 months ago #53758 by dpk
As a simpler alternative to stripping out the prefixes and suffixes in the extension code (which is not possible in the commercial, encoded version unfortunately), I figured out how to match full address fields so that "52 N. Main St." is matched with "201 S. Main St."

The answer is SOUNDEX in php; SOUNDS LIKE in mysql.

A sample query for this avatar matrix/gallery extension:

[code:1]SELECT
c.avatar,
c.user_id,
c.address,
u.id,
u.username,
u.name
FROM
#__comprofiler AS c,
#__users AS u
WHERE
c.avatarapproved = '1'
AND c.avatar NOT LIKE 'NULL'
AND c.banned = '0'
AND c.confirmed='1'
AND (c.user_id = u.id)
AND c.address SOUNDS LIKE '[value]'
ORDER BY RAND()[/code:1]

In the above example, I'm not sure if the 'S.' would trip up the match with 'N. Main' or not.

Would REGEXP be useful here?

The simple goal is to identify people who live on the same street.

The ideal, more complicated goal is to identify people who live on the same block, or within a certain range of blocks on the same street. (Getting more complicated, take into account adjacent cross streets.)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum