Kunena 7.0.6 & Kunena 6.4.12 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.6 [K 7.0.6] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0.

The Kunena team is also pleased to announce the twelfth version of Kunena 6.4, a native Joomla extension for Joomla! 5.0, 5.1, 5.2, 5.3, 5.4 and 6.0.

Question Create Kunena user in Kunena database upon joomla registration

More
15 years 5 months ago - 15 years 5 months ago #80373 by Dalandau
Hi,

I would like to automaticly create a user in kunenas database upon user registration.
As I see the user is only created upon his first visit to the forum.

The reason I would need the database row to be created upon registration is because I am using a Janrain RPX registration to my website and I would like it to update kunena avatar upon registration, but I am not able to insert the avatar filename in the database because the user row does not yet exist.

For example this is how it works for jomsocial:

Code:
// check if the Jomsocial tables are there, then set avatar $query = "SHOW TABLES LIKE '%__community_users'"; $db->setQuery($query); $Jomtableexists = $db->loadResult(); if (isset($Jomtableexists) && $auth_info['profile']['photo']) { jimport('joomla.filesystem.file'); jimport('joomla.utilities.utility'); require_once(JPATH_ROOT.DS.'components'.DS.'com_community'.DS.'helpers'.DS.'image.php'); $fileName = JUtility::getHash( $auth_info['profile']['photo'] . time() ); $fileName = JString::substr( $fileName , 0 , 24 ); $avatarimage = 'images/avatar/' . $fileName.'.jpg' ; $thumbavatar = 'images/avatar/' . 'thumb_' . $fileName.'.jpg' ; $st = JPATH_ROOT; $jPath = split('\administrator',$st); $storage = $jPath[0] . DS . 'images' . DS . 'avatar'. DS . $fileName.'.jpg'; $storageThumbnail = $jPath[0] . DS .'images'.DS . 'avatar'. DS . 'thumb_' . $fileName.'.jpg' ; $destType = 'image/jpg'; $imageMaxWidth = 140; // Only resize when the width exceeds the max. if( !cImageResizePropotional( $auth_info['profile']['photo'] , $storage , $destType , $imageMaxWidth ) ) { global $option,$mainframe; $msg = JText::sprintf( 'Image Upload Error '); } // Generate thumbnail if(!cImageCreateThumb( $auth_info['profile']['photo'] , $storageThumbnail , $destType )) { global $option,$mainframe; $msg = JText::sprintf( 'Image Upload Error '); } $query = "SELECT `userid` FROM `#__community_users` WHERE `userid`='" . $user->get('id') . "'"; $db->setQuery( $query ); if($db->loadResult()) { $query = "UPDATE `#__community_users` SET `avatar` = '" . $avatarimage . "', `thumb` = '" .$thumbavatar . "' WHERE `userid`='" . $user->get('id') . "'"; } else { $query = "INSERT INTO `#__community_users` SET `userid`='" . $user->get('id') . "', `avatar` = '" . $avatarimage . "', `thumb` = '" .$thumbavatar . "'"; } $db->setQuery( $query ); $db->query(); } }

What should I do inorder to make it work with kunena 1.6? (im very new at php)

Thank you for the help
Last edit: 15 years 5 months ago by Dalandau.

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

More
15 years 5 months ago #80397 by Dalandau
Do you think it is possible to edit this code to do the same for Kunena 1.6?

Thank you

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

More
15 years 5 months ago #80827 by Dalandau
Hi,

I still havent figured it out.

Any suggestions?

Thanks,

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

More
15 years 5 months ago #80923 by sozzled

Dalandau wrote: I would like to automaticly create a user in kunenas database upon user registration.
As I see the user is only created upon his first visit to the forum.

That pretty well sums it up.

Possible helpful further reading on this subject: Kunena is not "registering" all my Joomla users

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

More
15 years 5 months ago #81030 by Dalandau
Thanks,

I had read that before.
But what function registers the user into the Kunena DB upon his first visit ?
And how can I initialize that function?

Thank you

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

More
15 years 5 months ago #81034 by sozzled

Dalandau wrote: But what function registers the user into the Kunena DB upon his first visit ?
And how can I initialize that function?

I've never bothered to find out. I don't know the answer. In what way does knowing this information help you with some problem that you might be having? Perhaps if we knew what problem you are having we would know how to answer this question better.

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

Time to create page: 0.373 seconds