News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Troubleshooting question for those who know SF themes

Started by JAAulde, March 01, 2005, 12:30:50 PM

Previous topic - Next topic

JAAulde

Ladies and Gentlemen,

I am in dire need of help.  I am working on a SMF site and we are updating the theme of the entire site.  They are planning a large 'unveiling' of several things today (including this new look) as well as a PR campaign on local radio, newspapers, etc.

I originally installed SMF for this person, and programmed a site around it using SSI.php.

For this re-theming, I reworked all of the files outside of SMF to re-theme them and the person for whom I  am working had someone write him a SMF theme that matched.  All of my re-worked files were doing fine until we swithed the SMF theme over to the new one.  Then, on any page where I try to send headers, I get an error stating that the headers have already been sent.  So, obviously, something is sending content before I can.  And it is only when this new theme is in use on the board.

I don't know who wrote the new theme and haven't heard from the fellow in charge this morning with a response ot my queries.  He is very busy lately with work, school, and this project so I am not sure when I'll get a response form him.  Anything you guys can offer would be amazing.

Here is some more technical specific info:
The site layout:
/document_root
   |
   |--index.php
   |
   |--/smf
         |
         |
         SMF CODE AND DIRECTORIES


index.php, under the document root, has the following code in lines 1-11:
<?php
require_once("/home/music/www/smf/SSI.php");
//If the user is not logged in (is a guest), send them to the welcome page
//Append the location of this page to the query string of the redirection so we can send them back when they login
if ($context['user']['is_guest']) {
        
header("HTTP/1.0 302 Found");
        
header("Location: http://www.musicaccord.com/welcome.php?r=http://www.musicaccord.com{$_SERVER['REQUEST_URI']}");
        die();
}
//Get the page header
include('/home/music/public_html/template/header.php');



As you can see, it first calls SSI.php, then checks to see if the user is a guest.  if they are, they are redirected via HTTP headers to the welcome page I have written where they can log in.  this all works very well with the current theme, but breaks when the new on is in use.  When the new one is in use, I get this:
QuoteWarning: Cannot modify header information - headers already sent by (output started at /home/music/public_html/smf/Sources/Load.php(1040) : eval()'d code:544) in /home/music/public_html/index.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /home/music/public_html/smf/Sources/Load.php(1040) : eval()'d code:544) in /home/music/public_html/index.php on line 7

To me, this means that when I call SSI.php in the first lines of my index page, the code at Sources/Load.php get's included and at line 1040 of that file something happens that uses code from the new theme and starts content output.  Line 1040 of my Sources/Load.php look like so:
                $file_found = file_exists($filename) && eval('?' . '>' . implode('', file($filename))) !== false;
The entire function that it belongs to is template_include().  I can see in that function that there is several lines of HTML.  But I don't understand enough about SMF and it's theming to know why the new theme causes this function to output headers and data while the old one does not.

Can anyone point me to where to look and what to correct?  I'd really appreciate it.

Thanks,
Jim

JAAulde

I have discovered from the fellow for whom I am doing the work that it is Tomer Dean who wrote the theme.  This is indeed encouragin as I know Tomer is very active here and knows his stuff!

I've e-mailed Tomer for help, but also look forward to anything you guys can input.

Thanks,
Jim

JAAulde


Daniel D.

#3
Don't double-post. Other thread locked.

JAAulde

Quote from: Daniel D. on March 02, 2005, 09:15:32 AM
Don't double-post. Other thread locked.
I know--it's very bad manners.  And I do apologize.  I got concerned when there were no responses here and realized this may be more for the graphics folks than the coders.

Thanks for your action.  Good moderating keeps a board alive!   :)

Elissen

SMF Coding Discussion might have gotten a faster response indeed ;)

But try placing ob_start(); before the require. Also take a look at the SSI FAQ's.

JAAulde

Quote from: Elissen on March 02, 2005, 09:27:36 AM
But try placing ob_start(); before the require. Also take a look at the SSI FAQ's.
Elissen, I put the ob_start() in my first file and the errors seems to have gone away.  I thank you for the suggestion.

Now I just need to figure out what the difference between the two themes was that makes me need to do that...

Thanks!!!
Jim

Advertisement: