Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] 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

Question Category Subscriptions - Default Subscribed?

More
15 years 6 months ago - 15 years 6 months ago #63609 by DesoWV
Ok, so you are using the function onAfterStoreUser($user, $isnew, $succes, $msg) which was commented out. I tried un-commenting it but it still doesnt work. My guess is that the function is not valid. I will continue to screw around with things a bit to see if I can figure out how to detect a new user, if I get it ill post it here.

Otherwise I will eagerly await 1.7 so I can update, meanwhile I will be staying on 1.5 using mailman ;)

Thanks again for all your help!!

EDIT: oh ya.... still not receiving emails to notify me of replies to this thread??
Last edit: 15 years 6 months ago by DesoWV. Reason: above

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

More
15 years 6 months ago #63637 by sozzled

Matias wrote: PS. this subject belongs into hacks category..

Yes, you're probably right.

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

More
15 years 6 months ago #63645 by DesoWV
Ok, so I was able to get it working completely!!!

My solution was to abandon the **/plugins/system/kunena.php and go straight to the registration file itself, for me I am planning to use JomSocial so it was **/components/com_community/controllers/regsiter.php

then in the >> private function _sendEMail(&$user, $password, $isActivationResend=false) << on line 493 immediately below:
Code:
private function _sendEMail(&$user, $password, $isActivationResend=false) { $mainframe =& JFactory::getApplication(); $config =& CFactory::getConfig(); $db =& JFactory::getDBO(); $regModel =& $this->getModel('register'); $usersConfig = &JComponentHelper::getParams( 'com_users' ); $useractivation = $usersConfig->get( 'useractivation' ); $sitename = $mainframe->getCfg( 'sitename' ); $mailfrom = $mainframe->getCfg( 'mailfrom' ); $fromname = $mainframe->getCfg( 'fromname' ); $siteURL = JURI::base(); $name = $user->get('name'); $email = $user->get('email'); $username = $user->get('username');

add the following:
Code:
$selectedCategories = '21,36,38,37'; $db99 = Jfactory::getDBO(); $query99 = "INSERT INTO #__kunena_subscriptions_categories (catid, userid) SELECT c.id, {$user->id} AS userid FROM #__kunena_categories AS c LEFT JOIN #__kunena_subscriptions_categories AS s ON c.id=s.catid AND s.userid={$user->id} WHERE c.parent>0 AND c.id IN ({$selectedCategories}) AND s.userid IS NULL"; $db99->setQuery ( $query99 ); $db99->query ();

NOTE: YOU MUST use $db99 and $query99 or something other than $db and $query, I first tried to use those but it caused the email confirmation to not send... thus making it impossible for the user to verify their email and activate their account.

In the >> $selectedCategories = '21,36,38,37'; << is where you input your category ID's

I am sure that this could be used with regular joomla or community builder registrations, just need to put it in their registration files.

Credit for the code goes to Matias :)

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

More
15 years 6 months ago #63646 by DesoWV

sozzled wrote:

Matias wrote: PS. this subject belongs into hacks category..

Yes, you're probably right.



As previously stated, I am sorry this turned into a hack the coding post... this was originally intended as a question and no more...


I invite you to move this thread, however I have looked and found that the only hacks category is for Kunena 1.5 now, seeing as this is for 1.6 and would not apply to 1.5 since it does not have category subscriptions... perhaps a hacks category should be added for 1.6 and then this thread moved there??

Thank You.

PS Still no email notifications that there has been replies to this thread..........

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

More
15 years 6 months ago #67860 by sozzled

DesoWV wrote:

sozzled wrote: I have ... found that the only hacks category is for Kunena 1.5 ...

Correct. We do not have a K 1.6 "hacks" category.

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

More
14 years 7 months ago - 14 years 7 months ago #108098 by Shadal
Wow! Thank you DesoWV, your info helped me get automatic category subscriptions working with Community Builder!

Here's how I did it... (Should start on line 1347 of /components/com_comprofiler/comprofiler.php)

Immeditaly after
Code:
if ( $confirmed ) { // THIS is the normal case: user exists, is not yet confirmed, and confirmation code does match: $class = 'cbconfirmationinfo'; } else { $class = 'error'; } echo "\n" . '<div class="cbconfirming"><div class="' . $class . '">' . implode( '</div><div class="' . $class . '">', $messagesToUser ) . "</div></div>\n";

Insert DesoWV's code...
Code:
// Subscribe User to Kuna Categories $selectedCategories = '2,3'; $db99 = Jfactory::getDBO(); $query99 = "INSERT INTO #__kunena_subscriptions_categories (catid, userid) SELECT c.id, {$user->id} AS userid FROM #__kunena_categories AS c LEFT JOIN #__kunena_subscriptions_categories AS s ON c.id=s.catid AND s.userid={$user->id} WHERE c.parent>0 AND c.id IN ({$selectedCategories}) AND s.userid IS NULL"; $db99->setQuery ( $query99 ); $db99->query ();
As soon as the user's account is activated they are subscribed to (in my case) Kunena categories 2 & 3.
Last edit: 14 years 7 months ago by Shadal.

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

Time to create page: 0.246 seconds