MyBB Community Forums

Full Version: Login integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using this guide

I copied this code
<?php
$rel = "forum/"; // Ricordati la / finale
chdir($rel);
require("./global.php");
?>

<?php
if($mybb->user["uid"])
{
?>
&nbsp;• <a href="<?php echo $rel; ?>search.php?action=getnew">Visualizza Nuovi Messaggi</a><br>
&nbsp;• <a href="<?php echo $rel; ?>private.php">Visualizza nuovi messaggi privati</a><br>
&nbsp;• <a href="<?php echo $rel; ?>usercp.php">Pannello Utente</a><br>
&nbsp;&nbsp;&nbsp;&nbsp; <b>·</b> <a href="<?php echo $rel; ?>usercp.php?action=editsig">Modifica Firma</a><br>
&nbsp;&nbsp;&nbsp;&nbsp; <b>·</b><a href="<?php echo $rel; ?>usercp.php?action=avatar">Modifica avatar</a><br>
&nbsp;• <a href="<?php echo $rel; ?>member.php?action=profile&uid=<?php echo $mybb->user["uid"]; ?>">Il mio profilo</a><br>
&nbsp;• <a href="<?php echo $rel; ?>search.php?action=finduser&uid=<?php echo $mybb->user["uid"]; ?>">I miei messaggi</a>
<?php
}
else
{
?>
<table>
 <form method="POST" action="<?php echo $rel; ?>member.php" onsubmit="return submitted();">
  <input type="hidden" name="action" value="do_login">
  <input type="hidden" name="url" value="">
  <tr>
   <td>Username</td>
   <td><input type="text" name="username" size="15"></td>
  </tr>
  <tr>
   <td>Password</td>
   <td><input type="password" name="password" size="15"></td>
  </tr>
  <tr>
   <td colspan="2"><center><input type="submit" value="Login" name="submit"></center></td>
  </tr>
  <tr>
   <td colspan="2"><center><a href="<?php echo $rel; ?>member.php?action=register">Non sei un utente? Registrati ora!</a></center></td>
 </form>
</table>
<?php
}
?>

The login works but when you come back to the page, the buttons like: View PM, ecc aren't show Confused
How can i do?
Can you please paste your header template code here ???
<script>
function submitted()
{
 setTimeout("refresh()",6000);
}
function refresh()
{
 var sURL = unescape(window.location.pathname);
 window.location.href = sURL;
}
</script> 
Is this is yours entire header template code ?
The header template should be something like this
	<div id="container">		<a name="top" id="top"></a>		<div id="header">			<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>			<div class="menu">				<ul>					<li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>					<li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>					<li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>					<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>				</ul>			</div>			<hr class="hidden" />			<div id="panel">				{$welcomeblock}			</div>		</div>		<hr class="hidden" />		<br class="clear" />		<div id="content">			{$pm_notice}			{$bannedwarning}			{$bbclosedwarning}			{$unreadreports}			<navigation>			<br />

Copy this and add to your header template
Sorry that was the header template of my homepage! not mybb! That code is in my homepage!
Did you understand the problem?
Sorry Trinit . Here we are dealing with mybb related issues. If the question is about your site other then the mybb script we will NOT support this further. How ever , Feel Free to ask it HERE
But i did that with a guide of mybb!

http://community.mybboard.net/thread-13430.html
It sounds like he is using the log in code in hopes of having the forum menu on his main site. Unless you use the same structure as the MyBB code you'll have to code everything yourself. At least that's what I did. Checking to see a user is logged in is only the first step to having all that menu information on your main site.
Please make sure, whether you make any kind of page integrating it into mybb forum, First , you should add the {$header} and {$footer} to that page, making it possible to look like the mybb script.

After this, all the stuff in your header template (of mybb) will be copied autmatically to your new pages.
Trinit, have you tried the MyBB Integrator?
Welcome to the MyBB Integrator / MyBB SDK / MyBB API