Jump to content


Photo

Problema Com Html E Php.


  • Faça o login para participar
2 replies to this topic

#1 Love.Bitch

Love.Bitch

    Novato no fórum

  • Usuários
  • 6 posts
  • Sexo:Masculino
  • Localidade:Rio de Janeiro

Posted 06/04/2007, 12:06

Eu tenho uma página assim:

<table width="760" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td width="253" height="19"> </td>
	<td width="253"> </td>
	<td width="254"><? include("gera.lista.amigos.pequena.php"); ?></td>
  </tr>
</table>

Sendo que onde é feito o include eu quero que a lista de amigos fique assim:

|1|-|2|-|3|
|4|-|5|-|6|

Mas ao invés disso tá saindo assim:

|1|-|2|-|3|-|4|
|5|-|6|

E queria 3 amigos em cima e 3 embaixo.
Eu me espelhei no script Yougurt que está assim:

function draw_small_friend_list($rs)
	{
		?>
		<table width="96%" cellspacing=0 cellpadding=0>
		<tr><td align="center">
		<?
		draw_frame_top("Friends</b> (<a href=\"friends.php?id=". $_GET['id'] ."\">view all friends</a>)<b>");

		if(mysql_num_rows($rs)<=0)
			print("this user has no friends");
		?>
			<table width="100%">
			<?
			$count=0;
			while($row = mysql_fetch_array($rs))
			{
			?>
				<? if ($count==0) print("<tr>"); ?>
				<td align="center" width="25%">
					<a href="profile.php?id=<? print($row['friend']); ?>"><? draw_user_small_picture($row['friend']) ?><br>
					<? print($row['first_name'] . " " . $row['last_name']); ?></a><br>
				</td>
				<? if ($count==3) print("</tr>"); ?>
			<?
				$count++;
				if ($count>=4) $count=0;
			}
			if ($count!=0) print("</tr>");
			?>
			</table>
		<?
		draw_frame_bottom();
		?>
		</td></tr>
		</table>
		<?
	}


Sei que isso tem a ver com a tabela, mas o que devo colocar? ou tirar?

Muito obrigado...

#2 Guilherme Luiz

Guilherme Luiz

    Normal

  • Usuários
  • 78 posts
  • Sexo:Masculino
  • Localidade:São Paulo

Posted 07/04/2007, 03:10

nessa parte aki

if ($count>=4) $count=0;

muda p/

if ($count>=3) $count=0;

just its a lie when the truth is found !

#3 Love.Bitch

Love.Bitch

    Novato no fórum

  • Usuários
  • 6 posts
  • Sexo:Masculino
  • Localidade:Rio de Janeiro

Posted 07/04/2007, 16:28

muitíssimo obrigado,,,




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq