• Welcome to Simple Machines Community Forum. Please login or sign up.
October 24, 2021, 08:04:50 PM

News:

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


Mambo and SSI in components again

Started by Prone, October 03, 2004, 06:26:07 AM

Previous topic - Next topic

Prone

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
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

Orstio

You have to put the include in your Mambo template, before the "</head>" tag.

Prone

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
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

[Unknown]

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]

Prone

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.
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

Orstio

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.

-Garion-

October 04, 2004, 01:15:34 AM #6 Last Edit: October 04, 2004, 01:17:15 AM by -Garion-
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

Orstio


-Garion-


Prone

Thanks, I never would've thought it's so easy :)
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

Prone

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
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

-Garion-

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.

Prone

Will have a look at what I've done wrong and will keep you posted on the results.
Webmaster http://www.syndicate-1.com

SyndicateOne - For All your gaming needs

Advertisement: