Example #1
0
        echo ossn_site_url();
        ?>
u/<?php 
        echo $user->username;
        ?>
"><?php 
        echo $user->fullname;
        ?>
</a>
            </div>
            <?php 
        if (ossn_isLoggedIn()) {
            ?>
                <?php 
            if (ossn_loggedin_user()->guid !== $user->guid) {
                if (!ossn_user_is_friend(ossn_loggedin_user()->guid, $user->guid)) {
                    if (ossn_user()->requestExists(ossn_loggedin_user()->guid, $user->guid)) {
                        ?>
                            <a href="<?php 
                        echo ossn_site_url("action/friend/remove?cancel=true&user={$user->guid}", true);
                        ?>
"
                               class='button-grey friendlink'>
                                <?php 
                        echo ossn_print('cancel:request');
                        ?>
                            </a>
                        <?php 
                    } else {
                        ?>
                            <a href="<?php 
Example #2
0
$posts = $Pagination->getItem();
if ($posts) {
    foreach ($posts as $post) {
        $data = json_decode(html_entity_decode($post->description));
        $text = ossn_restore_new_lines($data->post, true);
        $location = '';
        if (isset($data->location)) {
            $location = '- ' . $data->location;
        }
        if (!isset($data->friend)) {
            $data->friend = '';
        }
        if (isset($post->{'file:wallphoto'})) {
            $image = str_replace('ossnwall/images/', '', $post->{'file:wallphoto'});
        } else {
            $image = '';
        }
        $user = ossn_user_by_guid($post->poster_guid);
        if ($post->access == OSSN_FRIENDS) {
            //lastchage: site admins are unable to access member profile threads without friendship #176
            if (ossn_user_is_friend(ossn_loggedin_user()->guid, $post->owner_guid) || ossn_loggedin_user()->guid == $post->owner_guid || ossn_isAdminLoggedin()) {
                echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image));
            }
        }
        if ($post->access == OSSN_PUBLIC) {
            echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image));
        }
    }
}
echo $Pagination->pagination();
echo '</div>';
    $posts = $wall->getFriendsPosts();
}
if ($posts) {
    foreach ($posts as $post) {
        if (!isset($post->poster_guid)) {
            $post = ossn_get_object($post->guid);
        }
        $data = json_decode(html_entity_decode($post->description));
        $text = ossn_restore_new_lines($data->post, true);
        $location = '';
        if (isset($data->location)) {
            $location = '- ' . $data->location;
        }
        if (isset($post->{'file:wallphoto'})) {
            $image = str_replace('ossnwall/images/', '', $post->{'file:wallphoto'});
        } else {
            $image = '';
        }
        $user = ossn_user_by_guid($post->poster_guid);
        if ($post->access == OSSN_FRIENDS) {
            if (ossn_user_is_friend(ossn_loggedin_user()->guid, $post->owner_guid) || ossn_loggedin_user()->guid == $post->owner_guid) {
                echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image));
            }
        }
        if ($post->access == OSSN_PUBLIC) {
            echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image));
        }
        unset($data->friend);
    }
}
echo ossn_view_pagination($count);
/**
 * Check if loggedin is friend with item owner or if owner is loggedin user;
 *
 * @return bool;
 */
function ossn_validate_access_friends($owner)
{
    if (ossn_user_is_friend(ossn_loggedin_user()->guid, $owner) || ossn_loggedin_user()->guid == $owner || ossn_isAdminLoggedin()) {
        return true;
    }
    return false;
}