question about SMF internal structure to hardcode php integration

Started by marcnyc, October 26, 2004, 10:01:35 AM

Previous topic - Next topic

marcnyc

Hello community.
I am creating a new website which will have SMF as the core of the community and I am doing the same old thing everybody else is doing: adding my header and my footer to SMF and possibily later change the table structure...
Why I am posting here when all it takes to do this is add some html code to the template file index.template.php or open that same file by just following the Theme and Layout Settings>Edit Theme>Modify the Index Template link?
I am posting because instead of adding an image or a table I would like to include(); my own php functions that generate my site's template... To do this I need to include('path/mytemplate.php'); somewhere and I started trying in index.template.php. Unfortunately every include results into a white page  (no source code), as if the include interrupted the parsing of the SMF page.
Yes, the path to mytemplate.php is correct (the above is obiviously just an example), and no, there are no variables or function names that have the same name of SMF functions, because when I coded it I named every function and every variable with my site's name as prefix.
Can somebody please help me and enlighten me as to the internal structure of SMF? Why would an include stop the page parsing?
I have also tried including my file (which obviously works just great on any non-SMF page) into index.php and even fiddled around with BoardIndex.template.php but what I thought wouldn't be too hard to do is really turning into a task... Hope to get some good advice from coders and people who know the SMF internal structure and code. Thansk in advance!

Tomer

Is the file your including HTML, or does it only have PHP functions?

marcnyc

thanks for the quick answer...
the file I am including is php with functions only (inside that file there is also another include that also has php code and functions). Basically no html to answer your question. Of course those functions will output html once executed.

marcnyc

I seem to have found the problem...
In my code I had one line where I make a variable global and by removing that line it works (well it's not all there, but at least now I can see codes and debug along)... Strange... this never happened to me, just one line like this:
global $var;
made the whole SMF template disappear in favour of a just this '<html><body></body></html>'
Anyway, now that I got a step further I can dive into this beautiful code, learn from it, and make a great website ;-)
Thanks

Advertisement: