tainz / CommunityBridge

A Minecraft plugin for connecting your game to your website.
https://www.spigotmc.org/resources/communitybridge.2232/
20 stars 22 forks source link

Enhancement for XenForo Avatar Support #136

Open SneakyDave opened 10 years ago

SneakyDave commented 10 years ago

The XenForo Avatar is stored in the file system, rather than the database. The avatar information is stored in the xf_user table, with the avatar_date, avatar_width, and avatar_height columns.

The only way to determine if a user has an avatar (I believe ) is to check the avatar_date column on that table. If the date is greater than 0, then the user has an avatar. If the date is 0, then no avatar has been chosen.

This doesn't quite work with CommunityBridge, as its avatar configuration simply looks for "any data" in the specified table and column, so any column with 0 as the avatar_date would count as having an avatar.

I assume you could change this to look for a "non zero" value, or include a configuration parameter to indicate that the avatar-column is numeric?

# Used either for requiring and avatar or rewarding the existence of an avatar.
app-avatar-config:
  enabled: true
  # Table that contains the avatar column
  table-name: xf_user
  # Column on the avatar table that contains the user ID.
  user-id-column: user_id
  # Column on the avatar table that contains the avatar information. If this
  # column contains data, the user is assumed by CommunityBridge to have an
  # avatar.
  avatar-column: avatar_date
iain-davis commented 10 years ago

I had a feeling it would be too simplistic. My initial pass at that one was mainly to get the feature that used to be in 1.x "back" into 2.x. There needs to be some kind of behavioral setting. Hmm. something like

# Options are zero, non-zero, non-blank...
look-for:

I imagine new options will present themselves as time goes on. :)

jwflory commented 10 years ago

@iain-davis Do you think this is a possibility of being added in? I would love to see this feature added, and it would save me the cost of adding a paid XenForo add-on to my site. I'd happily compensate you instead if this was added in as a native feature to CB. :)