Code Source Hide section

yanick beaulieu Posted in Beginning Developers 10 months ago

Can we request code here at this place can I write some or can you write it to me here.

Replies
Indonesian Arsalan Shah Replied 6 months ago
Catalan Yanick beaulieu Replied 6 months ago

If I want to add this code on php I do how to do it

around:
$profile->addPhotoWallPost($file->owner_guid, $resize->{0}->guid);

because I would like the profile image to be visible only to people who want to add it to their friends

When I do :

    if(ossn_isLoggedin() &&  ossn_user_is_friend(ossn_loggedin_user()->guid,  <id>)){
    $profile->addPhotoWallPost($file->owner_guid, $resize->{0}->guid);
            }

There is always a syntax error

Catalan Yanick beaulieu Replied 10 months ago

Perfect ! If I want to hide a function from everyone only on a single profile :)

Indonesian Arsalan Shah Replied 10 months ago

It is right below your comment

if(ossn_isLoggedin()){
    //show stuff for all users admin or normal users
}

if(!ossn_isLoggedin()){
    //when all type of users not loggedin
}
Catalan Yanick beaulieu Replied 10 months ago

I need please :
1. Administrator and user login
2. Administrator and user not logged in

Catalan Yanick beaulieu Replied 10 months ago

I forgot admin and user connect only

Catalan Yanick beaulieu Replied 10 months ago

Thank you very much for any wonderful function

Indonesian Arsalan Shah Replied 10 months ago

-I would like to know the code to hide it from everyone except the administrator.

if(ossn_isAdminLoggedin()){
    //show stuff for admins only
}

-I would like to have the code to display only to friends

if(ossn_isLoggedin() &&  ossn_user_is_friend(ossn_loggedin_user()->guid,  <id>)){
                    //replace ID with actual friend ID
                    //do stuff for friend
}

-I would like to have the code to display only to non-friend users

if(ossn_isLoggedin() &&  !ossn_user_is_friend(ossn_loggedin_user()->guid,  <id>)){
                    //replace ID with actual friend ID
                    //NOT FRIEND STUFF
}
Catalan Yanick beaulieu Replied 10 months ago

Thank you for this code by the way it helps me a lot
The code you provided me which was to be hidden from everyone belonging to the logged in user.

<?php if(ossn_isLoggedin() && ossn_loggedin_user()->guid == $params['user']->guid){ ?>
<?php }?>

-I would like to know the code to hide it from everyone except the administrator.
-I would like to have the code to display only to friends
-I would like to have the code to display only to non-friend users

Indonesian Arsalan Shah Replied 10 months ago

Provide some more details with screenshot so we can guide you