Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Mambo Bridge Support => Topic started by: Prone on October 03, 2004, 06:26:07 AM

Title: Mambo and SSI in components again
Post by: Prone on October 03, 2004, 06:26:07 AM
Hey guys,

I've searched and only found that people claim they have done it but no tutorial or anything I could find. Which leads me to the following question: how do I use the SSI includes in my index.php for the mambo cms? I've just hardcoded a few includes in there but it doesn't show up.

I then saw that the template example page of SMF has the extension shtml, which makes it server side, right?

Somebody help me out, I just want to have the last 10 threads on my frontpage (frontpage Mambo, forum of course SMF).

Thanks (the page is http://www.syndicate-1.com)
Phil
Title: Re: Mambo and SSI in components again
Post by: Orstio on October 03, 2004, 06:37:16 AM
You have to put the include in your Mambo template, before the "</head>" tag.
Title: Re: Mambo and SSI in components again
Post by: Prone on October 03, 2004, 10:11:16 AM
Quote from: Orstio on October 03, 2004, 06:37:16 AM
You have to put the include in your Mambo template, before the "</head>" tag.


Well, then I have the problem that I don't have the location defined, right? I mean, it's like Javascript: defined in the <head> I still have to call it somewhere.

How do I tell the template where to display the top 10 topics?

Thanks,
Phil
Title: Re: Mambo and SSI in components again
Post by: [Unknown] on October 03, 2004, 04:42:44 PM
Well, it depends, I'm not clear on how Mambo's templates work.

But, if you call the ssi_recentTopics() function, it will display those - if you have SSI.php included.

-[Unknown]
Title: Re: Mambo and SSI in components again
Post by: Prone on October 03, 2004, 04:51:56 PM
Okay, I implement the include in the header and just call it? I will try and let you guys know.

@Unknown: Mambo's templates are very basic, pure html with includes for the components.
Title: Re: Mambo and SSI in components again
Post by: Orstio on October 03, 2004, 06:24:56 PM
Quote from: Prone on October 03, 2004, 10:11:16 AM
Quote from: Orstio on October 03, 2004, 06:37:16 AM
You have to put the include in your Mambo template, before the "</head>" tag.


Well, then I have the problem that I don't have the location defined, right? I mean, it's like Javascript: defined in the <head> I still have to call it somewhere.

How do I tell the template where to display the top 10 topics?

Thanks,
Phil

You don't tell the template where to display it.

You have to include SSI.php in the <head> of the template.  In order to display a certain function on the page, you'll have to create a Mambo "module" and publish it in a certain place.

Your Mambo module can be as simple as this:

<?php ssi_recentTopics(); ?>

You save that as a file with the prefix "mod_". (For example, mod_recent_topics.php)

In order for you to be able to publish a module, however, it needs to be registered in the database table "mos_modules".  You can upload the file with FTP to your modules folder and do that with PhpMyAdmin, or you can create an XML installer file, and install the module via your Mambo control panel, which will upload the file to the correct location and add the row to the SQL database.
Title: Re: Mambo and SSI in components again
Post by: -Garion- on October 04, 2004, 01:15:34 AM
Following Orstio's instructions, I successfully created an SMF SSI module that I've also packed with an XML file for easy installation.  Just edit the php and xml files to name whatever function you want to use.  Don't forget that you still have to put the include in the <head> section of index.php.  If you want to code it into the template, it's relatively easy.  All you should have to do is place the function where you want it to appear.

http://home.comcast.net/~silverwolf521/mod_smf_ssi.zip
Title: Re: Mambo and SSI in components again
Post by: Orstio on October 04, 2004, 01:33:36 AM
Nice work, Garion.  8)
Title: Re: Mambo and SSI in components again
Post by: -Garion- on October 04, 2004, 01:37:10 AM
All thanks to you.   ;)
Title: Re: Mambo and SSI in components again
Post by: Prone on October 04, 2004, 04:58:58 AM
Thanks, I never would've thought it's so easy :)
Title: Re: Mambo and SSI in components again
Post by: Prone on October 04, 2004, 03:43:37 PM
Apparently it's not so easy for me :( I changed the file accordingly but to no avail. I get permission denieds and all kind of other errors (could not include). Because SMF (in this case it was YABB Gold originally) was installed in a different directory I seem to get the problems.

SMF is in /board and mambo is in /2k5

Can anyone help me please!

Thanks,
p
Title: Re: Mambo and SSI in components again
Post by: -Garion- on October 04, 2004, 04:14:20 PM
Have you put this in your <head> section of template index.php?  I grabbed the following code from your board's ssi_examples.php.

<?php require("/home/www/web837/html/board/SSI.php"); ?>

And post the code for the .xml and .php file that you edited so that we can look at it.
Title: Re: Mambo and SSI in components again
Post by: Prone on October 05, 2004, 02:23:11 AM
Will have a look at what I've done wrong and will keep you posted on the results.