News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PHP Fusion.

Started by bobjones, September 07, 2004, 02:56:08 PM

Previous topic - Next topic

bobjones

Hi,

The problem I am having is using my side panels and header and footer. They are all complicated, PHP-Scripts, dynamicallly generated.

This was the headache i had with PHPBB.

I have my own style sheets for my site, THe user chooses them in the theme settings. I just want to embed the forum, Without messy frames etc. This is such a pain, Every board seems to suffer here. If only i could do "include "smf_forumindex.php". But no... Most of these BB systems expect that they should take priority and that I should not have a nice dynamic website, Instead I should use simple HTML and slap it into your BB Templates, Right? Wrong... I'm not loooking for a monster BB to embed my site into.. I'm looking for a nice flexible BB to embed into MY site. SIgh.

[Unknown]

Do you have a separate header/footer?  If so, just include those in the index.template.php main_above/main_below.  Then you just access the forum directly.

Yes, SMF expects that you won't include it into something.  This is because it uses HTTP headers, redirects, and sends attachment/binary data.  Including your header in every image attached to the forum would be... well, bad, right?  That's why you have to use the templates.

But there's no reason why you can't use the templates to use your system.

-[Unknown]

bobjones

Thanks i'll try this. Sorry if i sound bitter I've spent many frustrating hours trying to work PHPbb .tpl files today and I am really looking for a flexible system.

I'll try what you said, thanks.

[Unknown]

Quote from: bobjones on September 07, 2004, 08:19:02 PM
Thanks i'll try this. Sorry if i sound bitter I've spent many frustrating hours trying to work PHPbb .tpl files today and I am really looking for a flexible system.

No, no, I understand.  I find the ".tpl" files to be worthless and inflexible.  I don't think anyone could fault you for being a bit bitter at spending time on it and not finding a solution - although maybe you did, you're posting here ;).

This template system was designed specifically such that it could be actually flexible.  Other forums let you change colors, or possibly shift html a bit... but this is the only one where some things are possible that just aren't in those.  For example, I wrote a phpBB theme for SMF on April Fool's ;).  It looked EXACTLY like phpBB.  Could a phpBB skin be made for most other forums...?

QuoteI'll try what you said, thanks.

If you can't get it to work, feel free to post more detail; I'll be happy to help you work it out.

There's always a way - at worst, it may not be clean, but there is ALWAYS a way.  Even with phpBB tpl files, but that's a bit more "out there" :P.

-[Unknown]

bobjones

The problem i'm finding is that variables are not being evaluated inside the header i think.
So When i add this to index.php or index.template.php:

require "../fusion_config.php";
require "../header.php";
require fusion_basedir."subheader.php";

It can't find the file "subheader.php" because fusion_basedir has no value.
fusion_basedir is actudally defined in header.php.

So, a simple way to fix that is use 'require "../subheader.php";' instead. Great so it manages to find and execute the include file, But then it still is not seem to be evaluting any of the variables in subheader.php,  Which means things just are not working.

I'm guessing it's a case of declaring this or that as global. I have been through this all with PHPbb. The header files i am using are not simple, They contain a lot of variables.

[Unknown]

Quote from: bobjones on September 07, 2004, 08:48:49 PM
The problem i'm finding is that variables are not being evaluated inside the header i think.
So When i add this to index.php or index.template.php:

require "../fusion_config.php";
require "../header.php";
require fusion_basedir."subheader.php";

Should that be $fusion_basedir?  Or is it a defined constant? (if it's a constant this definitely shouldn't be a problem!)

You should be able to load variables even in templates.  In cases, you may need to global them. (bring them in from the global scope...)

QuoteIt can't find the file "subheader.php" because fusion_basedir has no value.
fusion_basedir is actudally defined in header.php.

So, a simple way to fix that is use 'require "../subheader.php";' instead. Great so it manages to find and execute the include file, But then it still is not seem to be evaluting any of the variables in subheader.php,  Which means things just are not working.

I'm guessing it's a case of declaring this or that as global. I have been through this all with PHPbb. The header files i am using are not simple, They contain a lot of variables.

Well, I'm sure they use functions, then.  It might expect things to be in the global scope, instead of otherwise.  It may even depend on register_globals. (I hope not!)

Worst case scenario, you could try the extract() function on $GLOBALS.

-[Unknown]

jburnett

you could write a class for your site theme and store everything you need in that class. Then you would never have to worry about global variables. Just hardcode your vars in your class then you just call the class and do what you need to do.
I use SMF, why? BECAUSE ITS FREEKIN COOL.

http://www.geekmoz.com/

bobjones

Quote from: jburnett on September 08, 2004, 08:17:43 AM
you could write a class for your site theme and store everything you need in that class. Then you would never have to worry about global variables. Just hardcode your vars in your class then you just call the class and do what you need to do.

Hi im not sure i understand this but it sounds like re-writinng basic funtionality of the CMS. I guess there is just no easy way to integrate a forum unless you are happy with a bolted on look and feel, Or just a simple link to a full page forum, which feels just like going to an exteranal site really. Oh well, thanks for the help guys.

[Unknown]

Quote from: bobjones on September 19, 2004, 06:31:48 PM
Hi im not sure i understand this but it sounds like re-writinng basic funtionality of the CMS. I guess there is just no easy way to integrate a forum unless you are happy with a bolted on look and feel, Or just a simple link to a full page forum, which feels just like going to an exteranal site really. Oh well, thanks for the help guys.

I think he was going off the assumption this was some custom coding.  I was going off the assumption you were using a CMS.

Again, you can integrate it in.  I've done it.  You just have to show the header and the footer.... in the right places.  If the CMS uses globals too... agressively, you may need to include the fusion_config.php (etc.) in the global scope (index.php) instead of the template.

-[Unknown]

bobjones

Hi,

Well, I've made some progress with it. The problem I was having was not related to SMF, And would of affected any scripts I tried to use in this way.

I think with a bit of work i'll be able to get the full integration I am after... Thanks for your help, I'll keep you posted for the benefit of other users how it goes.   :)

bobjones

One thing im having problem with now is accessing the Admin panel.

PHP-Fusion already has a function called Admin(), So this causes an re-declare error when i click the SMF 'Admin' Button.

I did Search+Replace on /sources/admin.php replacing 'admin(' with 'smf_admin('. Now whene I click the Admin button I get the error:

Unable to load the 'main' template.

I think it would be cool if coders used prefix for stuff like Admin() which is highly likely to conflict with other scripts. I also had this problem with ParseSmileys. I Know my CMS pretty well and rename the ParseSmileys function... Renaming the Admin() function throught my CMS is a bit much though...  :o


[Unknown]

Go to index.php and rename it there too.  Search for 'Admin'.

-[Unknown]

bobjones

Thanks, Worked great :)

What a nice set of Admin options this board has too  ;D

Baja

Hi there

I have an SMF Forum, just for specially invited members and I would like to that these members should be able to write in my PHP Fusion forum which is open to anyone and those registered in the PHP fusion database can write in. I rather not want to force my SMF users register in the PHP-Fusion but be able to "auto-login" with there SMF credentials. Anyone that has any Idea how to do that?

My SMF and PHP-Fusion uses the same mySQL database.

Regards Baja

Marko Mitranic

i want to combine phpFusion and SMF to work together (membership system)... another word, i want that when someone registers in my phpFusion, that he is automaccly registered i SMF... With same Username and Pass... Is it possibile???

HELP!!!

theslam2006

^^Was about to ask the same thing. It sounds like this bobjones has done it...but dunno how. If so, can you please say? I know I would love to get phpfusion to work with SMF...auto-login and using the same DB. THat would be awesome.

yexusbeliever

I am interested in this one too.  If anyone know how to do it, please share.

Raidon

Well, i have maded my website with PHP-Fusion and i putted SMF too, offcourse.

But i want register 1 time for PHP-Fusion and SMF. (mark it that i have already installed)


Can anyone tell me how i can do that?
Mess with the best, die like the rest.

Raidon

Mess with the best, die like the rest.

adicrst

doesn't anyone know?... :(

Advertisement: