By Michael Zahariev on Tuesday, 10 November 2015
Posted in Technical Issues
Replies 3
Likes 0
Views 863
Votes 0
Hi,

I am looking to edit the category select to a multi select in order to perform a modification. Would you let me know how i can go about this or at least point me to the file where i can edit the $nestedCategories; variable which controls this select.

Thanks
Hey Michael,

These are being generated by the helper file in /components/com_easydiscuss/helpers/helper.php under the method populateCategories
·
Tuesday, 10 November 2015 21:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect, so i have managed to to make this a multi select. Now i am trying to make it so that when u select multiple categories that duplicate posts are created and one is assigned to each category.

So what I have tried to do is pass the multi select and the perform a submit for each item in the multiselect using a loop as the bottom of the below but it doesn't seem to be working. Could you point me in the right direction here?

public function submit()
{
JRequest::checkToken('request') or jexit( 'Invalid Token' );

$config = DiscussHelper::getConfig();
$my = JFactory::getUser();
$app = JFactory::getApplication();
$acl = DiscussHelper::getHelper( 'ACL' );

// If guest posting is disallowed in the settings, they shouldn't be able to create a discussion at all.
if( !$my->id && !$acl->allowed('add_question', '0') )
{
DiscussHelper::setMessageQueue( JText::_('COM_EASYDISCUSS_POST_PLEASE_LOGIN' ) , DISCUSS_QUEUE_ERROR );
$app->redirect( DiscussRouter::_('index.php?option=com_easydiscuss' , false ) );
return $app->close();
}

// If user is disallowed in the acl, they shouldn't be able to create a discussion at all.
if( $my->id && !$acl->allowed('add_question', '0') )
{
DiscussHelper::setMessageQueue( JText::_('COM_EASYDISCUSS_SYSTEM_INSUFFICIENT_PERMISSIONS' ) , DISCUSS_QUEUE_ERROR );
$app->redirect( DiscussRouter::_('index.php?option=com_easydiscuss' , false ) );
return $app->close();
}

// Get values from the posted form.
$data = JRequest::get( 'post' );

if( isset( $data['mod_post_topic_category_id'] ) )
{
$data['category_multi'] = $data['mod_post_topic_category_id'];
unset( $data['mod_post_topic_category_id'] );
}


//New loop to get the categories

foreach ($category_multi as $category_id){


// Run validation on the posted data.
if(! $this->_fieldValidate($data))
·
Wednesday, 11 November 2015 21:56
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry, but we do not provide support for customizations
·
Thursday, 12 November 2015 01:26
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post