[resolved] Quiz description different if user is logged or not (5 posts)

  1. isaaaka
    Posted 2 years ago #

    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.


  2. isaaaka
    Posted 2 years ago #

    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.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

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

  4. isaaaka
    Posted 2 years ago #

    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:

    and the text related to users not logged in between:

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

  5. isaaaka
    Posted 2 years ago #

    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">
    <?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>
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Wp-Pro-Quiz
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic