Ejemplo n.º 1
0
	function getBigAvatar19($userId)
	{
		$db		=& JFactory :: getDBO();
		$app = JFactory::getApplication('site');
		$config = &JComponentHelper::getParams('com_awdwall');
		$template 		= $config->get('temp', 'default');
		$avatarintergration 		= $config->get('avatarintergration', '0');
		
		$cbfacebookavatar=	AwdwallHelperUser::checkcbfacebookplguin();
		if(	$cbfacebookavatar==1)
		{
			$query = "SELECT fb_userid FROM #__comprofiler WHERE user_id = " . (int)$userId;
			$db->setQuery($query);
			$facebook_id = $db->loadResult();
			if($facebook_id)
			{
				$avatar='https://graph.facebook.com/'.$facebook_id.'/picture?type=square';
				return $avatar;
			}		
		}
		
			$query 	= "SELECT facebook_id FROM #__jconnector_ids WHERE user_id = "  . (int)$userId;
			$db->setQuery($query);
			$facebook_id = $db->loadResult();
			if($facebook_id)
			{
				$avatar='https://graph.facebook.com/'.$facebook_id.'/picture?type=square';
			}
			else
			{
				
				$query 	= 'SELECT avatar FROM #__awd_wall_users WHERE user_id = ' . (int)$userId;
				$db 	= & JFactory::getDBO();
				$db->setQuery($query);
				$img = $db->loadResult();		
				
				if($img == NULL){
					$avatar = JURI::base() . "components/com_awdwall/images/".$template."/".$template."19.png";
				}else{
					$avatar = JURI::base() . "images/wallavatar/" . $userId . "/thumb/tn19" . $img;
				}
				
			}
		if($avatarintergration==1) // k2
		{
				if(file_exists(JPATH_SITE . '/components/com_k2/k2.php'))
				{
					require_once (JPATH_SITE . '/components/com_k2/helpers/utilities.php');
					$avatar=K2HelperUtilities::getAvatar($userId);
				}
				
		}
		else if($avatarintergration==2) // easyblog
		{
				if(file_exists(JPATH_SITE . '/components/com_easyblog/easyblog.php'))
				{
					require_once (JPATH_SITE . '/components/com_easyblog/helpers/helper.php');
				
				$blogger	= EasyBlogHelper::getTable( 'Profile', 'Table');
				$blogger->load( $userId );
				$avatar=$blogger->getAvatar();
				}
		}
		else if($avatarintergration==3) // alphauserpoint
		{
				if(file_exists(JPATH_SITE . '/components/com_alphauserpoints/alphauserpoints.php'))
				{
					require_once (JPATH_SITE . '/components/com_alphauserpoints/helper.php');
					require_once (JPATH_SITE . '/components/com_alphauserpoints/helpers/helpers.php');
				
					$_user_info = AlphaUserPointsHelper::getUserInfo ( $referrerid='', $userId  );
					$com_params = &JComponentHelper::getParams( 'com_alphauserpoints' );
					$useAvatarFrom = $com_params->get('useAvatarFrom');
					$height = 19;
					$width=19;
					$avatar = getAvatar( $useAvatarFrom, $_user_info, $height,$width);	
					$doc = new DOMDocument();
					$doc->loadHTML($avatar);
					$imageTags = $doc->getElementsByTagName('img');
					
					foreach($imageTags as $tag) {
						$avatar=$tag->getAttribute('src');
					}
				}
		}
		return $avatar;
	}