I am using joomla 2.5 with it's default "user profile" plugin that adds extra fields to the profile page of joomla.
I am also using k2 and have a template override setup for the view I am working in:
site/templates/template/html/com_k2/category_item.php
Within that view I can successfully "pull" the data I need using this:
jimport('joomla.user.helper');
$user = & JFactory::getUser();
$profile = JUserHelper::getProfile($user->id);
echo $profile->profile['fieldname'];
My question is really... How can I update this field using jQuery / Javascript without refreshing the page? Unfortunately there is no joomla function like:
JUserHelper::updateProfileField(value,user->id)
Which is what I was hoping to use with jQuery's .ajax()... Anyway, I think I might have to write a function to do this... In which case I probably wouldn't want to modify the core joomla stuff (JUserHelper)... But instead maybe my own? or should I add a function to k2 that can update the joomla user profile data?
btw...The entire point of me doing this is because I want to add a custom "points" field to the user profile page... and I just need a reliable way of reading & updating it (with ajax I think) from the k2 category_item.php view!
Thank You!!!!