By Manuel on Tuesday, 07 October 2014
Posted in Technical Issues
Replies 5
Likes 0
Views 1.1K
Votes 0
Hello.

I have a small problem. I have configured easydiscuss so guests can not see the answers. If I ask a question without logging in, then I will read the question and although I can not see the answer, I get the form to register or log in at the bottom of the page.

If a guest want to read a question that has performed a registered user. He can read the question and not the answer, this is correct but it does not show the form to login.

I have this code in the file post.reply.form.php:


<?php if( (!$post->islock || DiscussHelper::isModerator( $post->category_id )) && $guests && ($post->user_id == $my->id || DiscussHelper::isSiteAdmin() || DiscussHelper::isModerator( $post->category_id, $my->id ))){ ?>
<div class="discuss-user-reply">
<div class="fd-cf">
<a name="respond" id="respond"></a>

<legend class="discuss-component-title"><?php echo JText::_('COM_EASYDISCUSS_ENTRY_YOUR_RESPONSE'); ?></legend>

<hr class="mv-5" style="margin-bottom: 20px;">
<?php /*
<!-- Note: please update form user_type = twitter | facebook | linkedin -->
<!-- div class="control-group">
<a href="javascript:void(0);" class="btn btn-mini btn-facebook"><i class="icon-facebook"></i> Reply with Facebook</a>
<a href="javascript:void(0);" class="btn btn-mini btn-twitter"><i class="icon-twitter"></i> Reply with Twitter</a>
</div -->
*/ ?>
<?php if( $access->canReply() && $post->user_id == $my->id || DiscussHelper::isSiteAdmin() || DiscussHelper::isModerator( $post->category_id, $my->id )){ ?>

<?php echo $composer->getComposer(); ?>

<?php } else { ?>

<?php if( $system->my->id ){ ?>
<div class="alert alert-notice"><?php echo JText::_( 'COM_EASYDISCUSS_NOT_ALLOWED_TO_REPLY' );?></div>
<?php /* } else { */?>
<?php echo $this->loadTemplate( 'form.reply.login.php' ); ?>
<?php } ?>

<?php } ?>
</div>
</div>
<?php } ?>


I tried changing the last "if" that if a guest shows the form but only appears when the question has made an unregistered user. I want to appear for all users who have not logged regardless of who asked the question.

Thanks in advance.

Regards.
Hello Manuel,

Kindly please do understand that customizations are beyond the scope of our support. I will add this as an exception and I have applied the hacks for you in this file for this time only.
·
Tuesday, 07 October 2014 23:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark.

First of all I appreciate your help. I did not know that this change was a customization Easydiscuss thought it was a component failure. Had I known that this is a customization not have asked because I know the rules for your support.

But if I have restricted reading the answers to the guests (who are not registered users or users who are registered but not authenticated), why give the option to log on only to the questions of guests? I think it would be normal had the option to log on to all questions regardless of which profile posted the question. This is my humble opinion.

Thanks again and sorry for the inconvenience. It works perfectly.

Regards.
·
Wednesday, 08 October 2014 12:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello again Mark.

Sorry but does not work properly. The problem is that now appears to sign the form for all the questions but also appears when you are logged. Also, when you're not allowed to log in to answer questions because the form is to log when the form should appear to write the answer.

But do not worry. I understand it is a customization and do not want to compromise him anything. I have undone the changes made to leave it as it was because he could not answer any questions. I only mention this for your information. Thank you.

Regards.
·
Wednesday, 08 October 2014 13:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello again.

I solved the problem. Now no matter which profile type the question. The form to sign will appear in all the questions and if you are logged in, the response form appears.

This is the solution.


<?php if( (!$post->islock || DiscussHelper::isModerator( $post->category_id )) && ($post->user_id == $my->id || DiscussHelper::isSiteAdmin() || DiscussHelper::isModerator( $post->category_id, $my->id ))){ ?>
<div class="discuss-user-reply">
<div class="fd-cf">
<a name="respond" id="respond"></a>

<legend class="discuss-component-title"><?php echo JText::_('COM_EASYDISCUSS_ENTRY_YOUR_RESPONSE'); ?></legend>

<hr class="mv-5" style="margin-bottom: 20px;">

<?php if( $access->canReply() && $post->user_id == $my->id || DiscussHelper::isSiteAdmin() || DiscussHelper::isModerator( $post->category_id, $my->id )){ ?>

<?php echo $composer->getComposer(); ?>

<?php } ?>
</div>
</div>
<?php } else { ?>
<?php if($my->id == NULL) { ?>
<?php echo $this->loadTemplate( 'form.reply.login.php' ); ?>
<?php } ?>
<?php } ?>
·
Wednesday, 08 October 2014 13:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Manuel,

Great! Glad you have it solved.
·
Wednesday, 08 October 2014 15:33
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post