Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/01/2005, 00:05
capsula4
 
Fecha de Ingreso: septiembre-2003
Ubicación: Mendoza, Argentina
Mensajes: 54
Antigüedad: 20 años, 8 meses
Puntos: 0
Exclamación Integrar PHPBB y Web, lo hice pero me da error.

Hola, estoy intentando integrar mi foro y mi web, y estoy intentando crear una tabla superior que aparezca en todas las páginas mediante un include.

La barra incluiría:

"Usuarios | MP's | Login | Perfil, etc..."

Este es el código entero de lo que he hecho.

Código:
<?php

define('IN_PHPBB', true);
$phpbb_root_path = 'forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);


$userdata = init_userprefs($userdata);

//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
	$u_login_logout = 'login.'.$phpEx.'?logout=true&amp;sid=' . $userdata['session_id'];
	$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
	$u_login_logout = '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('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'] == 1 ) ? $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'] == 1 ) ? $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;
}
?>


<body  leftmargin=0 topmargin=0>
<table width="100%" border="0">
  <tr> 
    <td height="60" valign="bottom" align="center"> 
      <? print $userdata['username']?>
      - <a href="<? print $u_login_logout ?>"> 
      <? print $l_login_logout ?>
      </a> - <a href="<? print append_sid('profile.'.$phpEx.'?mode=editprofile') ?>"> 
      <? print $lang['Profile'] ?>
      </a> - <a href="<? print append_sid('privmsg.'.$phpEx.'?folder=inbox') ?>"> 
      <? print $l_privmsgs_text ?>
      </a> - <b> 
    <?  $template->pparse('body');
	if ( !$userdata['session_logged_in'] )
{
	''->assign_block_vars('switch_user_logged_out', array();
}
else
{
	''->assign_block_vars('switch_user_logged_in', array();

	if ( !empty($userdata['user_popup_pm']) )
	{
		''->assign_block_vars('switch_enable_pm_popup', array();
	}
} ?>
<!-- BEGIN switch_user_logged_out -->
      </b> <a href="<? print append_sid('profile.'.$phpEx.'?mode=register') ?>"> 
      <? print $lang['Register'] ?>
      </a> <b> 
<!-- END switch_user_logged_out -->
      </b> </td>
  </tr>
</table>
El problema está en que aquí recibo un error:

Código:
 <?  $template->pparse('body');
	if ( !$userdata['session_logged_in'] )
{
	''->assign_block_vars('switch_user_logged_out', array();
}
else
{
	''->assign_block_vars('switch_user_logged_in', array();

	if ( !empty($userdata['user_popup_pm']) )
	{
		''->assign_block_vars('switch_enable_pm_popup', array();
	}
} ?>
Cómo puedo quitar la template por completo?

Yo he instalado un mod de cumpleaños (birthdayhack) También quiero eliminar la template del popup de los mensajes privados y de la felicitacion de cumpleaños y que la template esté dentro del mismo documento, usando la función <? print ?> . Si me podrían ayudar, muchisisimas gracias!!

REALMENTE APRECIARIA CUALQUIER AYUDA!!
__________________
www.capsulastudio.com