News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Integrating the forum into your site...

Started by [Unknown], November 09, 2004, 11:18:05 PM

Previous topic - Next topic

vibez

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/

bloc

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.

vibez

#122
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/

vibez

Ok i've investigated a little deeper and I think the code you have told us to add into the index.template.php at the end, isn't fully xhtml compatible?

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

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

Here is my edited index.template.php

<?php
// Version: 1.1 RC2; index

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

echo '
</div>
</form>

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

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

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

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

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

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

echo '
</div>'
;

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

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

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

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

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

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

echo '
</div>'
;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

echo '</span>';
}

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

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

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

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

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

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

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

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

if (empty($button_strip))
return '';

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

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

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

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

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

include('header.php');
}

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

include('footer.php');

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


and here are my errors

This page is not Valid XHTML 1.0 Transitional!

Below are the results of checking this document for XML well-formedness and validity.

   1. Error Line 10 column 58: document type does not allow element "div" here; assuming missing "object" start-tag.

      <div id="headerarea" style="padding: 12px 30px 4px 30px;">

      ✉
   2. Error Line 184 column 6: end tag for element "body" which is not open.

      </body></html>

      The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

      If this error occured in a script section of your document, you should probably read this FAQ entry.

      ✉
   3. Error Line 184 column 13: end tag for "object" omitted, but OMITTAG NO was specified.

      </body></html>

      You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

      ✉
   4. Info Line 10 column 1: start tag was here.

      <div id="headerarea" style="padding: 12px 30px 4px 30px;">

   5. Error Line 184 column 13: end tag for "head" omitted, but OMITTAG NO was specified.

      </body></html>

      ✉
   6. Info Line 2 column 6: start tag was here.

      <html><head>

   7. Error Line 184 column 13: end tag for "html" which is not finished.

      </body></html>

      Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

      Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.

Mr.Doro

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

jrcarr

[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
Jack Carr

Acf

Sigh...

jrcarr

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

Confused Too

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
Making the working lives of the disadvantaged a little easier.

jrcarr

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

Confused Too

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.
Making the working lives of the disadvantaged a little easier.

jrcarr

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

Confused Too

Quote from: jrcarr on February 17, 2006, 09:59:15 AM
So there is not perfect solution to this problem.  You are going to find that there will be some adjustments to make everytime SMF or any other software you are using releases a new version.  It's kind of like, "Death and Taxes".  ;D
LOL - Your right but running a forum which requires accessability I have to offer various colour, text only and screen reader friendly templates which all have to be edited to allow the updates.  It would be nice to simply use my site template cut in half to wrap seamlessly around the themes each time so when I do perform an upgrade there is no messing about except importing the new compliant themes in the colours and options offered.
The actual software is the best I have ever seen and I was a skeptic about SMF only 6 months ago now I am completely sold on it and find it exceptionally user friendly and intuitive to use.
I suppose this may be an option someone will build into future releases in the future.
Making the working lives of the disadvantaged a little easier.

Enigma

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?

sydbat

I want to thank everyone (especially [Unknown]) for their help in showing the steps for integrating SMF into my website (CAPI Forum [nofollow]). I used the "simple" tutorial provided and then followed my nose to get exactly what I wanted. Some day I'll try the "cooler" way.

I made a backup of the default theme, renamed it, and played with the code. I left everything in place. In <head>, before the SMF javascript, I added my javascript sources like so:// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />

  <script src="http://www.capi7.ca/menu_array.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/invest.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/foot.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/update.js" type="text/javascript"></script>
  <script src="http://www.capi7.ca/mmenu.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
// --></script>


I replaced the stylesheet with my own hybrid. I took the existing SMF stylesheet and added the elements from my stylesheet to create the container for the the forum.

Then, at the top of the <body>, I added<body>';
echo '<div class="container">';
  echo '<div class="banner" id="logo">
<h1 id="title">Calgary Association of Paranormal Investigations</h1>
  </div>';
echo '<div class="content" id="content">';


This gave me the result I wanted with very little discomfort. Now my contributors can choose if they want the "classic" forum style or the "new and improved" forum default.

One question - When I upgrade to 1.1 RC2 (or any following release), will I have to do all this again?

Once again, thank you all for your well written posts. And thank you Lewis Media for developing SMF!!
Don't mess with the dead boy. They have eerie powers.
    - Homer J Simpson

CAPI Forum [nofollow]

Telnets

#135
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.

Leipe Po

There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Eleazar

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

jrcarr

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

Eleazar

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 hxxp:calvarywv.com/board/Themes/Integrated%20Test/index.template.php [nonactive].

Advertisement: