Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » MetaModding with User Profile
MetaModding with User Profile
MetaModding with User Profile
Joomla 2.5.3
Metamod 3.9
Hi MetaModders,
I've searched the forums and this thread http://www.metamodpro.com/forums/topic?id=478 is the closest I could find but it doesn't quite answer my question.
I have created a new Joomla User Profile plugin to include a selection of interests, and further user details like address etc. (see here: http://docs.joomla.org/Creating_a_profile_plugin
I'd like to be able to include modules based on those extra details.
Can help mo on how to call in my new fields?
Thank you in advance!
Re: MetaModding with User Profile
Unfortunately the values do not show up automatically in the $user object. So you can use the following to query on a particular field in the additional profile plugin:
if ($user->id > 0) {
$query = "select profile_value from #__user_profiles where profile_key = 'profile.city' and user_id = " . (int)$user->id;
$db->setQuery($query);
$result = $db->loadResult();
if ($result == "Tokyo") return XXX;
}
Re: MetaModding with User Profile
Do I need "#" with my database prefix or does # cover whatever the prefix is?
Sorry if this a stupid question Stephen, it's just that I'm not familiar with SQL queries.
I'm asking because I'm trying lots of different values and nothings happening.
I'm pulling my hair out a bit with this site because I've inherited it from a Dev who recklessly hacked the core like a machete wielding maniac and I'm trying to use Metamod to do what his old hacks did.
Re: MetaModding with User Profile
Hi,
the #_ gets replaced with the database prefix automatically.
I'd suggest that you take a look at the (prefix)_user_profiles table in your database and double check what the profile_key and profile_value values are that you're relying on. "profile.city" is one of the keys in the Joomla-supplied user plugin, but yours may be different.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » MetaModding with User Profile
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7642
- Newest User:
- mary26
- Members Online:
- 0
- Guests Online:
- 149
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked