Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

a guest problem when i use getdisplay name function

12 years 3 months ago
  • Tarek's Avatar
    Topic Author
  • Tarek
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
Licenses:
JomSocial Active iSEO Expired Socialize Expired

I am using following code to display name on header right after my logo...

<?php 
       $cuser = CFactory::getUser();
    $data = $cuser->name;
    echo $data;
      
?>

It works perfectly but

when a guest come it shows " a guest"

i dont wana see it...

12 years 3 months ago
Licenses:

Hi, Tarek.

Your request has nothing to do with JomSocial.
We support only JomSocial related requests... as this is JomSocial support forum :)
You should rather ask on Joomla! forum.
You should add in this code a condition that echo is displayed only for registered user.
Look in Google... lmgtfy.com/?q=JFactory%2FgetUser


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
12 years 3 months ago
  • Tarek's Avatar
    Topic Author
  • Tarek
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
Licenses:
JomSocial Active iSEO Expired Socialize Expired

<?php
   $user =& JFactory::getUser();
   if ($user->guest) { ?>

      <div id="notloggediv">
          <jdoc:include type="modules" name="login" style="xhtml" />
      </div>

<?php } else { ?>
     <div id="loggedindiv">Alternate stuff here</div>
<?php } ?>



I use this on Joomla it works for me but

whether i am using Cfactory cuser or J its not working in JomSocial...

I suppose its problem at ur end.

12 years 3 months ago
Licenses:

Hi, terek.

Sure it works. I used it in few occasions: www.jomsocial.com/forum/search?q=$user%2...28%29;&childforums=1


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW