MyBB Community Forums

Full Version: [Tutorial] Basic Site-Forum Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
i get this at the bottom of my page
Fatal error: Call to a member function run_hooks() on a non-object in /hosted/subs/ulmb.com/d/b/dblunt/public_html/forums/inc/functions.php on line 146

For the recent posts code, this showed up:
<table>
 <tr>
  <td width="50%" bgcolor="#FFFFFF">
<a title="In forum: Version 2" href="forum/showthread.php?tid=&action=lastpost">
<b></b></a></p></td>
  <td width="50%" bgcolor="#FFFFFF">by 
<b><a title="'s Profile" href="forum/member.php?action=profile&uid=">
</b></a></td>
 </tr>
 <tr>
  <td width="50%" bgcolor="#FCFCFC">

<a title="In forum: Off-Topic" href="forum/showthread.php?tid=&action=lastpost">
<b></b></a></p></td>
  <td width="50%" bgcolor="#FCFCFC">by 
<b><a title="'s Profile" href="forum/member.php?action=profile&uid=">
</b></a></td>
 </tr>
 <tr>
  <td width="50%" bgcolor="#FFFFFF">
<a title="In forum: Off-Topic" href="forum/showthread.php?tid=&action=lastpost">
<b></b></a></p></td>
  <td width="50%" bgcolor="#FFFFFF">by 
<b><a title="'s Profile" href="forum/member.php?action=profile&uid=">

</b></a></td>
 </tr>
 <tr>
  <td width="50%" bgcolor="#FCFCFC">
<a title="In forum: Off-Topic" href="forum/showthread.php?tid=&action=lastpost">
<b></b></a></p></td>
  <td width="50%" bgcolor="#FCFCFC">by 
<b><a title="'s Profile" href="forum/member.php?action=profile&uid=">
</b></a></td>
 </tr>
 <tr>

  <td width="50%" bgcolor="#FFFFFF">
<a title="In forum: Off-Topic" href="forum/showthread.php?tid=&action=lastpost">
<b></b></a></p></td>
  <td width="50%" bgcolor="#FFFFFF">by 
<b><a title="'s Profile" href="forum/member.php?action=profile&uid=">
</b></a></td>
 </tr>
</table>
The <a title is correct, but nothing else shows up. The database connections are fine, they are the same ones I used for forum stats, and the forum stats worked fine. I used the correct code, if needed I can post it.
(Bumping Thread)
what does the table prefix of your database mean?
I'm not that familiar with mysql, in fact, I've never really coded it at all, but its the beginning statement before all of the tables in your database for mybb. To find it, go to your admin panel, then, in the left column, scroll all the way down to "back up database" and click it. In the select box with all of the tables, the prefix is what comes right before each table name(it is part of the table name). For example, my table prefix is "mybb_", which is the default. Therefore, all of my database tables would look like this:
  • mybb_adminlog
  • mybb_adminoptions
  • mybb_adminsessions
and so on. The table prefix in the list is bold.
I'm having a problem with this tutorial. I managed to make it to the end and the login panels appear and work too. Somehow atleast. The problem is that when I press the 'Login' button, it opens my whole forum in the frame where the login form is. What I would want it to do is just to sign in and maybe showing the 'view new posts', 'view new PM's' etc. part of this tutorial. Anyone knows what's wrong?

Oh, and it shows the right things (not the whole forum) when i first login and then refresh the site.

Edit. Also, how can I add 'Logout' link to the list that shows up when logged?
Meaning this:
- View new posts
- View new PM's
- User CP
- Edit Signature
- Edit Avatar
- My Profile
- My Posts

Sorry I can't tell very clearly what I mean. Smile
Shahzam Wrote:GREAT! now somebody makes a tutorial on integrating. when i spent a week coding to get my website to integrate with mybb, shahzam.com , if you want any scripts on there to integrate with mybb ask me.

could you help me with it. im trying to make a simple community "myspace like" website where i want to integrate mybb with.

I want to use the mybb structure and database as my reference, and integrate some of my pages to go along with mybb.
my pages would be Home, profile, gallery, blog, forums.

help please
ok well is there a way of showing like say i make a forum called Announcements how can i Integration all the posts in that to my index ?

edit i want to do some thing like pixel2life.com
[attachment=5493][attachment=5493]HI dear friends,

i studied the tutorial and other posts on it. i tried to inculde latest threads in my websites homepage(index). i can able to fit the login box . but  when i tried to include recent post in my page i am getting an  blank table.(image is attached. i belive some code i have wriiten wrong. please resolve.
my website root: lets say hello, then forum is located at hello/forums.

i placed this file under hello(root directory).
Quote:<?php

$rel = "./forums/"; // The directory to your forum--relative to this file's location; include ending slash
chdir($rel);
define('IN_MYBB', 1);
require("./global.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body><table width="127" border="3" cellspacing="0" cellpadding="0">
  <tr>
    <th scope="row">Recent post list </th>
  </tr>
  <tr>
    <th scope="row"><?php

$prfx = "mybb_"; // The table prefix of your database
$col1 = "#FFFFFF"; // The color of the first row--alternating row colours
$col2 = "#FCFCFC"; // The color of the second row
// NOTE: I didn't include ./global.php because I wasn't sure what the variables look like.
$num = 5; // The number of recent posts to show
$author = TRUE; // Should we display the post author? (TRUE or FALSE)


if($author == TRUE)
{
?>
<table>
<?php
}
$i = 0;
$q = $db->query("SELECT * FROM ".$prfx."posts ORDER BY dateline DESC LIMIT ".$num);
while($row = $db->fetch_array($q))
{
if($i % 2 == 0)
{
  $bgcolor = $col1;
}
else
{
  $bgcolor = $col2;
}
$i++;
$q2 = $db->query("SELECT * FROM ".$prfx."forums WHERE fid = '".$row["fid"]."';");
$row = $db->fetch_array($q2);
?>
<tr>
  <td width="50%" bgcolor="<?php echo $bgcolor; ?>">
<a title="In forum: <?php echo $row["name"]; ?>" href="<?php echo $rel; ?>showthread.php?tid=<?php echo $row["tid"]; ?>&action=lastpost">
<b><?php echo $row["subject"]; ?></b></a></p></td>
<?php
if($author == TRUE)
{
?>
  <td width="50%" bgcolor="<?php echo $bgcolor; ?>">by
<b><a title="<?php echo $row["username"]; ?>'s Profile" href="<?php echo $rel; ?>member.php?action=profile&uid=<?php echo $row["uid"]; ?>">
<?php echo $row["username"]; ?></b></a></td>
<?php
}
?>
</tr>
<?php
}
?>
</table>&nbsp;</th>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
  </tr>
</table>

</body>
</html>
I think this needs some update.
Pages: 1 2 3 4 5 6 7