Beispiel #1
0
//walltype is user
$OssnWall->name = 'user';
//getting some inputs that are required for wall post
$post = input('post');
$friends = input('friends');
$location = input('location');
$privacy = input('privacy');
//validate wall privacy
$privacy = ossn_access_id_str($privacy);
if (!empty($privacy)) {
    $access = input('privacy');
} else {
    $access = OSSN_FRIENDS;
}
if ($OssnWall->Post($post, $friends, $location, $access)) {
    if (ossn_is_xhr()) {
        $guid = $OssnWall->getObjectId();
        $get = $OssnWall->GetPost($guid);
        if ($get) {
            $get = ossn_wallpost_to_item($get);
            ossn_set_ajax_data(array('post' => ossn_wall_view_template($get)));
        }
    }
    //no need to show message on success.
    //3.x why not? $arsalanshah
    ossn_trigger_message(ossn_print('post:created'));
    redirect(REF);
} else {
    ossn_trigger_message(ossn_print('post:create:error'), 'error');
    redirect(REF);
}
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
echo ossn_wall_view_template($params);
Beispiel #3
0
$posts = $posts->GetPostByOwner($params['group']['group']->guid, 'group');
$Pagination = new OssnPagination();
$Pagination->setItem($posts);
$posts = false;
if ($params['ismember'] === 1 || $params['membership'] == OSSN_PUBLIC) {
    $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 = '';
        }
        //lastchage: Group admins are unable to delete member posting on group wall #171
        $post->owner_guid = $params['group']['group']->owner_guid;
        $user = ossn_user_by_guid($post->poster_guid);
        echo ossn_wall_view_template(array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image, 'ismember' => $params['ismember']));
    }
}
echo $Pagination->pagination();
echo '</div>';
Beispiel #4
0
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
echo '<div class="user-activity">';
$data = json_decode(html_entity_decode($params['post']->description));
$text = $data->post;
$location = '';
if (isset($data->location)) {
    $location = '- ' . $data->location;
}
//fix missing image in comment-item #161 $githubertus
if (isset($params['post']->{'file:wallphoto'})) {
    $image = str_replace('ossnwall/images/', '', $params['post']->{'file:wallphoto'});
} else {
    unset($image);
}
$params['post']->full_view = true;
$user = ossn_user_by_guid($params['post']->poster_guid);
if ($params['post']->type == 'user') {
    $vars = array('post' => $params['post'], 'text' => $text, 'friends' => explode(',', $data->friend), 'location' => $location, 'user' => $user, 'image' => $image);
    echo ossn_wall_view_template($vars);
}
if ($params['post']->type == 'group') {
    $vars = array('post' => $params['post'], 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image, 'show_group' => true);
    echo ossn_wall_view_template($vars);
}
echo '</div>';