SouthwestVA Posted July 13, 2012 Report Posted July 13, 2012 I have one question here, Im trying to do this. <?php if(!Auth::LoggedIn()) { // Show these if they haven't logged in yet ?> <?php } else { ?> <p class="front"> Your Hub Manager is...</p> <?php if ($userinfo->hub == KDEN) { echo "Dimitri"; } elseif ($userinfo->hub == KLAX) { echo "Josh"; } elseif ($userinfo->hub == KMDW) { echo "Jeff "; } elseif ($userinfo->hub == KBNA) { echo "Mark"; } else { echo "you have no manager yet"; } ?> <?php } ?> but it will always echo you have no manager yet. does $userinfo->hub echo a number or what? Please help. Thanks Quote
Moderators Kyle Posted July 13, 2012 Moderators Report Posted July 13, 2012 This will work, give this a go. The Letters needs to be closed in qoutes. <?php if(!Auth::LoggedIn()) { // Show these if they haven't logged in yet ?> <?php } else { ?> <p class="front"> Your Hub Manager is...</p> <?php if ($userinfo->hub == 'KDEN') { echo "Dimitri"; } elseif ($userinfo->hub == 'KLAX') { echo "Josh"; } elseif ($userinfo->hub == 'KMDW') { echo "Jeff "; } elseif ($userinfo->hub == 'KBNA') { echo "Mark"; } else { echo "you have no manager yet"; } ?> <?php } ?> Quote
SouthwestVA Posted July 13, 2012 Author Report Posted July 13, 2012 EDIT: Nah, it still dont work ;( Quote
Moderators Kyle Posted July 13, 2012 Moderators Report Posted July 13, 2012 Thanks Alot. One little thing i missed. Not a problem! Quote
SouthwestVA Posted July 13, 2012 Author Report Posted July 13, 2012 Not a problem! nah did not work Quote
mseiwald Posted July 13, 2012 Report Posted July 13, 2012 it works on my site..... where do you want to have this info? profile_main.tpl? Quote
Moderators Kyle Posted July 13, 2012 Moderators Report Posted July 13, 2012 Try this... <?php if(!Auth::LoggedIn()) { // Show these if they haven't logged in yet ?> <?php } else { ?> <p class="front"> Your Hub Manager is...</p> <?php if (Auth::$userinfo->hub == 'KDEN') { echo "Dimitri"; } elseif (Auth::$userinfo->hub == 'KLAX') { echo "Josh"; } elseif (Auth::$userinfo->hub == 'KMDW') { echo "Jeff "; } elseif (Auth::$userinfo->hub == 'KBNA') { echo "Mark"; } else { echo "you have no manager yet"; } ?> <?php } ?> 1 Quote
SouthwestVA Posted July 13, 2012 Author Report Posted July 13, 2012 Try this... <?php if(!Auth::LoggedIn()) { // Show these if they haven't logged in yet ?> <?php } else { ?> <p class="front"> Your Hub Manager is...</p> <?php if (Auth::$userinfo->hub == 'KDEN') { echo "Dimitri"; } elseif (Auth::$userinfo->hub == 'KLAX') { echo "Josh"; } elseif (Auth::$userinfo->hub == 'KMDW') { echo "Jeff "; } elseif (Auth::$userinfo->hub == 'KBNA') { echo "Mark"; } else { echo "you have no manager yet"; } ?> <?php } ?> Now i can say, Thanks Alot Kyle! I think it needed auth because i was calling it in Layout.TPL Quote
Moderators Kyle Posted July 13, 2012 Moderators Report Posted July 13, 2012 Yep, that's what you have to do. Cheers! 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.