Como puedo hacer que en algunas de mis paginas haiga que poner contraseña para verla. :?: :?:
Contraseña fija o que vaya por registro?
Saludos :wink:
<?php
define('IN_PHPBB', true); // se define que se va a usar phpbb.
$phpbb_root_path = '/usr/local/psa/home/www/elrincondelosrecursos.mywebcommunity.org/sesiones.php '; // el path directo del servidor a phpbb3, varia algo dependiendo del servidor, si hay errores con esto en el mismo error sale el path correcto.
$phpbb_url_path = 'http://elrincondelosrecursos.mywebcommunity.org/phpbb3'; // la url hacia tu phpbb3
$phpEx = substr(strrchr(__FILE__, '.'), 1); // tipo de extension
include($phpbb_root_path . 'common.' . $phpEx); // incluimos el common.php que es muy importante para la bd
include($phpbb_root_path . 'config.' . $phpEx); //include de config.php importante tambien en bd usuarios y pass
// iniciamos sesion
$user->session_begin();
$auth->acl($user->data);
?> <?php
if($user->data['is_registered'])
{
//en phpbb3_ suponemos que el prefijo de la tabla es phpbb3_
$avvy = "SELECT * FROM phpbb3_users WHERE user_id =" . $user->data['user_id'];
$result = mysql_query($avvy) or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$link = $row['user_avatar'];
$width = $row['user_avatar_width'];
$height = $row['user_avatar_height'];
}?>
[url="<?php echo $phpbb_url_path?>memberlist.php?mode=viewprofile&u=<?php echo $user->data['user_id'];?> "][/url]
<table width="145" height="392" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td align="center" valign="top">
<table width="145" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">Hola [url="<?php echo $phpbb_url_path?>memberlist.php?mode=viewprofile&u=<?php echo $user->data['user_id'];?> "] <?php echo $user->data['username'];?> [/url]!</td>
</tr>
</table>
<table width="135" height="255" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="250" align="center" valign="middle">[img]<?php echo $phpbb_url_path?>download/file.php?avatar=<? echo $link?> [/img] " height=" <? echo $height?>" alt='Avatar' /></td>
</tr>
</table>
<table width="145" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle" class="Estilo5"><span class="Estilo20"><a href="<?php echo $phpbb_url_path?>ucp.php" >Visita tu
Panel de control</a>
<?php echo( "[url=" . $phpbb_url_path . 'ucp.php?mode=logout&redirect=../index.php' . '&sid=' . $user->data['session_id'] . "]Cerrar Sesion[/url]");?>.</td>
</tr>
</table>
<table width="145" height="72" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="center" valign="top">0</td>
</tr>
</table></td>
</tr>
</table>
<?php
} else {
?>
<table width="145" height="392" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="145" align="center" valign="top">
<form action="<?php echo $phpbb_url_path?>ucp.php?mode=login" target="_top" method="post" enctype="multipart/form-data">
[img]http://www.tudominio.com/avatar-default.jpg[/img] Usuario:
<input name="username" type="text" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 110px; BORDER-BOTTOM: 0px" value="" size="10" />
Contraseña:
<input type="password" name="password" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 110px; BORDER-BOTTOM: 0px" size="10" maxlength="32" >
<input type="checkbox" name="autologin" id="autologin" class="checkbox" value="ON" />
Autologin
<input type="hidden" name="redirect" value="../index.php">
<div>[url="<?php echo $phpbb_url_path?>ucp.php?mode=register"]Soy nuevo[/url]</div>
<div>[url="<?php echo $phpbb_url_path?>ucp.php?mode=sendpassword"]Recordar password [/url]</div>
<input type="submit" value=" Entrar " name="login" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; WIDTH: 60px; BORDER-BOTTOM: 0px">
</form></td>
</tr>
</table>
<?php include("sesiones.php"); ?>
?>
los guardamos y los subimos al root de nuestro servidor.