Kunena 6.3.0 released

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

This category contains miscellaneous, uncategorised third-party extensions (e.g. JomSocial, Community Builder, etc.) relating to older versions of Kunena that are no longer supported.

This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.

The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, the ideas in these topics may not work with later versions and, for that reason, the topics are locked.

Question Kunena and JomSocial. And the signature?

More
13 years 1 month ago - 13 years 1 month ago #81 by DeepDown

sababer9 wrote: Hey guys,,

Studies few earlier messages in this post for the same requirement, the signautre integration with jomsocial. I think you ppl have got the solution with a plugin may be.

in the meantime, i built up my own solution, thought it might help anyone there.

Its an extra field in jomsocial which picks and puts signature in kunena table with following code.

// no direct access
defined('_JEXEC') or die('Restricted access');

class CFieldsForumSignature
{
function getFieldHTML( $field , $required )
{
$config =& CFactory::getConfig();
$js = '/assets/validate-1.5';
$js .= ( $config->getBool('usepackedjavascript') ) ? '.pack.js' : '.js';
CAssets::attach($js, 'js');

// If maximum is not set, we define it to a default
$field->max = empty( $field->max ) ? 200 : $field->max;

$loggedInUser =& JFactory::getUser();
$userid = JRequest::getVar('userid',$loggedInUser->id,'get');
$db =& JFactory::getDBO();
$query = "SELECT signature FROM #__kunena_users WHERE userid = $userid";
$db->setQuery($query);
$field->value = $db->loadResult();

$class = ($field->required == 1) ? ' required' : '';
CFactory::load( 'helpers' , 'string' );
$html = '<textarea id="field' . $field->id . '" name="field' . $field->id . '" class="jomTips tipRight inputbox textarea' . $class . '" title="' . $field->name . '::' . CStringHelper::escape( $field->tips ) . '">' . $field->value . '</textarea>';
$html .= '<span id="errfield'.$field->id.'msg" style="display:none;">&nbsp;</span>';
$html .= '<script type="text/javascript">cvalidate.setMaxLength("#field' . $field->id . '", "' . $field->max . '");</script>';

return $html;
}

function isValid( $value , $required )
{
if( $required && empty($value))
{
return false;
}
$loggedInUser =& JFactory::getUser();
$userid = JRequest::getVar('id',$loggedInUser->id);
$db =& JFactory::getDBO();
$query = "UPDATE #__kunena_users SET signature ='$value' WHERE userid = $userid";
$db->setQuery($query);
$db->query();

return true;
}
}

Regards,
The signature from jomsocial :)


Just 1 thing. This works perfectly but you forgot something.
Do not forget to put the following in front off the code above.
Code:
<?php

Then it all works fine!
Last edit: 13 years 1 month ago by DeepDown.

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

More
13 years 1 month ago #82 by sababer9

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

More
12 years 11 months ago - 12 years 11 months ago #83 by b0n40
didnt work for me :(
Installed version: Kunena 1.5.14
js 2.2.0
Last edit: 12 years 11 months ago by b0n40.

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

More
12 years 9 months ago - 12 years 9 months ago #84 by tuumke
JomSocial Version: 2.2.2
Joomla! Version Joomla! 1.6.3 Stable
Installed version: Kunena 1.6.4

We do have an extra field in the profile, but the signature does not appear in Kunena

i've tried with <?php at beginnen, ?> at the end...
all dont work

-edit-
It's puttin the info in: jos_community_fields_values
even when you change
$query = "SELECT signature FROM #__kunena_users WHERE userid = $userid";
to
$query = "SELECT signature FROM jos_kunena_users WHERE userid = $userid";
Last edit: 12 years 9 months ago by tuumke.

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

More
12 years 9 months ago #85 by sababer9
have you followed these steps:


Hi,

You have to follow these steps:

1. This code is to be added in a new file "forumsignature.php" created in /components/com_community/libraries/fields.

2. Edit the file "customfields.xml" and add new field tag:
<field>
<type>forumsignature</type>
<name>Forum Signature</name>
</field>

3. Now go into backend menu Components -> Jomsocial -> Custom Profiles -> New Field
4. Select "Forum Signature" and you are done.

Regards


tuumke wrote: JomSocial Version: 2.2.2
Joomla! Version Joomla! 1.6.3 Stable
Installed version: Kunena 1.6.4

We do have an extra field in the profile, but the signature does not appear in Kunena

i've tried with <?php at beginnen, ?> at the end...
all dont work

-edit-
It's puttin the info in: jos_community_fields_values
even when you change
$query = "SELECT signature FROM #__kunena_users WHERE userid = $userid";
to
$query = "SELECT signature FROM jos_kunena_users WHERE userid = $userid";

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

More
12 years 9 months ago #86 by tuumke
yes! :)
Hence, the <?php story ;-)
I've added the My Kunena Menu or something, so people can edit there forum signature for now, but i'd like it to be in the normal profile menu.

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

More
12 years 9 months ago #87 by sababer9
make sure you have "signature" named field in kunena users table

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

More
12 years 9 months ago - 12 years 9 months ago #88 by tuumke
How do you mean?
i've tried with
$query = "SELECT signature FROM #__kunena_users WHERE userid = $userid";
to
$query = "SELECT signature FROM jos_kunena_users WHERE userid = $userid";
but it still takes it from jos_community_fields_values and also puts it in there.

With the my kunena toolbar for jomsocial, you can edit your forum profile, which does show the
signature. So i think it might be in the query somehow.
Last edit: 12 years 9 months ago by tuumke.

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

More
12 years 9 months ago #89 by sababer9
can you send me a checkbox.php file from fields folder? so that i can see what technique jomsocial 2.0 is using?

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

More
12 years 9 months ago - 12 years 9 months ago #90 by tuumke
This is the code from the file
Code:
<?php /** * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php */ // no direct access defined('_JEXEC') or die('Restricted access'); class CFieldsCheckbox { public function _translateValue( &$string ) { $string = JText::_( $string ); } /** * Method to format the specified value for text type **/ public function getFieldData( $field ) { $value = $field['value']; // Since multiple select has values separated by commas, we need to replace it with <br />. $fieldArray = explode ( ',' , $value ); array_walk($fieldArray, array('CFieldsCheckbox', '_translateValue')); $fieldValue = implode('<br />', $fieldArray); return $fieldValue; } public function getFieldHTML( $field , $required ) { $class = ($field->required == 1) ? ' required validate-custom-checkbox' : ''; $lists = is_array( $field->value ) ? $field->value : explode(',', $field->value); $html = ''; $elementSelected = 0; $elementCnt = 0; $cnt = 0; CFactory::load( 'helpers' , 'string' ); $class = !empty( $field->tips ) ? 'jomTips tipRight' : ''; $html .= '<div class="' . $class . '" style="display: inline-block;" title="' . JText::_( $field->name ) . '::' . CStringHelper::escape( JText::_( $field->tips ) ). '">'; if( is_array( $field->options ) ) { foreach( $field->options as $option ) { $selected = in_array( JString::trim( $option ) , $lists ) ? ' checked="checked"' : ''; if( empty( $selected ) ) { $elementSelected++; } $html .= '<label class="lblradio-block">'; $html .= '<input type="checkbox" name="field' . $field->id . '[]" value="' . $option . '"' . $selected . ' class="checkbox '.$class.'" style="margin: 0 5px 5px 0;" />'; $html .= JText::_( $option ) . '</label>'; $elementCnt++; } } $html .= '<span id="errfield'.$field->id.'msg" style="display: none;">&nbsp;</span>'; $html .= '</div>'; return $html; } public function isValid( $value , $required ) { if( $required && empty($value)) { return false; } return true; } public function formatdata( $value ) { $finalvalue = ''; if(!empty($value)) { foreach($value as $listValue){ $finalvalue .= $listValue . ','; } } return $finalvalue; } }
Last edit: 12 years 9 months ago by tuumke.

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

Time to create page: 0.596 seconds