Autor Tema: Ayuda - Estadisticas de Usuario  (Leído 390 veces)

Desconectado Guero

  • PHPero Avanzado
  • ****
  • Mensajes: 439
  • Karma: 13
  • Sexo: Masculino
  • PHPeros, tu web PHP
    • Ver Perfil
    • De aquí, puedes encontrar Roma
Ayuda - Estadisticas de Usuario
« en: 24 de Junio de 2010, 20:54:37 pm »
Hola a todos PHPeros, vengo con una nueva duda.

Tengo este codigo:
Código: [Seleccionar]
<div align="center">
              <table width="429" height="138" border="0" cellpadding="0" cellspacing="2">
                <tr>
                  <td width="429" height="134"><div align="center">Buenas: <strong><?php echo $_SESSION[&#39;nnick&#39;]; ?></strong>, aqui te mostraremos tus estadisticas.</div>
                    <table width="415" height="109" border="0" cellpadding="0" cellspacing="0"><? $ax = mysql_query("SELECT * FROM usuarios WHERE nick = '".$comentarios['autor']."'")or die(mysql_error());

$arx = mysql_fetch_array($ax); ?>

              <tr>

                <td width="84" height="32" background="http://www.habbo.es/habbo-imaging/avatarimage?user=<?php echo $_SESSION[&#39;nnick&#39;]; ?>&action=&direction=2&head_direction=3&gesture=sml&size=l" style="background-repeat: no-repeat;">&nbsp;</td>

                <td width="331" valign="bottom">
<br />
<br />
<?
session_start();
session_cache_limiter('nocache,private');

$nnick = $_SESSION['nnick'];

// Chekamos DB
$check = mysql_query("SELECT * from `usuarios` where nick='".$_SESSION['nnick']."'");
$user = mysql_fetch_array($check);

// Variables
$nombre = $_SESSION['nnick'];
$habboname = $user['habbo'];
$fichas = $user['cantidad'];
$rango = $user['rol'];
$mensajes = $user['mensajes'];
$fecha = $user['fecha_registro'];
?><strong>Creditos:</strong>
                  <em><?php echo $fichas?></em><br />
                  <strong>Rango:</strong>
                  <?php if ($rango == "0"){
echo "Miembro VIP";
} else {
echo $rango;
?>
<br />
                      <strong>Fecha de Creacion: </strong><em><?php echo $fecha?></em> <br />
                      <strong>Numero de Mensajes:</strong>
                      <em>
                      <?php echo $mensajes?>                      </em><br />
                  <br />
                  Veces Baneado: 0 <br />
                  Alertas Recibidas: 0 <br />
                  <table width="331" border="0" cellspacing="0" cellpadding="0">

            <tr>

              <td width="219" valign="bottom">&nbsp;          </td>

              <td width="112"><div align="right">2009 - 2010 &copy;</div></td>
            </tr>
          </table></td>

              </tr>

            </table></td>
                          </tr>
                </table>
                                      </div>

Quiero meterlo en codigos que leea que el usuario esta conectado y lo puede ver y cuando no está conectado que ponga que no está logeado, pero el problema es el siguiente: si lo pongo a mi forma, la pagina (va por tablas) se me hace un puzzle.

Si vosotros dais la opinion de como lo pondriais.

Comunidad PHPeros

Ayuda - Estadisticas de Usuario
« en: 24 de Junio de 2010, 20:54:37 pm »

Desconectado Guero

  • PHPero Avanzado
  • ****
  • Mensajes: 439
  • Karma: 13
  • Sexo: Masculino
  • PHPeros, tu web PHP
    • Ver Perfil
    • De aquí, puedes encontrar Roma
Re:Ayuda - Estadisticas de Usuario
« Respuesta #1 en: 24 de Junio de 2010, 21:53:57 pm »
Perdon por el doble post, pero no muerdo :-[

Desconectado Fravier

  • PHPer@ Fijo
  • ***
  • Mensajes: 119
  • Karma: 7
    • Ver Perfil
Re:Ayuda - Estadisticas de Usuario
« Respuesta #2 en: 27 de Junio de 2010, 00:07:48 am »
Asi sería:

Código: [Seleccionar]
<?php if($_SESSION[&#39;nnick&#39;]) { ?>
<div align="center">
              <table width="429" height="138" border="0" cellpadding="0" cellspacing="2">
                <tr>
                  <td width="429" height="134"><div align="center">Buenas: <strong><?php echo $_SESSION[&#39;nnick&#39;]; ?></strong>, aqui te mostraremos tus estadisticas.</div>
                    <table width="415" height="109" border="0" cellpadding="0" cellspacing="0"><? $ax = mysql_query("SELECT * FROM usuarios WHERE nick = '".$comentarios['autor']."'")or die(mysql_error());

$arx = mysql_fetch_array($ax); ?>

              <tr>

                <td width="84" height="32" background="http://www.habbo.es/habbo-imaging/avatarimage?user=<?php echo $_SESSION[&#39;nnick&#39;]; ?>&action=&direction=2&head_direction=3&gesture=sml&size=l" style="background-repeat: no-repeat;">&nbsp;</td>

                <td width="331" valign="bottom">
<br />
<br />
<?
session_start();
session_cache_limiter('nocache,private');

$nnick = $_SESSION['nnick'];

// Chekamos DB
$check = mysql_query("SELECT * from `usuarios` where nick='".$_SESSION['nnick']."'");
$user = mysql_fetch_array($check);

// Variables
$nombre = $_SESSION['nnick'];
$habboname = $user['habbo'];
$fichas = $user['cantidad'];
$rango = $user['rol'];
$mensajes = $user['mensajes'];
$fecha = $user['fecha_registro'];
?><strong>Creditos:</strong>
                  <em><?php echo $fichas?></em><br />
                  <strong>Rango:</strong>
                  <?php if ($rango == "0"){
   echo 
"Miembro VIP";
   } else {
   echo 
$rango;
   } 
?>
<br />
                      <strong>Fecha de Creacion: </strong><em><?php echo $fecha?></em> <br />
                      <strong>Numero de Mensajes:</strong>
                      <em>
                      <?php echo $mensajes?>                      </em><br />
                  <br />
                  Veces Baneado: 0 <br />
                  Alertas Recibidas: 0 <br />
                  <table width="331" border="0" cellspacing="0" cellpadding="0">

            <tr>

              <td width="219" valign="bottom">&nbsp;          </td>

              <td width="112"><div align="right">2009 - 2010 &copy;</div></td>
            </tr>
          </table></td>

              </tr>

            </table></td>
                          </tr>
                </table>
                                      </div>
<?php } else {
echo&
#39;Conectate&#39;;
?>

Saludos