Topic-icon Hide intro text after logged in

Active Subscriptions:

None
14 years 6 months ago #16575 by Kbluemel
On the default joomla login, I have it setup to allow me to show some intro text above and below the login module. Once logged in it goes away. I noticed when I put the intro text in the jfblogin module, that the text shows up both on the login form, as well as on the module after the user has logged in. How can I make I hide the text once the user is logged in?

For example, the intro text is along these lines "Please login to access additional content, or create a free account below." I don't want it to show up above the users profile after they have logged in.
The topic has been locked.
Support Specialist
14 years 6 months ago #16581 by alzander
Kbluemel,
Yup, this is an annoyance. In the upcoming 4.1 release, the Intro text will only be displayed if the user isn't logged in.

If you really want to fix it now, you can make the following code change which should fix you right up. In the /modules/mod_jfbclogin/tmpl/default.php file, at the top, you'll see:
if ($userIntro != '')
{
    echo '<div class="jfbclogin_desc">' . $userIntro . "</div>";
}
Move that block down a few lines directly to the section below (new code included):
if ($params->get('showLoginForm'))
    {
       if ($userIntro != '')
      {
         echo '<div class="jfbclogin_desc">' . $userIntro . "</div>";
      }
That will make sure it only shows on the login side.

Hope that helps, but if you run into other issues, just let us know!
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 6 months ago #16585 by Kbluemel
That did not work for me. Copying and pasting it gave me an error. Looks like i needed to add an extra closing bracket to that block to get past that error. So I replaced:
if ($userIntro != '')

{

    echo '<div class="jfbclogin_desc">' . $userIntro . "</div>";

}
with
if ($params->get('showLoginForm'))

    {

       if ($userIntro != '')

      {

         echo '<div class="jfbclogin_desc">' . $userIntro . "</div>";

      }
	}

That allowed the page to load again, but did not fix the intro from showing on the logged in state. I even cleared the cache on both my browser, as well as on the webserver cache folder. Tried it both in FF and IE and both are still showing the intro text after logged in. Any ideas?

Thank you.
The topic has been locked.
Support Specialist
14 years 6 months ago #16587 by alzander
You shouldn't need to add a closing } . When done, it should look like below (top and last lines are already there, so don't change anything above or below these lines):
defined('_JEXEC') or die('Restricted access');

$userIntro = $params->get('user_intro');

if ($formType == "login")
{
    if ($params->get('showLoginForm'))
    {
         if ($userIntro != '')
        {
            echo '' . $userIntro . "";
        }
        $passwordName = 'password';
        if ($registerType == "communitybuilder")
Hope that helps you figure out the issue,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 6 months ago #16588 by Kbluemel
Awesome. That worked. Thank you!
The topic has been locked.
Support Specialist
14 years 6 months ago #16592 by alzander
Fantastic! Glad we got that going for you, and sorry to make you hack some code. In the 4.1 release, we'll be moving to a improved Login module which fixes this issues and is better all around, so you shouldn't have to worry about this again in the future.

If you run into anything else though, you know where to find us!

Finally, please consider leaving a rating and review for JFBConnect on the Joomla Extension Directory for the extension or our support:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and good luck,
Alex
The topic has been locked.