function ossn_js_page_handler($pages) { switch ($pages[0]) { case 'boot': if (!ossn_isLoggedIn()) { ossn_error_page(); } if (isset($pages[1]) && $pages[1] == 'ossn.boot.chat.js') { header('Content-Type: application/javascript'); echo ossn_plugin_view('js/OssnChat.Boot'); } break; case 'selectfriend': $user = input('user'); if (!empty($user)) { $user = ossn_user_by_guid($user); OssnChat::setUserChatSession($user); $friend['user'] = $user; echo ossn_plugin_view('chat/selectfriend', $friend); } break; default: ossn_error_page(); break; } }
/** * Notification View for liking annotation * * @return voud; * @access private */ function ossn_like_annotation($hook, $type, $return, $params) { $notif = $params; $baseurl = ossn_site_url(); $user = ossn_user_by_guid($notif->poster_guid); $user->fullname = "<strong>{$user->fullname}</strong>"; $img = "<div class='notification-image'><img src='{$baseurl}/avatar/{$user->username}/small' /></div>"; if (preg_match('/like/i', $notif->type)) { $type = 'like'; $database = new OssnDatabase(); $database->statement("SELECT * FROM kullaniciveriler WHERE(guid='{$notif->subject_guid}')"); $database->execute(); $result = $database->fetch(); $url = ossn_site_url("post/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}"); if ($result->subtype == 'file:ossn:aphoto') { $url = ossn_site_url("photos/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}"); } } $type = "<div class='ossn-notification-icon-{$type}'></div>"; if ($notif->viewed !== NULL) { $viewed = ''; } elseif ($notif->viewed == NULL) { $viewed = 'class="ossn-notification-unviewed"'; } $notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url); return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div> </div></li>'; }
/** * Post on wall * * @params $post: Post text * $friends: Friend guids * $location: Post location * $access: (OSSN_PUBLIC, OSSN_PRIVATE, OSSN_FRIENDS) * @param string $post * * @return bool; */ public function Post($post, $friends = '', $location = '', $access = '') { self::initAttributes(); if (empty($access)) { $access = OSSN_PUBLIC; } if ($this->owner_guid < 1 || $this->poster_guid < 1 || empty($post)) { return false; } if (isset($this->item_type) && !empty($this->item_type)) { $this->data->item_type = $this->item_type; } if (isset($this->item_guid) && !empty($this->item_guid)) { $this->data->item_guid = $this->item_guid; } $this->data->poster_guid = $this->poster_guid; $this->data->access = $access; $this->subtype = 'wall'; $this->title = ''; $post = preg_replace('/\\t/', ' ', $post); $wallpost['post'] = htmlspecialchars($post, ENT_QUOTES, 'UTF-8'); //wall tag a friend , GUID issue #566 if (!empty($friends)) { $friend_guids = explode(',', $friends); //reset friends guids $friends = array(); foreach ($friend_guids as $guid) { if (ossn_user_by_guid($guid)) { $friends[] = $guid; } } $wallpost['friend'] = implode(',', $friends); } if (!empty($location)) { $wallpost['location'] = $location; } //Encode multibyte Unicode characters literally (default is to escape as \uXXXX) $this->description = json_encode($wallpost, JSON_UNESCAPED_UNICODE); if ($this->addObject()) { $this->wallguid = $this->getObjectId(); if (isset($_FILES['ossn_photo'])) { $this->OssnFile->owner_guid = $this->wallguid; $this->OssnFile->type = 'object'; $this->OssnFile->subtype = 'wallphoto'; $this->OssnFile->setFile('ossn_photo'); $this->OssnFile->setPath('ossnwall/images/'); $this->OssnFile->setExtension(array('jpg', 'png', 'jpeg', 'gif')); $this->OssnFile->addFile(); } $params['subject_guid'] = $this->wallguid; $params['poster_guid'] = $this->poster_guid; if (isset($wallpost['friend'])) { $params['friends'] = explode(',', $wallpost['friend']); } ossn_trigger_callback('wall', 'post:created', $params); return true; } return true; }
/** * Get cover parameters * * @params $guid: User guid * * @return array; */ public function coverParameters($guid) { $user = ossn_user_by_guid($guid); if (isset($user->cover_position)) { $parameters = $user->cover_position; return json_decode($parameters); } return false; }
/** * Initialize library * * @return bool */ function ossn_users() { ossn_register_page('uservalidate', 'ossn_uservalidate_pagehandler'); /** * Logout outuser if user didn't exists */ if (ossn_isLoggedin()) { $user = ossn_user_by_guid(ossn_loggedin_user()->guid); if (!$user) { ossn_logout(); redirect(); } } }
/** * Initialize library * * @return bool */ function ossn_users() { ossn_register_page('uservalidate', 'ossn_uservalidate_pagehandler'); /** * Logout outuser if user didn't exists */ if (ossn_isLoggedin()) { $user = ossn_user_by_guid(ossn_loggedin_user()->guid); if (!$user) { ossn_logout(); redirect(); } //register menu item for logout, in topbar dropdown menu ossn_register_menu_item('topbar_dropdown', array('name' => 'logout', 'text' => ossn_print('logout'), 'href' => ossn_site_url('action/user/logout'), 'action' => true)); } }
/** * User notification menu item * * @return void; * @access private; */ function ossn_poke_notification($name, $type, $return, $params) { $notif = $params; $baseurl = ossn_site_url(); $user = ossn_user_by_guid($notif->poster_guid); $user->fullname = "<strong>{$user->fullname}</strong>"; $img = "<div class='notification-image'><img src='{$baseurl}avatar/{$user->username}/small' /></div>"; $type = 'poke'; $type = "<div class='ossn-notification-icon-poke'></div>"; if ($notif->viewed !== NULL) { $viewed = ''; } elseif ($notif->viewed == NULL) { $viewed = 'class="ossn-notification-unviewed"'; } $url = $user->profileURL(); $notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url); return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div> </div></li>'; }
/** * Add poke * * @params $poker guid of user who is trying to poke * $owner guid of user who is going to be poked * * @return bool; * @access public; */ public function addPoke($poker, $owner) { /* * Check if user is blocked or not */ if (com_is_active('OssnBlock')) { $user = ossn_user_by_guid($owner); if (OssnBlock::UserBlockCheck($user)) { return false; } } /* * Send notification */ $type = 'ossnpoke:poke'; $params['into'] = 'bildirimler'; $params['names'] = array('type', 'poster_guid', 'owner_guid', 'subject_guid', 'item_guid', 'time_created'); $params['values'] = array($type, $poker, $owner, NULL, NULL, time()); if ($this->insert($params)) { return true; } return false; }
$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>';
echo $params['user']->iconURL()->small; ?> " width="40" height="40"/> </div> <div class="post-controls"> <?php if (ossn_is_hook('wall', 'post:menu') && ossn_isLoggedIn()) { $menu['post'] = $params['post']; echo ossn_call_hook('wall', 'post:menu', $menu); } ?> </div> <div class="subject"> <?php $owner = ossn_user_by_guid($params['post']->owner_guid); ?> <a class="owner-link" href="<?php echo $params['user']->profileURL(); ?> "> <?php echo $params['user']->fullname; ?> </a> <?php if ($params['show_group'] == true) { $group = ossn_get_group_by_guid($params['post']->owner_guid); ?> <div class="ossn-wall-on ossn-posted-on"></div> <a class="owner-link"
/** * 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; }
/** * Get online user friends * * @params = $intervals => seconds * $user User guid * * @return object; */ public function getOnlineFriends($user, $intervals = 100) { if (empty($user->guid)) { $user = ossn_loggedin_user(); } else { $user = ossn_user_by_guid($user); } $friends = $user->getFriends(); $friend_guids = ''; if ($friends) { foreach ($friends as $friend) { $friend_guids[] = $friend->guid; } } if (!is_array($friend_guids) && empty($friend_guids)) { return false; } $friend_guids = implode(',', $friend_guids); $time = time(); $params['from'] = 'kullanicilar'; $params['wheres'] = array("last_activity > {$time} - {$intervals} AND guid IN ({$friend_guids})"); $friends = $this->select($params, true); return $friends; }
<?php /** * Open Source Social Network * * @packageOpen 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 */ $poke = new OssnPoke(); $user = input('user'); if ($poke->addPoke(ossn_loggedin_user()->guid, $user)) { $user = ossn_user_by_guid($user); ossn_trigger_message(ossn_print('user:poked', array($user->fullname)), 'success'); redirect(REF); } else { ossn_trigger_message(ossn_print('user:poke:error'), 'error'); redirect(REF); }
/** * Ossn Albums page handler * @pages: * getphoto, * view, * profile, * add * * @return false|null contents */ function ossn_album_page_handler($album) { $page = $album[0]; if (empty($page)) { return false; } switch ($page) { case 'getphoto': $guid = $album[1]; $picture = $album[2]; $size = input('size'); $name = str_replace(array('.jpg', '.jpeg', 'gif'), '', $picture); $etag = $size . $name . $guid; if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == "\"{$etag}\"") { header("HTTP/1.1 304 Not Modified"); exit; } // get image size if (empty($size)) { $datadir = ossn_get_userdata("object/{$guid}/album/photos/{$picture}"); } else { $datadir = ossn_get_userdata("object/{$guid}/album/photos/{$size}_{$picture}"); } //get image type $type = input('type'); if ($type == '1') { if (empty($size)) { $datadir = ossn_get_userdata("user/{$guid}/profile/photo/{$picture}"); } else { $datadir = ossn_get_userdata("user/{$guid}/profile/photo/{$size}_{$picture}"); } } if (is_file($datadir)) { $filesize = filesize($datadir); header("Content-type: image/jpeg"); header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime("+6 months")), true); header("Pragma: public"); header("Cache-Control: public"); header("Content-Length: {$filesize}"); header("ETag: \"{$etag}\""); readfile($datadir); return; } else { ossn_error_page(); } break; case 'getcover': $guid = $album[1]; $picture = $album[2]; $type = input('type'); $name = str_replace(array('.jpg', '.jpeg', 'gif'), '', $picture); $etag = $size . $name . $guid; if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == "\"{$etag}\"") { header("HTTP/1.1 304 Not Modified"); exit; } // get image size $datadir = ossn_get_userdata("user/{$guid}/profile/cover/{$picture}"); if (empty($type)) { $image = file_get_contents($datadir); } elseif ($type == 1) { $image = ossn_resize_image($datadir, 170, 170, true); } //get image file else show error page if (is_file($datadir)) { $filesize = filesize($datadir); header("Content-type: image/jpeg"); header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime("+6 months")), true); header("Pragma: public"); header("Cache-Control: public"); header("Content-Length: {$filesize}"); header("ETag: \"{$etag}\""); readfile($datadir); return; } else { ossn_error_page(); } break; case 'view': if (isset($album[1])) { $title = ossn_print('photos'); $user['album'] = $album[1]; $albumget = ossn_albums(); $owner = $albumget->GetAlbum($album[1])->album; if (empty($owner)) { ossn_error_page(); } //throw 404 page if there is no album access if ($owner->access == 3) { if (!ossn_validate_access_friends($owner->owner_guid)) { ossn_error_page(); } } //shows add photos if owner is loggedin user if (ossn_loggedin_user()->guid == $owner->owner_guid) { $addphotos = array('text' => ossn_print('add:photos'), 'href' => 'javascript::void(0);', 'id' => 'ossn-add-photos', 'data-url' => '?album=' . $album[1], 'class' => 'button-grey'); $delete_action = ossn_site_url("action/ossn/album/delete?guid={$album[1]}", true); $delete_album = array('text' => ossn_print('delete:album'), 'href' => $delete_action, 'class' => 'button-grey'); $control = ossn_plugin_view('output/url', $addphotos); $control .= ossn_plugin_view('output/url', $delete_album); } else { $control = false; } //set photos in module $contents = array('title' => ossn_print('photos'), 'content' => ossn_plugin_view('photos/pages/albums', $user), 'controls' => $control, 'module_width' => '850px'); //set page layout $module['content'] = ossn_set_page_layout('module', $contents); $content = ossn_set_page_layout('contents', $module); echo ossn_view_page($title, $content); } break; case 'profile': if (isset($album[1])) { $title = ossn_print('profile:photos'); $user['user'] = ossn_user_by_guid($album[1]); if (empty($user['user']->guid)) { ossn_error_page(); } //view profile photos in module layout $contents = array('title' => ossn_print('photos'), 'content' => ossn_plugin_view('photos/pages/profile/photos/all', $user), 'controls' => false, 'module_width' => '850px'); $module['content'] = ossn_set_page_layout('module', $contents); //set page layout $content = ossn_set_page_layout('contents', $module); echo ossn_view_page($title, $content); } break; case 'covers': if (isset($album[2]) && $album[1] == 'profile') { $title = ossn_print('profile:covers'); $user['user'] = ossn_user_by_guid($album[2]); if (empty($user['user']->guid)) { ossn_error_page(); } //view profile photos in module layout $contents = array('title' => ossn_print('covers'), 'content' => ossn_plugin_view('photos/pages/profile/covers/all', $user), 'controls' => false, 'module_width' => '850px'); $module['content'] = ossn_set_page_layout('module', $contents); //set page layout $content = ossn_set_page_layout('contents', $module); echo ossn_view_page($title, $content); } break; case 'add': //add photos (ajax) echo ossn_plugin_view('output/ossnbox', array('title' => ossn_print('add:album'), 'contents' => ossn_plugin_view('photos/pages/album/add'), 'success_id' => 'aga', 'callback' => '#ossn-album-submit')); break; default: ossn_error_page(); break; } }
function ossn_group_comment_post($hook, $type, $return, $params) { $notif = $params; $baseurl = ossn_site_url(); $user = ossn_user_by_guid($notif->poster_guid); $user->fullname = "<strong>{$user->fullname}</strong>"; $img = "<div class='notification-image'><img src='{$baseurl}/avatar/{$user->username}/small' /></div>"; $url = ossn_site_url("post/view/{$notif->subject_guid}"); if (preg_match('/like/i', $notif->type)) { $type = 'like'; } if (preg_match('/comments/i', $notif->type)) { $type = 'comment'; $url = ossn_site_url("post/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}"); } $type = "<div class='ossn-notification-icon-{$type}'></div>"; if ($notif->viewed !== NULL) { $viewed = ''; } elseif ($notif->viewed == NULL) { $viewed = 'class="ossn-notification-unviewed"'; } $notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url); return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div> </div></li>'; }
function ossn_messages_page($pages) { if (!ossn_isLoggedin()) { ossn_error_page(); } $OssnMessages = new OssnMessages(); $page = $pages[0]; if (empty($page)) { $page = 'messages'; } switch ($page) { case 'message': $username = $pages[1]; if (!empty($username)) { $user = ossn_user_by_username($username); if (empty($user->guid)) { ossn_error_page(); } $title = ossn_print('ossn:message:between', array($user->fullname)); $OssnMessages->markViewed($user->guid, ossn_loggedin_user()->guid); $params['data'] = $OssnMessages->get(ossn_loggedin_user()->guid, $user->guid); $params['user'] = $user; $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); $contents = array('content' => ossn_plugin_view('messages/pages/view', $params)); $content = ossn_set_page_layout('media', $contents); echo ossn_view_page($title, $content); } else { ossn_error_page(); } break; case 'all': $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); $active = $params['recent'][0]; if (isset($active->message_to) && $active->message_to == ossn_loggedin_user()->guid) { $getuser = $active->message_from; } if (isset($active->message_from) && $active->message_from == ossn_loggedin_user()->guid) { $getuser = $active->message_to; } if (isset($getuser)) { $user = ossn_user_by_guid($getuser); $OssnMessages->markViewed($getuser, ossn_loggedin_user()->guid); $params['data'] = $OssnMessages->get(ossn_loggedin_user()->guid, $getuser); $params['user'] = $user; } $contents = array('content' => ossn_plugin_view('messages/pages/messages', $params)); if (!isset($getuser)) { $contents = array('content' => ossn_plugin_view('messages/pages/messages-none')); } $title = ossn_print('messages'); $content = ossn_set_page_layout('media', $contents); echo ossn_view_page($title, $content); break; case 'getnew': $username = $pages[1]; $guid = ossn_user_by_username($username)->guid; $messages = $OssnMessages->getNew($guid, ossn_loggedin_user()->guid); if ($messages) { foreach ($messages as $message) { $user = ossn_user_by_guid($message->message_from); $message = $message->message; $params['user'] = $user; $params['message'] = $message; echo ossn_plugin_view('messages/templates/message-send', $params); } $OssnMessages->markViewed($guid, ossn_loggedin_user()->guid); echo '<script>Ossn.playSound();</script>'; } break; case 'getrecent': $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); echo ossn_plugin_view('messages/templates/message-with', $params); break; default: ossn_error_page(); break; } }
</div> <!-- $arsalan.shah datatstart --> <div class="data" id="ossn-chat-messages-data-<?php echo $user->guid; ?> "> <?php $messages_meta = ossn_chat()->get(ossn_loggedin_user()->guid, $user->guid); if ($messages_meta) { foreach ($messages_meta as $message) { if (ossn_loggedin_user()->guid == $message->message_from) { $vars['message'] = $message->message; $vars['time'] = $message->time; echo ossn_view('components/OssnChat/views/OssnChat/message-item-send', $vars); } else { $vars['reciever'] = ossn_user_by_guid($message->message_from); $vars['message'] = $message->message; $vars['time'] = $message->time; echo ossn_view('components/OssnChat/views/OssnChat/message-item-received', $vars); } } } ?> </div> <!-- $arsalan.shah datatend --> </div> <!-- $arsalan.shah tab container end --> <div class="inner friend-tab <?php echo $tab_class;
echo ossn_print('validate'); ?> </td> <td><?php echo ossn_print('edit'); ?> </td> <td><?php echo ossn_print('delete'); ?> </td> </tr> <?php if ($list) { foreach ($pagination->getItem() as $user) { $user = ossn_user_by_guid($user->guid); ?> <tr> <td> <div class="image"><img src="<?php echo ossn_site_url(); ?> avatar/<?php echo $user->username; ?> /smaller"/></div> <div class="name" style="margin-left:39px;margin-top: -39px;min-height: 30px;"><?php echo strl($user->fullname, 20); ?> </div> </td>
<?php /** * Open Source Social Network * * @packageOpen 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 */ if ($params['groups']) { foreach ($params['groups'] as $group) { $owner = ossn_user_by_guid($group->owner_guid); ?> <div class="ossn-view-users"> <img src="<?php echo ossn_site_url("components/OssnGroups/images/search_group.png"); ?> " width="100" height="100"/> <div class="uinfo"> <a class="userlink" href="<?php echo ossn_site_url(); ?> group/<?php echo $group->guid; ?> "><?php
<?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 */ echo '<div class="ossn-likes-view">'; $likes = new OssnLikes(); $guid = input('guid'); $type = input('type'); if (empty($type)) { $type = 'post'; } $likes = $likes->GetLikes($guid, $type); if ($likes) { foreach ($likes as $us) { if ($us->guid !== ossn_loggedin_user()->guid) { $users[] = ossn_user_by_guid($us->guid); } } } $users['users'] = $users; $users['icon_size'] = 'small'; echo ossn_view("system/templates/users_list", $users); echo '</div>';
"/> <?php } $limit++; } } ?> </div> <div class="title-h3"> <?php echo ossn_print('group:admin'); ?> </div> <div class="group-members-small"> <?php $group_admin = ossn_user_by_guid($params['group']->owner_guid); ?> <img src="<?php echo ossn_site_url("avatar/{$group_admin->username}/small"); ?> " title="<?php echo $group_admin->fullname; ?> "/> </div> </div> <?php }
/** * Get user friends. * * @return object; */ public function getFriends($user = '') { if (isset($this->guid)) { $user = $this->guid; } $this->statement("SELECT * FROM arkadasliklar WHERE(\n\t\t\t \t\t relation_to='{$user}' AND\n\t\t\t\t\t type='friend:request'\n\t\t\t\t\t );"); $this->execute(); $from = $this->fetch(true); if (!is_object($from)) { return false; } foreach ($from as $fr) { if ($this->isFriend($user, $fr->relation_from)) { $uss[] = ossn_user_by_guid($fr->relation_from); } } if (isset($uss)) { return $uss; } return false; }
<?php /** * Open Source Social Network * * @packageOpen 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 */ ossn_trigger_callback('comment', 'load', $params['comment']); $OssnLikes = new OssnLikes(); $comment = arrayObject($params['comment'], 'OssnWall'); $user = ossn_user_by_guid($comment->owner_guid); if ($comment->type == 'comments:post' || $comment->type == 'comments:entity') { $type = 'annotation'; } $likes_total = $OssnLikes->CountLikes($comment->id, $type); $datalikes = ''; if ($likes_total > 0) { $datalikes = $likes_total; $likes_total = '<span class="dot-likes">.</span><div class="ossn-like-icon"></div>' . $likes_total; } ?> <div class="comments-item" id="comments-item-<?php echo $comment->id; ?> "> <div class="ossn-comment-menu" onclick="Ossn.CommentMenu(this);"> <?php
/** * Save a user entity * * @return boolean */ public function save() { if (!isset($this->guid) || empty($this->guid)) { return false; } $this->owner_guid = $this->guid; $this->type = 'user'; if (parent::save()) { //check if owner is loggedin user guid , if so update session if (ossn_loggedin_user()->guid == $this->guid) { $_SESSION['OSSN_USER'] = ossn_user_by_guid($this->guid); } return true; } return false; }
?> ); }); </script> <div class="title"> <?php echo $params['user']->fullname; ?> </div> <div class="messages-inner" id="message-append-<?php echo $params['user']->guid; ?> "> <?php if ($params['data']) { foreach ($params['data'] as $message) { $user = ossn_user_by_guid($message->message_from); ?> <div class="message-item"> <img src="<?php echo ossn_site_url(); ?> avatar/<?php echo $user->username; ?> /smaller"/> <div class="data"> <div class="name"><a href="<?php echo $user->profileURL(); ?>
function ossn_group_joinrequest_notification($name, $type, $return, $params) { $baseurl = ossn_site_url(); $user = ossn_user_by_guid($params->poster_guid); $user->fullname = "<strong>{$user->fullname}</strong>"; $group = ossn_get_group_by_guid($params->subject_guid); $img = "<div class='notification-image'><img src='{$baseurl}avatar/{$user->username}/small' /></div>"; $type = "<div class='ossn-groups-notification-icon'></div>"; if ($params->viewed !== NULL) { $viewed = ''; } elseif ($params->viewed == NULL) { $viewed = 'class="ossn-notification-unviewed"'; } // lead directly to groups request page $url = "{$baseurl}group/{$params->subject_guid}/requests"; $notification_read = "{$baseurl}notification/read/{$params->guid}?notification=" . urlencode($url); return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$params->type}", array($user->fullname, $group->title)) . '</div> </div></li>'; }
/** * Get group members * * @params $object->guid Group guid * * @return object; */ public function getMembers() { $group = $this->guid; $this->statement("SELECT * FROM ossn_relationships WHERE(\n\t\t\t \t\t relation_to='{$group}' AND\n\t\t\t\t\t type='group:join'\n\t\t\t\t\t );"); $this->execute(); $from = $this->fetch(true); if (!$from) { return false; } foreach ($from as $fr) { if ($this->isMember($group, $fr->relation_from)) { $uss[] = ossn_user_by_guid($fr->relation_from); } } if (isset($uss)) { return $uss; } return false; }
"></div> </div> </div> <div class="description"> <div class="post-text"><?php echo stripslashes($params['text']); ?> <?php if (is_array($params['friends']) && !empty($params['friends'][0])) { ?> <div class="friends"> — with <?php foreach ($params['friends'] as $friend) { $user = ossn_user_by_guid($friend); $url = $user->profileURL(); $friends[] = "<a href='{$url}'>{$user->fullname}</a>"; } echo implode(', ', $friends); ?> </div> <?php } ?> </div> <?php if (!empty($image)) {
<?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 */ $user = ossn_user_by_guid(input('guid')); if (!$user) { ossn_trigger_message(ossn_print('admin:user:validate:error'), 'error'); redirect(REF); } $code = $user->activation; if ($user->ValidateRegistration($code)) { ossn_trigger_message(ossn_print('admin:user:validated')); } else { ossn_trigger_message(ossn_print('admin:user:validate: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 */ $guid = input('guid'); $user = ossn_user_by_guid($guid); if ($user && $user->guid !== ossn_loggedin_user()->guid) { if ($user->deleteUser()) { ossn_trigger_message(ossn_print('admin:user:deleted'), 'success'); } else { ossn_trigger_message(ossn_print('admin:user:delete:error'), 'error'); } } redirect(REF);