B
B
bender30002014-11-11 07:11:10
CMS
bender3000, 2014-11-11 07:11:10

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

3 answer(s)
A
Abc Edc, 2014-11-11
@gleber1

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

#
# artur #, 2014-11-11
@passshift

Isn't it easier to disable voting if the user is not authorized? Those. do not display anything at all except the rating number

S
Sergey Tsepelev, 2014-11-13
@tsepelev

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 question

Ask a Question

731 491 924 answers to any question