Support » Plugin: Wp-Pro-Quiz » Quiz description different if user is logged or not

  • Resolved isaaaka

    (@isaaaka)


    I’ve added a link to the loggin page in the section “quizz description” because the quizz is only opened for registered users.
    But I’d like that this link is visible only for users who aren’t registered. When a user is logged in, this link must be hidden.

    http://wordpress.org/plugins/wp-pro-quiz/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Alors j’ai juste mis le texte relatif aux membres entre les balises
    [members_only]le texte[/members_only]

    et le texte pour les non connectés sous
    [public_only]le texte[/public_only]

    et ça fonctionne car la fonction était déjà défini dans le php de base.

    esmi

    (@esmi)

    Forum Moderator

    These are English language forums, so please use English or provide an English translation. Alternatively, use a WP support forum in your language.

    Sorry, I’ve done a “copy and paste” from an other explanation… It can happen. Usually I always translate in english…

    I was saying:

    I’ve put the text related to users logged in between the following codes:
    [members_only]text[/members_only]

    and the text related to users not logged in between:
    [public_only]text[/public_only]

    It works because the function was already implemented in the php source file.

    An other solution if [members_only] is not already defined. I’ve changed lines 508 to 511 in WpProQuiz_View_FrontQuiz.php:

    <?php if (is_user_logged_in()) { ?>
    
    	<p><div align="center">
    
    				<input class="wpProQuiz_button" type="button" value="<?php _e('Start quiz', 'wp-pro-quiz'); ?>" name="startQuiz">
    			</div></p>
    <?php } else { // not logged in ?>
    <div align="center" style="text-align:center">Vous devez être connecté(e) pour jouer:<br/> </div>
    <div id="connexion_link" class="section-tabs" style="text-align:center; margin: 0 auto;	padding: 5px 20px !important;background: #E2001A !important;border-radius: 11px !important;	color: white !important;font-weight: bold !important;border: 1px solid #E2001A !important;box-shadow: 1px 1px 1px #333 !important;text-shadow: none !important;filter: none !important;float: none;width:175px" >
    <a href="your link" style="color:white !important;" class="" title="Me connecter">S'inscrire/Se connecter</a>
    </div>
    
    <?php } ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Quiz description different if user is logged or not’ is closed to new replies.