Skip to main content
Topic: Login To Reply (Read 2375 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Login To Reply

Hello devs,

Is it possible to have an addon that allow guests to view the post but they will be shown a button to login or register in order to reply?

Im pretty sure it can be done but I was wondering it theres already such a similar addons that exist?

thanks again in advance  :)

Re: Login To Reply

Reply #1

Simply deny permissions for Guests to post. If not already comes by default.

Re: Login To Reply

Reply #2

Quote from: Wizard – Simply deny permissions for Guests to post. If not already comes by default.

@Wizard yes it comes by default but my issue is that if Im the guest, I dont see a reply button which is fine because Im a guest or not logged in. It would be good if theres a button somewhere or on the right beside the "like" button which says "login to reply" just as a visual clue reminding them to login or register.


Re: Login To Reply

Reply #4

Quote from: Wizard – You can use a popup saying " Register or login to reply ".

Here is a tutorial

http://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/

If you need to add something like you said, it would need a template edit. Spuds or Emanuele would be able to help.

thanks @Wizard
I know a little bit of html, css, js, jquery and php. Just enough to edit a not so complicated stuff
So I hope @emanuele  or @Spuds can chime in to give some advice as to where and how I should to start ;-)

Re: Login To Reply

Reply #5

For most of the cases, open Display.controller.php, search for:
Code: [Select]
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.png', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true),
and replace it with:
Code: [Select]
'reply' => array('text' => 'reply', 'image' => 'reply.png', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], 'active' => true),
It will show the button even without permission to reply, when someone clicks on it will ask to login or register.
There is the side effect that if the guest registers he will not be redirected again to the topic and the reply forum (because "of course" he has to get the email verify the account, etc.).
Bugs creator.
Features destroyer.
Template killer.