1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hide online status from guests

Discussion in 'General PHP and MySQL Discussions' started by asma, Feb 11, 2016.

  1. asma

    asma Member

    i'm trying to work this out.. if the user choose to hide his online status from guests

    query from database for online users

    foreach ( ) {

    if ($visible ='0')
    echo "<xen:if is='{$visitor.user_id}'> display content </xen:if>";
    echo "display content";


    i get this error
    Parse error: syntax error, unexpected '.', expecting '}'
  2. Lawrence

    Lawrence Well-Known Member

    @asma did you get this implemented for your site? If not, the simplest method is to create a new user custom field (check box, or radio) for the members preferences, and then create an add-on to modify a couple of templates to check the new field value to see if they want their on-line status to show for guests or not.

    Another way, although a little more complex, is to create an add-on with an installer that modifies the xf_user table to add a new field: guest_visible, and then add a checkbox under the privacy settings with the option. TM's will still be required to modify the appropriate templates so that you do not need to edit them at all.

    Either way, a DB query is not required, :)
  3. wang

    wang Well-Known Member

    I do not think that you can use echo in xenforo templating system.

Share This Page