YaBB SE Community

English User Help => FAQ => Topic started by: Zef Hemel on December 30, 2001, 05:21:48 AM

Title: How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on December 30, 2001, 05:21:48 AM
It is possible, this is how I did it. First modify your template.html and remove all unnecessary stuff. For example like this:
Code: [Select]
<yabb title><br><br>
<yabb uname> <yabb im><BR>
<yabb time><br>
<yabb menu>
<yabb news>

<yabb main>

<yabb copyright>
Then rename your YaBB SE index.php to something else, for example forum.php. And also remove the line in this forum.php that says
Code: [Select]
ob_start();

Then create a new index.php At the first line put:
Code: [Select]
<?php ob_start(); ?>
Underneath that put anything you like, any php tag you like. Basically put your whole design there ;) At the point you want to put the YaBB output, put this:
Code: [Select]
<?php
require("forum.php");

function 
endhtml()
{
?>

then at the end of this php file put this:
Code: [Select]
<?php
}
?>


Then go to Subs.php, to the the obExit() function (around line 760), and after the line with "$HTTP_ACCEPT_ENCODING,$modSettings;" add:
Code: [Select]
endhtml();

Now upload all changed files and it should be working :) Of course you still have to tweak the template.html to make it look better, but you'll get the idea.

Good luck :)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Blackjack on December 30, 2001, 10:48:37 AM
Nice FAQ I'm going to try this in my clan site some day :D
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Kalin Somphane on December 30, 2001, 05:52:55 PM
I gotta say that's what was bugging me this morning. Thanks
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Kalin Somphane on December 30, 2001, 06:09:20 PM
Also.
If you want to put anything below the forum.php it won't work. So you have to put the rest of your website template in your template file.

EDIT: Never mind - didn't read the whole thing.
NOTE: Oh that's why I didn't read the whole thing, because you edited it :)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: adams on December 31, 2001, 01:56:53 AM
I just encountered this same problem. Any Idea why Zef?

It would appear that as tarch said nothign below the <?php
require("forum.php");
?> is included.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on December 31, 2001, 07:58:15 AM
Yes you're right, I updated the top message a bit. The changes starts when you put in the require("forum.php"); file.

Good luck, and let me know if there are still problems :)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: TheJkWhoSaysNi on December 31, 2001, 02:59:22 PM
I dont know much php but wouldnt that make it do when you click a link it will just be using template.html? because i tried that before using php virtual
Title: Re:How do I integrate YaBB into my PHP website?
Post by: adams on January 01, 2002, 07:03:57 PM
This is my new index.php
Code: [Select]
<?php ob_start(); ?>

<?php
include ('/www/html/template/top.shtml');
?>



<?php
require("forum.php");

function 
endhtml()
{
?>


<?php
include ('/www/html/template/bottem.shtml');
?>


<?php
}
?>


and in Subs.php

Code: [Select]
function obExit()
{
        global $HTTP_ACCEPT_ENCODING,$modSettings;
        if (!$modSettings['enableCompressedOutput'])
        {
                ob_end_flush();
                exit;
        }
        $html = ob_get_contents();
        ob_end_clean();
        $level = 1;

        // Check if zlib is installed
        if(function_exists("crc32") && function_exists("gzcompress"))
        {
        $encoding = '';
                // if so check what kind of gzipping can be used
                if(strpos(" ".$HTTP_ACCEPT_ENCODING, "x-gzip"))
                        $encoding = "x-gzip";
                elseif(strpos(" ".$HTTP_ACCEPT_ENCODING,"gzip"))
                        endhtml();
                        $encoding = "gzip";

                if ($encoding) // ok, encoding is accepted
                {
                        header("Content-Encoding: $encoding");

                        $size = strlen($html);
                        $crc = crc32($html);

                        $output = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
                        $output .= substr(gzcompress($html, $level), 0, -4);
                        $output .= pack("V", $crc);
                        $output .= pack("V", $size);
                }
                else
                $output = $html;
        }
        else
        $output = $html;

        echo $output;
        exit;
}
?>


This still doesn't seem to work (ie my last include is not being processed)

Title: Re:How do I integrate YaBB into my PHP website?
Post by: alexrolko on January 01, 2002, 07:10:20 PM
Quote
<?php ob_start(); ?>

<?php
include ('/www/html/template/top.shtml');
?>


<?php
require("forum.php");

function endhtml()
{
?>

<?php
include ('/www/html/template/bottem.shtml');
?>

<?php
}
?>


Oh about that code above... after each line you dont have to open and close PHP like the Tutorial says...  ;D

It can just look like this... but thats only if u have just the code.   :-X

Quote
<?php
    ob_start();

    include ('/www/html/template/top.shtml');
    include ('forum.php');

    function endhtml() {
          include ('/www/html/template/bottem.shtml');
    }
?>
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on January 02, 2002, 05:52:48 AM

Code: [Select]
function obExit()
{
       global $HTTP_ACCEPT_ENCODING,$modSettings;
       if (!$modSettings['enableCompressedOutput'])
       {
               ob_end_flush();
               exit;
       }
       $html = ob_get_contents();
       ob_end_clean();
       $level = 1;

       // Check if zlib is installed
       if(function_exists("crc32") && function_exists("gzcompress"))
       {
       $encoding = '';
               // if so check what kind of gzipping can be used
               if(strpos(" ".$HTTP_ACCEPT_ENCODING, "x-gzip"))
                       $encoding = "x-gzip";
               elseif(strpos(" ".$HTTP_ACCEPT_ENCODING,"gzip"))
                       endhtml();
                       $encoding = "gzip";

               if ($encoding) // ok, encoding is accepted
               {
                       header("Content-Encoding: $encoding");

                       $size = strlen($html);
                       $crc = crc32($html);

                       $output = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
                       $output .= substr(gzcompress($html, $level), 0, -4);
                       $output .= pack("V", $crc);
                       $output .= pack("V", $size);
               }
               else
               $output = $html;
       }
       else
       $output = $html;

       echo $output;
       exit;
}
?>


Where's the endhtml()?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: adams on January 02, 2002, 10:02:58 AM
Right after the "$HTTP_ACCEPT_ENCODING,"gzip perhaps thats the wrong place?


Indeed it was the wrong place. Now that I fixed it your procedure works like a charm. Thanks Zef.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Jaxom on January 04, 2002, 05:49:18 PM
Well, I got it working :) Thanks for the info...

Here's a tipette for you non-PHP experts out there...

I spent a good half hour banging my head over this until I finally figured it out (that'll teach me to think I know how to code without reading the references first)

This was what I was trying to get to work:

Code: [Select]
<?php 
    $headervar 
"http://www.theguildhouse.net/meta/header";
    
$extension ".php";
    include (
$headervar.$skin.$extension);
?>



<!--start of content-->

<?php
require("forum.php");

function 
endhtml()
{
$footervar"http://www.theguildhouse.net/meta/footer";
    
$extension ".php";
     include (
$footervar.$skin.$extension);
}
?>


(Note - $skin is set by another included script further up the page, I use it to theme the new website I'm building)


But it didn't work  - The header worked fine, but the footer $skin was never being set. I tried all sorts of things before finding out that basically, you need to add

Code: [Select]
global $skin;
inside the function, like this:


Code: [Select]
<?php 
    $headervar 
"http://www.theguildhouse.net/meta/header";
    
$extension ".php";
    include (
$headervar.$skin.$extension);
?>



<!--start of content-->

<?php
require("forum.php");

function 
endhtml()
{
    global 
$skin;
    
$footervar "http://www.theguildhouse.net/meta/footer";
    
$extension ".php";
include ($footervar.$skin.$extension);
}
?>



I'm used to the idea that a global variable is well, global, and local variables are only accessible inside a function. In PHP, ALL normal variables are global, but you need to declare it as such to access it inside a function. Doh.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Jaxom on January 04, 2002, 10:08:46 PM
Hmm, just discovered (and fixed) a related problem.

Don't forget to do the same thing to Reminder.php!Otherwise people won't be able to get email prompts when they forget their password.

I.E.

Remove

Code: [Select]

ob_start();


From the Reminder.php


rename Reminder.php to something else (I used subreminder.php)

Create a new page called Reminder.php with your custom php code in it, same as the index.php page we created earlier; just replace

Code: [Select]

require("forum.php");


with

Code: [Select]

require("subreminder.php");



HTH!
Title: Re:How do I integrate YaBB into my PHP website?
Post by: cessandra on January 05, 2002, 12:30:12 PM
my board: http://unidentity.net/bored (http://unidentity.net/bored)

my index.php:
Quote

<?php ob_start();

require("http://unidentity.net/bheader.php");

require("http://unidentity.net/bored/forum.php");

function endhtml()
{

require("http://unidentity.net/footer.php");

}
?>


no matter what link i click on, it just takes me back to index.php.  why?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: cessandra on January 05, 2002, 12:37:29 PM
ps

at the end of my board, i get this error:

Quote
Fatal error: Call to undefined function: endhtml() in /export/spare/www/unidentity.net/bored/Sources/Subs.php on line 745


this is my subs.php:
Quote

function obExit()
{
       global $HTTP_ACCEPT_ENCODING,$modSettings;
       endhtml();
       if (!$modSettings['enableCompressedOutput'])
       {
               ob_end_flush();
               exit;
       }
       $html = ob_get_contents();
       ob_end_clean();
       $level = 1;
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on January 05, 2002, 12:43:04 PM

my board: http://unidentity.net/bored (http://unidentity.net/bored)

my index.php:
Quote

<?php ob_start();

require("http://unidentity.net/bheader.php");

require("http://unidentity.net/bored/forum.php");

function endhtml()
{

require("http://unidentity.net/footer.php");

}
?>


no matter what link i click on, it just takes me back to index.php.  why?

Don't use urls when requiring, just say require('footer.php'); or require('forum.php'); not full urls.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: cessandra on January 05, 2002, 01:29:24 PM
for the header and footer, they're not in the same directory as the board... can i do it as ../header.php?

i did figure out my problem.  i had forgotten to take out that line from forum.php
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on January 05, 2002, 01:52:43 PM
for the header and footer, they're not in the same directory as the board... can i do it as ../header.php?
yes

you can also use the entire system path to the file. -Alex
Title: Re:How do I integrate YaBB into my PHP website?
Post by: wotaguy on January 06, 2002, 05:27:49 AM
I think with regard to the going back to your new index.php you have all overlooked and neglected to make another change to Subs.php. line 786 currently looks like:

$scripturl = $boardurl."/index.php";

and need to read:

$scripturl = $boardurl."/forum.php";

wher forum.php is the name you changed the original yabb index.php to

Guy
Title: Re:How do I integrate YaBB into my PHP website?
Post by: alexrolko on January 06, 2002, 05:06:35 PM

I think with regard to the going back to your new index.php you have all overlooked and neglected to make another change to Subs.php. line 786 currently looks like:

$scripturl = $boardurl."/index.php";

and need to read:

$scripturl = $boardurl."/forum.php";

wher forum.php is the name you changed the original yabb index.php to

Guy


Actaully no, when the forums.php is included into the newpage... all calls YaBB calls are still routed the index.php even though it isnt the YaBB index.php
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on January 06, 2002, 11:00:46 PM
Tried this out, and it's working fine. Thanks, Zef!  :)

One remark: as James Gater already wrote, one has to do the same with the "Reminder.pl". @Zef: maybe you should add this to the top message, too.

And one question: the integration of my dreams would look a little different, namely like this:
I wish people could log in at my start page "index" and that the forum <yabb main> is visible only when the "forum" link is clicked. Understand what I mean? The integration described here is just allowing me to add an own php header and footer to the YaBB SE. I wish to have the login, the active user checks and the private messages all over the web site, but the <yabb main> only in the forum area.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Joseph Fung on January 08, 2002, 02:31:37 PM
And, just for the hell of it, I gave the maintenance pack the ability to execute php statements in template.php if you use that instead of template.html ;)

just because I love you guys  ;)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: komplex on January 10, 2002, 01:58:39 AM

And one question: the integration of my dreams would look a little different, namely like this:
I wish people could log in at my start page "index" and that the forum <yabb main> is visible only when the "forum" link is clicked. Understand what I mean? The integration described here is just allowing me to add an own php header and footer to the YaBB SE. I wish to have the login, the active user checks and the private messages all over the web site, but the <yabb main> only in the forum area.


has anyone got something like this working yet?

i want users to be able to log into yabb through my main index page, and then be returned to that index page afterwards. then have a link off of that index page to the forums. i tried messing around with it a bit tonite, but i didn't get anywhere. if anyone has any suggestions, let me know. i'll report back if i can get something working.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Jaxom on January 10, 2002, 10:36:59 AM
http://www.yabb.info/community/index.php?board=141;action=display;threadid=3838;start=0 (http://www.yabb.info/community/index.php?board=141;action=display;threadid=3838;start=0)

This link should help some :)

Yay the maintenance release...
Title: Re:How do I integrate YaBB into my PHP website?
Post by: irbrian on January 19, 2002, 01:00:19 PM
Does the template.php feature of the Maintenance Release work yet? If so, how do I use it? Do I just create a template.php file?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Zef Hemel on January 19, 2002, 01:07:48 PM
There's a top.php and a bottom.php if I'm not mistaken. Use them
Title: Re:How do I integrate YaBB into my PHP website?
Post by: irbrian on January 21, 2002, 01:40:04 AM

There's a top.php and a bottom.php if I'm not mistaken. Use them


Please forgive me for being slow, but how do those two files relate to the template.php file?

My primary question was, if I use template.php instead of template.html, how do I tell the message board index.php file to access template.php instead of template.html.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on January 21, 2002, 12:40:35 PM


There's a top.php and a bottom.php if I'm not mistaken. Use them


Please forgive me for being slow, but how do those two files relate to the template.php file?

My primary question was, if I use template.php instead of template.html, how do I tell the message board index.php file to access template.php instead of template.html.


The messageboard will automatically use the template.php if the file is present. The top.php and the bottom.php are invoked automatically. If you leave them empty (as they are installed by default) they have no effect.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: irbrian on January 21, 2002, 05:21:25 PM
Ah ha! I answered my own question when I actually bothered to go through the 1.1.0 upgrade process...

Flawless! I didn't have to do anything special at all; the PHP I'd already included on my template.html (and commented out to prevent it from being displayed on the template.html page) automatically started working. I'm assuming the upgrade.php somehow renamed it to template.php.. haven't really had a chance to look into that yet.

At any rate, everything works without a hitch, and I love the new SSI features.. looking forward to more great work from the Dev team and others.

Andrea: Thanks for the tip. You were right on, of course.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: myk on May 29, 2002, 03:57:03 AM
Then go to Subs.php, to the the obExit() function (around line 760), and after the line with "$HTTP_ACCEPT_ENCODING,$modSettings;" add:
Code: [Select]

endhtml();

I know others had trouble with this and I hate to bump this but I just had to comment about the above code. I'm using 1.3 with the bug fix and as long as i ~dont~ do the above, my board works fine. If I ~do~ do the above, I receive the same error as the user on the bottom of page 1 in this thread. So, anyone else having trouble, try ~not~ putting anything in Subs.php.

PS, this is a "clean" board I am using (no mods) and I've followed all of the other directions in the first post to a T
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Doomster on June 02, 2002, 07:46:17 AM
I'm running 1.3,
To get all this to work I had to replace everyway way it passed on the HTML variables.  Using ";" it didn't pass on more than 1 variable, so I had to use "&" to pass them all on.

e.g. all the links created, such as:
http://www.yabb.info/community/index.php?board=135;action=post;threadid=3311;title=Post+reply;start=15

Had to be changed to:
http://www.yabb.info/community/index.php?board=135&action=post;threadid=3311&title=Post+reply&start=15

I eventually used an advanced search and replace program to search/replace examples such as:
;user to &user
;threadid to &threadid
;action to &action
etc.

I don't know if it has security implications, but it's the only way I could get it to work!
Thanks of the basic idea though,
- - DSJ
(btw, myk, I had to include the endhtml(); or it didn't include the header.  However, as I call the forum functions off the forum, I had to create a variable forums and make it endhtml(); optional)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on June 02, 2002, 04:41:07 PM
Since with YaBB SE 1.3.0 you can use template.php, the technique described in this thread should not be necessary any longer for 1.3.0. You can directly embed php commands in the template.php.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Shindou Hikaru on June 03, 2002, 11:37:22 AM
I intergrated Yse1.3 in my site without using the forums.php tecnique.

I have my forums at /Forums/index.php
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Doomster on June 04, 2002, 06:33:11 AM
andrea, with 1.3 I had to use this sort of method, because it messed up any Javascript that was passed through the YaBB parse scripts.  It removed all the spaces or the new lines or something which caused errors in the Javascript.
- - DSJ
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on June 04, 2002, 07:13:39 AM
aha...

Just an idea (dont know if it works): did you put the java script commands directly into the template.php or did you try to put them into a separate ".js" file?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Doomster on June 04, 2002, 07:37:41 AM
hmmmm, I think I tried...

putting it directly into the template.php ...

'include'ing it into the template.php, but I guess that would have the same affect as above when parsed ...

Not sure about the JS file though.  Why do you ask?
I'm a total beginner with using Javascript with PHP.  I can write basic JS, but not sure on anything else to do with it.  Would putting it in a JS file and adding it via HTML command make it keep its original format?

- - DSJ
http://www.dbdukclan.co.uk
Title: Re:How do I integrate YaBB into my PHP website?
Post by: kevje on September 09, 2002, 10:19:04 AM
Hello everyone,

I've got another question which I think is related to the
topic.
Well: on my site, I've already got a member-domain.
users can log in, and from then on, they can freely
manouvre there.
I want to ask if there's a way that my members
do not have to login again when they try to access
YaBB.
(of course I can forward form-data directly to
/yabbse/index.php?board=;action=login2, but that's
not sufficient)

It's a gigantic work to copy all the username's and pass
words into the YaBB database, since members
can also change their passwords themselves.

Can YaBB & the rest of my site share 1 MySQL table in
which my users are enlisted?

thanks in advance!
kevin
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on November 25, 2002, 12:47:52 AM

Would putting it in a JS file and adding it via HTML command make it keep its original format?

Yes.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Marcelo on December 17, 2002, 12:59:46 PM
Hey guys,

I'm pretty new in here, but i have a question similar to this forum.

I want to show in my index.shtml page only the latest post in my forum, how do i configure the ssi code.


Code: [Select]
<!--#include virtual="/path_to/lastpost.xxx" -->

Can you guys solve this to me ?

Thanks a lot,

Marcelo Pessoa
http://www.juridico.pro.br/
mpessoa@abc.mre.gov.br

Title: Re:How do I integrate YaBB into my PHP website?
Post by: Marcelo on January 22, 2003, 06:21:06 AM
Hey guys,

I'm pretty new in here, but i have a question similar to this forum.

I want to show in my index.shtml page only the latest post in my forum, how do i configure the ssi code.

Code: [Select]
<!--#include virtual="/path_to/lastpost.xxx" -->

Can you guys solve this to me ?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 02, 2003, 09:09:27 AM
HELP!

I've followed this thread as closely as I can and I am getting a duplicate headers error. I am using v 1.5.0. This is the template:
Code: [Select]
<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" align=\"center\" border=\"0\">
 
<tr>
 <td align=\"right\"><yabb uname><yabb im><br />
        <yabb time></td>
</tr>
<tr>
   
 <td align=\"center\"><yabb menu>
</td>
</tr>
<tr>
 <td><yabb news>
</td>
</tr>
</table>
<br />
<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" align=\"center\" border=\"0\">
 <tr>
   
 <td valign=\"top\"><yabb main>
     </td>
 </tr>
</table>
<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" align=\"center\" border=\"0\">
 <tr>
   <td nowrap=\"nowrap\" align=\"right\"><yabb vbstylelogin></td>
 </tr>
</table>
<br />
<table cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" border=\"0\">
             
<tr>
               
 <td width=\"20%\" align=\"left\" valign=\"middle\" nowrap=\"nowrap\">
                 <a href=\"http://www.mysql.com/\"><img height=\"31\" alt=\"Powered by MySQL\" src=\"YaBBImages/mysql.gif\" width=\"88\" border=\"0\" /></a>
                 <a href=\"http://www.php.net/\"><img height=\"31\" alt=\"Powered by PHP\" src=\"YaBBImages/php.gif\" width=\"88\" border=\"0\" /></a>
               </td>
 <td valign=\"middle\" align=\"center\" width=\"60%\"><yabb copyright></td>
 <td width=\"20%\" align=\"right\" valign=\"middle\" nowrap=\"nowrap\">
                 <a href=\"http://validator.w3.org/check/referer\"><img height=\"31\" alt=\"Valid XHTML 1.0!\" src=\"YaBBImages/valid-xhtml10.gif\" width=\"88\" border=\"0\" /></a>
                 <a href=\"http://jigsaw.w3.org/css-validator/check/referer\"><img height=\"31\" alt=\"Valid CSS!\" src=\"YaBBImages/vcss.gif\" width=\"88\" border=\"0\" /></a>
               </td>
</tr>
           
</table>


I renamed my index.php to phorum.php (and Reminder.php to reminders.php) and commented out the line in both that says "ob_start();"

This is the index.php i created using what I got out of this thread. Note that the tables here will be replaced with my real header and footer after troubleshooting:
Code: [Select]
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"?>
<?php ob_start(); ?>

<!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>
<title>The Sun Spot Phorum on Sun Spot Photography</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../scripts/sunspot.css" rel="stylesheet" type="text/css" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<script language="JavaScript" type="text/javascript">
   if (self != top) top.location.replace(self.location);
//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#CC3300" vlink="#CC3300" alink="#CC3300" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<?php // include "header.php"; ?>

<table width="100%" border="1" cellspacing="8" cellpadding="0">
<tr>
 <td bgcolor="#FFFFCC">header's here</td>
</tr>
</table>
<?php <br>require("phorum.php");<br>require("reminders.php");<br><br>function endhtml() { ?>

<table width="100%" border="1" cellspacing="8" cellpadding="0">
<tr>
 <td bgcolor="#FFFFCC">footer's here</td>
</tr>
</table>

<?php ?>

</body>
</html>


I changed my Subs.php to  read, starting on line 1272:
Code: [Select]
function obExit()
{
   global $HTTP_ACCEPT_ENCODING,$modSettings;
   endhtml();
   if (!$modSettings['enableCompressedOutput'])
   {
      ob_end_flush();
      exit;
   }
   $html = ob_get_contents();
   ob_end_clean();
   $level = 1;
   // ...more code follows, obviously!


At last, here is the error I am getting:
Code: [Select]
Warning: Cannot add header information - headers already sent by (output started at /home/www/eightseventeen/ssp/forum/index.php:1) in /home/www/eightseventeen/ssp/forum/Sources/Subs.php on line 1297
xXmo6<  ibiH鐶Y링h$j$~()efPD^pۅ&M糫#pf09z9yq}2-K<NlL~y] \hiq5nd"'n7 -ii QIEx3$<E\*R8l2rX/^3LaɻBHfg;Y܁G@3Ãn2rM5Voac+ Xu3b -=، 9>%2OqXIDbg㺞ȍti 7fps Xif'x1L ke9_"7D4@=ia 6G?6rq_s/1G'3|DUN\əHIPU~~/* ."UE! & db0GH5E1Ě^jgլ !K]2u/j"tή9G{/K JBMh=1! ^>< Tb^YmbyUdw6~%?{:s1W_U V9NTVg$Lc3 \o:J9kx l;>D5 [O]q9?==G1aZ-S*@[&4N3PJ*d^av,b'3#tۤY`8gg(=u``}B֮f +a3n.%+>FuԨmN86R-ݹ|: zH&(= K=fr')\aԏu/]y5l}jU쓋VFMlTTD5Zmp"i$]Wn , g`c /㟮6 hIJC재Ԯx&6܌Aᣝ*5YEbF`c f W*Cmf7_mdө涕ŒlK0ZƧv\j`~:uw̗'T1SM;0,uk*4oxցJ7.&N1 Hu{j;KM m/j^ٴ1K[{wMo]5mc+{+/Ez,&ţU{~݂YΤ~G;esI6

What am I doing wrong?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Spaceman-Spiff on February 02, 2003, 04:36:15 PM
and why do u want to do all those things above? ::)
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 02, 2003, 08:46:56 PM

and why do u want to do all those things above? ::)


To give an honest answer to a rather facetious question: I was following the directions I found in the posts to this thread. Read above, as I'm not about to regurgitate it here.

If I have totally misread everything, please let me know... and then tell me exactly what I need to do to put the forum within the design of my site.

For your infomation, my current site is as such:

*HTML header stuff*
*start HTML body*
*include header.php*
*page-specific HTML content.  This is where I am trying to include the phorum.php*
*include footer.php*
*end body and HTML*

Simple stuff. So why the freaky error?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Spaceman-Spiff on February 02, 2003, 09:32:03 PM
ah, sorry, thought this is an SSI.php question
in the first post, Zef said:
Quote
Then create a new index.php At the first line put:
Code:

<?php ob_start(); ?>


i think u really need to put that line ON TOP
just move the xml part below it, or maybe remove it (i dont think the xml tag is necessary)

btw, i dont see the usefulness of this feature
maybe this topic is a bit out of date...
since the template is already .php, u can just put php codes there...
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 02, 2003, 10:14:03 PM
WHAT?!?  >:( ;D

I can put php code inside the template? Seriously? That would solve everything! I will give it a shot and let you know.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on February 02, 2003, 10:54:46 PM

WHAT?!?  >:( ;D

I can put php code inside the template? Seriously? That would solve everything! I will give it a shot and let you know.


Make sure you embed the php code like this:

<?php ... ?>
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 04, 2003, 02:32:55 PM
Thanks for the tip. It's working almost just fine. But now I have another - yet smaller - problem.

I have attached a stylesheet document within the template, and I know it's working because some of the styles get applied. However, some of them don't; namely, it seems, font sizes. I have a "title" class that is only applying the color, letter-spacing, and font-family but not the font-size attribute. Same for a "fineprint" class I have.

What's the deal? is there another way I should set the font sizes? I wouldn't think there would be a difference.

To see the page, follow this link: http://www.eightseventeen.com/ssp/forum/ (http://www.eightseventeen.com/ssp/forum/). The menu bar font size, the "Sun Spot Phorum" title, and the copyright text at the bottom of the page are all the wrong sizes!

While we're at it  ;), you may notice that the first visit to the page gives a blank page. You have to hit "refresh" to make the page load. What causes that?

Thanks for all the help! Everyone!
Title: Re:How do I integrate YaBB into my PHP website?
Post by: andrea on February 04, 2003, 05:55:14 PM
Check that all classes you are using are defined in the css ssection (for example the class "smallText") and that you use that class ore another defined one everywhere.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 04, 2003, 07:08:28 PM
It's all defined correctly. I've triple-checked it, and it works everywhere else. Even inline styles like this don't work:
Code: [Select]
<tag style="font-size:16px;">text</tag>
Does YaBB do something unusual to the code or display the page in a non-traditional manner? How does that template-thing work, that it would partially ignore inline styles?
Title: Re:How do I integrate YaBB into my PHP website?
Post by: irbrian on February 05, 2003, 01:11:38 PM
This probably has absolutely nothing to do with it, but have you tried using pt instead of px for your font size units? Sixteen pixels comes out to roughly 12pt text at the standard text resolution..

I can't think of any reason font-size style defs alone should be ignored while others are rendered properly.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Dude on February 05, 2003, 01:46:26 PM
Two things. First the blank page is a bug in 1.5.0 and maybe 1.5.1 earlier versions. ??? You probably should upgrade or look for the fix in the bugs board.

If you are trying to change the font size in the board description (Please read this first if you are new to the Sun Spot Phorum. ) be aware the sizes are hard coded in the php file(s). You need to go thru boardindex.php, messageindex.php and display.php and take out all the font tags before your class will take effect. And then you will need to go thru a lot more for things like the im's profile, stats. etc.

nice looking board btw. Like the way you've integrated the colors with the site's scheme. :) Even your ads look like they belong.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: eight17 on February 05, 2003, 07:02:15 PM
Okay, I fixed the CCS problem. It didn't like the styles shorthand {font: normal bold 12px} but did accept the "normal" syntax {font-size: 12px; font-weight: bold}.

What is a good fix for the blank page bug, or do I have to wait until a new version comes out?

P.S. Thanks for the complement! ;D  I just wish I had the rest of the site as close to being ready for launch as the forum is!
Title: Re:How do I integrate YaBB into my PHP website?
Post by: Dude on February 07, 2003, 03:59:07 AM
Okay, I fixed the CCS problem. It didn't like the styles shorthand {font: normal bold 12px} but did accept the "normal" syntax {font-size: 12px; font-weight: bold}.

What is a good fix for the blank page bug, or do I have to wait until a new version comes out?

P.S. Thanks for the complement! ;D  I just wish I had the rest of the site as close to being ready for launch as the forum is!

don't know about the blank page fix. sorry, I am still running 1.4.1 There's a thead in the News Board (http://www.yabbse.org/community/index.php?board=9) about the latest version. I would imagine the blank page bug has been fixed.
Title: Re:How do I integrate YaBB into my PHP website?
Post by: marcnyc on February 22, 2003, 10:32:34 PM
I have only read the very first, the second and the last two or three posts in this forum but I would like to offer you my two cents... I had the same problem (succesfully integrating YaBB SE into my PHP site using my header, footer, functions, sidebar menus etc)... After some help from BigP and lots of testing I simply found out the following things that you might wanna know about:

1. you can put php code in the template BUT...
2. ...you must use require instead of include or include_once when including header or footer codes or other things
3. ...you must make the variables that you are gonna use in your page's extra-yabb content global at the very beginning of the template. Even if you normally wouldn't do this on a normal non-yabb page with yabb you must do so to have your functions() working properly when called from within the Yabb template.
4. Finally you have to remember that YaBB SE already uses functions by the name of footer(); (I know that for sure and had to change my entire site around to avoid coflicts and errors) and maybe header(); too (I am not sure about that, not tested) so if you use functions with those names you will have to rename them in your entire site or create a duplicate with a different name in your main include file where you have all the functions...

That's just form my own experience. If you wanna see how I integrated the board successfully into my site preserving all of my site's headers, footers, functions and sidebars check out my forum at http://www.chaindlk.org/forum

bye
Title: Re:How do I integrate YaBB into my Php website?
Post by: mirepup on March 01, 2003, 06:48:12 PM
Someone posted a question a while ago about not only integrating YABB SE with your site, but an existing DB of users.

I am hoping to set up a site like that as well. It will have areas that only members will have access to. The question is, is it better to use the YABBSE logins and extend the table to include custom fields, or have a separate login for my site, and bypass/integrate with YABB?

Anybody have any examples, thoughts or comments?
Title: Re:How do I integrate YaBB into my Php website?
Post by: [Unknown] on March 01, 2003, 07:40:30 PM
I've always chosen to use the same login, but with a new member table. (joined by way of ID_MEMBER.)

This way, I can upgrade with little problems.

-[Unknown]
Title: Re:How do I integrate YaBB into my Php website?
Post by: Asterik on May 04, 2003, 07:35:26 PM
In my sub.php... theres nothing close 2 what ur sayin  :o  :-\
Title: Re:How do I integrate YaBB into my Php website?
Post by: Jepa on June 27, 2003, 08:41:13 PM
Hi All,

Looks great but I would have to agree with Asterik.  My obExit() function looks like this:

function obExit()

{

   @ob_end_flush();
   exit;

}

And that is it.  My subs.php version is:

Subs.php YaBB SE 1.5.1

Any help would be helpful

Thanks,

Jepa
Title: Re:How do I integrate YaBB into my Php website?
Post by: andrea on June 28, 2003, 02:58:32 AM
Yes for 1.5.4 you have to adapt it a litte but it still works.