From 297a229213afc37155428c73b94bef5f6d486a03 Mon Sep 17 00:00:00 2001 From: "vishal_g@tekdi.net" Date: Wed, 29 Apr 2015 18:39:57 +0530 Subject: [PATCH] small changes runtime --- easysocial/easysocial/discussion.php | 9 +++++---- easysocial/easysocial/groupinvite.php | 2 +- easysocial/easysocial/newsfeed.php | 2 +- easysocial/libraries/mappingHelper.php | 8 +++++--- easysocial/libraries/schema/group.php | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/easysocial/easysocial/discussion.php b/easysocial/easysocial/discussion.php index 7e9dafa..68b0c5f 100755 --- a/easysocial/easysocial/discussion.php +++ b/easysocial/easysocial/discussion.php @@ -136,11 +136,12 @@ function createGroupDiscussion() // Check if the user is allowed to create a discussion - /*if( !$group->isMember() ) + if( !$group->isMember() ) { - //error code add here - return false; - }*/ + $wres->status = 0; + $wres->message[] = 'Not allowed to create group discussion'; + return $wres; + } // Assign discussion properties $discussion->uid = $group->id; diff --git a/easysocial/easysocial/groupinvite.php b/easysocial/easysocial/groupinvite.php index ebdc0f1..8351540 100755 --- a/easysocial/easysocial/groupinvite.php +++ b/easysocial/easysocial/groupinvite.php @@ -142,5 +142,5 @@ function inviteGroup() } return( $result ); } - + } diff --git a/easysocial/easysocial/newsfeed.php b/easysocial/easysocial/newsfeed.php index 504dc9f..90a9e84 100755 --- a/easysocial/easysocial/newsfeed.php +++ b/easysocial/easysocial/newsfeed.php @@ -67,7 +67,7 @@ function getStream() $options = array('clusterId' => $group_id, 'clusterType' => SOCIAL_TYPE_GROUP, 'startlimit' => $startlimit, 'limit' => $limit); } - if(!$target_user) + if($target_user == $id ) { switch($filter) { case 'everyone': diff --git a/easysocial/libraries/mappingHelper.php b/easysocial/libraries/mappingHelper.php index 11b3d61..540c642 100644 --- a/easysocial/libraries/mappingHelper.php +++ b/easysocial/libraries/mappingHelper.php @@ -2,6 +2,7 @@ defined('_JEXEC') or die('Restricted access'); jimport( 'libraries.schema.group' ); +jimport( 'joomla.filesystem.file' ); require_once JPATH_ADMINISTRATOR.'/components/com_easysocial/includes/foundry.php'; require_once JPATH_ADMINISTRATOR.'/components/com_easysocial/models/groups.php'; @@ -109,7 +110,6 @@ public function streamSchema($rows,$userid) foreach($rows as $ky=>$row) { - if(isset($row->uid)) { $item = new streamSimpleSchema(); @@ -403,14 +403,16 @@ public function groupSchema($rows=null,$userid=0) $item->creator_name = JFactory::getUser($row->creator_uid)->username; //$item->type = ($row->type == 1 )?'Public':'Public'; $item->type = $row->type; + $item->params = $row->params; foreach($row->avatars As $ky=>$avt) { $avt_key = 'avatar_'.$ky; $item->$avt_key = JURI::root().'media/com_easysocial/avatars/group/'.$row->id.'/'.$avt; - + + $fst = JFile::exists('media/com_easysocial/avatars/group/'.$row->id.'/'.$avt); //set default image - if(!file_exists($item->$avt_key)) + if(!$fst) { $item->$avt_key = JURI::root().'media/com_easysocial/avatars/group/'.$ky.'.png'; } diff --git a/easysocial/libraries/schema/group.php b/easysocial/libraries/schema/group.php index 53dd07c..2644a4a 100755 --- a/easysocial/libraries/schema/group.php +++ b/easysocial/libraries/schema/group.php @@ -26,5 +26,6 @@ class GroupSimpleSchema { public $approval_pending; public $cover; public $more_info; +public $params; }