Include - Error, Headers Already Sent - not a link. (German / Deutsch)

by M. Kastor (I swear I was logged in) @, Monday, March 07, 2011, 00:30 (4803 days ago) @ Riba
edited by M. Kastor (I swear I was logged in), Monday, March 07, 2011, 00:43

Integrate? As in putting a link in the site's menu to the forum? When I read:

Is there a way to install the forum in your script in the home?

I took it to mean that the question was about installing the forum at the root of a site.

So it's a template question :D "How can I make the forum look like the rest of my site" and a data usage question "How can I use the information from the forum database on my existing website" :D Yes? Those are difficult questions to answer. I looked at the template files and they're full blown programs written in smarty's template language. They work well :D but they're not so easy to sort out. For complicated things I like using the php like:


/* filenames match variables set */
include('meta.php');
include('css.php');
include('javascript.php');
include('etc.php');

/* static variables would be in a config file */
$title = 'title';

/* logic would be in an included file, but...*/
switch ($condition) {
    case 'comment':
        $class = 'comment';
        break;
    case 'title':
        $class = 'title';
        break;
    case 'other':
        $class = 'other';
        break;
    default:
        $class = 'generic';
        break;
}

/* with heredocs all the logic is already done,
 and all you insert are varibles. The templates
 are easily manipulated with common wysiwyg html
 editors. Plus, you don't have to escape anything.
 Of course the templates are called last, and are
 in a separate file.
*/

$simplePage =<<<HEREDOC
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 1st August 2004), see www.w3.org">
 $meta 
 $css 
 $title 
 $javascript
  </head>
  <body>
    <div class="$class" id="$etc">
        some content
    </div>
  </body>
</html>
HEREDOC;

echo $simplePage;

The database stuff is easier to get at. :D Someone could select data from it and display it in an existing cms, given the proper sql statements of course. ;)


Complete thread:

 RSS Feed of thread