Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: [Unknown] on November 09, 2004, 11:18:05 PM

Title: Integrating the forum into your site...
Post by: [Unknown] on November 09, 2004, 11:18:05 PM
Update: An extended version of this guide is now available at http://www.simplemachines.org/community/index.php?topic=145838.0



In many cases, people want their forum to look like their main site.  To make this possible might take a little bit of work, but it really isn't all that difficult.

The first step is to know some basic CSS and HTML.  If you don't know these, and cannot bother to learn them, I hope you're willing to pay someone to help you.  Learning just basic CSS and HTML isn't that difficult, and the benefits are wonderful and great; I'm not writing this for those who want things handed to them on silver platters.  Sorry to those who don't for having to say that.

Some guides on CSS and HTML are available here:
http://www.w3schools.com/html
http://www.w3schools.com/xhtml
http://www.w3schools.com/css

When I say HTML, I really mean XHTML, but the difference is more like a new version than a separate language.  XHTML is preferred, but if you know HTML it should be fine.  For more information on them and their differences, see the tutorials above.

Next, you'll want to make a copy of the default theme.  To do this, go into your administration center, and select "Theme and Layout Settings".  From there, under "Install a New Theme", type a name for your theme next to "Create a copy of Default named" and click Install!  You will be prompted to click OK - please do so.

Now you have a copy of the default theme.  If you want to customize the images for your theme, go to the theme's settings and change the URL from default/images to "yourname"/images, and use an FTP client to copy the files from default into your theme.

After this is done, you can use the style.css in your theme's directory to customize most of the colors.  Of course, this isn't exactly what you're looking for, but bare with me and get those customized.  There are comments in the file, but the main ones to worry about are titlebg (blue), windowbg and windowbg2 (shades of gray), and bordercolor/tborder. (backgrounds for tables, grid lines, etc.)

Moving to Your Layout

The next step is, of course, to make it look like your site.  I assume that, to do this, you already have a "template" of sorts made out of html - your site without the main content.  If you don't, making one would help markedly, but you may be able to wing it too.

Once you have this done, you'll want to split it into two parts: the header, and the footer.  Doing this makes it much easier to customize things, and can even make it easier to design your own site (with basic shtml or PHP includes.)  Put these two parts in a "header.php" and "footer.php" - don't worry, they don't have to have HTML in them at all, but they can.

The next step can be done in two separate ways.  One is cleaner, and makes it easier to use SSI to power your site (as is done here.)  The other is notably simpler and easier.  I'll cover the simpler one first.

You may notice that there's a lot of stuff in the header of the index template.  Much of this can be omitted, which is what we're going to do for simplicity's sake.  So, what we need to do is find the following:

<html

And keep going down until:
<body>

Delete it all.  We're going to start fresh, and simpler.  All you really need is: (note that this will screw up mutliple language support!)

<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>


That's probably less scary, right?  If you want the things we just took out (which make browsing better in cases, and internationalization better, etc.) it can be left in.  Now, after the <body> should be a ';.  Make sure to leave that there.  After that line, add:

include('header.php');

If you didn't put header.php in the same place as the forum, you may need to make it '../header.php'.  After that, we're going to remove the upshrink part (assuming you remove the above part) because it won't work anymore.  That means removing:

<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" />



Again, don't remove that last '; because it makes things work.  Okay, so we're almost done now.  The next step is to add the footer.  To do that, look for:
</body>

Above that, you will see a line that says echo ' - and, above that, we want to add:

include('footer.php');

Again, if you put the outside the forum's directory, you'll want to use ../ to "get to it".  That was the basic method.

I'll post the more advanced method in a reply.

-[Unknown]



(Edit: Stickied topic. - Motoko)
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on November 09, 2004, 11:36:22 PM
The Cooler Way

This other way, we're going to use what are called "layers".  Because of this, we will need to make a small change to the database.  If you don't have a way to get to the database, such as phpMyAdmin, you may wish to install and learn how to use it (phpMyAdmin, I mean.)

So, the first step is to create the "layer" itself.  A layer is simply two sub templates that go above and below the content.  For example, by default the 'main' layer is used, which means that above the main part of the page 'main_above' will be shown... and below, 'main_below' will be shown.  Not too difficult, right?

So, creating the layer only means creating two sub templates.  At the end of index.template.php, right before the ?>, add:
function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';

include('header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('footer.php');

echo '
</body></html>';
}


Again, if you have the header.php and footer.php files outside of your forum directory, you may have to change those lines slightly to point things to them.  So, if they're in your site's directory, just outside the forum directory, use ../header.php and ../footer.php.

The next step is to remove the shrink thing, since it won't work.  As said above, find and remove:

<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" />



Again, don't remove that last '; because it makes things work.

Now, in the templates it was using before, you need to remove the header and footer parts.  This means removing everything from:
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

To:
<body>';

And then removing:
echo '
</body>
</html>';


Now, if you did this, and went to your forum, it'd look REALLY CRAPPY.  There's one last vital thing that needs to be done for it to work.  And to do that, we need the id of the theme we're working with.

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box:

REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');

(where yourprefix_ is your prefix, often 'smf_' and that number is the theme id we found.)

By the by, if you're wanting to distribute your theme, and use layers, look in the file named "theme_info.xml".  It has a special spot just for this information.  Remember that the layers are loaded in the order listed - in this case, it goes site_above -> main_above -> content -> main_below -> site_below.

Wonderful.  You're done, and everything looks fancy.  But, now, you probably did this to use it with SSI - how does one do that?  Try the following code, in a PHP file:

<?php

error_reporting
(E_ALL);

$ssi_theme that pesky number again;
$ssi_layers = array('site');

// If you want SSI.php to start gzipping for you ;).
$ssi_gzip true;

require(
'forum/SSI.php');

echo 
'some stuffs go here.';

ssi_shutdown();

?>

(where that pesky number again is the theme id, and forum/SSI.php is where ever SSI.php is - not a URL.)

I'll admit a more complicated system is used for this site, but the example given should be more than enough to help you power everything through SMF and its template system, should you wish to.

Good luck!  Tell me if you have problems... (in this topic please, I get too many pms...)

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: TLM on November 14, 2004, 01:57:03 PM
I figured another way before I saw this thread but not sure if its any better.

In the forums index, I added the "outside" of the forum, menu, headers, etc...

Then in index.php in the root folder I used,


<?php
require('./smf/SSI.php');
template_header();

//Site content goes here
include "../includes/content.php";

template_footer();
?>



Just looking at what you said vrs what I figured out, I dont see a diffrence.  Is there a problem doing it the way I currently am?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on November 14, 2004, 05:59:37 PM
You're using functions that may or may not exist in the next version of SMF.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: scorpionusa on November 19, 2004, 10:06:09 PM
how do I integrate the left column or right column into the template along with header and footer?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on November 20, 2004, 12:37:41 AM
Quote from: scorpionusa on November 19, 2004, 10:06:09 PM
how do I integrate the left column or right column into the template along with header and footer?

Table, float, etc - basic HTML and CSS.  Just because it's named "above" doesn't mean it can't be to the right - look at the admin layer.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: ThaJester on January 16, 2005, 08:11:05 PM
[Unknown], I posted a topic here (http://www.simplemachines.org/community/index.php?topic=24582.0). I didn't want to post it as a reply in this thread because it wasn't directly related to your instructions.
Title: Re: Integrating the forum into your site...
Post by: Bliss on February 24, 2005, 09:40:36 PM
Has anyone successfully integrated the left column/right column (or even just the left column) using the "layers" system? It is giving me fits! Much thanks.

JER

Quote from: scorpionusa on November 19, 2004, 10:06:09 PM
how do I integrate the left column or right column into the template along with header and footer?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on February 25, 2005, 01:30:31 AM
I have, look at this site :P.  What problems are you having?

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: goluboy on March 02, 2005, 11:52:01 PM
Hi there,

I was wondering if the simple technique you described above can be made to work with site skinning.  I am currently using a skinning tool using cookies.  Basically, when my site is loaded, it checks for the cookie present on the user's machine and loads the "look" accordingly. 

An average page would look like this:

<? include("/path/to/cookiecheck.php"); ?>

<? include($headervar.$skin.$extension); ?>

<? include("/path/to/content.php"); ?>

<? include($footervar.$skin.$extension); ?>

I tried using these includes as is with the technique above, but I get nasty errors. 

The code in the cookiecheck is as follows:

<?
  if (isset($newskin)) {
    $newskin=(int)$newskin;
    if ($newskin<1) $newskin=1;
    if ($newskin>2) $newskin=1;
  } elseif (isset($skin)) {
    $newskin=(int)$skin;
    if ($skin<1) $newskin=1;
    if ($skin>2) $newskin=1;
  } else {
    $newskin=1;
  }
  $skin=$newskin;
  setcookie ('skin', "", time() - 3600);
  setcookie('skin', $newskin,time()+(86400*365),'/');
  setcookie('skin', $newskin,time()+(86400*365),'/','2xy.org');
      $skin=$newskin;

    $headervar = "/path/to/header";
    $footervar = "/path/to/footer";
    $extension = ".php";
?>

If anyone has any idea how to go around this, it would be much appreciated.

Thanks!
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on March 05, 2005, 04:28:16 AM
That is very very insecure and dependent on register_globals.  I strongly recommend using super-globals.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: goluboy on March 05, 2005, 10:25:02 AM
Hi,

I'm really new to PHP...  What do you mean by super-globals?
Title: Re: Integrating the forum into your site...
Post by: Foden on March 13, 2005, 06:04:06 AM
Hey.

I used this, but I get an error message saying 'headers already sent'  :o

Quote from: TLM on November 14, 2004, 01:57:03 PM
I figured another way before I saw this thread but not sure if its any better.

In the forums index, I added the "outside" of the forum, menu, headers, etc...

Then in index.php in the root folder I used,


<?php
require('./smf/SSI.php');
template_header();

//Site content goes here
include "../includes/content.php";

template_footer();
?>



Just looking at what you said vrs what I figured out, I dont see a diffrence.  Is there a problem doing it the way I currently am?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on March 13, 2005, 06:07:58 AM
Quote from: goluboy on March 05, 2005, 10:25:02 AM
Hi,

I'm really new to PHP...  What do you mean by super-globals?

http://www.php.net/reserved.variables

Foden, make sure to put it at THE VERY BEGINNING before ANYTHING else.

-[Unknown]
Title: Re: The Cooler Way
Post by: gabriele on March 15, 2005, 09:10:28 AM
I have integrated the forum in my site but the source page doesn't include the </head><body> tags.

thanks!

Gabriele
Title: Re: The Cooler Way
Post by: [Unknown] on March 15, 2005, 06:18:52 PM
Quote from: gabriele on March 15, 2005, 09:10:28 AM
I have integrated the forum in my site but the source page doesn't include the </head><body> tags.

Can you provide a link?  Are you sure you didn't delete them from the template?

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: gabriele on March 16, 2005, 07:22:58 AM
I am positive!

I had to get rid of the "if..." part to be able to see those tags in the source sento to the browser.

now it looks like this:

   

// added by Gabriele
   
function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />
<link href="/style.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" src="/includes/mouseover.js"></script>
</head>
<body ONLOAD="preloadImages();>';

include('../header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('../footer.php');

echo '
</body></html>';
}
// end of added


URL: www.pescarein.com/forum
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on March 16, 2005, 03:00:46 PM
Looks fine to me, although there are tabs before the doctype which Internet Explorer can't handle.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: checkmeout on March 22, 2005, 03:26:34 AM
I was hoping I could just "warp" my site around it with a simple include.
<?php include('foum/index.php'); ?> but I get session header errors is doing this even possable my site is very basic html nothing special at all.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on March 22, 2005, 03:54:14 AM
I'm afraid that even if you did it the right way, you'd still have problem with error messages.  The way outlined here is better...

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: manolain on April 07, 2005, 04:50:45 AM
Hello everyone

I followed steps of not so cool method to integrate forum into my website. Almost everything looks OK, but I have one problem with avatars, as system ones cannot be shown (it seems to be a javascript problem, although I copied all script.js content on my own one)

Here is the URL if you want to try:

http://www.fundacioncadizcf.com/index.php
Title: Re: Integrating the forum into your site...
Post by: shutiri on April 10, 2005, 04:11:28 AM
Hi,

I did everything you wrote on the cooler way and it works perfectly, THANK YOU.

but I'm still not able to add the left column.

I know you told us:

QuoteTable, float, etc - basic HTML and CSS.  Just because it's named "above" doesn't mean it can't be to the right - look at the admin layer.

Could you please post an example ?

Thank you again,
Shutiri.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on April 10, 2005, 04:14:07 AM
Quote from: manolain on April 07, 2005, 04:50:45 AM
I followed steps of not so cool method to integrate forum into my website. Almost everything looks OK, but I have one problem with avatars, as system ones cannot be shown (it seems to be a javascript problem, although I copied all script.js content on my own one)

I'm not sure what or where exactly you mean; can you clarify?

Quote from: shutiri on April 10, 2005, 04:11:28 AM
Could you please post an example ?

You could just make a basic table:

<table>
  <tr>
      <td width="200">left</td>
      <td>content</td>
      <td width="200">right</td>
  </tr>
</table>

And then, take that "content" and break it right there, putting everything before it in "above" and every after in "below".  Of course, tables aren't the right way to do it, but they're often easier to use to explain.

Like I said, basic HTML.

http://www.w3schools.com/

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: shutiri on April 10, 2005, 05:09:45 AM
mmm...   I don't really understand, sorry   ::).  I know HTML a little more than basic, so I understand the table thing.  I would like to have a structure like this:

<table width="100%">
  <tr>
    <td>header</td>
  </tr>
  <tr>
    <td width="20%">left menu</td>
    <td width="80%">forum</td>
  </tr>
  <tr>
    <td>footer</td>
  </tr>
</table>

How can I get this, based on the example you gave ?  In other words, what should I put instead of "header", "left menu", "forum" and "footer" ?

BTW, I know HTML, but no php, so please be kind  ;).

Thank you,
Shutiri.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on April 10, 2005, 05:47:42 AM
Whatever you'd like!  Here's an example.  Find:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


Replace:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="20%">left menu</td>
<td id="bodyarea" width="80%" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


I didn't even touch the PHP, I just added your HTML.  Of course, this isn't exactly what you suggested, but that's because it's really the same anyway and changes less of the HTML (which makes for a shorter and easier to understand post.)

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: guppy on May 05, 2005, 04:45:08 AM
Is this tutorial to make the forum look like the main site?

How can I do it the other way round, i.e. make the main site look like the forum? I wish to base my main site (basically just an index page with some SSI.php functions..) on index.template.php. Which file(s) do I include so that the variables in index.template.php will work?
Title: Re: Integrating the forum into your site...
Post by: londonhogfan on May 05, 2005, 01:36:29 PM
Hi,

I know very little about php, but I'm trying to integrate my message board to look like my website (http://www.razorbacklegacy.com/hog_archive).  I'm using the defaultXT theme found HERE (http://www.simplemachines.org/community/index.php?topic=23580.0).  So somehow I need this around the forum. 

Header

<center>
<table border="0" cellpadding="0" cellspacing="0" width="767">
<tr><td>
<img src="themes/new/images/theme.png" width="767" height="1" border="0" alt="">
</td></tr>
<tr><td>
<table align="left" border="0" cellpadding="0" cellspacing="0" width="767">
<tr><td><img src="themes/new/images/theme_r2_c1.png" width="2" height="110" border="0" alt=""></td>
<td><CENTER>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
   width="756" height="110">
   <param name="movie" value="themes/new/images/title.swf">
   <param name="quality" value="high">
   <embed src="themes/new/images/title.swf" quality="high"
    pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"
    width="756" height="110">
   </embed>
</object>
</CENTER></td>
<td><img name="theme_r2_c8_2" src="themes/new/images/theme_r2_c8.png" width="9" height="110" border="0" alt=""></td></tr></table>
</td></tr><tr><td width="767" height="40" background="themes/new/images/legacy.gif"><div align="center">
<font size="5" face="verdana, arial" color="#000000">
T H E <font size="5" face="verdana, arial" color="#8d0b0b"><b>R A Z O R B A C K</b> <font size="5" face="verdana, arial" color="#000000">L E G A C Y
</font>
</tr><tr><td>
<table align="left" border="0" cellpadding="0" cellspacing="0" width="767" height="34">
<tr><td><img name="theme_r3_c1_2" src="themes/new/images/1.gif" width="154" height="34" border="0" alt=""></td>
<td><img name="theme_r3_c3" src="themes/new/images/3.gif" width="147" height="34" border="0" alt=""></td>
<td><img name="theme_r3_c4" src="themes/new/images/4.gif" width="153" height="34" border="0" alt=""></td>
<td><img name="theme_r3_c5" src="themes/new/images/5.gif" width="136" height="34" border="0" alt=""></td>
<td><img name="theme_r3_c7" src="themes/new/images/7.gif" width="177" height="34" border="0" alt=""></a></td></tr></table>
</td></tr>
<tr><td width="767" height="19" background="themes/new/images/theme_r4_c1.png"><div align="cent<font size="1" face="verdana, arial">
<br>
</font>  </font>
</tr><tr><td width="767" background="themes/new/images/theme_r6_c1.png" style="padding: 0 15px 0 10px; background-repeat:repeat-y ">
<table width="735" cellpadding="0" cellspacing="0" border="0">
<tr><td width="100%" bgcolor="#FFFFFF">
<center>
<table border="0" width="735" bgcolor="#FFFFFF"><tr><td>



Footer

</td></tr></table>
</td></tr><tr><td><img src="themes/new/images/theme_r7_c1.png" width="767" height="15" border="0" alt=""></td></tr><tr><td width="767" align="center" background="themes/new/images/theme_r8_c1.png"><img src="themes/new/images/theme_r9_c1.png" width="767" height="13" border="0" alt=""></td></tr></table><br><center>
<font face="arial" color="#E0E0E0" size="3"><b><a href="#top">TOP OF PAGE</a></b></center><br><br><br>
<font size="1" face="arial" color="#CCCCCC">
<a href="http://www.razorbacklegacy.com/hog_archive/login.php?referer=%2Fhog_archive%2F">LOGIN</a> | <a href="http://www.razorbacklegacy.com/hog_archive/logout.php?referer=%2Fhog_archive%2F">LOGOUT</a> | <a href="http://www.razorbacklegacy.com/hog_archive/admin.php?admin_mode=1&referer=%2Fhog_archive%2Findex.php">ADMIN</a> | <a href="http://www.razorbacklegacy.com/hog_archive/admin.php?admin_mode=0&referer=%2Fhog_archive%2Findex.php">USER</a>
</center>
</body>

</html>
Title: Re: Integrating the forum into your site...
Post by: Dan1984 on May 05, 2005, 02:09:29 PM
I'm getting loads of errors. I followed the simple way the best I could, I'm sure I got it all right.

Please have a look at the errors and see if you can work out where I've got wrong.

http://www.sussexforums.co.uk/BBS
Title: Re: Integrating the forum into your site...
Post by: londonhogfan on May 05, 2005, 02:49:08 PM
Quote from: Dan1984 on May 05, 2005, 02:09:29 PM
I'm getting loads of errors. I followed the simple way the best I could, I'm sure I got it all right.

Please have a look at the errors and see if you can work out where I've got wrong.

http://www.sussexforums.co.uk/BBS

I was getting the same thing.
Title: Re: Integrating the forum into your site...
Post by: Dan1984 on May 05, 2005, 04:38:59 PM
Okay I've sorted it except now when I click a link my header and fotter disapear and I'm left with just the forum on its own again. Anyone know why this is?

Thanks in advance
Title: Re: Integrating the forum into your site...
Post by: Dan1984 on May 06, 2005, 08:26:29 AM
Now I've sorted all the out its working great except all the top buttons and text fields I cant click them or anything it doesn't make any sense. Please look at the url to see what I mean.

http://www.sussexforums.co.uk/BBS

I Didn't get any help before so not sure I will now but please do if you why I'm having this problem.
Title: Re: Integrating the forum into your site...
Post by: HEB XI 1 on May 06, 2005, 09:08:09 AM
at first glance ... frames.  Ew.  After looking around some more, I don't see the rest of the site (header and footer stuff).  I checked out your base domain and saw what I was looking for there, but it didn't show on the forums.  I was able to click on the buttons and links just fine, but below the forum I saw some what I think is some of the graphics from the wrapper.

If you're interested, take a look at http://www.raven-flight.com.  I have put in some of the SSI stuff and have gotten my forum to accept the includes for my header, menu, and footer.  I used includes so that I would only have to change one file and it would update on the entire site (rather than having to change 10 pages).  I'm sure it's not the cleanest way to do it, and probably not the simplest ... but it does validate HTML and CSS, so I'm satisfied.

Anyway,  if that's something similar to what you're looking to do, I can send you the basic files that I used - you won't be able to see much by viewing the source since I used PHP and includes to build the pages.
Title: Re: Integrating the forum into your site...
Post by: Dan1984 on May 06, 2005, 11:19:22 AM
Sorry my mistake I had changed it after I posted, Please look now to see what I mean and BTW there is no frames.

http://www.sussexforums.co.uk/BBS
Title: Re: Integrating the forum into your site...
Post by: HEB XI 1 on May 06, 2005, 09:29:29 PM
Ok now I see the site wrapper and what you mentioned about the buttons and links.  Without being a programmer (I'm really just a troll on these boards) my first thought is that the forum is not loading completely.  The base URL for the links that do work on the menu seems to be wrong as well, since I got a "Not Found" error on all of them.

As for why the forum is not loading ... I think the frameset is probably a big part of it.  I say there are frames because when I view the source code, I get this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="en"><head><title>Sussex Forums - A community website for the whole of sussex...</title><meta name="Keywords" content="Sussex, Brighton,Eastbourne,South East,Newhaven,Dieppe,Seahaven,The Grand,England,East Sussex,West Sussex,Sussex Community,Chat,Meet Friends, Find Old Friends In Sussex,Search Sussex, Map of Sussex"><meta name="Description" content="Meet new friends that live in Sussex or just find your old friends. This is one of the largest communities for Sussex online. Find out tourist information and much much more!"></head>
<frameset rows='100%,*' border='0' frameborder='0' framespacing='0'>
<frame title='http://www.paltrivia.co.uk/SussexForums/BBS' src='http://www.paltrivia.co.uk/SussexForums/BBS' name='mainframe' frameborder='0' noresize='noresize' scrolling='auto'>
<frame title='empty frame' frameborder='0' scrolling='no' noresize='noresize'>
<noframes><body> Sorry, you don't appear to have frame support.
Go here instead - <a href="http://www.paltrivia.co.uk/SussexForums/BBS">Sussex Forums - A community website for the whole of sussex...</a> </body> </noframes> </frameset> </html>


I know personally I had a site that I didn't know had frames ... it was actually frame forwarding.  Once I got that changed by my webhost, a lot of the Session and cookie errors I was having cleared up.  So whether you coded them in or not, you do indeed have frames, and that might be part of the problems that you are having.
Title: Re: Integrating the forum into your site...
Post by: WTFBA on June 11, 2005, 09:12:37 PM
Quote from: iwyen on May 05, 2005, 04:45:08 AMHow can I do it the other way round, i.e. make the main site look like the forum? I wish to base my main site (basically just an index page with some SSI.php functions..) on index.template.php. Which file(s) do I include so that the variables in index.template.php will work?

I'd also like to know this... could someone help?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on June 11, 2005, 09:21:41 PM
This is covered in the post as well.  Just look at the example that mentions SSI.php.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: WTFBA on June 11, 2005, 09:33:22 PM
D'oh! :o  Can't beleive I missed that!!  Thanks!

I try to use the example (changing the $ssi_theme value) and I get this on the resulting PHP.
QuoteUnable to load the 'site_above' template.

Does the $ssi_layers variable need to change too?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on June 11, 2005, 09:35:09 PM
Instead of array('site'), use array('main').

The idea is, you want the "main" layer wrapped around your content.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: WTFBA on June 11, 2005, 09:37:14 PM
Awesome! :D  Thanks for the clarification!! ;D
Title: Re: Integrating the forum into your site...
Post by: Caedmon Michael on June 19, 2005, 02:13:31 PM
I've searched the forums and the 'net. My apologies if this has been covered and I missed it, in which case a helpful point in the right direction is appreciated.

I'm using SSI successfully on 2 sites to create static pages following the forum templates, using the following basic code:


<?php
$ssi_layers 
= array('main');
$pagetitle "Sakamuyo Christian Fellowship";
ob_start();
include(
'/home2/sakamuyo/public_html/community/SSI.php');

// CONTENT

// END CONTENT

ssi_shutdown(); ?>



The only problem is that the >title< isn't set so the URL to the page is displaying where the browser would otherwise place the title. Is there an easy variable I could add to my pages so the title would set? And/Or, if that doesn't work, could you help me add the right "if" statement to my index.template.php to display a generic title if the page does not include a title?

Thanks!
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on June 19, 2005, 07:41:05 PM
Find:

$pagetitle

Replace:

$context['page_title']

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: Caedmon Michael on June 19, 2005, 07:54:59 PM
**smacks head**

Yes, it is that simple, isn't it? Thanks for returning my clue!   ;D
Title: Re: Integrating the forum into your site...
Post by: osckar on June 20, 2005, 06:30:30 PM
Hi:

This is my case:

I have this html code inserted in the template:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
   echo '
   <table width="770" cellpadding="0" cellspacing="0" border="0" align="center"><tr>
      <td width="130">left menu</td>
      <td id="bodyarea" width="640" style="padding: 1ex 10px 2ex 10px;">';
}

function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '</td>
   </tr></table>';


Everything is fine; I have a left column :) But..

I don't get to insert an external page like footer.php or header.php into this piece of html code... In this case I'd like to have left_menu.php in my left column.

I have tried it and get a parse error in my template; this is the code I use:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
   echo '
   <table width="770" cellpadding="0" cellspacing="0" border="0" align="center"><tr>
      <td width="130"><?php include('left_menu.php'); ?></td>
      <td id="bodyarea" width="640" style="padding: 1ex 10px 2ex 10px;">';
}

function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '</td>
   </tr></table>';


I have tried the <?php include('left_menu.php'); ?> without the <? & ?> tags like include('header.php'); but no sucess.

Thank you
Title: Re: Integrating the forum into your site...
Post by: A.M.A on June 20, 2005, 06:38:15 PM
try using:
// The main content should go here.  A table is used because IE 6 just can't handle a div.
   echo '
   <table width="770" cellpadding="0" cellspacing="0" border="0" align="center"><tr>
      <td width="130">';

include('left_menu.php');

   echo '
      </td>
      <td id="bodyarea" width="640" style="padding: 1ex 10px 2ex 10px;">';
}
Title: Re: Integrating the forum into your site...
Post by: osckar on June 20, 2005, 06:53:58 PM
Worked! Thank you A.M.A  ;)
Title: Re: Integrating the forum into your site...
Post by: TollyBoy on June 22, 2005, 02:41:53 PM
Quote from: [Unknown] on March 05, 2005, 04:28:16 AM
That is very very insecure and dependent on register_globals.  I strongly recommend using super-globals.

-[Unknown]

I have read the part about super-globals on the PHP documentation site and I realize why it is bad to use register_globals. But I still do not fully understand how to use super-globals instead of register_globals.

Lets take the following example: I use register_globals to check what page the user wants to view on my website. Let's say the users wants to view the contact page. I use the following URL: http://mysite/index.php?page=contact

How would I apply super-globals to find out what page the user wants to view?



if(!isset($page)) {
        $page = 'home';
}
else {
        $page = strtolower(trim($page));
}

switch($page) {
        case 'home':
                include('modules/home/home.php');
                break;

        case 'biography':
                include('modules/biography/biography.php');
                break;

        case 'coups':
                include('modules/coups/coups.php');
                break;

        case 'contact':
                include('modules/contact/contact.php');
                break;

        case 'guestbook':
                include('modules/guestbook/guestbook.php');
                break;

        case 'community':
                include('modules/community/community.php');
                break;

        default:
                include('modules/home/home.php');
                break;
}



And ... another "problem" which I wouldn't know to handle would be that this link can be shared with other people. If I use sessions and use the super-global $_SESSION['page']; the link would not be able to be shared.

How could I find a solution to this simple problem? I'm sure there's something easy out for it.

How does SMF find out what page a user is willing to view? Because those links can be shared if you're not logged in AND I assume SMF is not using register_globals since it is VERY VERY VERY insecure.
Title: Re: Integrating the forum into your site...
Post by: crammed on June 23, 2005, 07:18:42 PM
Hi folks.  I'm VERY new to using PHP.  But, I really like SMF and am having some trouble integrating it into my site.

I followed the "Cooler Way".  But, clearly I'm not quite cool enough yet.  Although it's entirely possible that I made mistakes along the way, I think that I followed it pretty closely.

My forum is here: http://www.gvgo.ca/mb

But, I created a seperate test file at http://www.gvgo.ca/mb/testindex.php

I'm pretty competant with HTML but I haven't had a good chance to figure out PHP.  Although, I was able to figure out how to integrate Coppermine into my site and bridge it to SMF.  In any case, some help for a PHP newbie would be greatly appreciated.  I am part way there.  But, it's probably something simple that I'm missing.

Thanks
Title: Re: Integrating the forum into your site...
Post by: osckar on June 23, 2005, 07:55:47 PM
Your testindex.php is full of errors. verify you are putting the php code at the very top of your page. Will be helpful if you can paste the code you are using.

Try using SSI.php see some examples at http://www.gvgo.ca/mb/ssi_examples.php and you can integrate parts of your forum to your index page of your site.

I guess it's quite simple to integrate that design into your forum (or vice versa whatever :) ) as long as you only have a header and footer and no left or right columns. Patience is all you will need  ;)

I suggest you to read this topic: http://www.simplemachines.org/community/index.php?topic=15678.0 to understand what parts you may need edit, if you are good with html then you may understand it.

Oscar
Title: Re: Integrating the forum into your site...
Post by: epyon on July 05, 2005, 03:03:03 PM
hey, i tried doing the first method (2 times) and both times it told me that it couldn't be viewed and that i had to swithc back to the original skin, and so i tried the 2nd method and it messed my hole forum up it was able to be viewed any more, so i had to erase it and start a new one over, i've been pretty nerves at this point and so i was wondering if someone could just post the code for for the forum with a left side pannel in it, (i dont care what colors cus i can fix that)

thanx ahead of time
Title: Re: Integrating the forum into your site...
Post by: osckar on July 05, 2005, 10:20:34 PM
Quote from: epyon on July 05, 2005, 03:03:03 PM
......... so i was wondering if someone could just post the code for for the forum with a left side pannel in it, (i dont care what colors cus i can fix that)

thanx ahead of time

It has been explained here.. http://www.simplemachines.org/community/index.php?topic=19638.msg244996#msg244996
Title: Re: Integrating the forum into your site...
Post by: epyon on July 06, 2005, 11:01:23 AM
wow that was easy,  :D thank you soo much!
Title: Re: Integrating the forum into your site...
Post by: barnjo on July 06, 2005, 12:59:38 PM
Just clarifying that i'm thinking on the right lines, whats actually ina header, is it like a picture at the top of each section?

Or is a header completely different.

So what do I put in the header.php if all I want is a different picture for each section?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on July 23, 2005, 05:40:25 PM
Quote from: TollyBoy on June 22, 2005, 02:41:53 PM
I have read the part about super-globals on the PHP documentation site and I realize why it is bad to use register_globals. But I still do not fully understand how to use super-globals instead of register_globals.

Lets take the following example: I use register_globals to check what page the user wants to view on my website. Let's say the users wants to view the contact page. I use the following URL: http://mysite/index.php?page=contact

How would I apply super-globals to find out what page the user wants to view?

Instead of your code, you want:


if (!isset($_GET['page'])) {
        $_GET['page'] = 'home';
}
else {
        $_GET['page'] = strtolower(trim($_GET['page']));
}

switch ($_GET['page']) {
        case 'home':
                include('modules/home/home.php');
                break;

        case 'biography':
                include('modules/biography/biography.php');
                break;

        case 'coups':
                include('modules/coups/coups.php');
                break;

        case 'contact':
                include('modules/contact/contact.php');
                break;

        case 'guestbook':
                include('modules/guestbook/guestbook.php');
                break;

        case 'community':
                include('modules/community/community.php');
                break;

        default:
                include('modules/home/home.php');
                break;
}


Quote
And ... another "problem" which I wouldn't know to handle would be that this link can be shared with other people. If I use sessions and use the super-global $_SESSION['page']; the link would not be able to be shared.

I wouldn't recommend using sessions, nor would I think that would work.

QuoteHow does SMF find out what page a user is willing to view? Because those links can be shared if you're not logged in AND I assume SMF is not using register_globals since it is VERY VERY VERY insecure.

Yes, it uses $_GET, $_REQUEST, $_POST, etc.

Quote from: epyon on July 05, 2005, 03:03:03 PM
hey, i tried doing the first method (2 times) and both times it told me that it couldn't be viewed and that i had to swithc back to the original skin, and so i tried the 2nd method and it messed my hole forum up it was able to be viewed any more, so i had to erase it and start a new one over, i've been pretty nerves at this point and so i was wondering if someone could just post the code for for the forum with a left side pannel in it, (i dont care what colors cus i can fix that)

"Couldn't be viewed"?  What exactly was the error?

Quote from: barnjo on July 06, 2005, 12:59:38 PM
Just clarifying that i'm thinking on the right lines, whats actually ina header, is it like a picture at the top of each section?

Or is a header completely different.

So what do I put in the header.php if all I want is a different picture for each section?

Header = the HTML to be shown for every page at the beginning.
Footer = the HTML to be shown for every page at the end.

For example, if I had:

abc
def
xyz


And:

abc
ghi
xyz


It would be logical that "abc" is the header (same for both pages) and "xyz" is the footer (same for both pages.)  The "def" and "ghi" parts are the content - different for each page.

This doesn't mean your header cannot be dynamic; quite the opposite, it can be.  I just mean the part that is basically the same HTML/PHP/whatever for every page.  If you want a random header image, use something like PHP's rand() function.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: epyon on July 31, 2005, 04:35:44 PM
i know i posted here and said i got what i wonted but it seems that i was mistaken, its been about a month now that iv used SMF and iv gotten somewhat the hang of everything

i used method 1 and i got it working  :D although i cant seem to be able to add a left side pannel in that goes on the out side, what i have now is a left side pannel thats on the inside (so the top of it is right under the buttons and log-in imformation)

could some one please tell or show me how to or where to add the proper code so i can have a left side pannel that goes on the out side of the forum

i really appreciate it, if i confused u in any way just let me know and ill put my forums url on here so u can see what im talking about.

thanks a bunch
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on July 31, 2005, 07:23:28 PM
It's just the same as HTML.  You could use a table, or a floating div, or... lots of things.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: epyon on July 31, 2005, 10:09:36 PM
but like where?

i mean i had tryed another thing (adding a table next to the table that shows yours stats and your avatar) and i mean i was able to get it but it mest up that table (the one with the avatar etc.) it had pushed it all the way to the far right side

im realyl sorry, im sure with all the dumb questions us noobs ask it probebly gets u and your team a lil tierd but this is all i need help on and im sure ill be set

thanx
Title: Re: Integrating the forum into your site...
Post by: Col on August 03, 2005, 06:46:16 PM
Hi,

I've done this, and so far so good, except, how do I get a tiled background-image up?

I've altered the css and removed the  background-color, and added the image to the same place as I put the header image (main forum directory). What am I doing wrong?

Thanks.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on August 03, 2005, 09:22:57 PM
Can you post a link?

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: Col on August 04, 2005, 10:52:46 AM
Hi Unknown,

http://www.<edit>xxxxxx</edit>.org/community

Thanks.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on August 04, 2005, 02:25:07 PM
Find:

#headerarea
{
background-color: white;
border-bottom: 1px solid gray;
}
/* This is the main area of the forum, the part that's gray. */
#bodyarea
{
background-color: #D4D4D4;
}
/* And this is the bottom, where the copyright is, etc. */
#footerarea
{
color: black;
background-color: white;
border-top: 1px solid gray;
}


Replace:

#headerarea
{
border-bottom: 1px solid gray;
}
/* This is the main area of the forum, the part that's gray. */
#bodyarea
{
}
/* And this is the bottom, where the copyright is, etc. */
#footerarea
{
color: black;
border-top: 1px solid gray;
}


-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: Col on August 04, 2005, 04:49:39 PM
Thanks Unknown.

Pretty obvious now that you point it out. well, it was late when I posted last night. :-[

Thanks again. :)
Title: Re: Integrating the forum into your site...
Post by: dpmagyari on August 06, 2005, 01:02:43 AM
Thanks for the guide Unknown! I followed the Cool method thinking I was cool and all. It turned out just wonderful with only one small problem that I am sure is a simple fix. I applied your thread also on adding the left menu. When visiting my forums on the Main Index page the link buttons I added as my left menu work perfectly. Sadly when you enter the boards it wants to add the /forums/ directory to the links. How can I avoid this problem without using the full domain name since I have several domains pointed to the site? Any help would be appreciated. My forums can be found at the following link:

http://www.spiralmindsinc.com/forums (http://www.spiralmindsinc.com/forums)
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on August 06, 2005, 10:55:00 AM
Prefix all your links with a /.  For example, instead of:

about/team.php
about/license.php
about/donations.php

Use:

/about/team.php
/about/license.php
/about/donations.php

You're currently using ../, which just won't cut it - especially with search engine friendly URLs on.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: dpmagyari on August 06, 2005, 12:47:04 PM
Works perfectly!  :D Thanks alot for your help.
Title: Re: Integrating the forum into your site...
Post by: ValleyCat on August 14, 2005, 06:05:36 PM
Quote from: [Unknown] on November 09, 2004, 11:18:05 PM
In many cases, people want their forum to look like their main site.  To make this possible might take a little bit of work, but it really isn't all that difficult.
<snip>

The next step can be done in two separate ways.  One is cleaner, and makes it easier to use SSI to power your site (as is done here.)  The other is notably simpler and easier.  I'll cover the simpler one first.


<snip>

-[Unknown]

I did this, following the instructions as close as I could. Unfortunately, when I tried to implement it, I got the following message:
Template Parse Error!
There was a problem loading the /Themes/Mike/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


If needed, I can post the index.template.php file

Thanks in Advance
Title: Re: Integrating the forum into your site...
Post by: xenovanis on August 14, 2005, 10:40:35 PM
Click this link: To see more specific error information from PHP, try accessing the file directly.

It will give you a line-number. Post about fifteen lines around this number here.
Title: Re: Integrating the forum into your site...
Post by: mister on August 31, 2005, 09:48:42 PM
Hi,

I have tried both methods two different times and I am wondering what I am doing wrong.  Does this method work with SMF 1.0.5?
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on August 31, 2005, 10:49:34 PM
Yes.  You said you tried both and are wondering what's wrong, but you didn't say why you think something is wrong.  Does it look wrong?  Are you getting an error?  Does it say WRONG in red letters when you try it :P?

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: n1kki6 on September 06, 2005, 05:10:17 PM
Here is my error
Warning: template_main_above(header.php): failed to open stream: No such file or directory in /home/user/root/dir/forum/Sources/Load.php(1040) : eval()'d code on line 118

I put the header.php and footer.php in every folder i could and it still doesnt seem to be finding it.  I would prefer to be able to put the php files in the theme's direcectory because i will be using four different themes with my forum depending on what section.  I am using the first method.
Title: Re: Integrating the forum into your site...
Post by: guppy on September 07, 2005, 01:34:26 AM
include('header.php');

will search from your forum root

include('/Themes/your_theme/header.php');

will search from your theme folder (i hope!)
Title: Re: Integrating the forum into your site...
Post by: n1kki6 on September 07, 2005, 03:18:16 AM
awesome thanks, i got it now.
Title: Re: Integrating the forum into your site... re suckerfish
Post by: JoeP on September 10, 2005, 08:28:10 AM
Gotta question before I go to too much trouble...
I've developed a site template that uses some suckerfish navigation.  I want to integrate smf using method 2 as well as extensive use of ssi functions.  The question is, will the suckerfish javascript cause problems for smf, or will smf cause problems for suckerfish?

Thanks in advance,
joe
Title: Re: Integrating the forum into your site... re suckerfish
Post by: [Unknown] on September 10, 2005, 11:07:12 PM
Quote from: JoeP on September 10, 2005, 08:28:10 AM
I've developed a site template that uses some suckerfish navigation.  I want to integrate smf using method 2 as well as extensive use of ssi functions.  The question is, will the suckerfish javascript cause problems for smf, or will smf cause problems for suckerfish?

Without seeing the JavaScript, I couldn't say for sure.  I know it will work as far as PHP goes, but I don't know if it will like or dislike SMF's JavaScript.  It is likely you'll be fine.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: genie on September 11, 2005, 11:39:13 AM
Is there a way to run the "Simple" version (because I can't my arms around the "Cool" version) to add a header and left menu only?

I have tried the Simple version with header and footer and been successful with your directions, but it's not what I have running on the rest of the site.

Thanks for your inexhustive help.
Title: How to get login to return to originating page
Post by: JoeP on September 11, 2005, 12:29:45 PM
I would like to use either the login button (from ssi_menubar) or the login box (ssi_login) to allow members to log in from any page .  Is there a way to make it so that when they're done loging in, they are returned to the original calling page rather than the forum home page?
The calling pages may not be in the smf folder and they are not forum pages other than the use of SSI functions.

Thanks,
joe

P.S.  I do put the powered by and smf copyright on all pages.
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on September 11, 2005, 10:28:55 PM
Quote from: genie on September 11, 2005, 11:39:13 AM
Is there a way to run the "Simple" version (because I can't my arms around the "Cool" version) to add a header and left menu only?

I have tried the Simple version with header and footer and been successful with your directions, but it's not what I have running on the rest of the site.

Thanks for your inexhustive help.

How is it different?

Quote from: JoeP on September 11, 2005, 12:29:45 PM
I would like to use either the login button (from ssi_menubar) or the login box (ssi_login) to allow members to log in from any page .  Is there a way to make it so that when they're done loging in, they are returned to the original calling page rather than the forum home page?

Search for ssi_login.... this has been covered to death in more than one topic.

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: genie on September 12, 2005, 05:35:59 PM
I don't understand this specfically:

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box
Title: Re: Integrating the forum into your site...
Post by: [darksteel] on September 12, 2005, 06:04:35 PM
If I have a one CSS of my web , this is a problem with Css forum?

darksteel-
Title: Re: Integrating the forum into your site...
Post by: meadwench on September 16, 2005, 08:33:01 AM
Hmm. I used the 'cooler' method, and at first got a parse error. Fixing the location of the header.php and footer.php fixed that.

Now, I get no errors, just a blank page when I preview. I'm not sure why. Here's my template code:

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';

// The logo and the three info boxes
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';

echo '
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';

if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>', $txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=regcenter">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
}

echo '
</td></tr></table>
</div>

<form action="', $scripturl, '?action=search2" method="post" style="margin: 0; margin-top: 7px;">
<b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;
<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />';

// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>

</td>
<td width="262" style="padding-left: 5px;" valign="top">';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
</div>';

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 35px; padding: 5px;" class="smalltext">
<b>', $modSettings['totalMessages'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $modSettings['totalTopics'], '</b> ', $txt[64], ' ', $txt[525], ' <b>', $modSettings['memberCount'], '</b> ',  $txt[19], '<br />
', $txt[656], ': <b> <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '">', $modSettings['latestRealName'], '</a></b>
</div>
</div>';

echo '
</td>
</tr>
</table>

';

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>';

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
<td width="130">

<!-- START AdPeeps.com Code -->
<p align="center">
<SCRIPT type="text/javascript" SRC="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bstyle=default&btotal=1&bzone=rightside-tower&bsize=120x600&btype=3&bpos=default&ver=2.0&btarget=_blank&bborder=0">
</SCRIPT>
<NOSCRIPT>
<a href="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=clickad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" target="_blank">
<img src="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" width="120" height="600" alt="Click Here!" border=0></a>
</NOSCRIPT>
</p>
<!-- END AdPeeps.com Code --></td>
</tr></table>';

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// --></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>';

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!--';

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
window_oldOnload();
}';
}

echo '
// --></script>';
}

}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num > 0)
echo str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' : '<br />';
}

echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0" />' : $txt[2]), '</a>', $context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


// Integrated Chat Mod Icon
if (!$context['user']['is_guest'])
echo '
<a href="', $scripturl, '?action=chat" target="_blank">', ($settings['use_image_buttons'] ? ' <img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt['chatAlt'] . '" target="_blank" style="margin: 2px 0;" border="0" />' : $txt['chatAlt']), '</a>', $context['menu_separator'];


// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
}
function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';

include('header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('footer.php');

echo '
</body></html>';
}


Also, I'm not completely sure I'm doing my header.php and footer.php correctly. I copied my header and footer code from my site layout, and place each in its own file, and added <?php
echo 
'  
to the beginning, and '
?>
          to the end, and saved it as a .php file, uploaded and chmodded to 777.

What am I doing wrong? Thanks for any insight you might be able to offer. (At least I'm not getting an *error*! LOL)
Title: Re: Integrating the forum into your site...
Post by: [Unknown] on September 16, 2005, 01:42:21 PM
Quote from: genie on September 12, 2005, 05:35:59 PM
I don't understand this specfically:

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box

Are you able to find the id?  Are you looking in the link as described?

Quote from: meadwench on September 16, 2005, 08:33:01 AM
Now, I get no errors, just a blank page when I preview. I'm not sure why.

For the header and footer, you don't need to have <?php or echo ' in them at all.  Just have the HTML.

Anything in the forum error log?

-[Unknown]
Title: Re: Integrating the forum into your site...
Post by: meadwench on September 16, 2005, 02:23:18 PM
Thanks for looking at it! No error in the log. I am getting chat errors like this:
8: Undefined index: chatAlt
File: /hsphere/local/home/meadwenc/gotmead.com/smf/Themes/yabbsetheme/Errors.template.php (eval?)
Line: 244

from the current theme (which is the yabbse conversion, hence my reason for trying to get a real SMF theme working)

I took the php stuff out of my header and footer. Uploaded them, cleared the error log and tried to view. No error showing up,  and the source of the blank page is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="http://www.gotmead.com/smf/Themes/default/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "http://www.gotmead.com/smf/Themes/gotmead";
var smf_images_url = "http://www.gotmead.com/smf/Themes/default/images";
// --></script>
<title>Choose a theme...</title>
<link rel="stylesheet" type="text/css" href="http://www.gotmead.com/smf/Themes/gotmead/style.css?rc1" />


Any ideas?

Title: Re: Integrating the forum into your site...
Post by: meadwench on October 04, 2005, 09:25:01 AM
Here's the code I'm using for the template:
// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';

// The logo and the three info boxes
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';

echo '
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/userinfo.gif" style="position: absolute; left: ', $context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' : '-1px', '; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>';

if (!empty($context['user']['avatar']))
echo '<td valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>', $txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=regcenter">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

<form action="', $scripturl, '?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
', $txt['smf52'], '
</form>';
}

echo '
</td></tr></table>
</div>

<form action="', $scripturl, '?action=search2" method="post" style="margin: 0; margin-top: 7px;">
<b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;
<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />';

// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>

</td>
<td width="262" style="padding-left: 5px;" valign="top">';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
</div>';

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['images_url'], '/', $context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 35px; padding: 5px;" class="smalltext">
<b>', $modSettings['totalMessages'], '</b> ', $txt[95], ' ', $txt['smf88'], ' <b>', $modSettings['totalTopics'], '</b> ', $txt[64], ' ', $txt[525], ' <b>', $modSettings['memberCount'], '</b> ',  $txt[19], '<br />
', $txt[656], ': <b> <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '">', $modSettings['latestRealName'], '</a></b>
</div>
</div>';

echo '
</td>
</tr>
</table>

';

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>';

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
<td width="130">

<!-- START AdPeeps.com Code -->
<p align="center">
<SCRIPT type="text/javascript" SRC="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bstyle=default&btotal=1&bzone=rightside-tower&bsize=120x600&btype=3&bpos=default&ver=2.0&btarget=_blank&bborder=0">
</SCRIPT>
<NOSCRIPT>
<a href="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=clickad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" target="_blank">
<img src="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" width="120" height="600" alt="Click Here!" border=0></a>
</NOSCRIPT>
</p>
<!-- END AdPeeps.com Code --></td>
</tr></table>';

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// --></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>';

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!--';

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
window_oldOnload();
}';
}

echo '
// --></script>';
}

}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num > 0)
echo str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' : '<br />';
}

echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" style="margin: 2px 0;" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" style="margin: 2px 0;" border="0" />' : $txt[2]), '</a>', $context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 2px 0;" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


// Integrated Chat Mod Icon
if (!$context['user']['is_guest'])
echo '
<a href="', $scripturl, '?action=chat" target="_blank">', ($settings['use_image_buttons'] ? ' <img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="' . $txt['chatAlt'] . '" target="_blank" style="margin: 2px 0;" border="0" />' : $txt['chatAlt']), '</a>', $context['menu_separator'];


// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" style="margin: 2px 0;" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" style="margin: 2px 0;" border="0" />' : $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
}
function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';

include('header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('footer.php');

echo '
</body></html>';
}
?>


I'm sure its something simple like a missing or extra character, but I'll be durned if I can find it......any suggestions?

Thanks!

Title: Re: Integrating the forum into your site...
Post by: FS.Ed on October 14, 2005, 04:20:06 PM
Help Please.......
I have been trying for days to intergrate SMF into my website. I have been meticulously following the 'Simple' method described on page one of this section and read every posting here three times or more and still just can not get it to work.

I have installed SMF and the Theme Techhead and it all works perfectly on its own. But when I try the 'Simple' method to intergrate it to my forum style it all fails!

I modify the index.template.php in the Techhead folder as described but am unable to find the code:
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" />

When I create the header.php do I have to strip out all the <html> & <head> tag information and just start after the <body> tag or should this be just left alone as a normal html page up to the point where I want the forum to appear?

Error codes that appear at the top of my page say:
Warning: template_main_above(/themes/techhead/header.php): failed to open stream: No such file or directory in /homepages/27/d73024444/htdocs/forum/Sources/Load.php(1040) : eval()'d code on line 68

Warning: template_main_above(): Failed opening '/themes/techhead/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/27/d73024444/htdocs/forum/Sources/Load.php(1040) : eval()'d code on line 68


(Line 68 is where the header.php line is inserted)

A similar meassage appears where the footer shoud be displayed:
Warning: template_main_below(/themes/techhead/footer.php): failed to open stream: No such file or directory in /homepages/27/d73024444/htdocs/forum/Sources/Load.php(1040) : eval()'d code on line 309

Warning: template_main_below(): Failed opening '/themes/techhead/footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/27/d73024444/htdocs/forum/Sources/Load.php(1040) : eval()'d code on line 309


My new forum is at: www.flyingsites.co.uk/forum (http://www.flyingsites.co.uk/forum)
Header.php is at: www.flyingsites.co.uk/forum/themes/techhead/header.php (http://www.flyingsites.co.uk/forum/themes/techhead/header.php)
Footer.php  is at:www.flyingsites.co.uk/forum/themes/techhead/footer.php (http://www.flyingsites.co.uk/forum/themes/techhead/footer.php)

If you need to look at the code for the index.template.php it can be found here in text form:
www.flyingsites.co.uk/forum/themes/techhead/index.template.txt (http://www.flyingsites.co.uk/forum/themes/techhead/index.template.txt)

I'm completly new to PHP but am reasonably competent with html.

My current forum is running on Yabb at: www.flyingsites.co.uk/cgi-bin/forum/YaBB.pl (http://www.flyingsites.co.uk/cgi-bin/forum/YaBB.pl)
This is the way I wish the SMF forum to appear on my site, but unless I can get it to intergrate I'm stuffed!

I hope someone can help as I'm now at a loss as to what to do.

Thanks in advance, and if anyone needs more info I will supply it.

Thanks
Peter
Title: Re: Integrating the forum into your site...
Post by: FS.Ed on October 15, 2005, 07:37:59 AM
Eureka!
I've managed to solve it!

Where I was going wrong was that I was putting the header & footers in the themes/techhead folders.

They have to be in the top level directory! In my case www.flyingsites.co.uk/forum directory.

Now, I'm just tweaking the Techhead style to suit the colour scheme of my site, but that easly adjusted in the css style sheet!

Next move after this is to convert my Yabb forum over to SMF, lets hope that is a little easier for me!

Cheers
Peter
www.flyingsites.co.uk/forum (http://www.flyingsites.co.uk/forum)
Title: Re: Integrating the forum into your site...
Post by: jrstark on October 22, 2005, 11:16:47 PM
OK, I'm using the non-cool version but didn't delete anything besides the logo.  Finally got the table to flow correctly.  However, part of my header is a left-hand column of beige-colored links.  I have added these definitions to the theme stylesheet.  Headersmf.php and footersmf.php are in my home directory.

The links are not showing the correct color, they are showing the default link color.  Do I need to move headersmf.php into the theme folder for the stylesheet to take effect on these links?
Title: Re: Integrating the forum into your site...
Post by: xrisos on October 23, 2005, 10:33:12 PM
all this topic did was confuse me....

how can i link/include a php script in my main page ie index.php (or another page ie forum.html for example) that will show my simple machines forum on that page???........
Title: Re: Integrating the forum into your site...
Post by: jrstark on October 23, 2005, 11:11:08 PM
Quote from: xrisos on October 23, 2005, 10:33:12 PM
all this topic did was confuse me....

how can i link/include a php script in my main page ie index.php (or another page ie forum.html for example) that will show my simple machines forum on that page???........

Do you want your forum to be your main page?  Then install it in root (public html) and put your logo and anything else specific to your site in header.php and footer.php and go from there.

But even so, it's probably better to put it in a subdirectory and just have a link to forums on your main page.  Because otherwise everything on your main page will be on every page of your forum.

If you want your forum to BE on forum.html you will need to do a one-frame frameset.
Title: Re: Integrating the forum into your site...
Post by: ecopilot on November 07, 2005, 03:01:40 PM
Dear,
Thanks very much for your answer to my question. May be I'm confused in my querry. At the end of your message I couldn't even understand my question anymore... Certainly helpful but unfocused!
So I recap.
Go to  http://www.ecopilot.be (http://www.ecopilot.be) and see how I have integrated the very nice look of the smf into my pages.
Than click the button forum in the welcome page http://www.sudepervier.be/forum/index.php (http://www.sudepervier.be/forum/index.php)
How come I back to my home page and other buttons I prepared? using the back arrows on the browser?
My question is SIMPLY
1- How do I integrate MY buttons so they APPEAR IN ADDITION TO THOSE already in the NAvigation bar  (HOME- HELP - SEARCH _ PROFILE - CALENDAR - LOGOUT as here
2- How are LINKS added to these buttons
To make short  how can I COMPLETE the SMF Navigation bar so all links from my welcome page are included. Where to put .gif and wjhat command in what folder...
Thanks for your help and your lecture that I will start to study

Yours
Title: Re: Integrating the forum into your site...
Post by: osh.com.au on November 10, 2005, 08:33:47 AM
Hi I have used the simple way of doing this and my results can be found at http://osh.com.au/forum/index.php

There is a slight problem my link bar as it is not sitting where it should be. If you go to www.osh.com.au you can see where it sits. Does anyone have any suggestions? I have fiddled with it a little (I am a bit of a noob  :-\) and have had no luck. I don't want to exactly change my link bar as It generally works well for everything else.

I only added the header as I didn't need a footer added. The code I am using is below.... Is there anyway to edit it so the link bar will fit?


<html><!-- InstanceBegin template="../../Unnamed%20Site%201/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
</head>

<body background="/images/lgrey104.jpeg" link="#FF6600" vlink="#0000CC" alink="#FF9900" style="margin:0;">
<table width=994 height="100%" border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="1004" height="17" background="/images/topbg.gif">&nbsp; </td>
</tr>
<td height="100" background="/images/mainpic4.jpg" style="padding-left:70px; ">&nbsp;</td>
</tr>
    <td height="78" background="/images/navbg.gif"><script language="JavaScript" src="/structure.js"></script>
        &nbsp;</div></td>
</tr>
<tr>
<!-- Start of StatCounter Code --><script type="text/javascript" language="javascript">
var sc_project=1026961;
var sc_invisible=1;
var sc_partition=9;
var sc_security="cf97aced";
    </script><script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript>
<a href="http://www.statcounter.com/" target="_blank"><img  src="http://c10.statcounter.com/counter.php?sc_project=1026961&amp;java=0&amp;security=cf97aced&amp;invisible=1" alt="free hit counter" border="0"></a></noscript><!-- End of StatCounter Code --><script language="JavaScript" src="/settings.js"></script></body><!-- InstanceEnd --></html>


Thanks in advance for your help!  :D
Title: Re: Integrating the forum into your site...
Post by: motumbo on November 15, 2005, 12:58:58 PM
I've read throught this thread a number of times.  I understand none of it.  I see so many people had problems that I don't want to go near this.

Is there anyone out there that has the complete code to put in a menubar on the left-hand side in a template so I can just substitute your template for mine and be done with this?  Is there anyone who's got their navbar in a separate file and just including it in?  Either way, I just want the code.

I've spent so many hours just researching this--too many hours.  I just want a navbar on the left-hand side.  That's all I want.  I just want to be done with this part.

Thank you.

Title: Re: Integrating the forum into your site...
Post by: meadwench on November 15, 2005, 01:31:54 PM
Bump.

I'm still unable to determine why my template won't display at all. I get no errors on the screen or in my log, just a blank page. I have to admit that I'm frustrated. Anyone have any ideas?

My template looks like this:

<?php
// Version: 1.0 RC2; index


// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">';

// The logo and the three info boxes
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">'
;

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="'
$settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">'
$context['forum_name'], '</span>';

echo '
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/userinfo.gif" style="position: absolute; left: '$context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' '-1px''; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>'
;

if (!empty($context['user']['avatar']))
echo '<td valign="middle">'$context['user']['avatar']['image'], '</td>';

echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>'
$txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
'
$txt['welcome_guest'], '<br />
'
$context['current_time'], '<br />

<form action="'
$scripturl'?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
</form>'
;
}

echo '
</td></tr></table>
</div>

<form action="'
$scripturl'?action=search2" method="post" style="margin: 0; margin-top: 7px;">
<b>'
$txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 8ex;" />&nbsp;
<a href="'
$scripturl'?action=search;advanced">'$txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />'
;

// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>

</td>
<td width="262" style="padding-left: 5px;" valign="top">'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">'
$context['random_news_line'], '</div>
</div>'
;

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 35px; padding: 5px;" class="smalltext">
<b>'
$modSettings['totalMessages'], '</b> '$txt[95], ' '$txt['smf88'], ' <b>'$modSettings['totalTopics'], '</b> '$txt[64], ' '$txt[525], ' <b>'$modSettings['memberCount'], '</b> ',  $txt[19], '<br />
'
$txt[656], ': <b> <a href="'$scripturl'?action=profile;u='$modSettings['latestMember'], '">'$modSettings['latestRealName'], '</a></b>
</div>
</div>'
;

echo '
</td>
</tr>
</table>

'
;

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>'
;

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '</td>
<td width="130">

<!-- START AdPeeps.com Code -->
<p align="center">
<SCRIPT type="text/javascript" SRC="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bstyle=default&btotal=1&bzone=rightside-tower&bsize=120x600&btype=3&bpos=default&ver=2.0&btarget=_blank&bborder=0">
</SCRIPT>
<NOSCRIPT>
<a href="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=clickad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" target="_blank">
<img src="http://www.gotmead.com/adpeeps/adpeeps.php?bfunction=showad&uid=100000&bmode=off&bzone=rightside-tower&bsize=120x600&btype=1&bpos=default&ver=2.0" width="120" height="600" alt="Click Here!" border=0></a>
</NOSCRIPT>
</p>
<!-- END AdPeeps.com Code --></td>
</tr></table>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// --></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>'
;

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!--'
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
window_oldOnload();
}'
;
}

echo '
// --></script>'
;
}

}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num 0)
echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
}

echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Show the [home] and [help] buttons.
echo '
<a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" style="margin: 2px 0;" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" style="margin: 2px 0;" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" style="margin: 2px 0;" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" style="margin: 2px 0;" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" style="margin: 2px 0;" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];


// Integrated Chat Mod Icon
if (!$context['user']['is_guest'])
echo '
<a href="'
$scripturl'?action=chat" target="_blank">', ($settings['use_image_buttons'] ? ' <img src="' $settings['images_url'] . '/' $context['user']['language'] . '/chat.gif" alt="' $txt['chatAlt'] . '" target="_blank" style="margin: 2px 0;" border="0" />' $txt['chatAlt']), '</a>'$context['menu_separator'];


// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" style="margin: 2px 0;" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" style="margin: 2px 0;" border="0" />' $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" style="margin: 2px 0;" border="0" />' $txt[108]), '</a>';
}
function 
template_site_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />
'
$context['html_headers'], '
</head>
<body>'
;

include('header.php');
}

function 
template_site_below()
{
global $context$settings$options$scripturl$txt$modSettings;

include('footer.php');

echo '
</body></html>'
;
}
?>


Quote from: meadwench on September 16, 2005, 02:23:18 PM
Thanks for looking at it! No error in the log. I am getting chat errors like this:
8: Undefined index: chatAlt
File: /hsphere/local/home/meadwenc/gotmead.com/smf/Themes/yabbsetheme/Errors.template.php (eval?)
Line: 244

from the current theme (which is the yabbse conversion, hence my reason for trying to get a real SMF theme working)

I took the php stuff out of my header and footer. Uploaded them, cleared the error log and tried to view. No error showing up,  and the source of the blank page is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="http://www.gotmead.com/smf/Themes/default/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "http://www.gotmead.com/smf/Themes/gotmead";
var smf_images_url = "http://www.gotmead.com/smf/Themes/default/images";
// --></script>
<title>Choose a theme...</title>
<link rel="stylesheet" type="text/css" href="http://www.gotmead.com/smf/Themes/gotmead/style.css?rc1" />


Any ideas?



Thanks!

Vicky
Title: Re: Integrating the forum into your site...
Post by: Confused Too on November 26, 2005, 08:36:00 AM
Is this thread SMF 1.1 RC1 compliant?  I ask because when I look at some of the code it is not like the code I have on my forum.
I have tried to play around and all I did was break it and had to delete the folder and revert back to SMF Default Theme.
I am a complete PHP virgin so need an idiots guide to try and intigrate the forum into the site.
Title: Re: Integrating the forum into your site...
Post by: Confused Too on November 26, 2005, 08:47:22 AM
I spoke too soon the forum is now broken...... :'(
How irritating.  All I was doing was working on a template and not the default template.  I have used the back button to go to a cached version and changed to forum to SMF default and to Classic Abba but nothing shows on screen at all?  ???
Title: Re: Integrating the forum into your site...
Post by: xenovanis on November 26, 2005, 08:50:36 AM
Upload all files from the upgradepackage of the smfversion you are using again.
Title: Re: Integrating the forum into your site...
Post by: Confused Too on November 26, 2005, 09:18:05 AM
Quote from: xenovanis on November 26, 2005, 08:50:36 AM
Upload all files from the upgradepackage of the smfversion you are using again.
Thanks xenovanis working on it now.
Title: Re: Integrating the forum into your site...
Post by: Confused Too on November 26, 2005, 09:30:57 AM
Thanks xenovanis I have re-installed the whole of SMF again to start with a fresh install and just changed the Database Tables Prefix: from smf_ to new_ and when into the admin changed the prefix back to smf_. Kicked me out and asked me to log in again and all is back.
Title: Re: Integrating the forum into your site...
Post by: Karrit on November 28, 2005, 11:07:16 AM
I can probably figure out the intrgration, but what all will I need to include in my header and footer.php? Is there an example I can look at?
Title: Re: Integrating the forum into your site...
Post by: becca on November 28, 2005, 06:28:21 PM
Hi, I integrated my site.. but its not lined up right. How do I made it line up so that the header is truely at the top and so the color I pick for the header stays as it should (it should be a green background on the top and bottom. Oh and I used the cool way of doing it hehe... I am still not to sure how to order it.. what is the acual code for ordering the top, content, bottom, site bottom and left hand? I saw where you said use a table, but where would I add the code for the table?

Thanks!

http://ourussvoyager.com/galaxies/index.php (http://ourussvoyager.com/galaxies/index.php)
Title: Re: Integrating the forum into your site...
Post by: motumbo on November 29, 2005, 05:16:27 AM
Quote from: becca on November 28, 2005, 06:28:21 PM
Hi, I integrated my site.. but its not lined up right. How do I made it line up so that the header is truely at the top and so the color I pick for the header stays as it should (it should be a green background on the top and bottom. Oh and I used the cool way of doing it hehe... I am still not to sure how to order it.. what is the acual code for ordering the top, content, bottom, site bottom and left hand? I saw where you said use a table, but where would I add the code for the table?

Thanks!

http://ourussvoyager.com/galaxies/index.php (http://ourussvoyager.com/galaxies/index.php)

First off, you should not be using absolute positioning on your header DIV.  That breaks the normal flow of the layout.  Here is the code from the HTML file your site generated:

"<div id="Layer1" style="position:absolute; width:301px; height:43px; z-index:1">"

I read Unknown's instructions on in this thread about 25 times and I still don't understand it.  So I tried another method.

In index.template.php:

Immediate after the body tag add a DIV and put the CSS info in style.css.  Optional if you want a left panel for navigation links and stuff,

<body>';
//Add the following two lines for your header and logo:
echo '
        <div class="myheaderdiv"></div>';  //This is the header
//Add this for a navigation bar at left:
echo '
<table class="wrappertable">
        <td class="leftnav">
        <div><a href="http://www.google.com/>Link 1</a></div>
        <div><a href="http://www.yahoo.com/>Link 2</a></div>
        </td>
        <td>';  //This <td> is to wrap the forum in a table cell because DIVs won't work.
//Resume regular code


You could also put an include function in there instead of embedding the code in the php file.  Also, be sure to add entries for these in your CSS so you can handle the formating in one place. 

In the same PHP file in the function template_main_below() add the following code immediately above the closing </body> tag to close the td and table from above:


</td>
</table>
</body>
</html>';
//The </body> and </html> tags are already there.  Just add the </td> and </table> tags.


You'll optionally want to remove this code to get rid of the SMF logo and forum name that was originally there:
echo '
<img src="', $settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';




Title: Re: Integrating the forum into your site...
Post by: Col on November 29, 2005, 09:05:15 AM
Hi,

I set up a header and footer some months ago, using the simple method, and works without any problems. However, when I tried setting the forum to search engine friendly URLs, my logo in the header, and an image in my footer failed. They still work on my index page, but when I enter boards, and threads, I get the red 'X's.

Is it that I must include the header/footer hacks with the other templates; is that I have to use the more complex header/footer method; or is there something else that I must do?

Thanks.
Title: Re: Integrating the forum into your site...
Post by: Col on November 29, 2005, 05:06:19 PM
Update:

What might just have been a curiosity now actually needs to be resolved. My stats tracker will not work with the default URLs, it needs the search engine friendly type. So, can anyone tell my why my images fail, and what I need to do to fix them?

Thanks.
Title: Re: Integrating the forum into your site...
Post by: HarleyDude on November 30, 2005, 11:17:41 AM
Myself, like a couple other posts I have read, am not seeing my header.php.  I am not using a footer and am using the "Cool Way".  I have changed the include path from relative to absolute and confirmed the header works by hitting it directly.  The main portion of the forum shows up with out issue, just without my header.  I am almost positive I did everything correctly.  Any ideas as to what could cause this?  This is on my test site which is running 1.1Beta3.  I was thinking of going back to 1.0.5 which is what our production site uses.  Is this going to be a problem in 1.1?
Title: Re: Integrating the forum into your site...
Post by: Prasad007 on November 30, 2005, 12:00:25 PM
hey this was very helpful and useful for me!
thank you guys!!
Title: Re: Integrating the forum into your site...
Post by: Col on November 30, 2005, 02:34:55 PM
Quote from: Col on November 29, 2005, 05:06:19 PM
Update:

What might just have been a curiosity now actually needs to be resolved. My stats tracker will not work with the default URLs, it needs the search engine friendly type. So, can anyone tell my why my images fail, and what I need to do to fix them?

Thanks.

If anyone's interested, I had a lot of problems. I could not get absolute or relative paths to work. If it worked on the index, it would not work deeper withing the forum. I could get it to work deeper, but then it would stop working on the index. Same problems if I moved the footer/header files to a higher directory. In the end I used the URLs instead, and it's all fine. I don't understand what caused the problem though. - Anyway, using URL fixes it.
Title: Re: Integrating the forum into your site...
Post by: motumbo on December 01, 2005, 01:05:28 PM
Quote from: HarleyDude on November 30, 2005, 11:17:41 AM
Myself, like a couple other posts I have read, am not seeing my header.php.  I am not using a footer and am using the "Cool Way".  I have changed the include path from relative to absolute and confirmed the header works by hitting it directly.  The main portion of the forum shows up with out issue, just without my header.  I am almost positive I did everything correctly.  Any ideas as to what could cause this?  This is on my test site which is running 1.1Beta3.  I was thinking of going back to 1.0.5 which is what our production site uses.  Is this going to be a problem in 1.1?

I had problems with relative paths, too.  From a reply to me somewhere else I was told that the path you need to use is the relative path to the main includee file.  That is, if the file your putting your include() in is included by another php file, you must use the path relative to the calling file.

It looks like everything is relative to the main forum folder and the main index.php.  So I just make sure my paths are something like include 'themes/mytheme/includes/includethis.php'.  That works for me.
Title: Re: Integrating the forum into your site...
Post by: Ghezus on December 01, 2005, 03:19:13 PM
ppf i'm going nut's. I've tried a lot and well when i was happy i let someone else check it he uses firefox and on firefox it was totally bugged while on opera it worked.

Page: http://test.g-gaming.net/stdp/

index.template.php:

<?php
// Version: 1.0; index

/*   This template is, perhaps, the most important template in the theme.  It
   contains the main template layer that displays the header and footer of
   the forum, namely with main_above and main_below.  It also contains the
   menu sub template, which appropriately displays the menu; the init sub
   template, which is there to set the theme up; (init can be missing.) and
   the linktree sub template, which sorts out the link tree.

   The init sub template should load any data and set any hardcoded options.

   The main_above sub template is what is shown above the main content, and
   should contain anything that should be shown up there.

   The main_below sub template, conversely, is shown after the main content.
   It should probably contain the copyright statement and some other things.

   The linktree sub template should display the link tree, using the data
   in the $context['linktree'] variable.

   The menu sub template should display all the relevant buttons the user
   wants and or needs.

   For more information on the templating system, please see the site at:
   http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
   global $context$settings$options$txt;

   /* Use images from default theme when using templates from the default theme?
      if this is 'always', images from the default theme will be used.
      if this is 'defaults', images from the default theme will only be used with default templates.
      if this is 'never' or isn't set at all, images from the default theme will not be used. */
   $settings['use_default_images'] = 'never';

   /* What document type definition is being used? (for font size and other issues.)
      'xhtml' for an XHTML 1.0 document type definition.
      'html' for an HTML 4.01 document type definition. */
   $settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
   global $context$settings$options$scripturl$txt$modSettings;

   // Show right to left and the character set for ease of translating.

   // Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
   echo '
   <div id="headerarea" style="padding: 12px 30px 4px 30px;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">';

   // The logo and the three info boxes.
   echo '
      <div align="center"><table cellspacing="0" class="position: relative;" cellpadding="0" border="0" 
 width="750px" class="background-color: #333333; ">
         <tr>
            <td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">'
;

   // This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative; color: white; "><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" />User Info</div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>'
;

if (!empty(
$context['user']['avatar']))
echo 
'<td valign="middle">'$context['user']['avatar']['image'], '</td>';

echo 
'<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo 
'
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo 
', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
echo 
'.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo 
'<br />
<b>'
$txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo 
'<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo 
'
<br />'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo 
$context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo 
$context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo 
'<br />
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo 
'
'
$txt['welcome_guest'], '<br />
'
$context['current_time'], '<br />

<form action="'
$scripturl'?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
</form>'
;
}

echo 
'
</td></tr></table>
</div></div>

<form action="'
$scripturl'?action=search2" method="post" style="margin: 0; margin-top: 7px; color: #C4C4C4; ">
<b>'
$txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 8ex;" />&nbsp;
<a href="'
$scripturl'?action=search;advanced">'$txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />'
;

// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo 
'
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo 
'
</form>

</td>
<td width="262" style="padding-left: 5px;" valign="top">'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo 
'
<div class="headertitles" style="width: 260px; color: white; "><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" />News</div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">'
$context['random_news_line'], '</div>
</div>'
;

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px; color: white; "><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" />Key Stats</div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<div style="height: 35px; padding: 5px;" class="smalltext">
<b>'
$modSettings['totalMessages'], '</b> '$txt[95], ' '$txt['smf88'], ' <b>'$modSettings['totalTopics'], '</b> '$txt[64], ' '$txt[525], ' <b>'$modSettings['memberCount'], '</b> '$txt[19], '<br />
'
$txt[656], ': <b> <a href="'$scripturl'?action=profile;u='$modSettings['latestMember'], '">'$modSettings['latestRealName'], '</a></b>
</div>
</div>'
;
   echo '
            </td>
         </tr>
      </table>'
;

      // Show the menu here, according to the menu sub template.
   echo '<table width="760px" align="center">';
      template_menu();
   echo '</table>';

   echo '
   </div>'
;

   // The main content should go here.  A table is used because IE 6 just can't handle a div.
   echo '
   <table width="760px" align="center" cellpadding="0" cellspacing="0" border="0"><tr>
      <td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">'
;
}

function 
template_main_below()
{
   global $context$settings$options$scripturl$txt;

   echo '</td>
   </tr></table>'
;

   // Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
   echo '

   <div id="footerarea" style="color: #C4C4C4; text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
      <script language="JavaScript" type="text/javascript"><!--
         function smfFooterHighlight(element, value)
         {
            element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
         }
      // --></script>
      <table cellspacing="0" cellpadding="3" border="0" align="center" width="760px" style="color: #C4C4C4;">
         <tr>
            <td width="28%" valign="middle" align="right">
               <a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
               <a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px; color: #C4C4C4;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
            </td>
            <td valign="middle" align="center" style="white-space: nowrap;">
               '
theme_copyright(), '
            </td>
            <td width="28%" valign="middle" align="left">
               <a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
               <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
            </td>
         </tr>
      </table>'
;

   // Show the load time?
   if ($context['show_load_time'])
      echo '
      <span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

   echo '
      </div>'
;

   // This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
   if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
   {
      // The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
      echo '
      <script language="JavaScript" type="text/javascript"><!--'
;

      // Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
      if ($context['browser']['is_safari'])
         echo '
         window.addEventListener("load", smf_codeFix, false);

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
                  codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
            }
         }'
;
      else
      {
         echo '
         var window_oldOnload = window.onload;
         window.onload = smf_codeFix;

         function smf_codeFix()
         {
            var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

            for (var i = 0; i < codeFix.length; i++)
            {
               if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
                  codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
            }

            if (window_oldOnload)
               window_oldOnload();
         }'
;
      }

      echo '
      // --></script>'
;
   }
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
   global $context$settings$options;

   // Folder style or inline?  Inline has a smaller font.
   echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

   // Each tree item has a URL and name.  Some may have extra_before and extra_after.
   foreach ($context['linktree'] as $link_num => $tree)
   {
      // Show the | | |-[] Folders.
      if (!$settings['linktree_inline'])
      {
         if ($link_num 0)
            echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
         echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
      }

      // Show something before the link?
      if (isset($tree['extra_before']))
         echo $tree['extra_before'];

      // Show the link, including a URL if it should have one.
      echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

      // Show something after the link...?
      if (isset($tree['extra_after']))
         echo $tree['extra_after'];

      // Don't show a separator for the last one.
      if ($link_num != count($context['linktree']) - 1)
         echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
   }

   echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context$settings$options$scripturl$txt;

   // Show the [home] and [help] buttons.
   echo '
            <a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" style="margin: 2px 0;" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '
            <a href="'
$scripturl'?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" style="margin: 2px 0;" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

   // How about the [search] button?
   if ($context['allow_search'])
      echo '
            <a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" style="margin: 2px 0;" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo '
            <a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" style="margin: 2px 0;" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo '
            <a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" style="margin: 2px 0;" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

   // The [calendar]!
   if ($context['allow_calendar'])
      echo '
            <a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];

   // If the user is a guest, show [login] and [register] buttons.
   if ($context['user']['is_guest'])
   {
      echo '
            <a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" style="margin: 2px 0;" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
            <a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" style="margin: 2px 0;" border="0" />' $txt[97]), '</a>';
   }
   // Otherwise, they might want to [logout]...
   else
      
echo '
            <a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" style="margin: 2px 0;" border="0" />' $txt[108]), '</a>';
}

function 
template_site_above()
{
global 
$context$settings$options$scripturl$txt$modSettings;

echo 
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />';

if (
$context['browser']['needs_size_fix'])
echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />
'
$context['html_headers'], '
</head>
<body>'
;

include(
'header.php');
}

function 
template_site_below()
{
global 
$context$settings$options$scripturl$txt$modSettings;

include(
'footer.php');

echo 
'
</body></html>'
;
}

?>


**Edit: It only works on Opera
Title: Re: Integrating the forum into your site...
Post by: Acf on December 01, 2005, 06:00:21 PM
Is the output (source) exactly the same? no, then i think it might require look in the php source.

if yes it is, then might look at the w3c validation of your code. Opera and firefox handle code differently, firefox is very hard on the rules of w3c, and opera Giff's more slack.

some links to validators:
http://validator.w3.org/check?verbose=1&uri=http%3A//test.g-gaming.net/stdp/ (http://validator.w3.org/check?verbose=1&uri=http%3A//test.g-gaming.net/stdp/)

http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A//test.g-gaming.net/stdp/ (http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A//test.g-gaming.net/stdp/)
Title: Re: Integrating the forum into your site...
Post by: Ghezus on December 02, 2005, 03:57:46 AM
It was a CSS error i fixed it now :)
Title: Re: Integrating the forum into your site...
Post by: Karrit on December 02, 2005, 01:53:21 PM
I feel a little confused. I have a site template, but when you break it up into a header.php and footer.php what parts other than the code, logo and such do you put in the header and what code goes into the footer?
Title: Re: Integrating the forum into your site...
Post by: Col on December 02, 2005, 04:09:11 PM
No part of the existing template goes inside the footer and header php files. Only place what you want to appear in the header and footer in those files. All I have in my header is my logo with a background, and a copyright notice in my footer. I guess that if you want forum elements in your header or footer, you would have to use the cool method, but I imagine SSI would work if you have employed the simple method.
Title: Re: Integrating the forum into your site...
Post by: Karrit on December 02, 2005, 10:21:16 PM
Oh no. I was referring to the HTML code in my site's template. Not the forum template itself.
Title: Re: Integrating the forum into your site...
Post by: Col on December 03, 2005, 11:12:09 AM
Hi,

I think I left in most of what could be removed according to the instructions posted by Unknown. I removed the up-shrink option, the key stats, and resized the newsbox. Anyway, these are the main bits of code I used. You will need to adjust them for your purposes.

In the main template I made the folling changes:

</head>
<body>';
   include('header.php');

   echo '


and...

   include('footer.php');
   echo '
   </body>
</html>';


In the style.css file code I added the following:

#hdr{
height:100px;
border-bottom:1px solid #CC66FF;
width:100%;
background-image: url(YOUR BACKGROUND IMAGE.jpg);
color: #333333;
margin:0;
}


#ftr {
width: auto;
padding: 10px 0 0 0;
height: 20px;
border: solid #cc66ff;
border-width: 1px 0 0 0;
background:#eeeeee;
color: #333333;
margin:0;
font-size: 10px;
}


If your BG image is in the same directory, you need only code:

background-image: url(IMAGE NAME.jpg);

I the created the files 'header.php' and 'footer.php'. I placed them in my top forum directory.

header.php:
<div id="hdr"><img src='http://www.YOURSITE.COM/forum/logo.gif' /></div>

I found that I had to use the URL for the logo image when I switched to search-friendly URLs. Otherwise, relative path would be fine.

footer.php:
<div id="ftr" align="center">Copyright © YOURSITE.COM YYYY-YYYY
</div>



Obviously, you include your own details where I've used UPPERCASE, and you will probably have to adjust the values in the CSS to match your site.

Hope that helps.
Title: Re: Integrating the forum into your site...
Post by: Leipe Po on January 01, 2006, 10:15:00 PM
is this still compatible for RC2? so i wont delete anyting crucial?
Title: Re: Integrating the forum into your site...
Post by: stephFL on January 18, 2006, 05:08:03 AM
Hi,

i understand that i need to have the below code in the "template_main_above()" function

include('header.php');

and the below code in template_main_below() function

include('footer.php');


However, is there any way that i can have this two code right at the top. Example:



<?php
$COMMON_CONSTANT_PATH 
$_SERVER["DOCUMENT_ROOT"]."/common/constant/constant.php";
include_once(
$COMMON_CONSTANT_PATH);

include(
'header.php');
include(
'footer.php');

.
.
.
.
.
.

?>




I got a different layout. Whereby my header and footer are nicely layout, but my forum only appear right below my footer instead of the actual between header and footer.

Can anyone help me ? Any help is very much appreciated.

Regards,
Steph..


Title: Re: Integrating the forum into your site...
Post by: largefoot on January 20, 2006, 01:50:38 PM
Wow I used your simple method and it works great, I am making a mental health community http://www.wearecion.org
the forum is at http:// www.weaecion.org/forum

thanks, does language support require I use the second method? I didnt remove the header info.
Title: Re: Integrating the forum into your site...
Post by: jeepers on January 20, 2006, 06:40:12 PM
SOOOOOOO AWESOME!!!!!!

The person that started this post should be awarded some kind of award.  My site is finally starting to take shape now and startin to rock.

I do have a problem though, for the SSI pages i chmoded the SSSI.php file to 777 because i kept getting an error when using that code you wrote for the pages.  So after I ch modded it I'm getting a new set or errors which ill post now:


Warning: template_site_above(header.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402

Warning: template_site_above(header.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402

Warning: template_site_above(): Failed opening 'header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402
some stuffs go here.
Warning: template_site_below(footer.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409

Warning: template_site_below(footer.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409

Warning: template_site_below(): Failed opening 'footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409


Anyone have a clue about this... I can honestly say i'm just starting now to learn PHP and I would like to learn how to fix this, also if anybody has the time explain what happened.

Greatly appreciated!
Josh

P.S. For anybody thats about ready to start doing there site you can see how cool mine is  :-* http://www.9212radio.com (http://www.9212radio.com)
Title: Re: Integrating the forum into your site...
Post by: vibez on January 28, 2006, 08:11:54 AM
Thank you so much for this guide. Its fantastic. There does seem to be a problem though. I followed the guide to the letter. I'm using smf 1.1rc2.

When I try to validate my site using http://validator.w3.org/

I get a bunch of errors.

See them here
http://validator.w3.org/check?uri=http%3A%2F%2Fvibez.co.uk%2Fforums%2Findex.php

My site is www.vibez.co.uk/forum/

here is my index.template.php

Can anyne help me sort out those errors please

<?php
// Version: 1.1 RC2; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.


echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">'
;

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" style="margin: 4px;" alt="'$context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<img src="'
$settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>'
;


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';


if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();


// The main content should go here.
echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Work out where we currently are.
$current_action 'home';
if (in_array($context['current_action'], array('admin''ban''boardrecount''cleanperms''detailedversion''dumpdb''featuresettings''featuresettings2''findmember''maintain''manageattachments''manageboards''managecalendar''managesearch''membergroups''modlog''news''optimizetables''packageget''packages''permissions''pgdownload''postsettings''regcenter''repairboards''reports''serversettings''serversettings2''smileys''viewErrorLog''viewmembers')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' 'profile' 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first 'last';
$last 'first';
}
else
{
$first 'first';
$last 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' 
$first '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</td>' 
$current_action == 'home' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'help' 'active_back' 'back' '">
<a href="'
$scripturl'?action=help">' $txt[119] , '</a>
</td>' 
$current_action == 'help' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The end of tab section.
echo '
<td class="maintab_' 
$last '">&nbsp;</td>
</tr>
</table>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
global $settings$buttons$context$txt$scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'last' 'first' '">&nbsp;</td>
<td class="'
$direction == 'top' 'main' 'mirror''tab_back">'implode(' &nbsp;|&nbsp; '$button_strip) , '</td>
<td class="'
$direction == 'top' 'main' 'mirror''tab_' $context['right_to_left'] ? 'first' 'last' '">&nbsp;</td>';
}
function 
template_site_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />
'
$context['html_headers'], '
</head>
<body>'
;

include('header.php');
}

function 
template_site_below()
{
global $context$settings$options$scripturl$txt$modSettings;

include('footer.php');

echo '
</body></html>'
;
}
?>

Title: Re: Integrating the forum into your site...
Post by: bloc on January 28, 2006, 08:28:47 AM
Quote from: stephFL on January 18, 2006, 05:08:03 AM
Hi,

i understand that i need to have the below code in the "template_main_above()" function

include('header.php');

and the below code in template_main_below() function

include('footer.php');


However, is there any way that i can have this two code right at the top. Example:



<?php
$COMMON_CONSTANT_PATH 
$_SERVER["DOCUMENT_ROOT"]."/common/constant/constant.php";
include_once(
$COMMON_CONSTANT_PATH);

include(
'header.php');
include(
'footer.php');

.
.
.
.
.
.

?>




I got a different layout. Whereby my header and footer are nicely layout, but my forum only appear right below my footer instead of the actual between header and footer.

Can anyone help me ? Any help is very much appreciated.

Regards,
Steph..



Did you put the include('header') into the template_main_above? and include('footer.php') in template_main_below?

They NEED to be like that, becuase when template_main_above function ends, the forum bit starts. So in order to have a footer at the actual bottom, you need to put that AFTER main_above has ended: in main_below.
Title: Re: Integrating the forum into your site...
Post by: bloc on January 28, 2006, 08:32:35 AM
Quote from: vibez on January 28, 2006, 08:11:54 AM
Thank you so much for this guide. Its fantastic. There does seem to be a problem though. I followed the guide to the letter. I'm using smf 1.1rc2.

When I try to validate my site using http://validator.w3.org/

I get a bunch of errors.

Normally you need to just go through one validation error at a time and sort it out...

But as far as I can see it seems you are including a header? with its own <doctype> and <html> tags. That will render a error in the validation, because SMF already outputs those in the template. So strip your template for these things, or change the included files so that only one set of these are rendered.
Title: Re: Integrating the forum into your site...
Post by: bloc on January 28, 2006, 08:35:59 AM
Quote from: jeepers on January 20, 2006, 06:40:12 PM
SOOOOOOO AWESOME!!!!!!

The person that started this post should be awarded some kind of award.  My site is finally starting to take shape now and startin to rock.

I do have a problem though, for the SSI pages i chmoded the SSSI.php file to 777 because i kept getting an error when using that code you wrote for the pages.  So after I ch modded it I'm getting a new set or errors which ill post now:


Warning: template_site_above(header.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402

Warning: template_site_above(header.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402

Warning: template_site_above(): Failed opening 'header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 402
some stuffs go here.
Warning: template_site_below(footer.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409

Warning: template_site_below(footer.php): failed to open stream: No such file or directory in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409

Warning: template_site_below(): Failed opening 'footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jeepxj86/public_html/forum/Sources/Load.php(1040) : eval()'d code on line 409


Anyone have a clue about this... I can honestly say i'm just starting now to learn PHP and I would like to learn how to fix this, also if anybody has the time explain what happened.

Greatly appreciated!
Josh

P.S. For anybody thats about ready to start doing there site you can see how cool mine is  :-* http://www.9212radio.com (http://www.9212radio.com)

It would seem your included files can't be found or have some errors in them. Check the paths maybe?
Title: Re: Integrating the forum into your site...
Post by: vibez on January 28, 2006, 09:40:27 AM
Quote

Normally you need to just go through one validation error at a time and sort it out...

But as far as I can see it seems you are including a header? with its own <doctype> and <html> tags. That will render a error in the validation, because SMF already outputs those in the template. So strip your template for these things, or change the included files so that only one set of these are rendered.

I did try that. but when I tried to sort out the errors, I ended up butchering my header :(

Here is my header. Can you see anything that will cause problems when using your method?

http://test.vibez.co.uk/
Title: Re: Integrating the forum into your site...
Post by: bloc on January 28, 2006, 09:48:13 AM
I can only see parts of it..but the source code show no opening <head> tag and doctype is missing...

You should ideally just include('header.php') right after <body> in the forum's index.template..and move any <head> stuff in header.php into the same template. The header.php would then just be the divs, no head or body tags at all.
Title: Re: Integrating the forum into your site...
Post by: vibez on January 28, 2006, 11:24:08 AM
Sorry that previous link is just the header.php on its own. Not merged into the index.template.php. I was just showing you that my stripped down header doesnt include any head or body tags.

this is it merged into the default  index.template.php

http://www.vibez.co.uk/forum/
Title: Re: Integrating the forum into your site...
Post by: vibez on January 30, 2006, 04:34:03 AM
Ok i've investigated a little deeper and I think the code you have told us to add into the index.template.php at the end, isn't fully xhtml compatible?

I've followed your guide for the cooler way and this time I've included a completely blank header.php file. Surely this should prove that the code you have told us to paste into the template is no longer xhtml valid with smf 1.1rc2?

Who knows, i'm losing my mind with this   :-\ :-\ :-\
My site is www.vibez.co.uk/forum

Here is my edited index.template.php

<?php
// Version: 1.1 RC2; index

/* This template is, perhaps, the most important template in the theme.  It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below.  It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = false;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = false;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = false;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.


// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">';

// The logo and the three info boxes.
echo '
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">'
;

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="'
$settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' 'left'';" alt="" />';
if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" alt="'$context['forum_name'], '" border="0" />';

echo '
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/userinfo.gif" style="position: absolute; left: '$context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' '-1px''; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>'
;

if (!empty($context['user']['avatar']))
echo '<td valign="middle">'$context['user']['avatar']['image'], '</td>';

echo '<td valign="top" class="smalltext" style="width: 100%; font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
echo '.<br />';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}

echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
'
$txt['welcome_guest'], '<br />
'
$context['current_time'], '<br />

<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<div style="text-align: right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
<input type="hidden" name="hash_passwrd" value="" />
</div>
</form>'
;
}

echo '
</td></tr></table>
</div>

<form action="'
$scripturl'?action=search2" method="post" style="margin: 0;">
<div style="margin-top: 7px;">
<b>'
$txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 8ex;" />&nbsp;
<a href="'
$scripturl'?action=search;advanced">'$txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</div>
</form>

</td>
<td style="width: 262px; '
, !$context['right_to_left'] ? 'padding-left' 'padding-right'': 6px;" valign="top">';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">'
$context['random_news_line'], '</div>
</div>'
;

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="'
, !$context['browser']['is_ie'] ? 'min-height: 35px;' 'height: 4em;'' padding: 5px;" class="smalltext">
<b>'
$context['common_stats']['total_posts'], '</b> '$txt[95], ' '$txt['smf88'], ' <b>'$context['common_stats']['total_topics'], '</b> '$txt[64], ' '$txt[525], ' <span style="white-space: nowrap;"><b>'$context['common_stats']['total_members'], '</b> '$txt[19], '</span><br />
'
$txt[656], ': <b> '$context['common_stats']['latest_member']['link'], '</b>
</div>
</div>'
;

echo '
</td>
</tr>
</table>

<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0;" border="0" /></a>';

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>'
;

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '</td>
</tr></table>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>'
;

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;
}

echo '
// ]]></script>'
;
}
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num 0)
echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
}

echo '</span>';
}

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

// Show the [home] and [help] buttons.
echo '
<a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" style="margin: 2px 0;" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=help">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" style="margin: 2px 0;" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" style="margin: 2px 0;" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" style="margin: 2px 0;" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" style="margin: 2px 0;" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];

// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" style="margin: 2px 0;" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" style="margin: 2px 0;" border="0" />' $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" style="margin: 2px 0;" border="0" />' $txt[108]), '</a>';
}

// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip$direction 'top'$force_reset false$custom_td '')
{
global $settings$buttons$context$txt$scripturl;

if (empty($button_strip))
return '';

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' '') . $value['image'] . '" alt="' $txt[$value['text']] . '" border="0" />' $txt[$value['text']]) . '</a>';

$button_strip[$key] = $buttons[$key];
}

echo '
<td '
$custom_td'>'implode($context['menu_separator'], $button_strip) , '</td>';
}
function 
template_site_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />
'
$context['html_headers'], '
</head>
<body>'
;

include('header.php');
}

function 
template_site_below()
{
global $context$settings$options$scripturl$txt$modSettings;

include('footer.php');

echo '
</body></html>'
;
}
?>


and here are my errors

This page is not Valid XHTML 1.0 Transitional!

Below are the results of checking this document for XML well-formedness and validity.

   1. Error Line 10 column 58: document type does not allow element "div" here; assuming missing "object" start-tag.

      <div id="headerarea" style="padding: 12px 30px 4px 30px;">

      ✉
   2. Error Line 184 column 6: end tag for element "body" which is not open.

      </body></html>

      The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

      If this error occured in a script section of your document, you should probably read this FAQ entry.

      ✉
   3. Error Line 184 column 13: end tag for "object" omitted, but OMITTAG NO was specified.

      </body></html>

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

      ✉
   4. Info Line 10 column 1: start tag was here.

      <div id="headerarea" style="padding: 12px 30px 4px 30px;">

   5. Error Line 184 column 13: end tag for "head" omitted, but OMITTAG NO was specified.

      </body></html>

      ✉
   6. Info Line 2 column 6: start tag was here.

      <html><head>

   7. Error Line 184 column 13: end tag for "html" which is not finished.

      </body></html>

      Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

      Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
Title: Re: Integrating the forum into your site...
Post by: Mr.Doro on February 09, 2006, 01:50:19 PM
Hi, i Want to Intergrate such things as Lastest Posts and such into a Joomla Based Website, could anyone help me with this?

Thanks
Doro
Title: Re: Integrating the forum into your site...
Post by: jrcarr on February 09, 2006, 11:18:10 PM
[Unknown] or anyone with any thoughts on this:

What would need to be added to the code in either of the two methods listed by [Unknown] in the first two posts, to limit access of the page to just selected groups?

Jack
Title: Re: Integrating the forum into your site...
Post by: Acf on February 10, 2006, 05:07:26 AM
Have you tried?:
http://www.simplemachines.org/community/index.php?topic=14906.0
I am sure your anwser is there. ;)
Title: Re: Integrating the forum into your site...
Post by: jrcarr on February 10, 2006, 10:13:01 AM
Thank you!  Yes, my answer was there and the answer to many other questions I have had.  I've used the last version of Yabbse for quite some time on one site and have SMF on another.  The Yabbse site has required that I do a number of code changes inside key /Source/ files to get some things in yabbse to do things that SMF now does as standard features.  However, trying to upgrade this site to SMF has been an intimidating idea, because of all the code changes I have had to make.  The use and changes in the SSI.php file and just taking time to really read through it, solves about 95% of the reasons that I haven't been able to update this forum in the past.  I believe that with a little further reading and research of the SMF site,  I will be able to solve the other 5% of my problems.  With this, I will be able to do upgrades as they come out and not have to worry about breaking the rest of my site at: www.carrscorner.com .  I have created a membership site using the login information from the forum, limiting access to several items based on the member's group.   Anyway, to keep a long story short, I am highly impressed with SMF and the direction it has taken and will be upgrading shortly after pre-preparing some pages so that they will still be accessible by the right group/s once the upgrade is completed.

Jack
Title: Re: Integrating the forum into your site...RC2
Post by: Confused Too on February 16, 2006, 05:48:20 PM
Is there a simple method to intigrate a forum entirely into a site yet leaving the users the ability to change their themes as they choose?
I have had RC1 running on my site for a while now and found it a little fiddly to change all the themes then along comes RC2 which doesn't appear to work correctly.  However, I have decided to use the default themes but wrap it into an iframe on another HTML document.  However, this is a problem for screen readers.
I have been using Active Scripts ActiveBook and they have a great method for integration.  They simply provide a box for the code to go before the book and another for the code to end it.  As long as you only use the code from body down to the start of your forum and then the other end of the HTML goes into another box and save.  Hey presto you have just wrapped your guestbook in your own site template?

Now knowing how complex and intigrated the SMF forums can be I am sure there must be another more simple way to do it than all the ways discussed here which would have have the robustness to withstand any upgrades or updates :D
Title: Re: Integrating the forum into your site...
Post by: jrcarr on February 16, 2006, 06:23:06 PM
HuttonIT,

I am by no means and expert at HTML, PHP, Themes, templates..... I know a little about a lot and alot about nothing.  ;)
Anyway, if you had seem my site at: www.carrscorner.com last Saturday morning and then later at about 10 pm that night, you would have seen little to no visible difference in the site.  At noon Saturday, I started upgrading by extremely modified Yabbse 1.5.5 board to SMF 1.0.6  The actual upgrade of the forum went pretty much as smooth as any upgrade I've done.  However, because of the excessive modification to Source files in Yabbse and creating my own template that wraps around it and all other pages on my site, getting the site back to it's original look was a scary thought.  I haven't worked with themes much in the past and so had to figure that out and how to make it look like the Template I had made for the site.  With some reading of the various topics here in the Themes section and learning about how to use the SSI.php file I was able to not only get my site back to the look my users were use to seeing, but most all of my intergrations and modifications were able to be solved and in most cases improved.  Much of the changes to the Theme came from adding includes of my original template into the right Template files in Themes/mytheme/.  As I said, it took a little reading, but now all is well.  In the next week or so I will make the necessary changes to the other Themes, so that my template for the Header, left menu and footer just wraps around the theme design.  In some cases this is going to cause some ugly color combinations, but that will still be at the option of each user and the theme they decide to select.  At this time, they are not give an option, but as I make each conversion, I'll add that them as an option.  The Themes in SMF are actually much simplier to modify than I ever expected and will eventually be able to make my Template be able to change colors with CSS so that it matches the other Theme colors.

Jack
Title: Re: Integrating the forum into your site...
Post by: Confused Too on February 17, 2006, 05:14:55 AM
jrcarr,
I appreciate that it can be done but every time there is an upgrade you have to go through the whole process again.  How about a simple method which lends SMF to integration as a standard feature instead of messing about with the code for every theme.
I already have RC1 themes customised but with the new release I have decided that I haven't got the time to keep doing it every time.  The simple option would be to build into the basic code of SMF the ability to use the top and bottom files if you want to.  It would also mean that if you re-design your site all you have to do is edit those files and nothing else changes.
I have decided that until this is available I will use an ilayer and point users to that.  The only other difficulty is that the links sent out to people will take them to the unwrapped version of the forum.  Where as if this were part of the SMF coded intigration would not happen.
Title: Re: Integrating the forum into your site...
Post by: jrcarr on February 17, 2006, 09:59:15 AM
Well, I guess that what I haven't had the opportunity to see, is whether with each up grade they make changes to the template system or not.  Since I have now created my own theme and named it different than the "Default" or Classic", I'm figuring that the upgrades won't be over writing those files, so the worse case scenerio would be to have to make some adjustments to my themes.  Before, I had re-written actual code in Source files for the Forum, so there was no doubt that the files were going to be over-written. 
The tendency to make changes to everything with each upgrade is one of the reasons I don't upgrade with every single new version that releases.  I manage two websites that require enough time to keep operating, add new features, write newsletters, answer questions.....to have to be taking time to make theme, template or programming changes for every upgrade that releases too.
I all fairness though, this is a problem with many of the Open-Source programs.  When adding new features or improving old features, causes changes to template files, so most time previous template files won't work with new releases.
Even when I had a template design that wrapped itself around SMF, the same template would have to be adjusted a little to wrap around Coppermine and just a little change to wrap around my own pages.  I was having to have 3-4 different set of Header and footer files depending on the need of the give program I was trying to wrap my template around.  Even doing this, my site that has been running SMF since the first release, required adjustments to my Header and footer files to get new releases/versions to work most of the time.
So there is not perfect solution to this problem.  You are going to find that there will be some adjustments to make everytime SMF or any other software you are using releases a new version.  It's kind of like, "Death and Taxes".  ;D

Jack
Title: Re: Integrating the forum into your site...
Post by: Confused Too on February 17, 2006, 03:44:16 PM
Quote from: jrcarr on February 17, 2006, 09:59:15 AM
So there is not perfect solution to this problem.  You are going to find that there will be some adjustments to make everytime SMF or any other software you are using releases a new version.  It's kind of like, "Death and Taxes".  ;D
LOL - Your right but running a forum which requires accessability I have to offer various colour, text only and screen reader friendly templates which all have to be edited to allow the updates.  It would be nice to simply use my site template cut in half to wrap seamlessly around the themes each time so when I do perform an upgrade there is no messing about except importing the new compliant themes in the colours and options offered.
The actual software is the best I have ever seen and I was a skeptic about SMF only 6 months ago now I am completely sold on it and find it exceptionally user friendly and intuitive to use.
I suppose this may be an option someone will build into future releases in the future.
Title: Re: Integrating the forum into your site...
Post by: Enigma on March 08, 2006, 04:55:02 PM
Can someone explain to me in simple terms how I can have tabs (like on this forum) that I can use that will point to pages outside of the forum and still keep the tabs for navigation?
Title: Re: Integrating the forum into your site...
Post by: sydbat on March 14, 2006, 01:05:32 PM
I want to thank everyone (especially [Unknown]) for their help in showing the steps for integrating SMF into my website (CAPI Forum (http://forum.capi7.ca/index.php)). I used the "simple" tutorial provided and then followed my nose to get exactly what I wanted. Some day I'll try the "cooler" way.

I made a backup of the default theme, renamed it, and played with the code. I left everything in place. In <head>, before the SMF javascript, I added my javascript sources like so:// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />

  <script src="http://www.capi7.ca/menu_array.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/invest.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/foot.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/update.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/mmenu.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>


I replaced the stylesheet with my own hybrid. I took the existing SMF stylesheet and added the elements from my stylesheet to create the container for the the forum.

Then, at the top of the <body>, I added<body>';
echo '<div class="container">';
  echo '<div class="banner" id="logo">
<h1 id="title">Calgary Association of Paranormal Investigations</h1>
  </div>';
echo '<div class="content" id="content">';


This gave me the result I wanted with very little discomfort. Now my contributors can choose if they want the "classic" forum style or the "new and improved" forum default.

One question - When I upgrade to 1.1 RC2 (or any following release), will I have to do all this again?

Once again, thank you all for your well written posts. And thank you Lewis Media for developing SMF!!
Title: Re: Integrating the forum into your site...
Post by: Telnets on March 21, 2006, 02:26:33 PM
ok I know this has been gone over and over, but Im still having issues getting it to sit where its suposed to on my site. I Am trying to use the rc2 package and follow these instructions but its not going very well.. Ive noticed a few small "Differences" in your examples and in the code. Is this tutorial written for 1.0.6 perhaps? Maybe thats my issue there.

Basicaly, i want to throw the forums in the <td> call i have where my content is suposed to go. I have a header.php and a footer.php file that wraps the site around any content i have right now. It all works awsome. Except when i try to put the forums in there.

Ive followed the directions you posted to the letter (minus the issue with the code not being exact). I can get it into the table i need.. however when it does go in there, the footer tables that close off the cells from the header are all messed up. Almost like the forums software has an extra </td> call or something. Thats about as close as i can get to having it work.

I can however take my index file, which calls my header/footer files.. throw and include to /forums/index.php in the middle, and everything looks exactly how i want it to.. The only issue with doing that of course is it all looks well and fine.. untill you click on a topic or option and it sends it full screen.

If there is any other suggestions, or ways to get this working i would love to hear it. Ive tried BOTH meathods you have posted and so far no luck. I can get things going with a silly <iframe> call.. but unfortunatly thats not a good way of doing this, and i would like the include to be working properly.

Even if there is anyone that has sucessfully wrapped thier site around thier forum that could take a look at mine through PM which i could give you the passwords to poke around or something?

Thanks very much. Im trying 1.0.6 now to see if it might work any better.
Title: Re: Integrating the forum into your site...
Post by: Leipe Po on March 24, 2006, 02:28:38 PM
http://www.phpscripters.net

its completly intergrated
Title: Re: Integrating the forum into your site...
Post by: Eleazar on March 26, 2006, 10:28:00 AM
I did the simple method, but I get an error for line 2 of index.template.php.

This is line 2 in that file: <html><head>

Line 1 is: <?php

Is this correct????
Title: Re: Integrating the forum into your site...
Post by: jrcarr on March 26, 2006, 11:51:28 AM
There should be an echo ' before and  a '; after those.  In my index.template.php there is actually a lot of html code that is surronded by an echo ' {html code} '; (no curly bracket).

You either need to close the <?php with a ?> then have the html code and then when there is more PHP you start a new <?php or use the echo statement to surround the html code.

Jack
Title: Re: Integrating the forum into your site...
Post by: Eleazar on March 26, 2006, 04:05:04 PM
Thanks man! That's what I needed.

Now, I have a new error on line 188: syntax error, unexpected '}'

I removed the }, but it doesn't display the board correctly then.
The board can be seen here (http://calvarywv.com/board/Themes/Integrated%20Test/index.template.php).
Title: Re: Integrating the forum into your site...
Post by: jrcarr on March 26, 2006, 05:17:26 PM
I find that many times error messages like this indicate I have forgotten to add a the closing to an Echo. (';) Also, if you have any single quotes inside the echo statement, you need to add a back-slash. Example:


<?php
echo '
<a href="example.php">This isn'
t right</a>';

echo'
<a href="example2.php">It\'s like this</a>';
?>



Jack
Title: Re: Integrating the forum into your site...
Post by: fous on March 29, 2006, 07:53:22 AM
Hi im brand new to php and am building my website. I keep trying to integrate the SMF forum into my site template but can't seem to do it. I don't even know how to split up the template into the header.php and footer.php .

so my website is www.thetechnicaltrader.net (http://www.thetechnicaltrader.net) Basically i want the SMF forum to sit in the middle there below the flash intro and to the right of the nav bar on the left while also including the disclaimer at the bottom.

I have my template made right now, which is just the top flash intro,side nav bar, and the bottom disclaimer and no content in the middle, but don't know how to properly split it into the header.php and footer.php file

Here is the XHTML file for my template. Now how to i split this up?
Quote
<!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">
<html>
<head>
<title>TheTechnicalTrader.net [ Your Guide to Technical Analysis ]</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<style type="text/css">
<!--
td {
   font-family: Tahoma;
   font-size: 11px;
   color: #333366;
   text-decoration: none;
   border: none;
}
img {
   text-decoration: none;
   border: none;
}
.data {
   font-family: Tahoma;
   font-size: 10px;
   color: #000066;
   text-decoration: none;
   border: none;
}
a {
   font-family: Arial, Helvetica, sans-serif;
   font-size: 11px;
   color: #FFFFFF;
   text-decoration: none;
   border: none;
}
.links {
   font-family: Tahoma;
   font-size: 11px;
   color: #FFFFFF;
   text-decoration: none;
   border: none;
}
body,td,th {
   font-size: 11px;
}
.style15 {color: #FF0000}
.style16 {font-size: 10px}
body {
   background-image: url(images/main_bg.jpg);
   background-color: #FFFFFF;
   background-repeat: repeat;
}
a:visited {
   color: #FFFFFF;
}
a:hover {
   color: #FF0000;
}
a:active {
   color: #FF0000;
}
.style20 {
   font-size: medium;
   color: #FF0000;
}
.style22 {color: #FFFFCC}
.style37 {color: #0000FF}
.style41 {
   color: #FFFF00;
   font-family: Arial;
   font-weight: bold;
   font-size: small;
}
.style50 {color: #FFFFFF}
.style56 {color: #00FF00}
.style58 {
   color: #000000;
   font-size: 10px;
   font-family: Arial;
}
.style59 {color: #FFFF00; font-family: Arial; }
.style60 {color: #FFFF00; font-family: Arial; font-size: 10px; }
.style61 {font-family: Arial; font-size: 11px; color: #000000; text-decoration: none; border: none; }
.style62 {
   color: #000000;
   font-family: Arial;
}
.Links2 {font-family: Arial}
.style65 {
   color: #FF0000;
   font-weight: bold;
   font-size: 11px;
   font-family: Tahoma;
}
.style66 {color: #000000}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="780" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"  bgcolor="#FFFFFF">


  <tr>
    <td width="780" height="20" align="center" valign="top" bgcolor="#FFFFFF"><table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <th colspan="2" scope="col"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="128" title="introflash">
            <param name="movie" value="Flash/0307intro.swf" />
            <param name="quality" value="high" />
            <embed src="Flash/0307intro.swf" width="780" height="128" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
          </object></th>
        </tr>
        <tr>
          <th width="120" height="0" align="center" valign="top" background="images/transparentquote.png" bgcolor="#0B43A1" class="links" scope="row"><table width="120" border="0" cellpadding="2">
            <tr>
              <td bgcolor="#0B43A1" scope="col"><div align="center"><img src="images/menu.png" alt="menu\" width="110" height="15" /></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><a href="index.php"><u>Home</u></a></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Login</u></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Register</u></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Message Board </u></div></td>
            </tr>
           
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Contact us </u></div></td>
            </tr>
            <tr>
              <td align="center" valign="top"><div align="left"><img src="images/portfolios.png" alt="port" width="110" height="15" /></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Speculation Chamber </u></div></td>
            </tr>
           
            <tr>
              <td align="center" valign="top"><div align="center"><img src="images/menuedu.png" alt="menuedu" width="110" height="15" /><br />
                  <span class="style15">(Coming Soon!)</span></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Chart Patterns </u></div></td>
            </tr>
            <tr>
              <td align="center" valign="top" class="links"><div align="left" class="Links2"><u>Candlestick Theory </u></div></td>
            </tr>
          </table>         
            <table width="120" height="69" border="1" cellpadding="1" bordercolor="#00FF00">
              <tr>
                <td colspan="2"><img src="images/chat.png" alt="chat" width="110" height="15" /></td>
              </tr>
              <tr>
                <td colspan="2" align="center" valign="top" background="chat.php" class="Links2"><div align="left"><a href="chat.php"><U>Enter Chat Room </u></a></div></td>
              </tr>
              <tr>
                <td width="56" class="Links2"><u><span class="style65">Users In: </span></u></td>
                <td width="54" bgcolor="#D9DEFF" class="style15"><script  type="&quot;text/javascript&quot;"  language="JavaScript"src="http://www.everywherechat.com/users.asp?room=The_Technical_Trader"></script></td>
              </tr>
              <tr>
                <td colspan="2" class="style50"><u class="style65">Members Chatting: </u> </td>
              </tr>
              <tr>
                <td colspan="2" bordercolor="#CCCCCC" bgcolor="#D9DEFF" class="style15"><script type="text/javascript" language="JavaScript"src="http://www.everywherechat.com/members.asp?room=The_Technical_Trader"></script>                </td>
              </tr>
          </table></th>
          <th width="656" align="center" valign="top" background="Drag to a file to choose it." bgcolor="#FFFFFF" scope="row"><table align="middle" width="660" border="0" cellpadding="1">
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table>
          </th>
        </tr>
       
        <tr>
          <td width="780" height="15" colspan="2" align="center" valign="top" nowrap="nowrap" bgcolor="#0C3E96" class="links" scope="row">Home | Message Board | Chat | Chart Patterns | Candlestick Theory | Contact Us          </td>
        </tr>
        <tr>
          <th colspan="2" align="center" valign="top" bgcolor="#CCCCCC" class="links" scope="row"><div align="left" class="style16"><span class="style66">Disclosure: Please read:</span>The technical trader.com service provided is for educational purposes only. Please be advised that our team is by no means SEC licensed brokers or financial advisors and are simply sharing trading ideas based off of our own experience. The technicaltrader.com and its owners certify that we do share our stock picks with the public so that they can trade using our portfolio as a guide. Futhermore Thetechnicaltrader.net and its owners certify that we may or not have an actual position in a stock that we recommend at any given time and may be held in part of a virtual portfolio. Thetechnicaltrader.net and its owners further certify that we trade the securities exactly as stated in our analysis. Trading the stock market is not an easy task, there is much risk involved and you can lose alot of money. Our site is designed to help you through the difficulties invovled in trading the stock market and help you develop profitable trading methods. We strongly advise to not make decisions based soley on our analysis. Thetechnicaltrader.net offers no guarantees and is not held liable for any losses you may incur. Do your own due diligence and make informed decisions. </div></th>
        </tr>
      </table>
    Thetechnicaltrader.net © 2006</td>
  </tr>
</table>

</body>
</html>

and so now when i split this up should it have <body> and <head> tags included etc included when i make the new php document? or should i just copy and paste what i divide up here into a completley blank document? Im really lost here so the more detailed instructions the better.

When i was placing the Include function the first time into the index.template file where "unknown" stated to place it the nav bar and base of the page was being displayed up above the smf forum and the flash wasnt showing up even though i had the flash file placed into the forum folder.

Much help needed here will greatly appreciate some feedback.

-fous

When
Title: Re: Integrating the forum into your site...
Post by: silverdragonrs on April 14, 2006, 09:49:36 PM
I would like to just add a link/button to the top (home, calender, etc) that links the forum to my existing site..... also.... i there any way i can change "home" to say "Forum Home" so that people don't think that "home" meens the beginning of my site?

I know this is simple stuff but I no absolutely nothing about php much less SMF editing... and only know basic html....

and is there a way to just sub my own graphics with those of an existing theme?...... I am not interested in changing the layout and functions and all that... just want an original look.... (make the home button round instead of square kinda thing... or look like a dragon head or eyeball sorta thing.... ) if so please point me to the right place.... if not...... anyone care to help a fella?..... I am willing to exchange graphics for services.....


thanks,
danny
Title: Re: Integrating the forum into your site...
Post by: jrcarr on April 14, 2006, 10:51:47 PM
Hello Danny,

I you will find your index.template.php file, located in Themes/yourtheme and scroll to the bottom of the file, you will find a function called template_menu.  It will look something like the following.

function template_menu()
{
global $context, $settings, $options, $scripturl, $txt, $user_info;

// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" border="0" />' : $txt[119]), '</a>', $context['menu_separator'], '
                <a href="http://www.carrscorner.com/gallery"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/gallery.gif" border="0"></a>', $context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


    // added code for viewing Pro information (Jack)
    if (in_array(1, $user_info['groups']) || in_array(30, $user_info['groups']) || in_array(28, $user_info['groups'])) {
        echo '
        <a href="http://www.carrscorner.com/yabbse/membertools/promemberfunc.php"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/proinfo.gif" border="0"></a>', $context['menu_separator'];
        echo '
        <a href="http://www.carrscorner.com/yabbse/membertools/suppliers.php"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/suppliers.gif" border="0"></a>', $context['menu_separator'];
        }

    // added code for Chat and Newsletter Systems (Jack)
        if (in_array(1, $user_info['groups']) || in_array(30, $user_info['groups'])) {
        echo '
        <a href="http://www.carrscorner.com/yabbse/chat.php"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" border="0"></a>', $context['menu_separator'];
        echo '
        <a href="http://www.carrscorner.com/yabbse/Newsletter/4-06.php"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/newsletter.gif" border="0"></a>', $context['menu_separator'];
        }
    // end added code for Chat System


// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" border="0" />' : $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" border="0" />' : $txt[108]), '</a>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
    {
echo '<br>
<a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forumadmin.gif" alt="' . $txt[2] . '" border="0" />' : $txt[2]), '</a>', $context['menu_separator'], '
<a href="http://www.carrscorner.com/admin"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/siteadmin.gif" border="0"></a>', $context['menu_separator'];
    }

}


This is a lot less greek than it looks.  It is basically HTML with some php variable stuck in it.  You will recongnize the <a> and <image> tags and with a little looking you can figure out which ones are which.  You can see a couple extra images and links in the above code that I have added to my site.  You can see with this link and button
        <a href="http://www.carrscorner.com/yabbse/Newsletter/4-06.php"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/newsletter.gif" border="0"></a>', $context['menu_separator'];

That I changed the href= to the url of one of my newsletters and with the graphic for the button, I just put a copy of it in the YabbImages folder and changed the end of one of the other button images code to point to my newletter.gif file.  You of course could get rid of all the php variable and point directly to any folder containing your images.

Hope this helps some.

Jack
Title: Re: Integrating the forum into your site...
Post by: sturgis on June 08, 2006, 02:54:22 PM
Can you add just a link at the top of the page?  how?
Title: Re: Integrating the forum into your site...
Post by: silverdragonrs on June 12, 2006, 03:49:42 PM
ok.. thanks... i have another integration issue.... a couple of them actually... i was using the forum on my own server but for the sake of bandwidth moved it to another faster one.. all is well but now i can't link to the ssi.php anymore...my site is on my server and my forum on another.... how can i call/ access the ssi.php for functions like login on the home page... recent topics... so on... if i try a direct link/include/call the ssi responds with a do not link directly to the ssi.php error... so i did this... i created an includes folder on the other server (with forum on it) and put in that folder logininclude.php... in that file is a simple ssi call and login include...

now i just include that file where i want the login to be... and it works... but looks off... the login and regester links are there.. but you can see some other coding also... odd..

that wraps up problem number one.....

problem number two is that i want profiles on my website for the customers/members... since smf already has this feature i can use it... but i need to add a few custom fields... like a member journal... that they can mark public or not.. and create a browser for other members to search/browse member profiles from an out of forum page..... logged in or not...doesnt matter... actually... ill post problem two on the mods and scripts boards...

thanks peeps... have a good one..
danny
Title: Re: Integrating the forum into your site...
Post by: Legolass on June 19, 2006, 02:54:05 AM
Please help! i've screwed up!

i attempted making my forum look like my site using the 'cooler way' it didnt work and i figured i dont know enough about it all just yet so decided to just backtrack

i re-uploaded my original index.template.php but now i get:
QuoteUnable to load the 'site_above' template.
when i use that theme, the forum works fine in the default theme :S

is it anything to do with the sql query? it took me ages to get that theme the way i wanted, i'd be gutted if i had to start over!  :'(
Title: Re: Integrating the forum into your site...
Post by: crashlab on July 07, 2006, 09:03:18 PM
Is too hard... is impossible!!!  :'(
I dont had never problem to skin forum or portal, but this is impossible!
I had 2 files, header.php (that contains te upper part of my html) and footer.php (that contain the lowest part).... and then? i cant find the parts to remove... is so strange the index.template.php

WHY???????? grrrrrrr!!!  :-[ :'( i would integrate the standard graphics to my actual layout!!! i see results with minibb http://www.smokinglinux.com/forum_old
but I have serious difficult with yours confusonary method and strange template file!!!
Title: Re: Integrating the forum into your site...
Post by: jrcarr on July 08, 2006, 01:38:47 PM
Not impossible, here is my forum with my site template wrapped around it: www.carrscorner.com/yabbse (http://www.carrscorner.com/yabbse)

Jack
Title: Re: Integrating the forum into your site...
Post by: junjimalaza on July 08, 2006, 03:10:09 PM
Jack,

Can you show us the codes, I've made some layout changes to the template, never really thought it can be done, and I didn't have to follow this tutorial, quite confusing if you are using the RC2.

Read about my problems here http://www.simplemachines.org/community/index.php?topic=97837.msg637352#msg637352

and the solution to it here
http://www.simplemachines.org/community/index.php?topic=97837.msg637352#msg637352

Cheers,


Junji
Title: Re: Integrating the forum into your site...
Post by: DLoney on July 09, 2006, 04:27:15 AM
Edit:
Never mind.
I just got the site 100% integrated!
---------------------------------------------

I do have one question though, where is the hex tag for this color, as I want to change it to white to match the rest of my background...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg518.imageshack.us%2Fimg518%2F989%2Fforumcolor1cf.jpg&hash=a7011debefceba715d47ac2f632312e7493aa7a7)

---------------------------------------------
Edit 2:
haha... Never mind. I was having a dead brain moment.
Sorry for the page bump. If you want to see the forum I was working on; it is here...
http://ctrlclick-online.com/forum/index.php (http://ctrlclick-online.com/forum/index.php)
Title: Re: Integrating the forum into your site...
Post by: Leipe Po on July 10, 2006, 12:57:27 PM
well how do you like: www.smf-apps.org/ then?? :P
even got multi theme support working
Title: Re: Integrating the forum into your site...
Post by: Col on July 10, 2006, 04:19:18 PM
Quote from: crashlab on July 07, 2006, 09:03:18 PM
Is too hard... is impossible!!!  :'(
I dont had never problem to skin forum or portal, but this is impossible!
I had 2 files, header.php (that contains te upper part of my html) and footer.php (that contain the lowest part).... and then? i cant find the parts to remove... is so strange the index.template.php

WHY???????? grrrrrrr!!!  :-[ :'( i would integrate the standard graphics to my actual layout!!! i see results with minibb http://www.smokinglinux.com/forum_old
but I have serious difficult with yours confusonary method and strange template file!!!

Hi Crashlab,

I posted what I did a few pages back, I hope it helps:

http://www.simplemachines.org/community/index.php?topic=19638.msg410696#msg410696
Title: Re: Integrating the forum into your site...
Post by: jbeezer on July 17, 2006, 05:27:27 PM
I am wanting to integrate an individual topic into my view.php (that takes an id variable that tells it what entry to pull from sql) page.  I pretty much want to use this nice forum as a fully featured commenting system.  For each new item in my database i want to try and set it up so that a corresponding topic is created, and that topic displayed at the bottom of my content page for that selected item.  Is this possible with SMF?  Idealy i'd like to be able to just do a <? include('smf/index.php?topic=$id') ?> in my view.php.  Somehow i doubt that its this easy.
Title: Re: Integrating the forum into your site...
Post by: hydroboy on August 07, 2006, 11:13:02 AM
Could somone who has either version working in RC2 please post up their index template files and any other changes they made?

I am having real trouble getting it working :(.  I have tried both the simple method and frames method.
Title: Re: Integrating the forum into your site...
Post by: ynneb on August 24, 2006, 10:18:27 AM
This is sheer phucking misery. :P
I have spent more than a week trying to get the bloody thing to work and it wont.
To tell the truth I am yet to see a site that has it done too.
While I appreciate this software I think the design for everyday users is too hard and could be set out better.
I have followed both methods and had heaps of erros and still cant get it to work.
ARRRRRRRRRRRRRR

This should be so simple, I want to put this http://www.machsupport.com/forum/menu/menu.php over http://machsupport.com/forum/index.php using this include code.

Its interesting to see how few sites are truely customised. I wonder if there are lots of people with similar problems who eventually give up trying. It just shouldnt be this hard.
Title: Re: Integrating the forum into your site...
Post by: Leipe Po on August 24, 2006, 12:34:37 PM
Quote from: ynneb on August 24, 2006, 10:18:27 AM
This is sheer phucking misery. :P
I have spent more than a week trying to get the bloody thing to work and it wont.
To tell the truth I am yet to see a site that has it done too.
While I appreciate this software I think the design for everyday users is too hard and could be set out better.
I have followed both methods and had heaps of erros and still cant get it to work.
ARRRRRRRRRRRRRR

This should be so simple, I want to put this http://www.machsupport.com/forum/menu/menu.php over http://machsupport.com/forum/index.php using this include code.

Its interesting to see how few sites are truely customised. I wonder if there are lots of people with similar problems who eventually give up trying. It just shouldnt be this hard.

hey i have drop downs to: http://www.smf-apps.org/

i have used this script: http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm
if you want i can tell you how ife done it?....
Title: Re: Integrating the forum into your site...
Post by: Col on August 24, 2006, 12:48:05 PM
Ynneb,

Here (http://www.simplemachines.org/community/index.php?topic=19638.msg410696#msg410696) is what I did. I used the simple method. My instructions apply to SMF1.0.x, but it should nearly identical for SMF1.1
Title: Re: Integrating the forum into your site...
Post by: ynneb on August 24, 2006, 09:44:36 PM
Just out of interest, should my header.php be constraucted the same as a conventional html page with HTML, Head, and body tags encased in HTML brackets?, but saved as a php instead of a html document?
Title: Re: Integrating the forum into your site...
Post by: Col on August 25, 2006, 01:01:35 PM
All you need do is include the HTML needed, and this will be imported into your page. Don't use a doctype, etc.
Title: Re: Integrating the forum into your site...
Post by: LuminousSpecter on August 26, 2006, 11:12:55 PM
http://waldenfans.com/movies/how/header.php
http://waldenfans.com/footer.php

I'm having trouble understanding the tutorials.  They seem to be written for those with more than just a slight understanding of php, which I have very little.  However, I'm learning, when it comes to this site.

http://www.waldenfans.com/forums/

I'd love to be able to fully integrate this forum into the site, in the same way that I have the gallery integrated.  This looks like the way to do it, but I can't understand the method.  I just don't know if it's clear enough or what, but there seem to be a few missing steps on the listing.  Any help?

Nevermind, I got it figured out.  However, I do have a suggestion.
QuoteYou may notice that there's a lot of stuff in the header of the index template. 
This would probably be more helpful, with the following:
QuoteYou may notice that there's a lot of stuff in the header of the index template (found in Themes/THEMENAME/index.template.php). 
Title: Re: Integrating the forum into your site...
Post by: AdventureWriter on September 15, 2006, 05:21:20 PM
I am integrating SMF into my site, which has a side navigation bar that I'd like to include. I have been able to get myfooter.php file to work just fine. But for some reason, I can't get the navmain_list.php to work (which has my side navigation for the rest of my site). Both php files are in the root folder of the forums section of my site, so it would seem that if the myfooter.php can be found, the navmain_list.php should be found as well.

I am not getting any php errors, I am just getting nothing at all in the area where I expect to see the side navigation bar. I used coding that A.M.A. provided to a poster (osckar) earlier in this thread, but to no avail. I suspect it's something really BASIC that I am missing, but after several days of focusing on this, I am just going around in circles at this point. ::) Perhaps someone can help me? Here is the code I have in index.template.php:


// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="93%" cellpadding="0" cellspacing="0" border="0" align="center"><tr>
      <td width="7%">';

include('navmain_list.php');

   echo '
      </td>
      <td id="bodyarea" width="100%" style="padding: 1ex 10px 2ex 10px;">';

}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


Thanks for any assistance possible!  :)

AdventureWriter
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on September 17, 2006, 04:21:19 PM
If someone can pm me about what i should do and things about the footer.php and header.php, what should be in it, and if i should be editing the forums files or the templates files, i have no clue. So please pm me tell me here on how i am supposed to get this complete, Thanks.
Title: Re: Integrating the forum into your site...
Post by: AdventureWriter on September 19, 2006, 05:06:36 PM
I am still struggling with the problem I posted on the 15th about using an include to integrate my side navigation bar into my forum (go two posts above this one). I hope it is OK to bump this to try and get a response.  :-[

Thanks to anyone who might be able to direct me in the right direction!

AdventureWriter
Title: Re: Integrating the forum into your site...
Post by: Asher Black on September 23, 2006, 11:23:20 PM
* Any idea what I'd change in index.template.php (or would it be there) to use the calendar button, but have a link for my google calendar (which we already use) instead?

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];


* Can I add a button that looks like the others (home/help/search, etc.) for "Store" and link it to our online store? If so, how?
Title: Re: Integrating the forum into your site...
Post by: Asher Black on September 23, 2006, 11:37:28 PM
This is a screenshot of the part of our forum that comes after our custom header include, and before the actual forum content, followed by our code that generates it. Any suggestions for cleaning it up, so the menu is centered and the searchbar is to the right of, and parallel to, the login info? I tried placing these items in table cells, but it kept giving me parse errors.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.mytholog.com%2Ftemp.gif&hash=e251ac444b6051e59cd772e86ca29c3fd86cfbb7)


// Show the menu here, according to the menu sub template.
template_menu();


echo '

<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td>
';


// Search box.
echo '
<form action="', $scripturl, '?action=search2" method="post" style="margin: 0; margin-top: 7px;"><b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a><input type="hidden" name="advanced" value="0" />';
// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
echo '
</form>';
';


</td><td>


';
// Login header.
echo '
';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>', $txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=regcenter">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
', $context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />

';
}

echo '
</div>';


';

</td></tr></table>




</div>';
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on October 09, 2006, 12:39:08 AM
can someone tell me what i should be including in my header.php and my footer.php? and where i should put it etc.



Please help me, im not sure what to do!
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on October 17, 2006, 07:01:34 PM
bump*
Title: Re: Integrating the forum into your site...
Post by: EliTe_ThuT on October 21, 2006, 02:07:35 PM
I included the forum very well to my website...I have my left menu and banner and all of this... but I have one problem.

In my footer, I have a © somewhere... but it displays as a ♦

Someone know what's the problem...well I know what is the problem...it's the charset...but I tried to change it but it doesn't work...
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on October 27, 2006, 10:36:54 AM
Quotecan someone tell me what i should be including in my header.php and my footer.php? and where i should put it etc.
In header.php, put whatever you'd like to put at the top of the page, on top of the forum. Likewise, put everything you want to appear at the bottom of the forum in footer.php.

QuoteIn my footer, I have a © somewhere... but it displays as a ♦

Someone know what's the problem...well I know what is the problem...it's the charset...but I tried to change it but it doesn't work...
Try using &copy; instead ;)
Title: Re: Integrating the forum into your site...
Post by: rhesusv on October 28, 2006, 06:45:45 AM
Can someone tell me what i did wrong here ? i'm trying to include my WP header as my forum header . I did follow the instruction as stated at the 1st post. But still the header from the WP is not showing. wat did i do wrong?? hmm...

here's the part where i edited in my index.templete.php
1.
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';
include('header.php');



2. For the footer

// The following will be used to let the user know that some AJAX process is running
include('footer.php');
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>';
}


The footer.hp & the header.php are those from the default WP theme.
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on October 29, 2006, 12:53:17 PM
where do i need to put the header and footer part? on the index.template.php? or what?
Title: Re: Integrating the forum into your site...
Post by: Martje on October 31, 2006, 09:00:57 AM
No, you make a custom header and footer file and you upload them to the sources dir :) at least if that is your question

else you put your custom made header  and footer in the index.template.php file, if you wait for a moment i put up an example.

allright I used this topic as  a manual http://www.simplemachines.org/community/index.php?topic=19638.msg158669#msg158669

here is the code i made to get it working in 1.1RC3, when upgrading from 1.09 my old template did not seem to work anymore, so I am not sure if i did it the right way but it works :)

so after following the instructions of unknown the template looks like the one i  attached in this topic.

the main confusion i see seems to be related to the header and footer part so i will concentrate on that.

in the index.template.php file you will find near the bottom this code

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
</head>
<body>';

include('headerHostelsBanner.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('hostelsBasicFooter.php');

echo '
</body></html>';
}
?>


you have to replace the headerHostelsBanner.php and the hostelsBasicFooter.php

with your own custom made header and footer file.

just make a new header file and name it for example myHeader.php, do the same with you footer and call it for example myFooter.php

in those files you can put any html you want.
To get a top side and bottom for example you can use
in the myHeader.php
<!--//table layout header -->
<table width="100%">
  <tr>
    <td colspan="2">here come you logo and stuff </td>
  </tr>
  <tr>
    <td width="27%">this is a sidebar </td>
    <td width="73%">
<!--// here ends the header -->


and in the myFooter.php
<!--//here starts the footer --> </td>
  </tr>
  <tr>
    <td colspan="2">this is the footer </td>
  </tr>
</table>
<!--//here starts the footer -->

of course you can add css to all of it, just play around with it :)

then you upload the my Header.php and myFooter.php into your Sources dir

now the only thing left to do is follow this info from [unknown]

Now, if you did this, and went to your forum, it'd look REALLY CRAPPY.  There's one last vital thing that needs to be done for it to work.  And to do that, we need the id of the theme we're working with.

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box:




REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');


(where yourprefix_ is your prefix, often 'smf_' and that number is the theme id we found.)

thats all, if you follow this you get something which looks like this....
http://www.hostelsamsterdam.com/forum/

well more ore less ;D

I used the classic theme for it

good luck

martijn

Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on November 01, 2006, 07:36:50 PM
ok thanks alot for the help, now i jsut have to find a nice simple web template to use and then edit it a little, the only hard thing is the phpmyadmin part, with the sql and stuff, but ill get back to you if i need any more help.
Title: Re: Integrating the forum into your site...
Post by: Martje on November 03, 2006, 03:45:50 AM
Quote from: MeRcChRiS on November 01, 2006, 07:36:50 PM
ok thanks alot for the help, now i jsut have to find a nice simple web template to use and then edit it a little, the only hard thing is the phpmyadmin part, with the sql and stuff, but ill get back to you if i need any more help.

Yeah i always wondered about that... there are many themes but i have never find an empty template, which you could edit. I think there should be a standard integration theme which you could edit easaly if you don't no nothing about php.

the only thing you needed for that is
1 theme in the themedirectory,
1 customheader.php and one customfooter.php in the Sources dir
and the explanation how to put the code
REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');

into your database with phpmyadmin.....
Although i can imagen that a coder could write a script for the whole lot and put it in a package.

personaly I think it should be a standard thing like the classic theme and the babylon theme, it would save a lot of posts from people who are new to php and simplemachines, because I think that there are a lot of people want to integrate their forum into their site.


I think this could be is something for the developement team to think about  ;) after all
since this topic exists there are on this moment 45758 views from nov 2004, that is about let me see.... 63, something views a day. I wish i had that score on one of my boards for one topic :P
but seriously why not a standard integration theme? editing the custom header and footer should not be that hard for most people... :)
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on November 04, 2006, 02:33:07 PM
Quotein the template file you will find near the bottom this code

what would be the template file? my webpage or the index.template.php?

i got confused lol
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 04, 2006, 04:20:10 PM
When I modify my style.css and save changes, it has no effect!

I am running 1.1 RC3, so I can see the changes as I'm making them, in the preview.  I created a copy of default to edit.  I make the changes to style.css, under "modify themes", and they keep in the preview, but they won't affect the site once I click on save changes.  I'm doing all of this on a test forum I have installed at www.mirrorstonemusic.com/test/index.php.  Another thing I tried was renaming style.css in the Themes/default folder and copying my modified one there, since I know it draws on the default theme.  At that point it finally took some of the changes, but it still didn't take the changes to:

/* This is used for categories, page indexes, and several other areas in the forum.
.catbg and .catbg2 is for boardindex, while .catbg3 is for messageindex and display headers*/
.catbg , tr.catbg td , .catbg3 , tr.catbg3 td
{
   background: url(images/catbg.jpg) #357e38 repeat-x;
   color: #ffffff;
   padding-left: 10px;
   padding-right: 10px;


Or to:

/* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */
.titlebg, tr.titlebg th, tr.titlebg td, .titlebg2, tr.titlebg2 th, tr.titlebg2 td
{
   color: black;
   font-style: normal;
   background: url(images/titlebg.jpg) #3367bd repeat-x;
   border-bottom: solid 1px #3367bd;
   border-top: solid 1px #FFFFFF;
   padding-left: 10px;
   padding-right: 10px;
}


How do I make changes to style.css and have them take effect globally?  I have also gone in to "manage and install" and reset the overall forum default as well as reset everone to, back and forth between SMF Default theme and my custom theme (named it mirrorstone).  And nothing is working as it should!  I refresh the page as well, very wierd!  I've tried it with both Firefox and IE, same thing!

I'm beginning to think that I just need to follow the direction a little more closely in the first post of this topic. 
QuoteThere are comments in the file, but the main ones to worry about are titlebg (blue), windowbg and windowbg2 (shades of gray), and bordercolor/tborder. (backgrounds for tables, grid lines, etc.)
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 04, 2006, 05:26:23 PM
Figured it out, it wasn't changing because of the image files.  Learning, slowly but surely.
Title: Re: Integrating the forum into your site...
Post by: Martje on November 04, 2006, 05:32:28 PM
Quotewhat would be the template file? my webpage or the index.template.php?
sorry its the index.template.php
you can download the index.template.php a couple of post back,
then replace the include('headerHostelsBanner.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('hostelsBasicFooter.php');


with your own custom made header and footer files :)

don't forget to upload those files to the sources dir and dont forget to do the phpmyadmin thing as descibed a couple of post back.
then everything will be fine  :)
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on November 05, 2006, 02:24:10 AM
ok, so i did what you said and i added stuff to my header.php and footer.php into the sources dir. tell me if this is how its supposed to look like so far without the theme id etc.

http://gfximpulse.blankcolors.com/forum/ (http://gfximpulse.blankcolors.com/forum/)
Title: Re: Integrating the forum into your site...
Post by: Martje on November 05, 2006, 02:08:20 PM
ok that looks really wierd if you get into a post , did you edit the original theme or did you made a new theme and edit that one.
the safest way not messing up your board is making a new theme and edit that one.

if you post your header and footer here i will take a look at that cause now it looks like there is nothing in your header and footer.

I can take a quicklook if you make me an admin on that board for now so i can see what went wrong and where. you can PM me the details if you want
Title: Re: Integrating the forum into your site...
Post by: MeRcChRiS on November 05, 2006, 02:10:36 PM
oh dang, i edited the original....ok well im gonna make a new of the original.

yeah ill make you a admin, just sign up and you can take a look.
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 05, 2006, 11:22:58 PM
Thank you so much for the tips!  I went the cooler way and enabled SSI.  I was really wanting to be able to provide dynamic content for my main website based on posts in the forum.  I learned a lot over the weekend, and everything is seamless now!  I am still working with CSS to make everything better, but it's fully functional.  My site is at www.mirrorstonemusic.com.  Check out the news page, killer!
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 06, 2006, 06:36:41 PM
A couple of quick questions.  Now that I have my theme up and running, whenever I go to make a post, delete a post, or any other action that would normally take me back to the board I was posting in, it takes me to a blank page.  For instance, after creating a new post, it takes me to the following site with a blank page:

http://www.mirrorstonemusic.com/forum/index.php?action=post2;start=0;board=7

I'm running a couple of mods as well.  TinyPortal .96, Post by Email, Streaming 3 and BBC-Google 2.5.1.

One other question I have is:  The header and footer are working great!  The issue that I'm seeing is that when I click on the forum link, or move about the forum, the background takes a bit before it kicks in.  Any way to get around this?  Pre-caching perhaps?
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 07, 2006, 02:03:26 AM
Got it all fixed up, corruption somewhere.  Thank goodness for a test site and good old repair_settings.php.  I was able to point the test site to my production database and everything was there and working, no blank screens upon posting.  I was also missing avatars among many pages of log file errors.  After getting all the attachments, avatars, etc copied over, I copied my test site back to my production area and I didn't skip a beat.  Still curious about speeding up the background load times, however.
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 09, 2006, 01:26:54 AM
I also figured out how to speed up the load times, so please forgive me if I am reiterating here, but by removing any background color at all under the following section of style.css:

/* The main body of the entire forum. */
body
{
   background-color: white;
   margin: 0px;
   padding: 0px;
}


And turned it into:

/* The main body of the entire forum. */
body
{
   margin: 0px;
   padding: 0px;
}


When one moved around the forum previously, it loaded a white background (in my case black), then loaded the background image I had in my header.php and footer.php, causing a flashing effect and slowing down load times.  After removing it, the flashing went away and the load time improved.  I'm assuming this is the correct method.

Title: Re: Integrating the forum into your site...
Post by: Dannii on November 09, 2006, 03:58:28 AM
Removing that wouldn't help load time in any noticeable way.
Title: Re: Integrating the forum into your site...
Post by: Xaneth on November 09, 2006, 03:24:47 PM
At the very least it eliminated the weird flashing issues.
Title: Re: Integrating the forum into your site...
Post by: Sh0ck on November 20, 2006, 10:11:21 AM
Ok so I am integrating my site with SMF. What i need to know is how to use the current usergroups and user permissions from the forum and apply them to a admin control panel and specific features on each page. IE admins can edit anything and mods or other groups can only use certain things.  I would help to find out ASAP.

NateoDesigns.com
We are currently Accepting Applications for the following:

To Apply Send a Email with your Name and Qualifications to [email protected]
Title: Re: Integrating the forum into your site...
Post by: iraklion on November 22, 2006, 03:25:54 AM
Quote from: [Unknown] on April 10, 2005, 05:47:42 AM
Whatever you'd like!  Here's an example.  Find:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


Replace:

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td width="20%">left menu</td>
<td id="bodyarea" width="80%" style="padding: 1ex 20px 2ex 20px;">';
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

echo '</td>
</tr></table>';


I didn't even touch the PHP, I just added your HTML.  Of course, this isn't exactly what you suggested, but that's because it's really the same anyway and changes less of the HTML (which makes for a shorter and easier to understand post.)

-[Unknown]


ok/ i did it.
what i want now is to view this included file only on index page.
or
to be splitted in tables only in index page
Title: Re: Integrating the forum into your site...
Post by: jayant on November 27, 2006, 03:38:30 AM
I wish to know a very silly question that I wish to add a left margin (including few buttons) with my forum. In which file of the template the alteration have to be made. As in the theme directory there are various files (whether the correction will be at profile or display or index or...... template). My desire is for a look of this type forum.http://img226.imageshack.us/img226/8020/forumhp0.jpg (http://img226.imageshack.us/img226/8020/forumhp0.jpg) a very simple one. I have only sound knowledge of html and I have the codes of html for my left portion. But, where to add and how to add, I am not getting. Please help.

-Regards
Title: Re: Integrating the forum into your site...
Post by: argus1881 on November 27, 2006, 12:42:45 PM
Quote from: EliTe_ThuT on October 21, 2006, 02:07:35 PM
I included the forum very well to my website...I have my left menu and banner and all of this... but I have one problem.

In my footer, I have a © somewhere... but it displays as a ♦

Someone know what's the problem...well I know what is the problem...it's the charset...but I tried to change it but it doesn't work...

I had the same problem  >:(
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on November 28, 2006, 08:20:18 PM
QuoteI wish to know a very silly question that I wish to add a left margin (including few buttons) with my forum. In which file of the template the alteration have to be made.
That would need to be a modification to the Index.template.php file. Index.template.php contains the header and footer of each page.
QuoteMy desire is for a look of this type forum.http://img226.imageshack.us/img226/8020/forumhp0.jpg a very simple one.
Unfortunately, Imageshack isn't loading for me (for some strange reason), so I can't see that image.

QuoteI had the same problem  [copyright symbol thing]
Find: ©
Replace with: &copy;
Title: Re: Integrating the forum into your site...
Post by: MirditaForum on December 16, 2006, 04:06:37 PM
How can i insert (include) a small chat in my SMF forum?
Title: Re: Integrating the forum into your site...
Post by: gupp on December 28, 2006, 05:32:48 PM
Hi, I've been carefully trying to follow these instructions but I'd like to do something a bit different than what I came up with and wondered if someone could help.

I had smfone as my theme but it didn't work as well after the upgrade and I wanted to add the gallery and chat so I decided to just make the default theme green. Everything worked out OK. I'll probably do a few changed but so far I'm good with it.

I did the header and footer php's today. The footer worked out great. Instead of having my header above the forum I'd like to put it in the place where your forum name and smflogo usually default to.   

I've done a small screen shot, I'm adding of what it's doing now and then a modified version of what I want it to look like to help explain better.

I've been writing my html in text for more than 10 years but I don't really know any other code or language. Can I just put the   include('header.php');   in somewhere to make it show up in the logo space?

This is the page:

http://naturalaquariums.com/bb/
Title: Re: Integrating the forum into your site...
Post by: Uqqeli on January 03, 2007, 01:34:18 PM
Quote from: [Unknown] on November 09, 2004, 11:36:22 PMSo, creating the layer only means creating two sub templates.  At the end of index.template.php, right before the ?>, add:function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';

include('header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('footer.php');

echo '
</body></html>';
}
Would the template_site_above function echo </head><body> only when $context['browser']['needs_size_fix'] is true? I think other browsers would like those tags too... ;)
Title: Re: Integrating the forum into your site...
Post by: mdrcracing on January 04, 2007, 06:11:17 AM
Hi everyone.. As you can tell I'm new here.. I'm fairly good at html.. php I'm still getting into trying to understand it.  I've searched and went though the thread trying to see if I can figure this one out.  This is my 5th bbs software that I'm tryin to get to work the way I want.. so far, its been the best. but anyways.

I followed the header/footer as in post #1.  No probs there.  But now I need to add a right column, but its a remote file, just like the header.php is.  Is there any simple way for me to include right.php?

Either the includes can define its width or I could define its width within the right.php.


also, while I'm here.. I haven't fully looked into it yet, but is there a way I can break the menu up?
ie: here has; forum help search profile my messages calendar members logout
but if I just wanted: forum help search members logout 
is it possible? and is it possible to add a menu item?   I'm attempting to do drop down menu's..
Where I would have:

Your Account
View Profile
Edit Profile
messages
view new post
Show Stats

I also want to make another one "Features" that would include the calander, my gallery script and other related material.


Thanks for any help you can give me.
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on January 04, 2007, 07:36:45 AM
QuoteWould the template_site_above function echo </head><body> only when $context['browser']['needs_size_fix'] is true? I think other browsers would like those tags too...
It looks like an oversight :P
Not many people do that method though, they aim for the layer system instead (it's a lot more powerful).

QuoteBut now I need to add a right column, but its a remote file, just like the header.php is.  Is there any simple way for me to include right.php?
It depends on where you need to put the code for the column. If it goes above the actual content (as it would if you're using CSS to align it), you can use another include statement to include it (either below the header, or inside the header.php file, depending on where the code needs to go). If the code goes below the actual content (as it would if you're using tables for layout), then you can use another include statement above the footer
Reading over my post again, it doesn't make much sense :P. Please feel free to ask if you have any further questions ;)

Quotealso, while I'm here.. I haven't fully looked into it yet, but is there a way I can break the menu up?
ie: here has; forum help search profile my messages calendar members logout
but if I just wanted: forum help search members logout 
is it possible? and is it possible to add a menu item?   I'm attempting to do drop down menu's..
Sure, look in index.template.php (search for template_menu). This contains all the buttons. If you're using the default SMF 1.1 theme, there's information on how to add a new button at http://docs.simplemachines.org/index.php?topic=564
Title: Re: Integrating the forum into your site...
Post by: mdrcracing on January 05, 2007, 02:01:50 AM
alright, I still need help.. Working with Daniel tonight, we still can't figure out what I'm doing wrong.


echo'
<div style="float: right; width= 225px">';
include('../right.php');
echo'
</div>';


This is what I have to load the "right.php" file.  It loads the file, but loads it to the left, which I can fix, but it doesn't float it to the right.  I have the code inbetween my header and the welcome header.

if you look at my page you'll understand what I mean more.. I'm working on a new welcome header for my layout, but I still have the current one on there as well, since this is my way of undering how the code works.  but I have the right inbetween the 2.  What its not doing is shifting the 2nd welcome header and the forum to the left, its just putting them inline with each other.. 

http://www.mdrcracing.com/smf/index.php

there where I have everything installed..
Please help..thanks.
Title: Re: Integrating the forum into your site...
Post by: mdrcracing on January 05, 2007, 07:23:21 AM
Sorry for the doouble post.

I ended up making a table, putting the forum in 1 column and the remote file in the other.

But I have another question.  I closed the table right before the body tag.  I'd like to close the table right before the info center.  But in the index.template file I can't figure out where it is.  I just want my right column to cover the board. and have the info center full width..  can anyone tell me where I can find it?

and just to save time, if its another file, would I just copy it from the default theme, edit what I need to and copy it over to my theme and it would show?  I'm sorry for all the questions.
Title: Re: Integrating the forum into your site...
Post by: tensop on January 14, 2007, 10:53:11 PM
Ok, i've done it the 'simple' way, and my 'welcome user blah blah, you currently have 121 messages" thing has disapeared under the header, any idea on how to fix?
Title: Re: Integrating the forum into your site...
Post by: beanstalk on January 19, 2007, 09:52:44 PM
i did the 'cooler way'.  everything looks fine in firefox, but it can't find the styles in internet explorer.  also, the button that brings up the 'edit in the post' box is not working.  i get the loading on the top and that's it.  any tips?  thanks.

EDIT: i found the styles problem.  i had an extra character in the styles file.  used IE's web developer add-in to check validity of the css. 
Title: Re: Integrating the forum into your site...
Post by: a2h_ on January 25, 2007, 12:58:33 AM
Be careful as the tutorial is from 3 years ago and there may be many template changes from the version that [Unknown] is referring to.
Title: Re: Integrating the forum into your site...
Post by: beanstalk on January 25, 2007, 01:43:07 AM
is there a better way to wrap your forum now? 
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on January 25, 2007, 02:37:30 AM
I've attached a index.template.php file that can be used with "The Cooler Way" (layer system). This file has been split into two 'layers' (site and main), and I've indicated where to put the custom header and footer via comments (// Put your header stuff here and // Put your footer stuff here). If you want to use an include() to add the header and footer (as shown in [Unknown]'s post), uncomment the include('header.php'); and include('footer.php'); lines. Alternatively, you may place the code directly into the index.template.php file, in an echo statement.

Note that if you use this file, you can skip down to Now, if you did this, and went to your forum, it'd look REALLY CRAPPY on the tutorial (after you've read the introductory text on what layers are).

Hopefully this is useful for someone! :D. I haven't tested it, but it should work. Please report any errors ;)
Title: Re: Integrating the forum into your site...
Post by: skaushik on January 26, 2007, 12:01:14 PM
Hi,
    I tried to use the cooler way to integrate this forum to the website. Actually I had made the changes that were specified to modify the index.template.php. The original website is running on CMS made simple. But when I went to the UI, the forum was not using any template which is being used in the main website. Instead, it had plain white background and looked crappy.

Any reasons for this? Am I missing something here? Actually, in CMS made simple, the templates for the main website are managed from the admin panel for CMS made simple. Does this affect it in anyway? I had used the header.php and footer.php to be used from this admin directory - the code is something like

include('../admin/header.php');

Please let me know if I have left out something.

Thanks,
Kaushik
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on January 26, 2007, 09:06:26 PM
QuoteActually I had made the changes that were specified to modify the index.template.php. The original website is running on CMS made simple. But when I went to the UI, the forum was not using any template which is being used in the main website. Instead, it had plain white background and looked crappy.
Did you read the section beginning with Now, if you did this, and went to your forum, it'd look REALLY CRAPPY. ? You need to update the theme's entry in the database so that it knows what layers to use.
Title: Re: Integrating the forum into your site...
Post by: Jorge Santos on January 27, 2007, 06:42:52 PM
Hello, everyone.

I'm SILIBAIP and new to SMF. Living actually in Spain.

Well, I have some questions. I'm ruling a new SMF Forum, and now I decided to have a portal, kind of a PHP Nuke, with some news and things like that. I like to make the other sense integrating my php site with my forum. Is this possible? I like to know if I can use the SMF users in my PHP Nuke site. If this is not possible, can you tellme a way not to hard of doing it?

Thank you so much in advance.
Title: Re: Integrating the forum into your site...
Post by: d12boy420 on January 27, 2007, 06:52:59 PM
I must say this integration is prett cool but i just have one problem. When i goto post something all the emoticions are all broken up. They won't display side by side they are acting like if someone has put a <br> tag after each image. Does anyone know what to do to fix this? Example - http://www.coldbloodedkillerz.com/forums/index.php?action=post;board=1.0

Thanks for your time
Title: Re: Integrating the forum into your site...
Post by: beanstalk on January 27, 2007, 11:11:37 PM
have to register to post in your forum...

i would look at your css.  you probably have some style defined that is overriding the smf styles.  might want to validate your css too.  something similar happened to me. 
Title: Re: Integrating the forum into your site...
Post by: d12boy420 on January 28, 2007, 01:35:17 AM
Lol fixed. Stupid text-align: left; code in the wrapper that will do it. Thanks for your help
Title: Re: Integrating the forum into your site...
Post by: Col on January 28, 2007, 09:17:48 PM
Hi,

Ever since the upgrade to to 1.1.1, I've had problems with anchors, such as the links from PM index to the individual PMs. I use the simple method for the header. Is there a known problem with the simple method and 1.1.1? I will carry out some tests, but thought I'd check here first.
Title: Re: Integrating the forum into your site...
Post by: WiiStyle on February 08, 2007, 04:53:43 PM
I am using a tables system for my site, and im not sure if it is possible for me to get the desired effect, so i was wondering if somebody here could help...

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg232.imageshack.us%2Fimg232%2F4439%2Fisthispossiblewr4.th.jpg&hash=51ae3b5c0a8fe3ba116832dec52cf11e14856ce3) (http://img232.imageshack.us/my.php?image=isthispossiblewr4.jpg)

My site uses a table layout, so the black outline is all down to the table, and my problem is, how do i get my forum into the place where the red box is on the image, but keeping the black outline layout and stuff?

Is it possible?

My site is at http://www.wiistyle.co.uk if you want to see the source for the layout.
Title: Re: Integrating the forum into your site...
Post by: beanstalk on February 08, 2007, 04:58:19 PM
just follow the more advanced method in this thread.  it should work.  i assume that your red box is a table cell <td></td>.  just split your page at the center of that cell.  put the first half into a header file and the second half into a footer file.   
Title: Re: Integrating the forum into your site...
Post by: WiiStyle on February 08, 2007, 05:00:50 PM
Quote from: beanstalk on February 08, 2007, 04:58:19 PM
just follow the more advanced method in this thread.  it should work.  i assume that your red box is a table cell <td></td>.  just split your page at the center of that cell.  put the first half into a header file and the second half into a footer file.  
Well that red box is something i put on it in paint so that it was more obvious where i wanted the forum, but i understand what you mean anyway.
So if i split up a table into 2 files, one will just carry onto the other?
Title: Re: Integrating the forum into your site...
Post by: beanstalk on February 08, 2007, 05:02:49 PM
well, you're really just appending all the code into one file anyway.  so, yes.

you might want to checkout the announcement here (http://www.simplemachines.org/community/index.php?topic=145838.0).
Title: Re: Integrating the forum into your site...
Post by: WiiStyle on February 08, 2007, 05:43:07 PM
Yay i did it, and the simple way too :-P

Now i just need to edit the css coding as my forum links look weird using my sites normal link colours...
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on February 09, 2007, 02:40:35 AM
As beanstalk mentioned, there's an extended version of this guide available at http://www.simplemachines.org/community/index.php?topic=145838.0. It is updated for SMF 1.1.1 (this post was based on SMF 1.0 RC2, which was released a long time ago.
Title: Re: Integrating the forum into your site...
Post by: wcravens on February 09, 2007, 04:09:26 PM
In using the 'simple' method I'm getting extra non-printable characters output any time I use an include('xyz.php') in the index.template.php.  The characters are '' by the time they get to the browser.  The codes seen on the network are #ef #bb and #bf.  I've tried both with and without compression just in case.

Test code:
echo '</head><body>';
echo '<!-- Test from index.template.php just prior to include. -->';
    include('../header.php');
echo '<!-- Test from index.template.php just subsequent to include. -->';

Output to browser:
<!-- Test from index.template.php just prior to include. --><!-- Test just inside header.php -->

Any help greatly appreciated.
Title: Re: Integrating the forum into your site...
Post by: beanstalk on February 09, 2007, 05:16:41 PM
what is in your include file? anything?
Title: Re: Integrating the forum into your site...
Post by: wcravens on February 09, 2007, 06:05:40 PM
<?php
echo '<!-- just a test-->';
echo 
'<link rel="stylesheet" type="text/css" href="../styles/sawgrass_styles.css" />
    <div id="banner">
        <!--<img src="images/gradient_100x2.jpg" />-->
        <img class="banner_left" src="../images/sawgrass_main.jpg" />
        <span align="center">
            <h1 style="color: #412500;">Sawgrass</h1>
            <h2 style="color: #eac755;">Home Owners Association</h2>
        </span>
            <a href="http://maps.google.com/maps?f=q&hl=en&q=61822&ie=UTF8&z=16&ll=40.123881,-88.309886&spn=0.011338,0.017166&om=1&iwloc=addr">
            <img class="banner_right" src="../images/sawgrass_map.jpg" /></a>
    </div>
    <div id="horiz_bar">
            <!--<img id="Gradient" src="../images/gradient_square.png" />-->
    </div>'
;

?>



When I prepare a simple index.php as follows, these characters don't appear:


<?php

echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sawgrass Home Owners Association</title>
    <link href="styles/sawgrass_styles.css" rel="stylesheet" type="text/css" />
</head>

<body>'
;
include (
'./header.php');
echo 
'
</body>
</html>'
;

?>

Title: Re: Integrating the forum into your site...
Post by: Daniel15 on February 09, 2007, 06:59:20 PM
QuoteIn using the 'simple' method I'm getting extra non-printable characters output any time I use an include('xyz.php') in the index.template.php.  The characters are '' by the time they get to the browser.  The codes seen on the network are #ef #bb and #bf.  I've tried both with and without compression just in case.
Have you tried simple header.php file? Try something like:

A test header

and see if it still occurs.

Note that PHP files do not need to include PHP code. If you put plain HTML (as I did), it will be output directly to the client. Basically, you don't need to put everything in echo statements, just copy the raw HTML directly into the PHP file  :)
Title: Re: Integrating the forum into your site...
Post by: hcm_erhan on March 12, 2007, 10:27:25 AM
Hi everybody
I'm Turkish, my English is not very good for this :( sorry about that.
This is my site's forum page (http://www.pumprock.com/site/forum.htm). I used to frame, but its not so good :(
Can you help me to integrating the forum, please..
Thankyou

forum page:
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
<META HTTP-EQUIV="Page-Enter" CONTENT="BlendTrans(Duration=0.5)">
<META HTTP-EQUIV="Page-Exit" CONTENT="BlendTrans(Duration=0.5)">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link href="stylesheet.htm" type="text/css"
rel="stylesheet">
<link href="standard_v2.css" type="text/css"
rel="stylesheet">
<link href="retail.css" type="text/css" rel="stylesheet">
<title>PumpRock : FORUM</title>
</head>

<body class="doc-home">
<div class="module" id="m-nav">
  <div class="list" style="width: 966; height: 25">

<ul>
  <li><a title="" href="index.htm">ANA SAYFA</a> </li>
  <li><a href="etkinlikler.htm">ETKİNLİKLER</a></li>
  <li class="on"><a href="forum.htm">FORUM</a></li>
  <li><a href="radyo.htm">RADYO</a></li>
  <li><a href="chat.htm">CHAT</a></li>
  <li><a href="kurallar.htm">KURALLAR</a></li>
  <li><a href="uye_resim_albumleri.htm">ÜYE RESİM ALBÜMLERİ</a></li>
  <li><a href="iletisim.htm">İLETİŞİM</a></li>
  <li><a href="linkler.htm">LİNKLER</a></li>
  <li><a href="kayit.htm">KAYIT OL</a></li>
  <li><a href="giris.htm">GİRİŞ</a></li>
</ul>
</div></div>

<table id="doc-layout" cellSpacing="0" cellPadding="0" border="0" height="129" width="94%">
<TBODY>
  <tr>
    <td id="leftcol" vAlign="top" align="left" height="129" width="33%">
            <div class="module" id="m-subnav">
      <h4 class="hdr-asset">&nbsp;</h4>
      <div class="list" style="width: 885; height: -2">
<iframe  frameborder="0" src="http://www.pumprock.com/forum"  width="880px" height="7300px" allowtransparency="true" style="margin-left:0px; margin-top:0px "></iframe>
    </div>
    </div>
    </td>
    </tr>
</TBODY>
</table>
<center><script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-03-05: pumprock.com/forum, pumprock.com/forum/radyo.php, pumprock.com
google_ad_channel = "3369310324+5804894352+9634059199";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_text = "CCCCCC";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script></center>
     <p align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as_rimg";
google_cpa_choice = "CAAQ9fGAlAIaCPvVtZKiFJKBKKW9mHQ";
google_ad_channel = "3599094081";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
     <br>
     <br>
     <p align="center">&nbsp;<p align="center"><span class="smalltext"><font size="1">Copyright © 2006 -
    2007 PumpRock</font></span>
</h3>
</body>
</html>
Title: Re: Integrating the forum into your site...
Post by: KingBowser on March 14, 2007, 11:32:23 PM
I am making a rpg with SMF as my boards, and I am wondering how will I be able to make register and login for both my site and forum. And how will I be able to check if they are logged in and stuff
Title: Re: Integrating the forum into your site...
Post by: Kindred on March 15, 2007, 12:29:57 AM
look at ssi_examples.php in your smf directory...

use
<?php
require("path/to/SSI.php");
ssi_login();

ssi_whosOnline();
?>
Title: Re: Integrating the forum into your site...
Post by: Daniel15 on March 15, 2007, 03:59:57 AM
Quote from: KingBowser on March 14, 2007, 11:32:23 PM
I am making a rpg with SMF as my boards, and I am wondering how will I be able to make register and login for both my site and forum. And how will I be able to check if they are logged in and stuff
As Kindred said, take a look at the ssi_examples.php file. Also, some pages in the SMF Online Manual would be of use to you (in particular, http://docs.simplemachines.org/index.php?topic=400)

To begin, you may try something like:

require('forum/SSI.php');
if ($context['user']['is_logged'])
{
echo 'Welcome back!';
ssi_logout();
}
else
{
ssi_login();
}

Heaps of data is stored in $context; you may see it by putting

echo '<pre>', print_r($context, true), '</pre>';

Somewhere below the require('SSI.php') line. Also, $user_info contains some information about the user.

Quote from: hcm_erhan on March 12, 2007, 10:27:25 AM
Hi everybody
I'm Turkish, my English is not very good for this :( sorry about that.
This is my site's forum page (http://www.pumprock.com/site/forum.htm). I used to frame, but its not so good :(
Can you help me to integrating the forum, please..
Thankyou

forum page:
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
<META HTTP-EQUIV="Page-Enter" CONTENT="BlendTrans(Duration=0.5)">
<META HTTP-EQUIV="Page-Exit" CONTENT="BlendTrans(Duration=0.5)">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link href="stylesheet.htm" type="text/css"
rel="stylesheet">
<link href="standard_v2.css" type="text/css"
rel="stylesheet">
<link href="retail.css" type="text/css" rel="stylesheet">
<title>PumpRock : FORUM</title>
</head>

<body class="doc-home">
<div class="module" id="m-nav">
  <div class="list" style="width: 966; height: 25">

<ul>
  <li><a title="" href="index.htm">ANA SAYFA</a> </li>
  <li><a href="etkinlikler.htm">ETKİNLİKLER</a></li>
  <li class="on"><a href="forum.htm">FORUM</a></li>
  <li><a href="radyo.htm">RADYO</a></li>
  <li><a href="chat.htm">CHAT</a></li>
  <li><a href="kurallar.htm">KURALLAR</a></li>
  <li><a href="uye_resim_albumleri.htm">ÜYE RESİM ALBÜMLERİ</a></li>
  <li><a href="iletisim.htm">İLETİŞİM</a></li>
  <li><a href="linkler.htm">LİNKLER</a></li>
  <li><a href="kayit.htm">KAYIT OL</a></li>
  <li><a href="giris.htm">GİRİŞ</a></li>
</ul>
</div></div>

<table id="doc-layout" cellSpacing="0" cellPadding="0" border="0" height="129" width="94%">
<TBODY>
  <tr>
    <td id="leftcol" vAlign="top" align="left" height="129" width="33%">
            <div class="module" id="m-subnav">
      <h4 class="hdr-asset">&nbsp;</h4>
      <div class="list" style="width: 885; height: -2">
<iframe  frameborder="0" src="http://www.pumprock.com/forum"  width="880px" height="7300px" allowtransparency="true" style="margin-left:0px; margin-top:0px "></iframe>
    </div>
    </div>
    </td>
    </tr>
</TBODY>
</table>
<center><script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-03-05: pumprock.com/forum, pumprock.com/forum/radyo.php, pumprock.com
google_ad_channel = "3369310324+5804894352+9634059199";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_text = "CCCCCC";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script></center>
     <p align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as_rimg";
google_cpa_choice = "CAAQ9fGAlAIaCPvVtZKiFJKBKKW9mHQ";
google_ad_channel = "3599094081";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
     <br>
     <br>
     <p align="center">&nbsp;<p align="center"><span class="smalltext"><font size="1">Copyright © 2006 -
    2007 PumpRock</font></span>
</h3>
</body>
</html>

Have you seen the post at http://www.simplemachines.org/community/index.php?topic=145838.0? It may be able to help you :)
Title: Re: Integrating the forum into your site...
Post by: CuTe_MaN on March 21, 2007, 11:17:57 AM
I have a problem

After I have added the query I got this error in my website

and i couldnt come back to it



"Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later."

any body can help me.


Thx

CuTe_MaN
Title: Re: Integrating the forum into your site...
Post by: CuTe_MaN on March 22, 2007, 07:09:13 AM
I have solved the problem of the connection to the Database

I had the passoword of the database changed and I forgot to change it in the Forum
looool

but I couldnt fix integrating the style into my forum


anybody can help me??

this is the code that is in the index.template.php

<

?php
// Version: 1.1 RC3; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC3';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!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"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc3"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
// ]]></script>
<title>', $context['page_title'], '</title>';

// The ?rc3 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc3" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc3" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = ', empty($options['collapse_leftbar']) ? 'false' : 'true', ';

                function shrinkHeaderLeftbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "', $context['session_id'], '");';
        echo '
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = ', empty($options['collapse_rightbar']) ? 'false' : 'true', ';

                function shrinkHeaderRightbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "', $context['session_id'], '");';

        echo '
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>



<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>';

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

function shrinkHeaderIC(mode)
{';

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>';
// TinyPortal start
     if($context['TPortal']['fixed_width']!=0)
             echo '<table align="center" width="'.$context['TPortal']['fixed_width'].'" cellpadding="0" cellspacing="0" border="0"><tr><td>';

// TinyPortal end



echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">';

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>';


// TinyPortal
     if($context['TPortal']['showtop']==1)
     {
// TinyPortal end

// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>';

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
</td>';

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' , $context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>';

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>', $txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="43200">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>';

echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
';
// TinyPortal
       }
//  end
echo '


</div>';


// Show the menu here, according to the menu sub template.
template_menu();


// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';

// TinyPortal integrated bars
          if($context['TPortal']['leftbar'])
          {
              echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; padding-top: 4px;padding-right: 1ex;" valign="top">
                 <div id="leftbarHeader"', empty($options['collapse_leftbar']) ? '' : ' style="display: none;"', ' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 TPortal_sidebar('left');
              echo '</div></td>';

          }

        echo '<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;">';
        if($context['TPortal']['centerbar'])
                     echo '<div>' , TPortal_sidebar('center') , '</div>';


}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

   echo '</td>';

         // TinyPortal integrated bars
          if($context['TPortal']['rightbar']){
              echo '<td style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' , 'px; padding-top: 4px; padding-left: 1ex;" valign="top" align="right">
                 <div id="rightbarHeader"', empty($options['collapse_rightbar']) ? '' : ' style="display: none;"', ' style="width: ' ,$context['TPortal']['rightbar_width'], 'px; text-align: left; padding-top: 5px;">';
              TPortal_rightbar();
              echo '</div></td>';
          }

        echo '</tr></table>';




// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'right' : 'left', '">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="', $settings['images_url'], '/powered-mysql.gif" alt="', $txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="', $settings['images_url'], '/powered-php.gif" alt="', $txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
                           <td valign="middle" align="center" style="white-space: nowrap;" class="smalltext">
                                        ', theme_copyright(), ' <br />', tportal_version() , '
                                </td>

<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>';

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';

echo '
// ]]></script>';
}

echo '
</div>';

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
';
// TinyPortal
     if($context['TPortal']['fixed_width']!=0)
             echo '</td></tr></table>';
// end
echo '


</body></html>';
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))

$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

if (isset($_GET['dl']))
$current_action = 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">FORUM</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last"> </td>' : '';


// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
';
// TinyPortal
if($context['TPortal']['leftbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if($context['TPortal']['rightbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '


</tr>
</table>';

}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}

?>




and here is the code for the header:



<html dir="rtl">
<Div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td width="9%">
<img border="0" src="Header%20Right%20a.jpg" width="102" height="350"></td>
<td background="Header%20Match%20a.jpg" width="39%">
<img border="0" src="Header%20Center%20Right%20a.jpg" width="409" height="350" align="right"></td>
<td background="Header%20Match%20a.jpg" width="1%">&nbsp;</td>
<td background="Header%20Match%20a.jpg" width="40%">
<img border="0" src="Header%20Center%20Left%20a.jpg" width="411" height="350" align="left"></td>
<td width="9%">
<img border="0" src="Header%20Left%20a.jpg" width="102" height="350"></td>
</tr>
<tr>
<td background="Body%20Right%20a.jpg" width="9%">&nbsp;</td>
<td colspan="3">
<p align="center">




and here is the code for the footer:




<td background="Body%20Left%20a.jpg" width="9%">&nbsp;</td>
</tr>
<tr>
<td width="9%">
<img border="0" src="Footer%20Right%20a.jpg" width="102" height="140"></td>
<td background="Footer%20Match%20a.jpg" width="39%">
<img border="0" src="Footer%20Center%20Right%20a.jpg" width="409" height="140" align="right"></td>
<td background="Footer%20Match%20a.jpg" width="1%">&nbsp;</td>
<td background="Footer%20Match%20a.jpg" width="40%">
<img border="0" src="Footer%20Center%20Left%20a.jpg" width="411" height="140" align="left"></td>
<td width="9%">
<img border="0" src="Footer%20Left%20a.jpg" width="102" height="140"></td>
</tr>
</table>
</Div>



and the header and footer includes images that i want to add, where to put these images????



and body can help?


THX

CuTe_MaN
Title: Re: Integrating the forum into your site...
Post by: rs14smith on April 17, 2007, 03:22:03 PM
I get this error: http://www.hastyhost.com/host/forum/test.php
Title: Re: Integrating the forum into your site...
Post by: hcm_erhan on May 01, 2007, 07:55:19 AM
Quote from: hcm_erhan on March 12, 2007, 10:27:25 AM
Hi everybody
I'm Turkish, my English is not very good for this :( sorry about that.
This is my site's forum page (http://www.pumprock.com/site/forum.htm). I used to frame, but its not so good :(
Can you help me to integrating the forum, please..
Thankyou

forum page:
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
<META HTTP-EQUIV="Page-Enter" CONTENT="BlendTrans(Duration=0.5)">
<META HTTP-EQUIV="Page-Exit" CONTENT="BlendTrans(Duration=0.5)">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link href="stylesheet.htm" type="text/css"
rel="stylesheet">
<link href="standard_v2.css" type="text/css"
rel="stylesheet">
<link href="retail.css" type="text/css" rel="stylesheet">
<title>PumpRock : FORUM</title>
</head>

<body class="doc-home">
<div class="module" id="m-nav">
  <div class="list" style="width: 966; height: 25">

<ul>
  <li><a title="" href="index.htm">ANA SAYFA</a> </li>
  <li><a href="etkinlikler.htm">ETKİNLİKLER</a></li>
  <li class="on"><a href="forum.htm">FORUM</a></li>
  <li><a href="radyo.htm">RADYO</a></li>
  <li><a href="chat.htm">CHAT</a></li>
  <li><a href="kurallar.htm">KURALLAR</a></li>
  <li><a href="uye_resim_albumleri.htm">ÜYE RESİM ALBÜMLERİ</a></li>
  <li><a href="iletisim.htm">İLETİŞİM</a></li>
  <li><a href="linkler.htm">LİNKLER</a></li>
  <li><a href="kayit.htm">KAYIT OL</a></li>
  <li><a href="giris.htm">GİRİŞ</a></li>
</ul>
</div></div>

<table id="doc-layout" cellSpacing="0" cellPadding="0" border="0" height="129" width="94%">
<TBODY>
  <tr>
    <td id="leftcol" vAlign="top" align="left" height="129" width="33%">
            <div class="module" id="m-subnav">
      <h4 class="hdr-asset">&nbsp;</h4>
      <div class="list" style="width: 885; height: -2">
<iframe  frameborder="0" src="http://www.pumprock.com/forum"  width="880px" height="7300px" allowtransparency="true" style="margin-left:0px; margin-top:0px "></iframe>
    </div>
    </div>
    </td>
    </tr>
</TBODY>
</table>
<center><script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-03-05: pumprock.com/forum, pumprock.com/forum/radyo.php, pumprock.com
google_ad_channel = "3369310324+5804894352+9634059199";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_text = "CCCCCC";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
      </script></center>
     <p align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-9612100770747093";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as_rimg";
google_cpa_choice = "CAAQ9fGAlAIaCPvVtZKiFJKBKKW9mHQ";
google_ad_channel = "3599094081";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
     <br>
     <br>
     <p align="center">&nbsp;<p align="center"><span class="smalltext"><font size="1">Copyright © 2006 -
    2007 PumpRock</font></span>
</h3>
</body>
</html>

Have you seen the post at http://www.simplemachines.org/community/index.php?topic=145838.0? It may be able to help you :)
[/quote]

Thankyou very much
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 08, 2007, 05:17:19 AM
im having probems i used the simplemeathod and itsworking great exept for the fact that after i started editing the theme it stuffed up my actual site not the forum

here are some screens:

the forum look like it should at this point
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg356.imageshack.us%2Fimg356%2F6594%2Funtitledfb5.th.jpg&hash=a162bbb27111db49ab4ec1c811536d23d96fd380) (http://img356.imageshack.us/my.php?image=untitledfb5.jpg)

the site not looking like it used to even thow i havent changed it
[img=http://img356.imageshack.us/img356/802/untitledbcbzb8.th.jpg] (http://img356.imageshack.us/my.php?image=untitledbcbzb8.jpg)

see my problem
Title: Re: Integrating the forum into your site...
Post by: Gary on June 08, 2007, 10:21:10 AM
That means it is not able to find the SSI.php file, ensure that the path is correct.

-ALM
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 09, 2007, 05:07:37 AM
it is correct

and seems to have corrected itself maybe its becouse im using a beta version of easy PHP


[EDIT]
it stuffed up again it only douse it when the theme as the code added...

i have not changed anything on the main pages just the forums theme...
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 09, 2007, 06:02:28 AM
it is actualy using SSI.php it just produces that error for some reason i can actualy log in and out with the login box
Title: Re: Integrating the forum into your site...
Post by: DobleB on August 28, 2007, 02:58:46 PM
Hello, I'm new using the forum so try to understand me...
I'm trying to put te forum inside my page using this method, in the index.php of the forum I make this changes:

<html>
<head>
<title></title>
<style>
    /*Here goes all the style code*/
</style>
</head>

<body>
<table width="900" height="500" border="0" align="center" cellpadding="0" cellspacing="0">
   <tr valign="top">
      <td width="900">
                   <table width="900" border="0" cellpadding="0" cellspacing="0">
                       <tr>
                          <td align="center" valign="top">
                                   /*Here goes the title banner*/
                          </td>
                       </tr>
        </table>
                  <table width="900" border="0" cellpadding="0" cellspacing="0">
               <tr>
                    <td>
                           /*Here goes the menu*/
                      </td>
          </tr>
          </table>
     <table width="900" height="265" border="0" cellpadding="0" cellspacing="0">
               <tr align="center" valign="top">
                   <td height="19" colspan="2">
                       <div align="justify" style="background-color:#FFFFFF; padding:5px">
             <?php
                     /**********************************************************************************
                     * index.php                                                                       *
                     ***********************************************************************************
                     * SMF: Simple Machines Forum                                                      *
                     * Open-Source Project Inspired by Zef Hemel ([email protected])                    *
                     * =============================================================================== *
                     * Software Version:           SMF 1.1.3                                           *
                     * Software by:                Simple Machines (http://www.simplemachines.org)     *
                     * Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) *
                     *           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
                     * Support, News, Updates at:  http://www.simplemachines.org                       *
                     ***********************************************************************************
                     * This program is free software; you may redistribute it and/or modify it under   *
                     * the terms of the provided license as published by Simple Machines LLC.          *
                     *                                                                                 *
                     * This program is distributed in the hope that it is and will be useful, but      *
                     * WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
                     * or FITNESS FOR A PARTICULAR PURPOSE.                                            *
                     *                                                                                 *
                     * See the "license.txt" file for details of the Simple Machines license.          *
                     * The latest version can always be found at http://www.simplemachines.org.        *
                     **********************************************************************************/
                     
                     
                     /*   This, as you have probably guessed, is the crux on which SMF functions.
                        Everything should start here, so all the setup and security is done
                        properly.  The most interesting part of this file is the action array in
                        the smf_main() function.  It is formatted as so:
                     
                           'action-in-url' => array('Source-File.php', 'FunctionToCall'),
                     
                        Then, you can access the FunctionToCall() function from Source-File.php
                        with the URL index.php?action=action-in-url.  Relatively simple, no?
                     */
                     
                                                           .... and the rest of the index.php code...      
                     ?>
                  </div>
               </td>
              </tr>
        </table>
     </td>
   </tr>
</table>
</body>
</html>

The forum looks just fine, but it have a problem, each time I try to use a form like the register or try to post a message the page gets blank, don't show the forum, but it do post the message... Can somebody tell me what it's wrong with my method? Am I a mad scientist? WHAT'S WRONG!?!?!?!
Title: Re: Integrating the forum into your site...
Post by: ajayvibha on September 20, 2007, 01:30:44 PM
Hi,

I am following the cooler way and I facing problem as heder image are not appearing except for main forum page.I have made a separate post for this problem at http://www.simplemachines.org/community/index.php?topic=195826.0

Multiple times I have read the various tips / guidelines but still there seem to be problem.

Can someone help .

Thanks & Regards,
Ajay

Title: Re: Integrating the forum into your site...
Post by: Rabain on September 29, 2007, 03:45:28 PM
This is a lazy question:

Are there templates for sites using this integration where you just need to populate your own database address etc?

I just want to get something presentable up and then work on it as I go.
Title: Re: Integrating the forum into your site...
Post by: Kindred on September 30, 2007, 01:57:25 PM
lazy answer.... no
Title: Re: Integrating the forum into your site...
Post by: lukehol on May 22, 2008, 11:29:55 AM
Hi,

I know this topic is rather old, but I already posted a new topic and nobody replied to it, so I thought I would restart this one.

My problem is this: after using the 'cooler way' I am having problems validating. It seems only to have a single error, that my </head> tag isn't showing.

My site is aenglish dot net / english-forum

Can anyone advise about this? Otherwise I'm extremely happy with this integration.

Luke
Title: Re: Integrating the forum into your site...
Post by: SA™ on June 20, 2008, 03:48:57 AM
how can i sort this out im trying to include my left.php from my main site and i have manged to do so but im facing this problem see here

http://waynesworld.kicks-ass.net/forum/index.php

the forum is half way down the page

and when i click arcade the left blocks go all the way to the bottom

what need doing

this is the code i added to my index.template.php

echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="20%">';
include 'C:\xampp\htdocs/left.php';
echo '</td>


and my left.php code

<link rel="stylesheet" type="text/css" href="site style.css" />
</div>
<div id="navcol">
    <table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Best Players</td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">
<?php   //Game Of The Day                                                  
$no=5;

global 
$sourcedir,$user_info;
require_once(
$sourcedir.'/ArcadeDbConnector.php');
require_once(
$sourcedir '/Subs-Arcade.php');
require_once(
$sourcedir.'/ArcadeStats.php');
require_once(
$sourcedir.'/ArcadeBlocks.php');

//$user_info[query_see_game]=1;   

loadArcadeSettings();
loadLanguage('Arcade');

//$arcade_display = Arcade3champsBlock($no);

//$arcade_display = ArcadeInfoLongestChamps($no);

//$arcade_display = ArcadeInfoMostPlayed($no);

$arcade_display ArcadeInfoBestPlayers($no);

//$arcade_display = ArcadeRandomGameBlock();

//$arcade_display = ArcadeGOTDBlock();

echo $arcade_display
echo 
'</table><p>

 <table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Most Played</td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">'
;
//Game Of The Day                                                  
$no=5;

global 
$sourcedir,$user_info;
require_once(
$sourcedir.'/ArcadeDbConnector.php');
require_once(
$sourcedir '/Subs-Arcade.php');
require_once(
$sourcedir.'/ArcadeStats.php');
require_once(
$sourcedir.'/ArcadeBlocks.php');

//$user_info[query_see_game]=1;   

loadArcadeSettings();
loadLanguage('Arcade');

//$arcade_display = Arcade3champsBlock($no);

//$arcade_display = ArcadeInfoLongestChamps($no);

$arcade_display ArcadeInfoMostPlayed($no);

//$arcade_display = ArcadeInfoBestPlayers($no);

//$arcade_display = ArcadeRandomGameBlock();

//$arcade_display = ArcadeGOTDBlock();

echo $arcade_display;

?>

</table>
<p>
<table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Newest Games</td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">
<?php   //Game Of The Day                                                  
$no=5;

global 
$sourcedir,$user_info;
require_once(
$sourcedir.'/ArcadeDbConnector.php');
require_once(
$sourcedir '/Subs-Arcade.php');
require_once(
$sourcedir.'/ArcadeStats.php');
require_once(
$sourcedir.'/ArcadeBlocks.php');

//$user_info[query_see_game]=1;   

loadArcadeSettings();
loadLanguage('Arcade');

//$arcade_display = Arcade3champsBlock($no);

$arcade_display ArcadeInfoNewestGames($no);

//$arcade_display = ArcadeInfoLongestChamps($no);

//$arcade_display = ArcadeInfoMostPlayed($no);

//$arcade_display = ArcadeInfoBestPlayers($no);

//$arcade_display = ArcadeRandomGameBlock();

//$arcade_display = ArcadeGOTDBlock();

echo $arcade_display;?>

</table><p>
<table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Game Of The Day</td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">
<?php
//Game Of The Day                                                  
$no=5;

global 
$sourcedir,$user_info;
require_once(
$sourcedir.'/ArcadeDbConnector.php');
require_once(
$sourcedir '/Subs-Arcade.php');
require_once(
$sourcedir.'/ArcadeStats.php');
require_once(
$sourcedir.'/ArcadeBlocks.php');

$user_info[query_see_game]=1;   

loadArcadeSettings();
loadLanguage('Arcade');

//$arcade_display = Arcade3champsBlock($no);

//$arcade_display = ArcadeInfoLongestChamps($no);

//$arcade_display = ArcadeInfoMostPlayed($no);

//$arcade_display = ArcadeInfoBestPlayers($no);

//$arcade_display = ArcadeRandomGameBlock();

$arcade_display ArcadeGOTDBlock();

echo 
$arcade_display;
?>

</table>
<p>
<table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Link To Us & Friends  </td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">
<br>
<p align="center"><a href="http://waynesworld.kicks-ass.net"><img src="http://waynesworld.kicks-ass.net/forum/banners/banner.gif"><br>
<br><TEXTAREA id=holdtext rows=3 cols=20><p align="center"><a href="http://waynesworld.kicks-ass.net"><img src="http://waynesworld.kicks-ass.net/forum/banners/banner.gif"></textarea></a>
<br>
<p align="center"><a href="http://www.smfgames.net/index.php"><img src="http://www.smfgames.net/buttom.jpg">
<br>
<p align="center"><a href="http://www.ridersplace.net"><img src="http://waynesworld.kicks-ass.net/forum/banners/rider.gif">


</table>

<p>
<table width="186"   style="border: solid 1px #696464; cellpadding="4" cellspacing="0" bgcolor="">
        <tr>
        <td width="186" height="29" class="titlebg">Please Vote For us </td>
        </tr>
        <tr>
        <td width="186" height="70" class="windowbg2" valign="left">
<a href="http://tinyadminresources.com/extras/topsites/"><img
src="http://tinyadminresources.com/extras/topsites/button.php?u=wdm2005" alt="TAR
Topsites" border="0" /></a>




<a href="http://www.smftopsite.com/"><img src="http://www.smftopsite.com/button.php?u=wdm2005" alt="SMFTopSite.com" border="0" /></a>










<!-- BEGIN TOP SITE LIST PLANET VOTING CODE -->

<a href="http://arcade.top-site-list.com/vote572.html">
<IMG SRC="http://arcade.top-site-list.com/images/voteimage/arcade-1.gif" border=0></a><br><a href="http://www.top-site-list.com/">Arcade Top Site List</a>

<!-- END TOP SITE LIST PLANET VOTING CODE -->




<a href="http://www.best-arcade.net/"><img src="http://www.best-arcade.net/button.php?u=wdm2005" alt="The Best Arcade Sites on the Net!" border="0" /></a>




<!-- Begin TopGameSites voting code -->
<a href="http://www.topgamesites.net/general" title="Top General Gaming sites" target="_blank"> <img src="http://www.topgamesites.net/images/10.jpg" border="0" alt="Top General Gaming sites" /></a>
<noscript><a href="http://www.topgamesites.net">Private Servers</a></noscript>
<!-- End TopGameSites voting code -->


<!-- Arcade Top Sites -->
<a href="http://www.arcadetopsites.com/index.php?do=votes&id=1263"><img border="0" src="http://www.arcadetopsites.com/button.gif" alt="Arcade Top Sites" /></a>
<!-- /Arcade Top Sites -->


<a href="http://www.arcadetopsite.com/"><img src="http://www.arcadetopsite.com/button.php?u=wdm2005" alt="Arcade Top Site" border="0" /></a>


<a href="http://www.toparcadesite.com/"><img src="http://www.toparcadesite.com/button.php?u=wdm2005" alt="Top Arcade Sites" border="0" /></a>
</table>
</div>



please help thanks
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 20, 2008, 04:48:43 AM
well for one if you'v got a header.php you might want to combine the 2. second when i follow the link all i see is a login screen and some forums no sidebar. also you may want to make the "include('C:\xampp\htdocs/left.php');" relative to the forum so it will work on pritty much any server without having to modify the directory structure all the time.
Title: Re: Integrating the forum into your site...
Post by: SA™ on June 20, 2008, 04:58:09 AM
well that just lost me :D why would i want to combine the header and left ? doesnt make sence to me yes i commented it out for now cos it looks crap
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 20, 2008, 05:45:47 AM
well usualy a website loads left to right top to bottom. so putting the left in the head section will just prevent you from having all these files that need including.

not being able to see the site i can't rly  help you much.

also waynes world is also the name of an Australian kids TV show...
Title: Re: Integrating the forum into your site...
Post by: SA™ on June 21, 2008, 01:38:36 AM
Quote from: [Unknown] on November 09, 2004, 11:36:22 PM
The Cooler Way

This other way, we're going to use what are called "layers".  Because of this, we will need to make a small change to the database.  If you don't have a way to get to the database, such as phpMyAdmin, you may wish to install and learn how to use it (phpMyAdmin, I mean.)

So, the first step is to create the "layer" itself.  A layer is simply two sub templates that go above and below the content.  For example, by default the 'main' layer is used, which means that above the main part of the page 'main_above' will be shown... and below, 'main_below' will be shown.  Not too difficult, right?

So, creating the layer only means creating two sub templates.  At the end of index.template.php, right before the ?>, add:
function template_site_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc1" />';

if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />
', $context['html_headers'], '
</head>
<body>';

include('header.php');
}

function template_site_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

include('footer.php');

echo '
</body></html>';
}


Again, if you have the header.php and footer.php files outside of your forum directory, you may have to change those lines slightly to point things to them.  So, if they're in your site's directory, just outside the forum directory, use ../header.php and ../footer.php.

The next step is to remove the shrink thing, since it won't work.  As said above, find and remove:

<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" />



Again, don't remove that last '; because it makes things work.

Now, in the templates it was using before, you need to remove the header and footer parts.  This means removing everything from:
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

To:
<body>';

And then removing:
echo '
</body>
</html>';


Now, if you did this, and went to your forum, it'd look REALLY CRAPPY.  There's one last vital thing that needs to be done for it to work.  And to do that, we need the id of the theme we're working with.

To find this id (which, if you've only created one theme, will be 3) you will need to check the link to "preview" it in your profile.  You'll see it say "theme=xyz".  The number (I put xyz but it should be a number) is the id.  Once you have that, you want to write the following query in phpMyAdmin - go to your database and pick the SQL tab, and type in the box:

REPLACE INTO yourprefix_themes
   (ID_THEME, variable, value)
VALUES (that number, 'theme_layers', 'site,main');

(where yourprefix_ is your prefix, often 'smf_' and that number is the theme id we found.)

By the by, if you're wanting to distribute your theme, and use layers, look in the file named "theme_info.xml".  It has a special spot just for this information.  Remember that the layers are loaded in the order listed - in this case, it goes site_above -> main_above -> content -> main_below -> site_below.

Wonderful.  You're done, and everything looks fancy.  But, now, you probably did this to use it with SSI - how does one do that?  Try the following code, in a PHP file:

<?php

error_reporting
(E_ALL);

$ssi_theme that pesky number again;
$ssi_layers = array('site');

// If you want SSI.php to start gzipping for you ;).
$ssi_gzip true;

require(
'forum/SSI.php');

echo 
'some stuffs go here.';

ssi_shutdown();

?>

(where that pesky number again is the theme id, and forum/SSI.php is where ever SSI.php is - not a URL.)

I'll admit a more complicated system is used for this site, but the example given should be more than enough to help you power everything through SMF and its template system, should you wish to.

Good luck!  Tell me if you have problems... (in this topic please, I get too many pms...)

-[Unknown]

i understand i have to remove some stuff from my index.template.php

ie this

echo '<!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"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js?b21"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/theme.js?b21"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_default_theme_url = "', $settings['default_theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";', $context['show_pm_popup'] ? '
if (confirm("' . $txt['show_personal_messages'] . '"))
window.open("' . $scripturl . '?action=pm");' : '', '
var ajax_notification_text = "', $txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "', $txt['modify_cancel'], '";
// ]]></script>
<title>', $context['page_title'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';

// The ?b21 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?b21" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/print.css?b21" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/css/fonts-compat.css" />';



// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("upshrinkHeader");
mainHeader.addTogglePanel("upshrinkHeader2");
// ]]></script>';

echo '

</head>
<body>
';


but when i remove it the forum tabs dont work i have my forum tabbed  what is it?
Title: Re: Integrating the forum into your site...
Post by: mike16889 on June 21, 2008, 09:20:46 AM
removing the stuff is optinal. if it isnt working properly dont remove it.
Title: Re: Integrating the forum into your site...
Post by: Foxylucious on July 21, 2008, 06:46:13 PM
Hello i tryed this integrating thing, it almost worked  :P
But, well, i run version 1.1.5, and that code is a bit differnt from what is shown here in the examples... tryed to do it anyway with some logic.

Anyway after finnishing this and looking at the source code, the </head>and<body>  tags where are missing...
looked like the part; from the line...

if ($context['browser']['needs_size_fix'])
echo '<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />', $context['html_headers']
<link rel="stylesheet" href="http://www.chatkamer.com/ckcom.css" type="text/css" />
</head>
<body>';

from the 'function template_site_above()' doesn't work great... any idea how to solve this, and could it be that i removed to much by doing everything that was told in the second post in this topic... (for version 1.1.5)
Thanks for any reply's

tryed the updated post put there was the index.template.php attachment missing or i couldn't find it  ;D

Thanks so far for this great helping post thing  ;D

Greetings Foxman eh.. Foxylucious
Title: Re: Integrating the forum into your site...
Post by: Kindred on July 21, 2008, 09:28:26 PM
that code can't be right....

what that code says is "... show everything in that echo statement, only if the browser needs_size_fix."



if ($context['browser']['needs_size_fix'])
echo '<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />', $context['html_headers']';

echo '
<link rel="stylesheet" href="http://www.chatkamer.com/ckcom.css" type="text/css" />
</head>
<body>';
Title: Re: Integrating the forum into your site...
Post by: Foxylucious on July 22, 2008, 12:47:33 AM
Yes, thanks. that's what i thought to.
i did change it like that, and it indeed solves that problem, but wasn;t sure if there was more in that statement that needed to be shown, whitout the "if"
Title: Re: Integrating the forum into your site...
Post by: Xaneth on October 13, 2008, 02:05:37 AM
This does not seem to work on SMF 2.0 Beta 4.  I recently upgraded from a working 1.1.5.  My old theme (created in 1.1.x) still works, but I can't really install any mods because my theme is using old code.  Any update for those that are running 2.x?
Title: Re: Integrating the forum into your site...
Post by: Xaneth on October 13, 2008, 01:04:33 PM
Not sure why I was having trouble, but got it sorted out using the method at:

http://www.simplemachines.org/community/index.php?topic=19638.0

Works great for fully integrating the forum into your website.  Pretty sure it was because I was using Firefox at home without the web developer tools, which disable cached settings like I have on my other computer :)
Title: Re: Integrating the forum into your site...
Post by: Kleidi on December 27, 2009, 05:23:35 AM
Hello every1 !
I was looking around for a tutorial how to integrate the smf 2.0 rc2 into my existing site that is made in php/html. I have searched and found some tutorials but they are 2 old and doesn't worked for smf 2.0 . They r made for smf 1.+ version. (Like this one)
Can some1 help me with any "How to..." tutorial to integrate smf 2.0 on an existing site, pleaseeeeeeeeeeeeee?
Thank you in advance!
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on December 27, 2009, 08:58:48 PM
I have used most of the tutorial on the 2.x version and most of it is still useful, the templates changed a little between versions but the principle is still sound.
Title: Re: Integrating the forum into your site...
Post by: Kindred on December 27, 2009, 11:38:54 PM
and, as a side note, I suggest that you learn to write in proper English...
Title: Re: Integrating the forum into your site...
Post by: Kleidi on December 29, 2009, 06:11:06 AM
OK, thank you for your reply.

It was a little hard for me bcz I'm a starter in php but i think i have made some progresses :P
I have integrated (tried :P ) smf on my existing site with "layer" mode but i receive this msg when i access my forum:
Unable to load the 'main_above' template.

I have attached the index.template.php file that i'm using.
Thank you for your help!
Title: Re: Integrating the forum into your site...
Post by: Kleidi on December 29, 2009, 10:41:08 AM
help plssssssssssss
Title: Re: Integrating the forum into your site...
Post by: Kindred on December 29, 2009, 11:15:52 AM
please do not bump...  and please do not whine.
the support staff and others are scattered all over the world, so just because someone does not respond immediately is not a reason to bump.
Title: Re: Integrating the forum into your site...
Post by: Legend Zero on January 01, 2010, 05:55:57 PM
I tried doing this with a non-default theme and DAMN was that a mistake, apparently now only the first teeny tiny bit of content is acceptable, as it breaks the table after the first post of ANY thread.

Just thought you would all want to know that.
Title: Re: Integrating the forum into your site...
Post by: Kleidi on January 06, 2010, 08:18:13 PM
Hello there,

I made all the modification that Unknown provide on this thread and i received the msg that is unable to load the 'main_above' template. I have provided the index.template source on a post some times ago, and now i have attached with this post an printscreen how the site looks like with the modification made.

Thank you for your support!
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on January 07, 2010, 02:42:49 AM
Well see there has been some changes in the templates that need to be taken into consideration. If I get time in the next few days I will write up an addition to the topic that is linked in the first post and expand this to the new version of smf. Its still about the same as the old tutorial but there are more layers that need to be accounted for.

We are now using two layers in a default template which are html, body. So site needs to be added to this in the themes table, column layers. To test this you can manually change this in the database via phpmyadmin. Keep in mind that you should ideally, if your going to use the "site" layer then you will need a site_above and a site_below function (subtemplate) in the theme file iirc (its been awhile since I did this myself). As a short example you can have this in the template file.

This will go between the html layer and the body layer (the below layer will go after the body below layer etc)
function template_site_above(){
echo '<div>This is just so we can see where this will show up</div>';


function template_site_below(){
echo '<div>This is just so we can see where this will show up</div>';


Look in the themes table and find the column which corresponds with the correct theme ID and add the site layer to the column. Reload the page and see if you still get the same error. Please understand I am writing this from memory......
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on January 07, 2010, 02:49:57 AM
I took a look at the file and there is no need to change anything with the default functions. Just add the two functions. If I find time I will try to edit the file you have attached so that it will work (as long as the db changes have been made).
Title: Re: Integrating the forum into your site...
Post by: Kleidi on January 09, 2010, 04:53:41 PM
Quote from: Tyrsson™ on January 07, 2010, 02:49:57 AM
I took a look at the file and there is no need to change anything with the default functions. Just add the two functions. If I find time I will try to edit the file you have attached so that it will work (as long as the db changes have been made).
Thank you Tyrsson for the reply.
I have made the database modification as Unknown said at the first page of this post.
When you get time, pls, made the needed modification on that template. Please ...
Thank you again ;)
Title: Re: Integrating the forum into your site...
Post by: ACAMS on January 10, 2010, 04:24:29 PM
After I got my forum looking like I wanted it to, I opened the forum and then right clicked selected View Source then I made an index.php (with a few hours work) and made the rest of my site look like the forum.

http://gametechmods.com/ (http://gametechmods.com/)
Title: Re: Integrating the forum into your site...
Post by: Kindred on January 10, 2010, 05:10:00 PM
that, of course, does not take into account any of the conditional php code that the templates use to display the forum header, footer or anything else.
Title: Re: Integrating the forum into your site...
Post by: Kleidi on January 10, 2010, 05:23:30 PM
Quote from: ACAMS on January 10, 2010, 04:24:29 PM
After I got my forum looking like I wanted it to, I opened the forum and then right clicked selected View Source then I made an index.php (with a few hours work) and made the rest of my site look like the forum.

http://gametechmods.com/ (http://gametechmods.com/)
It's a good idea, but, when u make any changes on forum like adding/deleting/editing  forum/subforum or adding any mod on it, those modifications will not appear... or i'm wrong ?
Title: Re: Integrating the forum into your site...
Post by: ACAMS on January 10, 2010, 07:07:47 PM
Right, I have to manually add any extras......like snow.
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on January 10, 2010, 09:50:49 PM
Remember to declare any variables that you will need as global within the functions you add.
Title: Re: Integrating the forum into your site...
Post by: Kleidi on January 20, 2010, 07:33:47 PM
Quote from: Kleidi on January 09, 2010, 04:53:41 PM
Quote from: Tyrsson™ on January 07, 2010, 02:49:57 AM
I took a look at the file and there is no need to change anything with the default functions. Just add the two functions. If I find time I will try to edit the file you have attached so that it will work (as long as the db changes have been made).
Thank you Tyrsson for the reply.
I have made the database modification as Unknown said at the first page of this post.
When you get time, pls, made the needed modification on that template. Please ...
Thank you again ;)

Any idea Tyrsson ? You got any time to take a look there ?
Thx anyway
Title: Re: Integrating the forum into your site...
Post by: Josh79 on January 25, 2010, 11:26:35 AM
I am using 2.0 and trying to add my own headers and footers.  I followed the directions to my ability and was finally able to get my page to load, but it is an index instead of a forum.  I created my website in rapidweaver, if you are familiar, and have been using an HTML editor.

Should I upload my index.template?

Here is what I am using for a header template and index template
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on January 25, 2010, 01:37:20 PM
Quote from: Kleidi on January 20, 2010, 07:33:47 PM
Quote from: Kleidi on January 09, 2010, 04:53:41 PM
Quote from: Tyrsson™ on January 07, 2010, 02:49:57 AM
I took a look at the file and there is no need to change anything with the default functions. Just add the two functions. If I find time I will try to edit the file you have attached so that it will work (as long as the db changes have been made).
Thank you Tyrsson for the reply.
I have made the database modification as Unknown said at the first page of this post.
When you get time, pls, made the needed modification on that template. Please ...
Thank you again ;)

Any idea Tyrsson ? You got any time to take a look there ?
Thx anyway
Actually it will be faster if I just post a template that has been edited in the way I suggested. Will try to get to it today, just a lot going on.
Title: Re: Integrating the forum into your site...
Post by: Kleidi on February 20, 2010, 03:57:52 PM
Thx bro ... just waiting for it ;)
Title: Re: Integrating the forum into your site...
Post by: yitwail on March 12, 2010, 03:27:31 AM
I'd just like to acknowledge that I tried the simple method outlined here (because I don't need SSI functionality) and it worked flawlessly. My last project was embedding WordPress in my site, and this was so much easier.  :) And with most other Forum software, I probably would have had to create a new template/style/whatever. I just hope the process will work again when SMF 2.x is released.
Title: Re: Integrating the forum into your site...
Post by: Tyrsson on April 05, 2010, 10:29:37 PM
Quote from: Kleidi on February 20, 2010, 03:57:52 PM
Thx bro ... just waiting for it ;)
Kleidi, Can you please send me a copy of the file and I hope I can get to it tomorrow. YOU can email it to support [at] tyrsson.com