Проблемы с выводом информации о юзере.

Автор dzhet, 09 февраля 2012, 16:07:32

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

dzhet

Здравствуйте.
Я сделал форму для входа на форум и просмотра информыции о себе. Но она работает только на моем сайте. Если я пытаюсь запихнуть ее на главную форума то иформация выводится криво.


Код на сайте:
<div class="shade">

    <?php if ($context['user']['is_guest'])
 { echo 
'<div class="log123">',ssi_loginform($redirect_to $scripturl$output_method 'echo'),'</div>'
 }
else
 {
loadMemberData($user_info['id']);
loadMemberContext($user_info['id']);

$member_info $memberContext[$user_info['id']]; $member_info['karma']['total'] = $member_info['karma']['good'] - $member_info['karma']['bad'];
   echo
   
'<h5 align="center" class="usinf1"> Имя пользователя: <br /> '$context['user']['name'],'</h5><p align="center" class="usinf2">';
   if (!empty(
$member_info['group']))
echo '
Группа: '
$member_info['group'], '<br />';
else
{echo '
'
$member_info['post_group'], '<br />';}
    
echo '
Количество сообщений: '
$member_info['posts'], '<br />';
echo '
Репутация'
':</strong> ',$member_info['karma']['total'];
ssi_logout1($redirect_to 'http://epiccraft.ru'$output_method 'echo');

 }

?>



</div>
</td>
<td width=20px;>
</td>
<td>
<div class="shade1">

SSI:
function ssi_loginform($redirect_to = '', $output_method = 'echo')
{
global $scripturl, $txt, $user_info, $context, $modSettings;

if ($redirect_to != '')
$_SESSION['login_url'] = $redirect_to;

if ($output_method != 'echo' || !$user_info['is_guest'])
return $user_info['is_guest'];

echo '
<form action="','forum/index.php?action=login2" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
<tr>
<td align="right" class="log12"><img src="forum/Themes/Epiccraft/images/login.png" height="50" alt="Login" /></td>
<td><input type="text" id="user" name="user" size="9"  class="input_text" /></td>
</tr><tr>
<td align="right" class="log12"><img src="forum/Themes/Epiccraft/images/password.png" height="40" alt="Password" /></td>
<td><input type="password" name="passwrd" id="passwrd" size="9" class="input_password" /></td>
</tr>';

// Open ID?
if (!empty($modSettings['enableOpenID']))
echo '<tr>
<td colspan="2" align="center"><strong>&mdash;', $txt['or'], '&mdash;</strong></td>
</tr><tr>
<td align="right"><label for="openid_url">', $txt['openid'], ':</label>&nbsp;</td>
<td><input type="text" name="openid_identifier" id="openid_url" class="input_text openid_login" size="17" /></td>
</tr>';

echo '
<tr height="3px"></tr>
<tr style="position:relative; left:10px;">
<td colspan="1" align="center"><input align="center" border="0px" type="submit" value="', $txt['login'], '" class="button_submit12" /></td>
<td colspan="1" align="center"><a  align="center"  class="button_submit12" href="/forum/index.php?action=register">Регистрация</a></td>
</tr>
</table>
</form>';

}


Код на форуме(index.tamplate.php):

<div class="shade">';
if ($context['user']['is_guest'])
{ echo '<div class="log123">';
echo '
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
<tr>
<td align="right" class="log12"><img src="Themes/Epiccraft/images/login.png" height="50" alt="Login" /></td>
<td><input type="text" id="user" name="user" size="9"  class="input_text" /></td>
</tr><tr>
<td align="right" class="log12"><img src="Themes/Epiccraft/images/password.png" height="40" alt="Password" /></td>
<td><input type="password" name="passwrd" id="passwrd" size="9" class="input_password" /></td>
</tr>';

// Open ID?
if (!empty($modSettings['enableOpenID']))
echo '<tr>
<td colspan="2" align="center"><strong>&mdash;', $txt['or'], '&mdash;</strong></td>
</tr><tr>
<td align="right"><label for="openid_url">', $txt['openid'], ':</label>&nbsp;</td>
<td><input type="text" name="openid_identifier" id="openid_url" class="input_text openid_login" size="17" /></td>
</tr>';

echo '
<tr height="3px"></tr>
<tr style="position:relative; left:10px;">
<td colspan="1" align="center"><input align="center" border="0px" type="submit" value="', $txt['login'], '" class="button_submit12" /></td>
<td colspan="1" align="center"><a  align="center"  class="button_submit12" href="/forum/index.php?action=register">Регистрация</a></td>
</tr>
</table>
</form></div>';
}
else
{ loadMemberData($user_info['id']);
loadMemberContext($user_info['id']);

$member_info = $memberContext[$user_info['id']];
                $member_info['karma']['total'] = $member_info['karma']['good'] - $member_info['karma']['bad'];
   echo
   '<h5 align="center" class="usinf1"> Имя пользователя: <br /> ', $context['user']['name'],'</h5><p align="center" class="usinf2">';
   if (!empty($member_info['group']))
{echo '
Группа: ', $member_info['group'] , '<br />';}
else
{echo '
', $member_info['post_group'], '<br />';}
    echo '
Количество сообщений: ', $context['user']['posts'], '<br />';
echo '
Репутация', ':</strong> ',$member_info['karma']['total'];


}

echo '
</div>
</td>
<td width=20px;>
</td>
<td>
<div class="shade1">


Подскажите в чем может быть проблема пожайлусто.

dzhet