Ver Mensaje Individual
  #6 (permalink)  
Antiguo 11/01/2015, 20:18
Arcana
 
Fecha de Ingreso: mayo-2010
Mensajes: 185
Antigüedad: 14 años
Puntos: 2
Respuesta: Algun experto que pueda ayudarme?

Lo siente unu, mejor dicho me podrian ayudar? u orientarme?
Encontre esta parte en un archivo class.user.inc al parecer aqui esta el problema, pero no entiendo muchas , este es el codigo
Código:
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Friends
	// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	public function GetFriendsCount()
	{
		$stmt = $this->db->prepare("SELECT friend_id FROM friends_data WHERE friend_to_id=(:friend_to_id)");
		$stmt->bindParam(":friend_to_id", $this->id, PDO::PARAM_INT);
		$stmt->execute();

		if ($stmt->rowCount() > 0)
		{
			return $stmt->rowCount();
		}
		else
		{
			return 0;
		}
	}

	public function GetFriends($page=0, $TEXT)
	{
		$msg_per_page = 20;
		$ask_cnt = 0;
		$max_page = 0;

		$stmt = $this->db->prepare("SELECT friend_id FROM friends_data WHERE friend_to_id=(:friend_to_id)");
		$stmt->bindParam(":friend_to_id", $this->id, PDO::PARAM_INT);
		$stmt->execute();

		if ($stmt->rowCount() > 0)
		{
			$ask_cnt = $stmt->rowCount();
			$max_page = intval($ask_cnt/$msg_per_page);

			if (($ask_cnt%$msg_per_page)&&($max_page!=0)) $max_page++;

			if (($page > $max_page)||($page < 0))
			{
				$page = 0;
			}
			else
			{
				$favorites = array();

				$offset = $page*$msg_per_page;
				$max = $offset+$msg_per_page;
/*				$sth = $this->db->prepare("SELECT friend_id FROM friends_data WHERE friend_to_id=(:friend_to_id) LIMIT :offset,:max");
				$sth->bindParam(':friend_to_id', $user->id, PDO::PARAM_INT);
				$sth->bindParam(':offset', $offset, PDO::PARAM_INT);
				$sth->bindParam(':max', $max, PDO::PARAM_INT);
				$sth->execute();
*/
				while ($row = $stmt->fetch())
				{
                    $infouser = new infouser($this->db,$row['friend_id']);
                    $favorites[] = array("time" => $infouser->lasttime, "id" => $infouser->id);
                    unset($infouser);
				}

                arsort($favorites);

                $current = 0;

                foreach ($favorites as $key => $value)
                {
					$current++;
                	if (($current>$offset)&&($current<=$max))
                	{
	                    $draw = new draw($this->db, $TEXT);
	                    $draw->User($value['id']);
	                    unset($draw);
					}
                }

				$page++;

				if (($max_page != 0)&&($page < $max_page))
				{
				?>
                        <div class="view-more-container">
                            <a id="favorites-in-more-btn" rel="<?php echo $page; ?>" class="uiButton uiButtonConfirm"><?php echo $TEXT['action-view-more']; ?></a>
                            <img id="view-more-spinner" class="hide" src="/img/spinner24.gif">
                        </div>
				<?php
				}
			}
		}

		return false;
	}
}