Topic-icon Welcome message

Active Subscriptions:

None
12 years 10 months ago #10413 by fb_782343432
Replied by fb_782343432 on topic Welcome message
Works great! I actually made a few tweaks...I just used the module once set show to all and used an if else statement. :) Only issue the %s doesn't work??

<?php
$user = JFactory::getUser();
if ($user->guest)
{ ?>
<div style="float: right;">{rokbox module=|login| text=|Member Login| size=|300 200|}{/rokbox}</div>
<?php }else;
{ ?>
<div style="float:right;">Welcome %s,<a href='index.php?option=com_community&view=profile'>View Profile</a></div>
<?php
} ?>
The topic has been locked.
Support Specialist
12 years 10 months ago #10414 by alzander
Replied by alzander on topic Welcome message
The %s is a replacement that we do using the language string. Good idea as to what you're trying though...

Instead of %s, try:
Welcome <?php echo $user->get('name'); ?>, ....

Let us know how it goes.. I can feel it this time!
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10415 by fb_782343432
Replied by fb_782343432 on topic Welcome message
that was it! Thanks for your help!

Now if I can only add a Logout link.... :)
The topic has been locked.
Support Specialist
12 years 10 months ago #10416 by alzander
Replied by alzander on topic Welcome message
Just put {JFBCLogin logout=true} before the closing div. JFBConnect will replace that correctly for you. That normally would show the login button if the user isn't logged in and the logout if they are.. but since that will only be shown when logged in, you'll just get the logout button!

I hope that sets you up on everything, but as always, if not, just let us know!

Also, please consider leaving a rating and review on the Joomla Extension Directory for JFBConnect. They use JFBConnect for registrations now, so it's easy to create an account!
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and good luck!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10429 by fb_782343432
Replied by fb_782343432 on topic Welcome message
ok I've actually have a small problem....

When I am logged in the welcome message is perfect.. But if I am logged out its like the php if else doesn't work and I see the following and the rokbox does actually process and I see the code.....


{rokbox module=|login| text=|Member Login| size=|300 200|}{/rokbox}
Welcome , View Profile| Logout

This is my final code.....
<?php
$user = JFactory::getUser();
if ($user->guest)
{ ?>
<div style="float: right;">{rokbox module=|login| text=|Member Login| size=|300 200|}{/rokbox}</div>
<?php }else;
{ ?>
<div style="float:right;">Welcome <?php echo $user->get('name'); ?>, <a href='index.php?option=com_community&view=profile'>View Profile</a>| <a href="javascript:void(0)" onclick="javascript:jfbc.login.logout_button_click()"><?php echo JText::_('Logout') ?></a></div>
<?php
} ?>
The topic has been locked.
Support Specialist
12 years 10 months ago #10432 by alzander
Replied by alzander on topic Welcome message
Not you again! :)

The ; after the else is the problem. Remove that and you should be good to go. Definitely let us know when you get it up and running perfectly! Always like to hear when things are going smoothly.
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10435 by fb_782343432
Replied by fb_782343432 on topic Welcome message
Finally got it working and fully tested... :)
That module does not process plugins so I had to use a href="" rel="rokbox[300 200][module=login] for the popup.

For anyone who wants to do something similar here is my code....
<?php
$user = JFactory::getUser();
if ($user->guest)
{ ?>
<div style="float: right;">
  <a href="" rel="rokbox[300 200][module=login]" title="">Member Login</a>
</div>
<?php }else
{ ?>
<div style="float:right;">Welcome <?php echo $user->get('name'); ?>, <a href='index.php?option=com_community&view=profile'>View Profile</a>| <a href="javascript:void(0)" onclick="javascript:jfbc.login.logout_button_click()"><?php echo JText::_('Logout') ?></a></div>
<?php
} ?>
The topic has been locked.
Support Specialist
12 years 10 months ago #10460 by alzander
Replied by alzander on topic Welcome message
Neil,
Great to hear you got it going, and thanks for posting your results!

Should you need anything else, as always, you know where to find us. We hope you continue enjoying JFBConnect!

Alex
The topic has been locked.