By Patrick Kidney on Tuesday, 15 July 2014
Posted in General Issues
Likes 0
Views 612
Votes 0
Hello,

I have my EasyDiscuss linked to my menu. I know that I can hide the entire menu item from guests, but I do not want to do that.
Instead, I have a large image with a "click here to register" button (JomSocial calls it a 'hero area'). This is a module which is only displayed to guests.
I would like to hide the entire EasyDiscuss from guests, and only have them see my 'hero area".

My question is similar to this one:
http://stackideas.com/forums/hide-toolbar-horizontal-menu-for-guests-frosty-theme

but I cannot see the answer...

Thank you for your time and effort.
Hello Patrick,

That particular post is for EasySocial, hence you are not able to view it. As for displaying the module on EasyDiscuss page, you'll probably need to customize the theme file in order for you to be able to achieve this. You can edit the file /components/com_easydiscuss/themes/simplistic/structure.php and locate the codes below,


<script type="text/javascript">
<?php if( $system->config->get( 'main_syntax_highlighter') ){ ?>
// Find any response that contains a code syntax.
EasyDiscuss.main_syntax_highlighter = true;

EasyDiscuss.require()
.script( 'prism' )
.done(function($){

Prism.highlightAll();

});
<?php } ?>
</script>

<?php echo $jsToolbar; ?>

<div id="discuss-wrapper" class="discuss-wrap<?php echo $suffix . $categoryClass . $jomsocialClass . $discussView;?>">



<?php echo $toolbar; ?>

<?php echo $contents; ?>

<?php echo DISCUSS_POWERED_BY; ?>

<input type="hidden" class="easydiscuss-token" value="<?php echo DiscussHelper::getToken();?>" />

</div>


Replace it with,


<?php if ($system->my->id) { ?>
<script type="text/javascript">
<?php if( $system->config->get( 'main_syntax_highlighter') ){ ?>
// Find any response that contains a code syntax.
EasyDiscuss.main_syntax_highlighter = true;

EasyDiscuss.require()
.script( 'prism' )
.done(function($){

Prism.highlightAll();

});
<?php } ?>
</script>

<?php echo $jsToolbar; ?>

<div id="discuss-wrapper" class="discuss-wrap<?php echo $suffix . $categoryClass . $jomsocialClass . $discussView;?>">



<?php echo $toolbar; ?>

<?php echo $contents; ?>

<?php echo DISCUSS_POWERED_BY; ?>

<input type="hidden" class="easydiscuss-token" value="<?php echo DiscussHelper::getToken();?>" />

</div>
<?php } ?>


This will ensure that non registered users cannot view anything from EasyDiscuss.
·
Tuesday, 15 July 2014 03:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect!

Thanks Mark!

You are always so quick to respond and solve my issues! You alone make the license fee worth it!
·
Tuesday, 15 July 2014 04:06
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Patrick and Thank you for the kind compliments
·
Tuesday, 15 July 2014 12:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey guys,

I want to use this
 <?php if ($system->my->id) { ?> code<?php } ?>
but rather than checking just if the user is logged in, I want to check if the user has a specifc usergroup.

Something like
<?php 
$allGroups = $system->my->usergroups;
$theGroup = 18;
if (in_array($theGroup, $allGroups) { ?>
code

<?php } ?>


How do I get the user groups of the logged in user?
·
Thursday, 07 August 2014 21:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Patrick,

You can use EasyDiscuss api to retrieve the groups they belong to,


$ids = DiscussHelper::getUserGids($system->my->id);
·
Friday, 08 August 2014 11:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect, thanks Mark!
·
Friday, 08 August 2014 20:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Patrick Kidney,

You're welcome
·
Friday, 08 August 2014 21:57
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post