lol768 / XenForo-MCASSOC

Minecraft association addon for XenForo
Other
20 stars 9 forks source link

Accessing MCAssoc vars from any page #16

Closed incrementing closed 8 years ago

incrementing commented 8 years ago

Is there anyway to check if a user has their minecraft profile linked? I'm trying to make pop display to the user if they don't have an account linked.

I've tried the following IF statement but nothing...

<xen:if is="{$mcNames.{$user.user_id}}==null">
  send message asking user to link account.
</xen:if>
lol768 commented 8 years ago

Hi there,

For performance reasons, the mcNames variable isn't added for every single action since it would require a lot of data to be transferred from the database. Right now it's only there for thread-related pages.

This isn't a bad idea though and would probably be achieved best with a xen:helper function since you could then query one user at a time which would be a simple SELECT COUNT() query which should be pretty fast.

I'll try and look at adding something like this for you.

Cheers.

incrementing commented 8 years ago

Thanks, I'll see what I can do on my own using xen:helper and SQL queries.