Qwilm!2

Integracion del Foro phpbb con tu Web

Bueno, este voy a publicar como integro la pagina con el foro phpbb y se vea en su web el tablero de login para los usuarios.
Primero se colocara este codigo:

  1. <?php
  2.  $phpbb_root_path = 'foro/'; //PATH DEL FORO RESPECTO DEL SCRIPT
  3. if (!function_exists("init_userprefs"))
  4. {
  5. include($phpbb_root_path . 'extension.inc');
  6. include($phpbb_root_path . 'common.'.$phpEx);
  7. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  8. init_userprefs($userdata);
  9. }
  10. // determinamos si cookie activada sino propagamos sid por url

Recuerda que $phpbb_root_path es la ruta del foro en donde se encuentre, este caso usaremos foro, pero si se encuentra en otra carpeta solo reempazarias esa ruta, este caso de esta forma.
$phpbb_root_path = ‘miforo/’;
Funciones para el tabla de Login para los usuarios

  1. <?php
  2. if( $userdata['session_logged_in'])
  3.    {
  4.  //Pagina de personas registradas y respectivamente logueadas
  5. }
  6. else         {
  7. //Por favor registrese para tener acceso a este lugar
  8. }
  9. ?>

Con el codigo completo iria de esta forma

  1. <?php
  2. if ( $userdata['session_logged_in'] )
  3. {
  4. echo '<table border="0" cellpadding="0" cellspacing="0" >';
  5. echo '<tr>';
  6. echo '<td width="190" height="15" class="alt5" colspan="2" align="center" valign="top" >';
  7. echo '<b>Bienvenido a VkMangaeX!!!</b></td>';
  8. echo '</tr>';
  9. echo '<tr>';
  10. echo '<td width="40" height="84" class="alt5" valign="top" >';
  11. echo '<table cellpadding="0" cellspacing="0" border="0" >';
  12. echo '<tr>';
  13. echo '<td width="">'.$avatar_img.'</td>';
  14. echo '</tr>';
  15. echo '</table> </td>';
  16. echo '<td width="150" class="alt5" valign="top" height="84" > <p style="MARGIN: 0px 2px 0px 5px">';
  17. echo '<a href="'.$u_login_logout.'" class="mainmenu">'.$l_login_logout.'</a></span> <br/>';
  18. echo '<a href="'.$U_PROFILE.'" class="mainmenu">'.$L_PROFILE.'</a> <br/>';
  19. echo '<a href="'.$u_memberlist.'" class="mainmenu">'. $l_memberlist.' </a> <br/> ';
  20. echo '<a href="'.$U_PRIVATEMSGS.'" class="mainmenu"> '.$l_privmsgs_text.' </a> <br/>';
  21. echo 'Has Publicado: '.$userdata['user_posts'].' Post</p>';
  22. echo '</td>';
  23. echo '</tr>';
  24. echo '</table>';
  25. }
  26. else
  27. {
  28. echo' <p style="margin-left: 16; margin-top: 28; margin-bottom:0"><table align="center" border="0" cellpadding="0" cellspacing="0" style="FONT-SIZE: 10px; COLOR: #333333; FONT-FAMILY: Tahoma; BORDER-COLLAPSE: collapse" width="180" height="86" >';
  29. echo' <form method="post" action="'.$u_login_logout.'">';
  30. echo' <tr>';
  31. echo' <td width="64" >Username: </td><td width="98" height="28">';
  32. echo' <input class="txtstyle" type="text" name="username" size="14" /></td>';
  33. echo' </tr>';
  34. echo' <tr>';
  35. echo' <td width="64" >Password: </td><td width="98" height="22"> ';
  36. echo' <input class="txtstyle" type="password" name="password" size="14" /></td>';
  37. echo' </tr>';
  38. echo' <tr>';
  39. echo' <td height="24" colspan="2" >Auto Login ';
  40. echo' <input class="txtstyle" type="checkbox" CHECKED name="autologin" value="ON" />&nbsp;&nbsp;&nbsp; ';
  41. echo' <input type="submit" class="butstyle" name="login" value="Entrar" />';
  42. echo' <input type="hidden" name="redirect" value="..'. $_SERVER['REQUEST_URI'] .'"/> ';
  43. echo' </td>';
  44. echo' </tr>';
  45. echo' <tr>';
  46. echo' <td height="12" colspan="2" align="center" ><a href="'.$U_SEND_PASSWORD.'" class="gensmall">'.$L_SEND_PASSWORD.'</a></td>';
  47. echo' </tr>';
  48. echo' </form>';
  49. echo' </table>';
  50. }?>

[ 7C ] [ Abril 13, 2007 ] [ Lenguaje PHP ]

Posts Relacionados
  1. Gravatar tineo-kun
    Abril 16th, 2007 at 16:59

    bueno es algo largo pero intentare ke me salga de todas maneras
    mas bien Gracias xD ahahah
    muchas gracias

  2. Gravatar vhyllkuns
    Abril 16th, 2007 at 22:38

    Luego pondre mas sistemas para paginas web, si necesitas otro me avisas xD

  3. Gravatar tineo-kun
    Abril 17th, 2007 at 15:56

    mm encontre como instalar un tracker con archivos php
    pero lo malo es ke al crear parece ke los usuarios deben registrarse de nuevo (para ser usuarios del tracker)
    como hago para ke ya no sea necesario ke se registren de nuevo

    cual seria codigo o modificaion ke debo hacer

    es algo con las tablas en la base de datos

    (otro inconveniente ke tengo es ke mi host no tiene visualizacion de base de datos jojo xD)

    http://dhost.info/

    muy bueno el host pero no puedo ver mi base de datos xD

  4. Gravatar tineo-kun
    Abril 17th, 2007 at 15:58

    el tracker es torrenttrader

    http://www.torrenttrader.org/

    y como se instala ah? hahaha xD

  5. Gravatar tineo-kun
    Abril 17th, 2007 at 16:02

    ?php
    $phpbb_root_path = ‘foro/’; //PATH DEL FORO
    if (!function_exists(”init_userprefs”))
    {
    include($phpbb_root_path . ‘extension.inc’);
    include($phpbb_root_path . ‘common.’.$phpEx);
    $userdata = session_pagestart($user_ip, PAGE_INDEX);
    init_userprefs($userdata);
    }
    // determinamos si cookie activada sino propagamos sid por url

    donde va esto donde lo pongo explica

    en el index o el un php aparte =S

  6. Gravatar tineo-kun
    Julio 13th, 2007 at 10:44

    y para un foro smf?
    ke se pone

  7. Gravatar vhyllkuns
    Julio 15th, 2007 at 17:02

    Para integrar tu foro SMF, solo debes incluir el.
    include(’community/SSI.php’);
    Y listo, para mas informacion te recomiendo su foro, pero esta en ingles.
    http://www.simplemachines.org/community/index.php?topic=19638.0

Leave a Reply