Fallo del codigo
O a la hora de integrarlo?
Código PHP:
<?php
include("sesiones_foro.php");
?>
<?
if($user->data['is_registered'])
{
$avvy = "SELECT * FROM phpbb_users WHERE user_id =" . $user->data['user_id'];
$result = mysql_query($avvy) or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$username = $row['username'];
$link = $row['user_avatar'];
$width = "40";
$height = "40";
}
echo "<div id='li'>";
echo "<div style='clear:both;'>";echo $username;
echo " ";
echo "<a href='".$phpbb_url_path."ucp.php'><img src='".$phpbb_url_path."/download/file.php?avatar=".$link."' border='0' width='".$width."' height='".$height."'
alt='Avatar' /></a>";
echo " ";
echo "<a href=" . $phpbb_url_path . 'ucp.php?mode=logout' . '&sid=' . $user->data['session_id'] . " target='_self'><font color='red'>Salir</font></a>";
echo "</div>";
}
else{
echo "<div id='li'>"; // principio del formulario de logeo en el foro -->
?>
<table>
<form action="<?php echo $phpbb_url_path?>ucp.php?mode=login" target="_top" method="post" enctype="multipart/form-data">
Usuario:
<input type="text" id="s" name="username" value="" size="9" class="text" />
Password:
<input type="password" id="p" name="password" style="width:9px" value="" size="9" maxlength="16" class="text">
<input id="x" name="login" type="submit" value="Login" class="button" />
<input type="hidden" name="autologin" id="autologin" class="checkbox" value="ON" />
<input type="hidden" name="redirect" value="/">
</form>
</div>
<?
}
?>
Código PHP:
<?php
define('IN_PHPBB', true);
$site_root_path="";
$phpbb_root_path = $_SERVER['DOCUMENT_ROOT'] .'/foro/';
$phpbb_url_path = 'http://www.dominio.es/foro/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'config.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
?>