Answer the question
In order to leave comments, you need to log in
Drupal. How can I make a registration offer when trying to rate a post?
I use the "Vote up/down" module. You need to click Up or Down to offer user login or registration
Answer the question
In order to leave comments, you need to log in
Onclick="auth()" pops up a window or whatever you decide then PHP checks for authorization and Ajax so that PHP returns something like authorization=yes or no. If I understand you correctly
Isn't it easier to disable voting if the user is not authorized? Those. do not display anything at all except the rating number
On suse.me , when liking the application, I did this:
<?php
global $user;
if ($user->uid) {
//Если авторизован выводим ссылку с лайком
print '<div class="panel-footer">
<a href="#like"><i class="fa fa-heart-o fa-2x"></a>
</div>';
} else {
//Если нет, то модальное окошко с регистрацией
print '<div class="panel-footer">
<a href="#" data-toggle="modal" data-target="#enter"><i class="fa fa-heart-o fa-2x"></i></a>
</div>';
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question