Exemplo n.º 1
0
	function addphotowalllike()
	{
		$db		=& JFactory :: getDBO();
		$user =& JFactory::getUser();
		$photoid=$_REQUEST['photoID'];
		$uid=$_REQUEST['uID'];
		$sql="select count(*) from #__awd_jomalbum_photo_wall_like  where photoid=".$photoid." and userid=".$uid;
		//echo $sql;exit;
		$db->setQuery($sql);
		$totRec=$db->loadResult();
		if($totRec==0)
		{		
			$sql="insert into #__awd_jomalbum_photo_wall_like(photoid,userid) values($photoid,$uid)";
			$db->setQuery($sql);
			if (!$db->query()) {
			return JError::raiseWarning( 500, $db->getError() );
			}	
			
				// AUP POINTS
				$query='select wall_id from #__awd_wall_images where id='.$photoid;
				$db->setQuery($query);
				$wall_id = $db->loadResult();
				$query='select commenter_id from #__awd_wall where id='.$wall_id.' and wall_date IS NOT NULL';
				$db->setQuery($query);
				$commenter_id = $db->loadResult();
				if($commenter_id!=$user->id)
				{
					$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
					if ( file_exists($api_AUP)){				
						require_once ($api_AUP);
						
				$keyreference  = AlphaUserPointsHelper::buildKeyreference('plgaup_points4jomwallphotolike', $photoid );
				 AlphaUserPointsHelper::newpoints('plgaup_points4jomwallphotolike','', $keyreference);
						 
						 }
				}
			
		}
		
		
		$sql="select * from #__awd_jomalbum_photo_wall_like where photoid=".$photoid." order by id desc Limit 5";
		$db->setQuery($sql);
		$rows=$db->loadObjectList();
	
		$sql="select count(*) from #__awd_jomalbum_photo_wall_like where photoid=".$photoid;
		$db->setQuery($sql);
		$totLike=$db->loadResult();
		
		$link='index.php?option=com_awdwall&controller=colors';
		$db->setQuery("SELECT params FROM #__menu WHERE `link`='".$link."'");
		$params = json_decode( $db->loadResult(), true );
		for($i=1; $i<=14; $i++)
		{
			$str_color = 'color'.$i;			
			$color[$i]= $params[$str_color];
		}
		?>
		<div style="background-color:#<?php echo $color[12];?>;margin-bottom:5px;">
		<?php 
		$user =& JFactory::getUser();
		?>
		<div style="width:100%; text-align:left;padding-bottom:3px;"><span  class="likespan"><?php echo $totLike.'&nbsp;'.JText::_('People like this photo');?></span></div>
		<?php
		foreach($rows as $row)
		{
		$userprofileLinkAWDCUser=JRoute::_('index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$row->userid.'&Itemid='.AwdwallHelperUser::getComItemId());
				 $values=getCurrentUserDetails($row->userid);  
				 $avatarTable=$values[2];
				 $userprofileLinkCUser=$values[1];
			
			$values1=getUserDetails($row->userid,$avatarTable,$user->id); 
			$imgPath1=$values1[0];
			 
			?>
			<a href="<?php echo $userprofileLinkCUser; ?>" style="padding-right:5px;"><img  src="<?php echo $imgPath1; ?>" height="32" width="32" border="0"/></a>
			<?php
		}
		
		?></div><?php
		exit;
		}
Exemplo n.º 2
0
			$avatarTable=$values[2];
			$userprofileLinkCUser=$values[1];
			$values1=getUserDetails($albumlikerow->userid,$avatarTable,$user->id); 
			$imgPath1=$values1[0];
		?>
        <a href="<?php echo $userprofileLinkCUser; ?>" style="padding-right:5px;" target="_top"> <img src="<?php echo $imgPath1; ?>" border="0" height="32" width="32" /> </a>
        <?php } ?>
      </div>
   	  <div style="height: 250px; overflow:hidden; overflow-y: scroll; width: 100%;">
      <div id="new_comment_here"></div>
      <div class="commentBox"></div>
      <?php 
            
            $userprofileLinkAWDCUser=JRoute::_('index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$user->id.'&Itemid='.AwdwallHelperUser::getComItemId());
            $avatarTable='';
            $values=getCurrentUserDetails($user->id);
            $imgPathCUser=$values[0];
            $userprofileLinkCUser=$values[1];
            $avatarTable=$values[2];
            $cDatecUser=AwdwallHelperUser::getDisplayTime(time());
            if($commentrows){
            $counter=0; 
            foreach($commentrows as $commentrow) {
				list($y, $m,$d) = explode('-', $commentrow->cdate);
				if($d!='')
				{
					$comment_date=strtotime($commentrow->cdate);
				}
				else
				{
					$comment_date=$commentrow->cdate;
Exemplo n.º 3
0
$totLike=$this->totLike;

?>

<div style="width:100%; text-align:left;"><?php echo $totLike.'&nbsp;'.JText::_('People like this comment');?></div>

<?php

foreach($rows as $row)

{

$userprofileLinkAWDCUser=JRoute::_('index.php?option=com_awdwall&view=awdwall&layout=mywall&wuid='.$row->userid.'&Itemid='.AwdwallHelperUser::getComItemId());

		 $values=getCurrentUserDetails($row->userid);  

		 $avatarTable=$values[2];

		 

	

	$values1=getUserDetails($row->userid,$avatarTable,$user->id); 

	$imgPath1=$values1[0];

	 

	?>