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'm still getting this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/rctloung/public_html/header.inc:4) in /home/rctloung/public_html/forums/inc/functions.php on line 1216
Other than that, everything works fine!
I'm getting this error when I try to use the recent posts feature:
Quote:Error: Database connection failed."); $sel = mysql_select_db($data,$conn) or die("Error: Database connection failed."); if($author == TRUE) { ?>
" href="showthread.php?tid=&action=lastpost"> by 's Profile" href="member.php?action=profile&uid=">
Heres the url for where I'm using it: www.crazycomputers.org

Also, should I be worried if users can easily access all of the database information when using this code?

Edit: Also, when you go to the site you see the login box that came with the theme, is there anyway to use that login box with the code here so it will log users into the forum?
^Bumpity
Firstly the login box on your theme can be used you just need to edit the form to something like shown below

  <form action="http://www.crazycomputers.org/forums/member.php" onsubmit="return submitted();" method="post" name="member_log_in" id="member_log_in">
    <input type="hidden" name="action" value="do_login">
    <input type="hidden" name="url" value="">
    <label>Username:</label>
    <input name="username" class="txtBox" type="text">
    <label>Password:</label>
    <input type="password" name="password" class="txtBox">
	<a href="http://www.crazycomputers.org/forums/member.php?action=register">Sign up here!</a>
	<input name="go" value="" class="go" type="submit">
    <br class="spacer">
  </form>

You will also need to make sure you have the various items required in the header tags of your page as shown in the first few post in this thread.

As for the error you are getting i do not use the code mentioned in the first post for getting the recent post instead i use the plugins that are available in the mods area.

Cheers Fishntassie...
772pilot Wrote:I'm still getting this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/rctloung/public_html/header.inc:4) in /home/rctloung/public_html/forums/inc/functions.php on line 1216
Other than that, everything works fine!
I am getting the exact same error. Please help me!
Anyone?
Posting the code here of the page might help to find your problem.

FnT...
I want to add in statistics who's online: online count(users+guests), onlined user nicks and guest count. How I can make it? Smile
Is there a way to pick what forum/forums we can pull the recent post from?
I've inserted the code for the user control panel thingy. The code works, BUT!, I get this error:

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/manne/public_html/p_index.php on line 10

I checked what is on line 10 which is the following:
    define("IN_MYBB", 1);

It's part of a code that's being used to retreive posts as news items on my website.

So the main website code looks like this:
<head>
<script>
function submitted()
{
 setTimeout("refresh()",6000);
}
function refresh()
{
 var sURL = unescape(window.location.pathname);
 window.location.href = sURL;
}
</script> 

<link rel="stylesheet" href="tangodown.css">

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

Now I'm using this together with a different news post-retreive thing which uses the following code (p_index.php):

<?php

    $fid = 2;
    $limit = 5;
    $forumpath = 'forum/';

    chdir($forumpath);
    define("IN_MYBB", 1);
    require('./global.php');
    require_once MYBB_ROOT."inc/class_parser.php";
    $parser = new postParser;
    chdir('../');
?>
<span class="forumtext">
<?php
    
    $query = $db->simple_select(TABLE_PREFIX.'threads', '*', "fid='{$fid}' ORDER BY tid DESC LIMIT {$limit}");
    if($db->num_rows($query) > 0)
    {
        while($row = $db->fetch_array($query))
        {
            $query2 = $db->simple_select(TABLE_PREFIX.'posts', '*', "pid='{$row['firstpost']}'");
            $row2 = $db->fetch_array($query2);
            
            $date = my_date($mybb->settings['dateformat'], $row2['dateline'], "", 1);
            $time = my_date($mybb->settings['timeformat'], $row2['dateline'], "", 1);

            $options = array(
                            'allow_html' => 'no', 
                            'filter_badwords' => 'yes', 
                            'allow_mycode' => 'yes', 
                            'allow_smilies' => 'yes', 
                            'nl2br' => 'yes', 
                            'me_username' => 'yes'
                            );
            $message = $parser->parse_message($row2['message'], $options);
            echo("<a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['subject']}</a> <br />");
	    echo("Door <a href=\"{$forumpath}member.php?action=profile&uid={$row2['uid']}\">{$row2['username']}</a> op {$date}");
            echo("<br /><br />");
            echo("{$message}<br /><br />");
	    echo("<a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['replies']} Reacties</a>");
            echo("<hr />");
            echo("<br /><br />");
        }
    }
    else
    {
        echo 'Nothing to display.';
    }

?>

Could it be that the combination of these scripts create the error? I thought it might be because 2 times the code defines IN_MYBB but deleting one row doesn't work..
Pages: 1 2 3 4 5 6 7