<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" href="<?php echo ossn_site_url("group/{$group->guid}"); ?> "> <?php echo $group->title; ?> </a> <?php } ?> <br/>
/** * Get cover position params * * @param int $guid Group guid * * @return array; * @access public; */ public function coverParameters($guid) { $parameters = ossn_get_group_by_guid($guid)->cover; return json_decode($parameters); }
<?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 */ header('Content-Type: application/json'); $group = ossn_get_group_by_guid(input('group')); if ($group->owner_guid !== ossn_loggedin_user()->guid) { exit; } if ($group->repositionCOVER($group->guid, input('top'), input('left'))) { $params = $group->coverParameters($group->guid); echo json_encode(array('top' => $params[0], 'left' => $params[1])); }
/** * Delete comment menu * * @return voud; * @access private */ function ossn_comment_menu($name, $type, $params) { $OssnComment = new OssnComments(); if (is_object($params)) { $params = get_object_vars($params); } $comment = $OssnComment->getComment($params['id']); if ($comment->type == 'comments:post') { if (com_is_active('OssnWall')) { $ossnwall = new OssnWall(); $post = $ossnwall->GetPost($comment->subject_guid); //check if type is group if ($post->type == 'group') { $group = ossn_get_group_by_guid($post->owner_guid); } //group admins must be able to delete ANY comment in their own group #170 //just show menu if group owner is loggedin if (ossn_loggedin_user()->guid == $post->owner_guid || ossn_loggedin_user()->guid == $group->owner_guid) { ossn_unregister_menu('delete', 'comments'); ossn_register_menu_item('comments', array('name' => 'delete', 'href' => ossn_site_url("action/delete/comment?comment={$params['id']}", true), 'class' => 'ossn-delete-comment', 'text' => ossn_print('comment:delete'))); } } } $user = ossn_loggedin_user(); if (ossn_isLoggedin()) { if ($comment->type == 'comments:entity') { $entity = ossn_get_entity($comment->subject_guid); } if ($user->guid == $params['owner_guid'] || ossn_isAdminLoggedin() || $comment->type == 'comments:entity' && ($entity->type = 'user' && $user->guid == $entity->owner_guid)) { ossn_unregister_menu('delete', 'comments'); ossn_register_menu_item('comments', array('name' => 'delete', 'href' => ossn_site_url("action/delete/comment?comment={$params['id']}", true), 'class' => 'ossn-delete-comment', 'text' => ossn_print('comment:delete'))); } } }
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>'; }
<?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 */ $add = new OssnGroup(); $group = input('group'); $user = input('user'); if (ossn_get_group_by_guid($group)->owner_guid !== ossn_loggedin_user()->guid) { ossn_trigger_message(ossn_print('member:add:error'), 'error'); redirect(REF); } if ($add->deleteMember($user, $group)) { ossn_trigger_message(ossn_print('member:request:deleted'), 'success'); redirect(REF); } else { ossn_trigger_message(ossn_print('member:request:delete:fail'), 'error'); redirect(REF); }
<?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 */ $guid = input('guid'); $group = ossn_get_group_by_guid($guid); if ($group->owner_guid !== ossn_loggedin_user()->guid) { ossn_trigger_message(ossn_print('group:delete:fail'), 'error'); redirect(REF); } if ($group->owner_guid !== ossn_loggedin_user()->guid || ossn_isAdminLoggedin()) { if ($group->deleteGroup($group->guid)) { ossn_trigger_message(ossn_print('group:deleted')); redirect(); } else { ossn_trigger_message(ossn_print('group:delete:fail'), 'error'); redirect(REF); } } else { ossn_trigger_message(ossn_print('group:delete:fail'), 'error'); redirect(REF); }
/** * Group member requests page * * Page: * group/<guid>/requests * * @return mixdata; * @access private */ function group_requests_page($hook, $type, $return, $params) { $page = $params['subpage']; $group = ossn_get_group_by_guid(ossn_get_page_owner_guid()); if ($group->owner_guid !== ossn_loggedin_user()->guid) { redirect("group/{$group->guid}"); } if ($page == 'requests') { $mod_content = ossn_view('components/OssnGroups/pages/requests', array('group' => $group)); $mod = array('title' => ossn_print('requests'), 'content' => $mod_content); echo ossn_set_page_layout('module', $mod); } }
* * @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 */ $comment = input('comment'); $delete = new OssnComments(); $comment = $delete->GetComment($comment); //group admins must be able to delete ANY comment in their own group #170 //first get wall post then get group and check if loggedin user is group owner if ($comment->type == 'comments:post') { $post = ossn_get_object($comment->subject_guid); if ($post && $post->type == 'group') { $group = ossn_get_group_by_guid($post->owner_guid); } } $user = ossn_loggedin_user(); if ($comment->type == 'comments:entity') { $entity = ossn_get_entity($comment->subject_guid); } //Post owner can not delete others comments #607 if ($comment->owner_guid == $user->guid || $post->type == 'user' && $user->guid == $post->owner_guid || $group->owner_guid == $user->guid || $entity->owner_guid == $user->guid || ossn_isAdminLoggedin()) { if ($delete->deleteComment($comment->getID())) { if (ossn_is_xhr()) { echo 1; } else { ossn_trigger_message(ossn_print('comment:deleted'), 'success'); redirect(REF); }