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:

Code: [Select]
<html
And keep going down until:
Code: [Select]
<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!)

Code: [Select]
<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:

Code: [Select]
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:

Code: [Select]
<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:
Code: [Select]
</body>
Above that, you will see a line that says echo ' - and, above that, we want to add:

Code: [Select]
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:
Code: [Select]
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:

Code: [Select]
<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:
Code: [Select]
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
To:
Code: [Select]
<body>';
And then removing:
Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
<?php

error_reporting
(E_ALL);

$ssi_theme that pesky number again;
$ssi_layers = array(&#39;site&#39;);

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

require(&
#39;forum/SSI.php&#39;);

echo &#39;some stuffs go here.&#39;;

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,

Code: [Select]
<?php
require(&#39;./smf/SSI.php&#39;);
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
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

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

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,

Code: [Select]
<?php
require(&#39;./smf/SSI.php&#39;);
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
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
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:

Code: [Select]
   

// 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:

Quote
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.

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
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?

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:

Code: [Select]
// 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:

Code: [Select]
// 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
Code: [Select]
<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
Code: [Select]
</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
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:

Code: [Select]
<!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
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?

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.
Quote
Unable 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:

Code: [Select]
<?php
$ssi_layers 
= array(&#39;main&#39;);
$pagetitle "Sakamuyo Christian Fellowship";
ob_start();
include(&
#39;/home2/sakamuyo/public_html/community/SSI.php&#39;);

// 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:

Code: [Select]
// 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:

Code: [Select]
// 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(&#39;left_menu.php&#39;); ?></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:
Code: [Select]
// 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
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?


Code: [Select]
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
......... 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
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:

Code: [Select]
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.

Quote
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.

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

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?

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:

Code: [Select]
abc
def
xyz

And:

Code: [Select]
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:

Code: [Select]
#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:

Code: [Select]
#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
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
Code: [Select]
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
Code: [Select]
include('header.php');
will search from your forum root

Code: [Select]
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
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
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?

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:
Code: [Select]
// 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
Code: [Select]
<?php
echo &
#39;  
to the beginning, and
Code: [Select]
'
?>
          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
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?

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:
Code: [Select]
<!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:
Code: [Select]
// 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:
Code: [Select]
<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:
Code: [Select]
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:
Code: [Select]
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
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?


Code: [Select]
<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:
Code: [Select]
<?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 &#39;always&#39;, images from the default theme will be used.
if this is &#39;defaults&#39;, images from the default theme will only be used with default templates.
if this is &#39;never&#39; or isn&#39;t set at all, images from the default theme will not be used. */
$settings[&#39;use_default_images&#39;] = &#39;never&#39;;

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

// 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 &#39;
<div id="headerarea" style="padding: 12px 30px 4px 30px;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">&#39;;

// The logo and the three info boxes
echo &#39;
<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;">&#39;;

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

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

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

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

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

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

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

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

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

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

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

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

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

<form action="&#39;, $scripturl, &#39;?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">&#39;, $txt[&#39;smf53&#39;], &#39;</option>
<option value="1440">&#39;, $txt[&#39;smf47&#39;], &#39;</option>
<option value="10080">&#39;, $txt[&#39;smf48&#39;], &#39;</option>
<option value="302400">&#39;, $txt[&#39;smf49&#39;], &#39;</option>
<option value="-1" selected="selected">&#39;, $txt[&#39;smf50&#39;], &#39;</option>
</select>
<input type="submit" value="&#39;, $txt[34], &#39;" /><br />
&#39;, $txt[&#39;smf52&#39;], &#39;
</form>&#39;;
}

echo &#39;
</td></tr></table>
</div>

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

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

echo &#39;
</form>

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

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

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

echo &#39;
</td>
</tr>
</table>

&#39;;

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

echo &#39;
</div>&#39;;

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

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

echo &#39;</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>&#39;;

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

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(elementvalue)
{
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="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-mysql.gif" alt="&#39;, $txt[&#39;powered_by_mysql&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-php.gif" alt="&#39;, $txt[&#39;powered_by_php&#39;], &#39;" 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;">
&#39;, theme_copyright(), &#39;
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-xhtml10.gif" alt="&#39;, $txt[&#39;valid_xhtml&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-css.gif" alt="&#39;, $txt[&#39;valid_css&#39;], &#39;" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>&#39;;

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

echo &#39;
</div>&#39;;

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

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

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

for (var 0codeFix.lengthi++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight 20)
codeFix[i].style.height = (codeFix[i].offsetHeight 20) + "px";
}
}&#39;;
else
{
echo &#39;
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 0codeFix.lengthi++)
{
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();
}&#39;;
}

echo &#39;
// --></script>&#39;;
}

}

// 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 &#39;<span class="nav"&#39;, $settings[&#39;linktree_inline&#39;] ? &#39; style="font-size: smaller;"&#39; : &#39;&#39;, &#39;>&#39;;

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

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

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

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

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

echo &#39;</span>&#39;;
}

// 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 &#39;
<a href="&#39;, $scripturl, &#39;">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/home.gif" alt="&#39; . $txt[103] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[103]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;], &#39;
<a href="&#39;, $scripturl, &#39;?action=help" target="_blank">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/help.gif" alt="&#39; . $txt[119] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[119]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;];

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

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

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

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


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


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

echo &#39;<!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="&#39;, $settings[&#39;default_theme_url&#39;], &#39;/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url "&#39;, $settings[&#39;theme_url&#39;], &#39;";
var smf_images_url "&#39;, $settings[&#39;images_url&#39;], &#39;";
// --></script>
<title>&#39;, $context[&#39;page_title&#39;], &#39;</title>
<link rel="stylesheet" type="text/css" href="&#39;, $settings[&#39;theme_url&#39;], &#39;/style.css?rc1" />&#39;;

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

include(&#39;header.php&#39;);
}

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

include(&#39;footer.php&#39;);

echo &#39;
</body></html>&#39;;
}
?>

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:
Code: [Select]
<!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
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
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,

Code: [Select]
<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:

Code: [Select]
</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:
Code: [Select]
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
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
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:

Code: [Select]
<?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[&#39;linktree&#39;] 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 &#39;always&#39;, images from the default theme will be used.
      if this is &#39;defaults&#39;, images from the default theme will only be used with default templates.
      if this is &#39;never&#39; or isn&#39;t set at all, images from the default theme will not be used. */
   $settings[&#39;use_default_images&#39;] = &#39;never&#39;;

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

// 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 &#39;
   <div id="headerarea" style="padding: 12px 30px 4px 30px;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">&#39;;

   // The logo and the three info boxes.
   echo &#39;
      <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;">&#39;;

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

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

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

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

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

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

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

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

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

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

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

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

<form action="&#39;, $scripturl, &#39;?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">&#39;, $txt[&#39;smf53&#39;], &#39;</option>
<option value="1440">&#39;, $txt[&#39;smf47&#39;], &#39;</option>
<option value="10080">&#39;, $txt[&#39;smf48&#39;], &#39;</option>
<option value="302400">&#39;, $txt[&#39;smf49&#39;], &#39;</option>
<option value="-1" selected="selected">&#39;, $txt[&#39;smf50&#39;], &#39;</option>
</select>
<
input type="submit" value="&#39;, $txt[34], &#39;" /><br />
&
#39;, $txt[&#39;smf52&#39;], &#39;
</form>&#39;;
}

echo &
#39;
</td></tr></table>
</
div></div>

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

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

echo &#39;
</form>

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

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

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

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

   echo &#39;
   </div>&#39;;

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

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

   echo &#39;</td>
   </tr></table>&#39;;

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

   <div id="footerarea" style="color: #C4C4C4; text-align: center; padding-bottom: 1ex;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">
      <script language="JavaScript" type="text/javascript"><!--
         function smfFooterHighlight(elementvalue)
         {
            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="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-mysql.gif" alt="&#39;, $txt[&#39;powered_by_mysql&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-php.gif" alt="&#39;, $txt[&#39;powered_by_php&#39;], &#39;" 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;">
               &#39;, theme_copyright(), &#39;
            </td>
            <td width="28%" valign="middle" align="left">
               <a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-xhtml10.gif" alt="&#39;, $txt[&#39;valid_xhtml&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-css.gif" alt="&#39;, $txt[&#39;valid_css&#39;], &#39;" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
            </td>
         </tr>
      </table>&#39;;

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

   echo &#39;
      </div>&#39;;

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

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

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

            for (var 0codeFix.lengthi++)
            {
               if (codeFix[i].className == "code" && codeFix[i].offsetHeight 20)
                  codeFix[i].style.height = (codeFix[i].offsetHeight 20) + "px";
            }
         }&#39;;
      else
      {
         echo &#39;
         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 0codeFix.lengthi++)
            {
               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();
         }&#39;;
      }

      echo &#39;
      // --></script>&#39;;
   }
}

// 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 &#39;<span class="nav"&#39;, $settings[&#39;linktree_inline&#39;] ? &#39; style="font-size: smaller;"&#39; : &#39;&#39;, &#39;>&#39;;

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

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

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

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

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

   echo &#39;</span>&#39;;
}

// 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 &#39;
            <a href="&#39;, $scripturl, &#39;">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/home.gif" alt="&#39; . $txt[103] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[103]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;], &#39;
            <a href="&#39;, $scripturl, &#39;?action=help" target="_blank">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/help.gif" alt="&#39; . $txt[119] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[119]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;];

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

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

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

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

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

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

echo &
#39;<!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="&#39;, $settings[&#39;default_theme_url&#39;], &#39;/script.js"></script>
<
script language="JavaScript" type="text/javascript"><!--
var 
smf_theme_url "&#39;, $settings[&#39;theme_url&#39;], &#39;";
var 
smf_images_url "&#39;, $settings[&#39;images_url&#39;], &#39;";
// --></script>
<title>&#39;, $context[&#39;page_title&#39;], &#39;</title>
<link rel="stylesheet" type="text/css" href="&#39;, $settings[&#39;theme_url&#39;], &#39;/style.css?rc1" />&#39;;

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

include(&#39;header.php&#39;);
}

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

include(&
#39;footer.php&#39;);

echo &#39;
</body></html>&#39;;
}

?>

**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:

Code: [Select]
</head>
<body>';
   include('header.php');

   echo '

and...

Code: [Select]
   include('footer.php');
   echo '
   </body>
</html>';

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

Code: [Select]
#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:

Code: [Select]
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:
Code: [Select]
<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:
Code: [Select]
<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

Code: [Select]
include('header.php');
and the below code in template_main_below() function

Code: [Select]
include('footer.php');

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

Code: [Select]

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

include(&
#39;header.php&#39;);
include(&#39;footer.php&#39;);

.
.
.
.
.
.

?>



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

Code: [Select]
<?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[&#39;linktree&#39;] 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 &#39;always&#39;, images from the default theme will be used.
if this is &#39;defaults&#39;, images from the default theme will only be used with default templates.
if this is &#39;never&#39; or isn&#39;t set at all, images from the default theme will not be used. */
$settings[&#39;use_default_images&#39;] = &#39;never&#39;;

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

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

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

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

/* Show sticky and lock status seperate from topic icons? */
$settings[&#39;seperate_sticky_lock&#39;] = 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 &#39;
<div class="tborder" &#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; style="width: 100%;"&#39; : &#39;&#39;, &#39;>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">&#39;;

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

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


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

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

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


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

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

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

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

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

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

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

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

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

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

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

echo &#39;
</td>
</tr>
</table>
</td>
</tr>
</table>&#39;;

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

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings[&#39;enable_news&#39;]))
echo &#39;
<td width="90%" class="titlebg2">
<span class="smalltext"><b>&#39;, $txt[102], &#39;</b>: &#39;, $context[&#39;random_news_line&#39;], &#39;</span>
</td>&#39;;
echo &#39;
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="&#39;, $scripturl, &#39;?action=search2" method="post" style="margin: 0;">
<a href="&#39;, $scripturl, &#39;?action=search;advanced"><img src="&#39;.$settings[&#39;images_url&#39;].&#39;/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="&#39;, $txt[182], &#39;" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />&#39;;

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

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

echo &#39;
</form>
</td>
</tr>
</table>
</div>&#39;;


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


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

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

echo &#39;
</div>&#39;;

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

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(elementvalue)
{
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="&#39;, !$context[&#39;right_to_left&#39;] ? &#39;right&#39; : &#39;left&#39;, &#39;">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-mysql.gif" alt="&#39;, $txt[&#39;powered_by_mysql&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/powered-php.gif" alt="&#39;, $txt[&#39;powered_by_php&#39;], &#39;" 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;">
&#39;, theme_copyright(), &#39;
</td>
<td width="28%" valign="middle" align="&#39;, !$context[&#39;right_to_left&#39;] ? &#39;left&#39; : &#39;right&#39;, &#39;">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-xhtml10.gif" alt="&#39;, $txt[&#39;valid_xhtml&#39;], &#39;" 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="&#39;, $settings[&#39;images_url&#39;], &#39;/valid-css.gif" alt="&#39;, $txt[&#39;valid_css&#39;], &#39;" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>&#39;;

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

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

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

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

for (var 0codeFix.lengthi++)
{
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";
}
}&#39;;
else
echo &#39;
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 codeFix.length 10i--)
{
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 != || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload null;
}
}&#39;;

echo &#39;
// ]]></script>&#39;;
}

}

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

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

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

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

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

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

echo &#39;</div>&#39;;
}

// 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 = &#39;home&#39;;
if (in_array($context[&#39;current_action&#39;], array(&#39;admin&#39;, &#39;ban&#39;, &#39;boardrecount&#39;, &#39;cleanperms&#39;, &#39;detailedversion&#39;, &#39;dumpdb&#39;, &#39;featuresettings&#39;, &#39;featuresettings2&#39;, &#39;findmember&#39;, &#39;maintain&#39;, &#39;manageattachments&#39;, &#39;manageboards&#39;, &#39;managecalendar&#39;, &#39;managesearch&#39;, &#39;membergroups&#39;, &#39;modlog&#39;, &#39;news&#39;, &#39;optimizetables&#39;, &#39;packageget&#39;, &#39;packages&#39;, &#39;permissions&#39;, &#39;pgdownload&#39;, &#39;postsettings&#39;, &#39;regcenter&#39;, &#39;repairboards&#39;, &#39;reports&#39;, &#39;serversettings&#39;, &#39;serversettings2&#39;, &#39;smileys&#39;, &#39;viewErrorLog&#39;, &#39;viewmembers&#39;)))
$current_action = &#39;admin&#39;;
if (in_array($context[&#39;current_action&#39;], array(&#39;search&#39;, &#39;admin&#39;, &#39;calendar&#39;, &#39;profile&#39;, &#39;mlist&#39;, &#39;register&#39;, &#39;login&#39;, &#39;help&#39;, &#39;pm&#39;)))
$current_action $context[&#39;current_action&#39;];
if ($context[&#39;current_action&#39;] == &#39;search2&#39;)
$current_action = &#39;search&#39;;
if ($context[&#39;current_action&#39;] == &#39;theme&#39;)
$current_action = isset($_REQUEST[&#39;sa&#39;]) && $_REQUEST[&#39;sa&#39;] == &#39;pick&#39; ? &#39;profile&#39; : &#39;admin&#39;;

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

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

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

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

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

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

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

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

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

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


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


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


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

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

}

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

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

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

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

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

echo &#39;<!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="&#39;, $settings[&#39;default_theme_url&#39;], &#39;/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url "&#39;, $settings[&#39;theme_url&#39;], &#39;";
var smf_images_url "&#39;, $settings[&#39;images_url&#39;], &#39;";
// --></script>
<title>&#39;, $context[&#39;page_title&#39;], &#39;</title>
<link rel="stylesheet" type="text/css" href="&#39;, $settings[&#39;theme_url&#39;], &#39;/style.css?rc1" />&#39;;

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

include(&#39;header.php&#39;);
}

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

include(&#39;footer.php&#39;);

echo &#39;
</body></html>&#39;;
}
?>

Title: Re: Integrating the forum into your site...
Post by: bloc on January 28, 2006, 08:28:47 AM
Hi,

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

Code: [Select]
include('header.php');
and the below code in template_main_below() function

Code: [Select]
include('footer.php');

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

Code: [Select]

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

include(&
#39;header.php&#39;);
include(&#39;footer.php&#39;);

.
.
.
.
.
.

?>



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
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
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

Code: [Select]
<?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[&#39;linktree&#39;] 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 &#39;always&#39;, images from the default theme will be used.
if this is &#39;defaults&#39;, images from the default theme will only be used with default templates.
if this is &#39;never&#39; or isn&#39;t set at all, images from the default theme will not be used. */
$settings[&#39;use_default_images&#39;] = &#39;never&#39;;

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

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

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

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

/* Show sticky and lock status seperate from topic icons? */
$settings[&#39;seperate_sticky_lock&#39;] = 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 &#39;
<div id="headerarea" style="padding: 12px 30px 4px 30px;&#39;, $context[&#39;browser&#39;][&#39;needs_size_fix&#39;] && !$context[&#39;browser&#39;][&#39;is_ie6&#39;] ? &#39; width: 100%;&#39; : &#39;&#39;, &#39;">&#39;;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<form action="&#39;, $scripturl, &#39;?action=login2" method="post" style="margin: 3px 1ex 1px 0;"&#39;, empty($context[&#39;disable_login_hashing&#39;]) ? &#39; onsubmit="hashLoginPassword(this, \&#39;&#39; . $context[&#39;session_id&#39;] . &#39;\&#39;);"&#39; : &#39;&#39;, &#39;>
<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">&#39;, $txt[&#39;smf53&#39;], &#39;</option>
<option value="1440">&#39;, $txt[&#39;smf47&#39;], &#39;</option>
<option value="10080">&#39;, $txt[&#39;smf48&#39;], &#39;</option>
<option value="302400">&#39;, $txt[&#39;smf49&#39;], &#39;</option>
<option value="-1" selected="selected">&#39;, $txt[&#39;smf50&#39;], &#39;</option>
</select>
<input type="submit" value="&#39;, $txt[34], &#39;" /><br />
&#39;, $txt[&#39;smf52&#39;], &#39;
<input type="hidden" name="hash_passwrd" value="" />
</div>
</form>&#39;;
}

echo &#39;
</td></tr></table>
</div>

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

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

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

echo &#39;
</div>
</form>

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

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

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

echo &#39;
</td>
</tr>
</table>

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

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

echo &#39;
</div>&#39;;

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

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

echo &#39;</td>
</tr></table>&#39;;

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

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

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

echo &#39;
</div>&#39;;

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

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

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

for (var 0codeFix.lengthi++)
{
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";
}
}&#39;;
else
{
echo &#39;
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 codeFix.length 10i--)
{
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 != || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload null;
}
}&#39;;
}

echo &#39;
// ]]></script>&#39;;
}
}

// 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 &#39;<span class="nav"&#39;, $settings[&#39;linktree_inline&#39;] ? &#39; style="font-size: smaller;"&#39; : &#39;&#39;, &#39;>&#39;;

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

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

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

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

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

echo &#39;</span>&#39;;
}

// 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 &#39;
<a href="&#39;, $scripturl, &#39;">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/home.gif" alt="&#39; . $txt[103] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[103]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;], &#39;
<a href="&#39;, $scripturl, &#39;?action=help">&#39;, ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . $context[&#39;user&#39;][&#39;language&#39;] . &#39;/help.gif" alt="&#39; . $txt[119] . &#39;" style="margin: 2px 0;" border="0" />&#39; : $txt[119]), &#39;</a>&#39;, $context[&#39;menu_separator&#39;];

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

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

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

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

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

// Generate a strip of buttons, out of buttons.
function template_button_strip($button_strip$direction = &#39;top&#39;, $force_reset = false, $custom_td = &#39;&#39;)
{
global $settings$buttons$context$txt$scripturl;

if (empty($button_strip))
return &#39;&#39;;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value[&#39;test&#39;]) && empty($context[$value[&#39;test&#39;]]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = &#39;<a href="&#39; . $value[&#39;url&#39;] . &#39;" &#39; .( isset($value[&#39;custom&#39;]) ? $value[&#39;custom&#39;] : &#39;&#39;) . &#39;>&#39; . ($settings[&#39;use_image_buttons&#39;] ? &#39;<img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/&#39; . ($value[&#39;lang&#39;] ? $context[&#39;user&#39;][&#39;language&#39;] . &#39;/&#39; : &#39;&#39;) . $value[&#39;image&#39;] . &#39;" alt="&#39; . $txt[$value[&#39;text&#39;]] . &#39;" border="0" />&#39; : $txt[$value[&#39;text&#39;]]) . &#39;</a>&#39;;

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

echo &#39;
<td &#39;, $custom_td, &#39;>&#39;, implode($context[&#39;menu_separator&#39;], $button_strip) , &#39;</td>&#39;;
}
function 
template_site_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo &#39;<!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="&#39;, $settings[&#39;default_theme_url&#39;], &#39;/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url "&#39;, $settings[&#39;theme_url&#39;], &#39;";
var smf_images_url "&#39;, $settings[&#39;images_url&#39;], &#39;";
// --></script>
<title>&#39;, $context[&#39;page_title&#39;], &#39;</title>
<link rel="stylesheet" type="text/css" href="&#39;, $settings[&#39;theme_url&#39;], &#39;/style.css?rc1" />&#39;;

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

include(&#39;header.php&#39;);
}

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

include(&#39;footer.php&#39;);

echo &#39;
</body></html>&#39;;
}
?>

and here are my errors

Code: [Select]
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
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:
Code: [Select]
// 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
Code: [Select]
<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:

Code: [Select]
<?php
echo &#39;
<a href="example.php">This isn&#39;t right</a>&#39;;

echo&#39;
<a href="example2.php">It\&#39;s like this</a>&#39;;
?>


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.
Code: [Select]
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
Code: [Select]
        <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:
 
Quote
Unable 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=9cfd463c9c0b79439927af2a31b0438c)

---------------------------------------------
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
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
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.
Quote
You 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:
Quote
You 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:


Code: [Select]
// 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?

Code: [Select]
// 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=cc980eb014b8a1106e67872fdc28aac9)

Code: [Select]
// 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
Quote
can 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.

Quote
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...
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.
Code: [Select]
<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
 
Code: [Select]
// 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

Code: [Select]
// 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
Code: [Select]
<!--//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
Code: [Select]
<!--//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:




Code: [Select]
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
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
Code: [Select]
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
Quote
in 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:

Code: [Select]
/* 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:

Code: [Select]
/* 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. 
Quote
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.)
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
Quote
what 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
Code: [Select]
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:

Code: [Select]
/* The main body of the entire forum. */
body
{
   background-color: white;
   margin: 0px;
   padding: 0px;
}

And turned it into:

Code: [Select]
/* 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 Owner@nateodesigns.com
Title: Re: Integrating the forum into your site...
Post by: iraklion on November 22, 2006, 03:25:54 AM
Whatever you'd like!  Here's an example.  Find:

Code: [Select]
// 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:

Code: [Select]
// 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
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
Quote
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.
That would need to be a modification to the Index.template.php file. Index.template.php contains the header and footer of each page.
Quote
My 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.

Quote
I had the same problem  [copyright symbol thing]
Find:
Code: [Select]
©Replace with:
Code: [Select]
&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
So, creating the layer only means creating two sub templates.  At the end of index.template.php, right before the ?>, add:
Code: [Select]
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 understan