/** * Send message * * @params $from: User 1 guid * $to User 2 guid * $message Message * * @return bool; */ public function send($from, $to, $message) { if (empty($message)) { return false; } //send valid text to database only no html tags //missing reconversion of html escaped characters in messages #118 $message = html_entity_decode($message, ENT_QUOTES, "UTF-8"); $message = strip_tags($message); $message = ossn_restore_new_lines($message); $message = ossn_input_escape($message, false); $params['into'] = 'ossn_messages'; $params['names'] = array('message_from', 'message_to', 'message', 'time', 'viewed'); $params['values'] = array((int) $from, (int) $to, $message, time(), '0'); if ($this->insert($params)) { $this->lastMessage = $this->getLastEntry(); return true; } return false; }
/** * Send emails to provided addresses * * @return bool; */ public function sendInvitation() { $email = $this->address; $message = strip_tags($this->message); $message = html_entity_decode($message, ENT_QUOTES, "UTF-8"); $message = ossn_restore_new_lines($message); $user = ossn_loggedin_user(); if (!isset($user->guid) || empty($email)) { return false; } $site = ossn_site_settings('site_name'); $url = ossn_site_url(); if (empty($message)) { $params = array($url, $user->profileURL(), $user->fullname); $message = ossn_print('com:ossn:invite:mail:message:default', $params); } else { $params = array($site, $user->fullname, $message, $url, $user->profileURL()); $message = ossn_print("com:ossn:invite:mail:message", $params); } $subject = ossn_print("com:ossn:invite:mail:subject", array($site)); return $this->NotifiyUser($email, $subject, $message); }
echo ossn_view_form('group/container', array('action' => ossn_site_url() . 'action/wall/post/g', 'component' => 'OssnWall', 'id' => 'ossn-wall-form', 'params' => array('group' => $params['group'])), false); echo '</div>'; } echo '<div class="user-activity">'; $posts = new OssnWall(); $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);
/** * Convert wallobject to wall post item * * @param object $post A wall object * * @return array|false */ function ossn_wallpost_to_item($post) { if ($post && $post instanceof OssnWall) { 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); return array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image); } return false; }
<?php /** * Open Source Social Network * * @package Open Source Social Network * @author Open Social Website Core Team <*****@*****.**> * @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $send = new OssnMessages(); $message = input('message'); $to = input('to'); if ($send->send(ossn_loggedin_user()->guid, $to, $message)) { $user = ossn_user_by_guid(ossn_loggedin_user()->guid); $message = ossn_restore_new_lines($message); $params['user'] = $user; $params['message'] = $message; echo ossn_view('components/OssnMessages/templates/message-send', $params); } else { echo 0; }
/** * Send message * * @params $from: User 1 guid * $to User 2 guid * $message Message * * @return bool; */ public function send($from, $to, $message) { $message = html_entity_decode($message, ENT_QUOTES, "UTF-8"); $message = strip_tags($message); $message = ossn_restore_new_lines($message); $message = ossn_input_escape($message, false); $params['into'] = 'ossn_messages'; $params['names'] = array('message_from', 'message_to', 'message', 'time', 'viewed'); $params['values'] = array((int) $from, (int) $to, $message, time(), '0'); if ($this->insert($params)) { return true; } return false; }