Ver Mensaje Individual
  #8 (permalink)  
Antiguo 30/01/2005, 22:23
capsula4
 
Fecha de Ingreso: septiembre-2003
Ubicación: Mendoza, Argentina
Mensajes: 54
Antigüedad: 20 años, 8 meses
Puntos: 0
Estuve intentando y...

Lo logréeeeee!!

Esto es lo que logré hacer:
http://www.simsextremos.com/xxx.php

Pero tenía unas dudas, cuando uno está logueado, la barra se ve perfecta, pero deslogueado, aparece "Anonymous", ¿se puede cambiar y que sea compatible con los lenguajes del foro?

Luego.
Perfil | Entre para ver sus mensajes privados | Su última visita fué:

¿Se pueden quitar cuando uno está deslogueado y en vez de eso que aparezca una tabla para hacer login?


A ver si me pueden ayudar porfis :D!!!

Les dejo el código de los archivos:

Archivo TPL
Código:
<style type="text/css">
<!--
a.foro:link {  font-family: tahoma; font-size: 11px; color: #FFFFFF; text-decoration: none}
.text {  font-family: tahoma; font-size: 11px; color: #FFFFFF; text-decoration: none}
a.foro:hover {  color: #FFFFFF; text-decoration: none}
a.foro:active {  color: #99CCFF; text-decoration: none}
a.foro:visited {  text-decoration: none; color: #FFFFFF}
-->
</style>

<table cellspacing="0" cellpadding="0" border="0" align="center" class=foro width="100%" background="forotop/background.gif" height="20" bgcolor="#006699">
  <tr valign="middle"> 
    <td align="center" background="forotop/background_user.gif" class=text width="150"><b> 
      {USER}</b></td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <td align="center" class=text> 
      <!-- BEGIN switch_user_logged_out -->
      <a class="foro" href="{U_REGISTER}" >{L_REGISTER}</a> </td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <!-- END switch_user_logged_out -->
    <td align="center" class=text width="75"><a class="foro" href="{U_PROFILE}" >{L_PROFILE}</a></td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <td align="center" class=text><a class="foro" href="{U_PRIVATEMSGS}" >{PRIVATE_MESSAGE_INFO}</a></td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <td align="center" class=text>{LAST_VISIT_DATE}</td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <td align="center" class=text> {CURRENT_TIME}</td>
    <td align="center" background="forotop/divider.gif" class=text width="2"></td>
    <td align="center" background="forotop/background_logout.gif" class=text width="100"><a class="foro" href="{U_LOGIN_LOGOUT}" >{L_LOGIN_LOGOUT}</a></td>
  </tr>
</table>
Archivo PHP
Código PHP:
<?php

define
('IN_PHPBB'true);
$phpbb_root_path 'foro/';
include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);
$userdata session_pagestart($user_ipPAGE_INDEX);
init_userprefs($userdata);
global 
$db$board_config;
global 
$HTTP_COOKIE_VARS$HTTP_GET_VARS$SID;
$cookiename $board_config['cookie_name'];
$cookiepath $board_config['cookie_path'];
$cookiedomain $board_config['cookie_domain'];
$cookiesecure $board_config['cookie_secure'];

// determinamos si cookie activada sino propagamos sid por url
    
if ( !(isset($HTTP_COOKIE_VARS[$cookiename '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename '_data'])) )
    {
    
output_add_rewrite_var('sid'$userdata['session_id']);
    } 

if ( !
defined('IN_PHPBB') )
{
    die(
"Hacking attempt");
}

define('HEADER_INC'TRUE);

//
// Parse and show the overall header.
//
$template->set_filenames(array(
    
'sxtop' => ( empty($gen_simple_header) ) ? 'sxtop.tpl' 'simple_header.tpl')
);

//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
    
$u_login_logout 'foro/login.'.$phpEx.'?logout=true&amp;sid=' $userdata['session_id'];
    
$l_login_logout $lang['Logout'];
}
else
{
    
$u_login_logout 'foro/login.'.$phpEx;
    
$l_login_logout $lang['Login'];
}

$s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';

//
// Obtain number of new private messages
// if user is logged in
//
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
{

// Start add - Birthday MOD
// see if user has or have had birthday, also see if greeting are enabled
    
if ( $userdata['user_birthday']!=999999 && $board_config['birthday_greeting'] && create_date('Ymd'time(), $board_config['default_timezone'])  >= $userdata['user_next_birthday_greeting'].realdate ('md',$userdata['user_birthday'] ) )
    {
        
$sql "UPDATE " USERS_TABLE "
            SET user_next_birthday_greeting = " 
. (create_date('Y'time(), $board_config['board_timezone'])+1) . "
            WHERE user_id = " 
$userdata['user_id'];
        if( !
$status $db->sql_query($sql) )
        {
            
message_die(GENERAL_ERROR"Could not update next_birthday_greeting for user."""__LINE____FILE__$sql);
        }
        
$template->assign_var("GREETING_POPUP",
            
"<script language=\"Javascript\" type=\"text/javascript\"><!--
            window.open('"
.append_sid('foro/birthday_popup.'.$phpEx)."', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
            //-->
            </script>"
);
    } 
//Sorry user shall not have a greeting this year
// End add - Birthday MOD


    
if ( $userdata['user_new_privmsg'] )
    {
        
$l_message_new = ( $userdata['user_new_privmsg'] == ) ? $lang['New_pm'] : $lang['New_pms'];
        
$l_privmsgs_text sprintf($l_message_new$userdata['user_new_privmsg']);

        if ( 
$userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
        {
            
$sql "UPDATE " USERS_TABLE "
                SET user_last_privmsg = " 
$userdata['user_lastvisit'] . "
                WHERE user_id = " 
$userdata['user_id'];
            if ( !
$db->sql_query($sql) )
            {
                
message_die(GENERAL_ERROR'Could not update private message new/read time for user'''__LINE____FILE__$sql);
            }

            
$s_privmsg_new 1;
            
$icon_pm $images['pm_new_msg'];
        }
        else
        {
            
$s_privmsg_new 0;
            
$icon_pm $images['pm_new_msg'];
        }
    }
    else
    {
        
$l_privmsgs_text $lang['No_new_pm'];

        
$s_privmsg_new 0;
        
$icon_pm $images['pm_no_new_msg'];
    }

    if ( 
$userdata['user_unread_privmsg'] )
    {
        
$l_message_unread = ( $userdata['user_unread_privmsg'] == ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
        
$l_privmsgs_text_unread sprintf($l_message_unread$userdata['user_unread_privmsg']);
    }
    else
    {
        
$l_privmsgs_text_unread $lang['No_unread_pm'];
    }
}
else
{
    
$icon_pm $images['pm_no_new_msg'];
    
$l_privmsgs_text $lang['Login_check_pm'];
    
$l_privmsgs_text_unread '';
    
$s_privmsg_new 0;
}


// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
$l_timezone explode('.'$board_config['board_timezone']);
$l_timezone = (count($l_timezone) > && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f'$board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
    
'USER' => $userdata['username'],
    
'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
    
'CURRENT_TIME' => sprintf(create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
    
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
    
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
    
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
    
'PRIVMSG_IMG' => $icon_pm,
    
'L_USERNAME' => $lang['Username'],
    
'L_PASSWORD' => $lang['Password'],
    
'L_LOGIN_LOGOUT' => $l_login_logout,
    
'L_LOGIN' => $lang['Login'],
    
'L_LOG_ME_IN' => $lang['Log_me_in'],
    
'L_AUTO_LOGIN' => $lang['Log_me_in'],
    
'L_REGISTER' => $lang['Register'],
    
'L_PROFILE' => $lang['Profile'],
    
'L_PRIVATEMSGS' => $lang['Private_Messages'],

    
'U_REGISTER' => append_sid('foro/profile.'.$phpEx.'?mode=register'),
    
'U_PROFILE' => append_sid('foro/profile.'.$phpEx.'?mode=editprofile'),
    
'U_PRIVATEMSGS' => append_sid('foro/privmsg.'.$phpEx.'?folder=inbox'),
    
'U_PRIVATEMSGS_POPUP' => append_sid('foro/privmsg.'.$phpEx.'?mode=newpm'),
    
'U_LOGIN_LOGOUT' => append_sid($u_login_logout),
    
'S_LOGIN_ACTION' => append_sid('foro/login.'.$phpEx),
)
);

//
// Login box?
//
if ( !$userdata['session_logged_in'] )
{
    
$template->assign_block_vars('switch_user_logged_out', array());
}
else
{
    
$template->assign_block_vars('switch_user_logged_in', array());

    if ( !empty(
$userdata['user_popup_pm']) )
    {
        
$template->assign_block_vars('switch_enable_pm_popup', array());
    }
    
}


// Add no-cache control for cookies if they are set
//$c_no_cache = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_data'])) ? 'no-cache="set-cookie", ' : '';

// Work around for "current" Apache 2 + PHP module which seems to not
// cope with private cache control setting
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
{
    
header ('Cache-Control: no-cache, pre-check=0, post-check=0');
}
else
{
    
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');

$template->pparse('sxtop');

?>
__________________
www.capsulastudio.com

Última edición por capsula4; 30/01/2005 a las 22:27