コード例 #1
0
ファイル: view.html.php プロジェクト: kosmosby/medicine-prof
	public function getMsgBlock($tpl = null)

	{

		$wallalbumfile = JPATH_SITE . '/components/com_awdjomalbum/awdjomalbum.php';
		//echo $wallalbumfile;
		$jomalbumexist='';
		if (file_exists($wallalbumfile)) // if com_awdjomalbum install then only
		{
			$jomalbumexist=1;
		}
		$this->assignRef('jomalbumexist', $jomalbumexist);

		$hwdvideosharefile = JPATH_SITE . '/components/com_hwdvideoshare/hwdvideoshare.php';
		$hwdvideoshare='';
		if (file_exists($hwdvideosharefile)) // if com_awdjomalbum install then only
		{
			$hwdvideoshare=1;
		}
		$this->assignRef('hwdvideoshare', $hwdvideoshare);
		
		$wallModel = & $this->getModel('wall');

		$receiverId = JRequest::getInt('receiver_id', 0);

		$wid 		= JRequest::getInt('wid', 0);

		$mywall 	= JRequest::getString('layout', '');

		$type		= JRequest::getString('type', 'text');

		$msg = $_REQUEST['awd_message'];

		$msg = AwdwallHelperUser::checkTrailPost($msg);		

		$msg 		= AwdwallHelperUser::formatUrlInMsg($msg);

		$receiver 	=  &JFactory::getUser($receiverId);

		// get configuration from database
	
		//$config = &JComponentHelper::getParams('com_awdwall');
		$app = JFactory::getApplication('site');
		$config =  & $app->getParams('com_awdwall');

		$displayName 	= $config->get('display_name', 1);
		$videoLightbox  = $config->get('video_lightbox', 0);
		$width  		= $config->get('width', 725);
		$imageLightbox  = $config->get('image_lightbox', 1);

		$user = &JFactory::getUser();

		// check group

		$groupId = JRequest::getInt('groupid', 0);

		if($groupId){

			require_once (JPATH_COMPONENT . DS . 'models' . DS . 'group.php');

			$groupModel = new AwdwallModelGroup();

			$owner = $groupModel->checkGrpOwner($user->id, $groupId);

			$this->assignRef('owner', $owner);

			// get group info

			$grpInfo = $groupModel->getGroupInfo($groupId);

			$this->assignRef('grpInfo', $grpInfo);

		}

		$this->assignRef('videoLightbox', $videoLightbox);
		$this->assignRef('width', $width);
		$this->assignRef('imageLightbox', $imageLightbox);

		$this->assignRef('receiverId', $receiverId);

		$this->assignRef('receiver', $receiver);

		$this->assignRef('msg', $msg);

		$this->assignRef('wid', $wid);

		$this->assignRef('layout', $mywall);

		$this->assignRef('type', $type);

		$this->assignRef('postedTime', time());

		$this->assignRef('wallModel', $wallModel);

		$app = JFactory::getApplication('site');
		 
		$config =  & $app->getParams('com_awdwall');
		$display_profile_link = $config->get('display_profile_link', 1);
		$this->assignRef('display_profile_link', $display_profile_link);
		parent::display($tpl);

	}
コード例 #2
0
ファイル: controller.php プロジェクト: kosmosby/medicine-prof
	public function addMsg()
	{
		require_once (JPATH_COMPONENT . DS . 'models' . DS . 'wall.php');
		$wallModel = $this->getModel('wall');
		$mainframe	=& JFactory::getApplication();
		$itemId = AwdwallHelperUser::getComItemId();	
		$msg = $_REQUEST['awd_message'];
		$post_privacy = $_REQUEST['post_privacy'];
		$widTmp = JRequest::getInt('wid_tmp', 0);
		$groupId = JRequest::getInt('groupid', NULL);
		$msg = AwdwallHelperUser::checkTrailPost($msg);
		$type = 'text';
		$pos = stripos($msg, '<a href="http://www.everytrail.com/view_trip.php');
		$user 		= &JFactory::getUser();
		if($pos !== false)
			$type = 'trail';
		$receiverId = JRequest::getInt('receiver_id', 0);
		if($groupId){
			$receiverId = $user->id;
		}
		if($groupId==0)
		$groupId =NULL;
		$db 		= &JFactory::getDBO();
		
		$gprivacy=1;
		if(!empty($groupId))
		{
			$query 	= 'SELECT privacy FROM #__awd_groups '					
					 .'WHERE id = ' . (int)$groupId . ' ';
			$db->setQuery($query);
			$gprivacy = $db->loadResult();
		}
		
		if((int)$user->id){			
			$msg = AwdwallHelperUser::formatUrlInMsg($msg);			
			$wall 				=& JTable::getInstance('Wall', 'Table');						
			$wall->user_id		= $receiverId;
			$wall->group_id		= $groupId;
			$wall->type			= $type;
			$wall->commenter_id	= $user->id;
			$wall->user_name	= '';
			$wall->avatar		= '';
			$wall->message		= nl2br($msg);
			$wall->reply		= 0;
			$wall->is_read		= 0;
			$wall->is_pm		= 0;
			$wall->is_reply		= 0;
			$wall->posted_id	= NULL;
			$wall->wall_date	= time();
			if((int)$widTmp){				
				$wall->id = $widTmp;
				$wall->type = JRequest::getString('type', 'text');				
			}
			// store wall to database
			if (!$wall->store()){				
				$this->setRedirect(JRoute::_('index.php?option=com_awdwall&&view=awdwall&layout=main&Itemid='.$itemId , false ), JText::_('Post Failed'));
			}
			// set wall id to view
			JRequest::setVar('wid', $wall->id);
			//insert into awd_wall_ privacy table.
			
			$query = 'INSERT INTO #__awd_wall_privacy(wall_id, privacy) VALUES(' . $wall->id . ', ' . $post_privacy . ')';
			$db->setQuery($query);
			$db->query();
			//insert into awd_wall_notification table.
			$ndate=date("Y-m-d H:i:s");
			$query = 'INSERT INTO #__awd_wall_notification(ndate, nuser, ncreator, ntype, nwallid, ngroupid, nphotoid, nalbumid, nread) VALUES( "'.$ndate.'" , "' . $receiverId . '", "' . $user->id . '", "' . $type . '", "' . $wall->id . '", "' . $groupId . '"," ", "","0")';
			$db->setQuery($query);
			$db->query();
			
			
			if($post_privacy==0)
			{
				if($gprivacy==1)
				{
	
					//********************* for plguin acesss code start here ***********************//
					//Call For OnJomwallstreamcreate() trigger in system plugin
					if($type=='link')
					{
						$query 	= "SELECT link FROM #__awd_wall_links WHERE wall_id = "  . (int)$wall->id;
						$db->setQuery($query);
						$attachment = $db->loadResult();
					}
					if($type=='video')
					{
						$query 	= "SELECT path FROM #__awd_wall_videos WHERE wall_id = "  . (int)$wall->id;
						$db->setQuery($query);
						$attachment = $db->loadResult();
					}
					if($type=='jing')
					{
						$query 	= "SELECT jing_link FROM #__awd_wall_jing WHERE wall_id = "  . (int)$wall->id;
						$db->setQuery($query);
						$attachment = $db->loadResult();
					}
					if($type=='image')
					{
						$query 	= "SELECT path FROM #__awd_wall_images WHERE wall_id = "  . (int)$wall->id;
						$db->setQuery($query);
						$path = $db->loadResult();
						$attachment=JURI::base().'images/'.$user->id.'/thumb/'.$path;
					}
					
					if($type=='mp3')
					{
						$query 	= "SELECT path FROM #__awd_wall_mp3s WHERE wall_id = "  . (int)$wall->id;
						$db->setQuery($query);
						$path = $db->loadResult();
						$attachment=JURI::base().'images/mp3/'.$user->id.'/'.$path;
					}
					
					$dispatcher = &JDispatcher::getInstance();
					JPluginHelper::importPlugin('system');//@TODO:need to check plugim type..
					$result=$dispatcher->trigger('onJomwallstreamcreate',array($wall->message,$attachment,$type));
					//End Call For OnJomwallstreamcreate() trigger in system plugin			
					//********************* for plguin acesss code end here ***********************//
				}
			}
			// send email if is enabled
			$app = JFactory::getApplication('site');
			$config =  & $app->getParams('com_awdwall');
			$displayName 	= $config->get('display_name', 1);
			$layout 		= JRequest::getString('layout', '');

			if($config->get('email_auto', 0) && $layout == 'mywall'){
			if($user->id!=$receiverId){
			$walllink=JRoute::_(JURI::base().'index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$receiverId.'&Itemid='.$itemId.'#here'.$wall->id,false) ;
				$receiver = &JFactory::getUser($receiverId);
				$rName =  AwdwallHelperUser::getDisplayName($receiverId);
				$sName =  AwdwallHelperUser::getDisplayName($user->id);	
$sitename=$mainframe->getCfg('fromname');
$siteaddress=JURI::base();
$useravatarimage=AwdwallHelperUser::getBigAvatar51($user->id);
$emailgreeting=JText::sprintf('COM_COMAWDWALL_EMAIL_GREETING', $rName);
$emailbody=JText::sprintf('COM_COMAWDWALL_EMAIL_NEW_POST_BODY',$sName);	
$emailtext1=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_VIEW_CONVERSATION');	
$emailtext2=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_SEE_POST');
$emailfooter=JText::sprintf('COM_COMAWDWALL_EMAIL_FOOTER',$siteaddress,$sitename);	
$reciverurl=JURI::base().'index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$user->id.'&Itemid='.$itemId;
$emailcontent='<table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="font-size:16px;font-family:lucida grande,tahoma,verdana,arial,sans-serif;background:#313131;color:#ffffff;font-weight:bold;vertical-align:baseline;letter-spacing:-0.03em;text-align:left;padding:10px 38px 4px"><a target="_blank" href="'.$siteaddress.'" style="text-decoration:none" title="'.$siteaddress.'"><span style="background:#313131;color:#ffffff;font-weight:bold;font-family:lucida grande,tahoma,verdana,arial,sans-serif;vertical-align:middle;font-size:16px;letter-spacing:-0.03em;text-align:left;vertical-align:baseline"><span class="il">'.$sitename.'</span></span></a></td></tr></tbody></table><table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="border-right:1px solid #ccc;color:#333333;font-size:11px;border-bottom:1px solid #ccc;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;border-top:1px solid #ccc;padding:10px 25px;border-left:1px solid #ccc; background-color:#f7f7f7"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:10px 25px;color:#333333;width:620px"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-bottom:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td colspan="2" valign="top" style="height:30px;"><span style="font-size:13px;">'.$emailgreeting.'</span></td></tr><tr><td valign="top" style="width:100%;"><span style="font-size:13px">'.$emailbody.'</span></td><td valign="top" style="padding-right:10px;font-size:0px"><a target="_blank" style="color:#3b5998;text-decoration:none" href="'.$reciverurl.'" title="'.$rName.'"><img style="border:0" src="'.$useravatarimage.'"  /></a></td></tr></tbody></table></td></tr><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;width:100%"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-right:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td ><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px 0px;">'.$emailtext1.'</td></tr></tbody></table></td></tr></tbody></table></td><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="border-width:1px;border-style:solid;border-color:#E3C823;background-color:#FFF9D9"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px;border-top:1px solid #fff"><a target="_blank" style="color:#6176b7;text-decoration:none" href="'.$walllink.'"><span style="font-weight:bold;white-space:nowrap;color:#3b5b98;font-size:11px">'.$emailtext2.'</span></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;">'.$emailfooter.'</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>';
				
				
							
				$body = $emailcontent;				 
				$mailer = & JFactory::getMailer();
				$mailer->setSender(array($mainframe->getCfg('mailfrom'), $mainframe->getCfg('fromname')));
				$mailer->setSubject($mainframe->getCfg('fromname').' '.JText::sprintf('COM_COMAWDWALL_EMAIL_SUBJECT_NEW_POST', $sName));
				$mailer->setBody($body);
				$mailer->IsHTML(1);
				$mailer->addRecipient($receiver->email);
				$rs = $mailer->Send();		
				}
			}

			if($config->get('email_auto', 0) ){
			if($groupId )
			{
				//sending email to group owner
				$query 	= 'SELECT creator FROM #__awd_groups WHERE id = ' . (int)$groupId;
				$db->setQuery($query);
				$creator = $db->loadResult();
				$query 	= 'SELECT title FROM #__awd_groups WHERE id = ' . (int)$groupId;
				$db->setQuery($query);
				$grpname = $db->loadResult();
				if($creator!=$user->id)
				{
				
				$walllink=JRoute::_(JURI::base().'index.php?option=com_awdwall&task=viewgroup&groupid='.$groupId.'&Itemid='.$itemId.'#here'.$wallId,false) ;
				$grplink=JRoute::_(JURI::base().'index.php?option=com_awdwall&task=viewgroup&groupid='.$groupId.'&Itemid='.$itemId,false) ;
				$receiver = &JFactory::getUser($creator);
				$rName =  AwdwallHelperUser::getDisplayName($creator);
				$sName =  AwdwallHelperUser::getDisplayName($user->id);	
				
$sitename=$mainframe->getCfg('fromname');
$siteaddress=JURI::base();
$useravatarimage=AwdwallHelperUser::getBigAvatar51($user->id);
$emailgreeting=JText::sprintf('COM_COMAWDWALL_EMAIL_GREETING', $rName);
$emailbody=JText::sprintf('COM_COMAWDWALL_EMAIL_NEW_GROUP_POST_BODY',$grplink,$grpname,$sName);	
$emailtext1=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_VIEW_CONVERSATION');	
$emailtext2=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_SEE_POST');
$emailfooter=JText::sprintf('COM_COMAWDWALL_EMAIL_FOOTER',$siteaddress,$sitename);	
$reciverurl=JURI::base().'index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$user->id.'&Itemid='.$itemId;
$emailcontent='<table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="font-size:16px;font-family:lucida grande,tahoma,verdana,arial,sans-serif;background:#313131;color:#ffffff;font-weight:bold;vertical-align:baseline;letter-spacing:-0.03em;text-align:left;padding:10px 38px 4px"><a target="_blank" href="'.$siteaddress.'" style="text-decoration:none" title="'.$siteaddress.'"><span style="background:#313131;color:#ffffff;font-weight:bold;font-family:lucida grande,tahoma,verdana,arial,sans-serif;vertical-align:middle;font-size:16px;letter-spacing:-0.03em;text-align:left;vertical-align:baseline"><span class="il">'.$sitename.'</span></span></a></td></tr></tbody></table><table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="border-right:1px solid #ccc;color:#333333;font-size:11px;border-bottom:1px solid #ccc;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;border-top:1px solid #ccc;padding:10px 25px;border-left:1px solid #ccc; background-color:#f7f7f7"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:10px 25px;color:#333333;width:620px"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-bottom:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td colspan="2" valign="top" style="height:30px;"><span style="font-size:13px;">'.$emailgreeting.'</span></td></tr><tr><td valign="top" style="width:100%;"><span style="font-size:13px">'.$emailbody.'</span></td><td valign="top" style="padding-right:10px;font-size:0px"><a target="_blank" style="color:#3b5998;text-decoration:none" href="'.$reciverurl.'" title="'.$rName.'"><img style="border:0" src="'.$useravatarimage.'"  /></a></td></tr></tbody></table></td></tr><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;width:100%"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-right:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td ><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px 0px;">'.$emailtext1.'</td></tr></tbody></table></td></tr></tbody></table></td><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="border-width:1px;border-style:solid;border-color:#E3C823;background-color:#FFF9D9"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px;border-top:1px solid #fff"><a target="_blank" style="color:#6176b7;text-decoration:none" href="'.$walllink.'"><span style="font-weight:bold;white-space:nowrap;color:#3b5b98;font-size:11px">'.$emailtext2.'</span></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;">'.$emailfooter.'</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>';
				
				$body = $emailcontent;				
				$mailer = & JFactory::getMailer();
				$mailer->setSender(array($mainframe->getCfg('mailfrom'), $mainframe->getCfg('fromname')));
				$mailer->setSubject($mainframe->getCfg('fromname').' '.JText::sprintf('COM_COMAWDWALL_EMAIL_GROUP_SUBJECT_NEW_POST', $sName));
				$mailer->setBody($body);
				$mailer->IsHTML(1);
				$mailer->addRecipient($receiver->email);
				$rs = $mailer->Send();		
				}
				
		// sending email to the group memebers
		// getting list of grpmembers
		$query 	= 'SELECT user_id FROM #__awd_groups_members WHERE group_id = ' . (int)$groupId . ' AND status = 1  ' ;
		$db->setQuery($query);
		$grpmemberlist=$db->loadObjectList();
			if($grpmemberlist)
			{
				foreach($grpmemberlist as $c)
				{
					if($c->user_id!=$user->id)
					{
						$receiver = &JFactory::getUser($c->user_id);
						$rName =  AwdwallHelperUser::getDisplayName($c->user_id);
						$sName =  AwdwallHelperUser::getDisplayName($user->id);	
$grplink=JRoute::_(JURI::base().'index.php?option=com_awdwall&task=viewgroup&groupid='.$groupId.'&Itemid='.$itemId,false) ;
$sitename=$mainframe->getCfg('fromname');
$siteaddress=JURI::base();
$useravatarimage=AwdwallHelperUser::getBigAvatar51($user->id);
$emailgreeting=JText::sprintf('COM_COMAWDWALL_EMAIL_GREETING', $rName);
$emailbody=JText::sprintf('COM_COMAWDWALL_EMAIL_NEW_GROUP_POST_BODY',$grplink,$grpname,$sName);	
$emailtext1=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_VIEW_CONVERSATION');	
$emailtext2=JText::_('COM_COMAWDWALL_EMAIL_NEW_POST_SEE_POST');
$emailfooter=JText::sprintf('COM_COMAWDWALL_EMAIL_FOOTER',$siteaddress,$sitename);	
$reciverurl=JURI::base().'index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$user->id.'&Itemid='.$itemId;
$emailcontent='<table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="font-size:16px;font-family:lucida grande,tahoma,verdana,arial,sans-serif;background:#313131;color:#ffffff;font-weight:bold;vertical-align:baseline;letter-spacing:-0.03em;text-align:left;padding:10px 38px 4px"><a target="_blank" href="'.$siteaddress.'" style="text-decoration:none" title="'.$siteaddress.'"><span style="background:#313131;color:#ffffff;font-weight:bold;font-family:lucida grande,tahoma,verdana,arial,sans-serif;vertical-align:middle;font-size:16px;letter-spacing:-0.03em;text-align:left;vertical-align:baseline"><span class="il">'.$sitename.'</span></span></a></td></tr></tbody></table><table cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:620px"><tbody><tr><td style="border-right:1px solid #ccc;color:#333333;font-size:11px;border-bottom:1px solid #ccc;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;border-top:1px solid #ccc;padding:10px 25px;border-left:1px solid #ccc; background-color:#f7f7f7"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:10px 25px;color:#333333;width:620px"><table width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-bottom:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td colspan="2" valign="top" style="height:30px;"><span style="font-size:13px;">'.$emailgreeting.'</span></td></tr><tr><td valign="top" style="width:100%;"><span style="font-size:13px">'.$emailbody.'</span></td><td valign="top" style="padding-right:10px;font-size:0px"><a target="_blank" style="color:#3b5998;text-decoration:none" href="'.$reciverurl.'" title="'.$rName.'"><img style="border:0" src="'.$useravatarimage.'"  /></a></td></tr></tbody></table></td></tr><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;width:100%"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-right:10px"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td ><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px 0px;">'.$emailtext1.'</td></tr></tbody></table></td></tr></tbody></table></td><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="border-width:1px;border-style:solid;border-color:#E3C823;background-color:#FFF9D9"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse"><tbody><tr><td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:2px 6px 4px;border-top:1px solid #fff"><a target="_blank" style="color:#6176b7;text-decoration:none" href="'.$walllink.'"><span style="font-weight:bold;white-space:nowrap;color:#3b5b98;font-size:11px">'.$emailtext2.'</span></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td>&nbsp;</td></tr><tr><td style="font-size:13px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px;border-left:none;border-right:none;">'.$emailfooter.'</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>';
						
									
						$body = $emailcontent;				
						$mailer = & JFactory::getMailer();
						$mailer->setSender(array($mainframe->getCfg('mailfrom'), $mainframe->getCfg('fromname')));
						$mailer->setSubject($mainframe->getCfg('fromname').' '.JText::sprintf('COM_COMAWDWALL_EMAIL_GROUP_SUBJECT_NEW_POST', $sName));
						$mailer->setBody($body);
						$mailer->IsHTML(1);
						$mailer->addRecipient($receiver->email);
						$rs = $mailer->Send();		
					}
				}
			}
				
			}
	
	
	}

			// prepend html to main wall		
			$view  = &$this->getView('awdwall', 'html');
			$view->setLayout('msg_block');
			$view->setModel($wallModel);
			$view->getMsgBlock();						
		}else{
			$this->setRedirect(JRoute::_('index.php?option=com_awdwall&&view=awdwall&layout=main&Itemid='.$itemId, false), JText::_('Need to login'));
		}
		exit;
	}