Best way to notify group members in SocialEngine

Being an group manager you always want to share news among group members. Announcements  posted as a featured news within the group to share about new information. So group announcement plugin is one of the solution for posting announcements for specific groups.The SocialEngine Group Announcement  allows you to add announcement notices which can display automatically for group members who have not yet viewed that announcement.It helps the group owner regarding promotion and  easy communication with all community members as well as guests. Admin can also place this widget on other places and can display announcements for muliple groups at a same area.

Implementing announcements in social networking site based on socialengine

Here are some steps for posting and managing amount with in the specific groups. With in the group options menu you will see the link named “post announcement” or if already announcement posted then will see the “manage post” option.

Step 1: Write a function to create announcement action.

public function createAction()
    {
          // used some needed code 
           ...................
           ..................
           $announcement_table = Engine_Api::_()->getDbtable('announcements', 'groupannouncement');
           $announcement = $announcement_table->createRow();
           $announcement->setFromArray($params);
           $announcement->save();

           .............. 
           // some of the code is been used for redirecting page to group profile
           ..............
           ...............
        	  
    }

 

 Step 2 : Write a function to update announcement action.

public function editAction()
    {
   	if( !$form->isValid($this->getRequest()->getPost()) ) {
	  return;
	}
	try
	{
	  $values = $form->getValues();
          $announcement->setFromArray($values);
          $announcement->save();
	}catch( Exception $e ){
	  throw $e;
	}
    }

Step 3 : Write a function to delete announcement action.

  public function deleteAction()
   {
     try
    	{
	   Engine_Api::_()->getDbtable('announcements', 'groupannouncement')->delete(array(
	    'announcement_id = ?' => $announcement_id,
	    ));
    	}catch( Exception $e ){
    	   throw $e;
    	}
    }

Step 4 :  How to enable announcement.

public function enableAction()
 {
   try
     	{
	   $announcement_table->update(array(
	     	'enable' => 1,
	     	), array(
	     	'announcement_id= ?' => $announcement_id,
	    ));
     	}
     	catch( Exception $e ) {
     	    throw $e;
     	}

Step 5 : How to disable announcement.

public function disableAction()
  {
   try
     	{
	    $announcement_table->update(array(
	     	'enable' => 0,
	     	), array(
	     	'announcement_id = ?' => $announcement_id,
	     ));
     	}catch( Exception $e ){
     	      throw $e;
        }
  }

Conclusion

Hence by following the approach, you to share news with in the group.  To save your time and enegry, we already have Group Announcement Plugin which notify for all group members. Feel free to contact us if you have any further queries.

Leave a Comment

Scroll to Top