Display recent posts or stats in a mambo module

Started by bmupton, February 03, 2005, 12:06:22 PM

Previous topic - Next topic

bmupton

K, I've read many many threads about integrating mambo and smf...and that's all fine and good for some people, but I don't need the power that gives.

All I want is a module for Mambo that will display things from SMF in the mambo site.  Things like the last 10 forum posts, the most recent registered member, some simple stats.

I'm not using the mambo registration at all, and I'm using the REALLY COOL planetfall theme for SMF that matches the one Mambo theme...so the site is fairly consistent.  If you want to take a look, click here [nofollow].  It redirects to my Mambo site, and from there you can hit the forums.


jorgen

#1
Your site looked...   Heavy  8)

You should look into the SSI-possibilities that are in SMF.
Check out   http://saskmetal.com/forums/ssi_examples.php   and    http://saskmetal.com/forums/ssi_examples.shtml

bmupton

Quote from: jorgen on February 03, 2005, 12:37:11 PM
Your site looked...   Heavy  8)

You should look into the SSI-possibilities that are in SMF.
Check out   http://saskmetal.com/forums/ssi_examples.php [nofollow]   and    http://saskmetal.com/forums/ssi_examples.shtml [nofollow]
Those SSI's look like what I need, but I'm not sure exactly how to implement them.  Since my mambo and my SMF are in different directories, can you call the SSI's from mambo and just add the path in front?

Maybe I should just go RTFM?  hehehe.

bmupton

#3
Could I have someone move this topic to a more suitable area?  Since I'm not using the mambo bridge, and trying to do this with just the SSI's, it makes no sense to have it here...

And on to my problem:

http://saskmetal.com/mambo/thingy.php [nofollow]

The code for that file is:
<?php
require("/home/sask/public_html/forums/SSI.php");
ssi_recentTopics();
?>


Why am I getting an error relating to the Mambo database?  The only thing I can think of is that my Mambo and SMF share a database, each with their own table prefix (mos_ for Mambo and smf_ for the forums)

Any ideas?

Edit: I've now seperated my databases and I still get the error.  I can put my little php script anywhere on my server and I still get the same error:
Notice: Undefined index: mosConfig_live_site in /home/sask/public_html/forums/Sources/Load.php(1040) : eval()'d code on line 157

I don't understand why that would be.

Line 157 says:
$user_settings = array();

Man, I wish I knew the first thing about php...probably make this whole process a lot easier.

Orstio

The problem you are facing is the fact that the theme you are using is the one Xenovanis modified to work with the bridge.  It contains global variables defined in Mambo, so because your SSI page is not in Mambo, you get errors.

bmupton

#5
Quote from: Orstio on February 03, 2005, 03:16:25 PM
The problem you are facing is the fact that the theme you are using is the one Xenovanis modified to work with the bridge.  It contains global variables defined in Mambo, so because your SSI page is not in Mambo, you get errors.

That makes sense I guess.  If I change my forums default theme to something else, then that error would go away?

I'm going to have to look at his theme and remove the mambo related stuff I guess.  Wish me luck!  (Unless someone has already done this and wants to share, that is)

EDIT:  I cheated and replaced Xenovanis' index.template.php file with the one from the default theme, and also replaced his index.english.php language file with the default and everything seems to work.  I've been surfing around the site trying to see if anything is broken, and I can't find anything...

Now to get php working in a mambo block...apparently you can't just use php in your code.

Orstio

Of course you can.  ;)

But, you have to make a proper xml installer file, and then zip the module and the installer so that Mambo can install it via the module installer.

xenovanis

Quote from: bmupton on February 03, 2005, 03:34:43 PM

EDIT:  I cheated and replaced Xenovanis' index.template.php file with the one from the default theme, and also replaced his index.english.php language file with the default and everything seems to work.  I've been surfing around the site trying to see if anything is broken, and I can't find anything...


This should definately not lead to any errors.
"Insanity: doing the same thing over and over again and expecting different results."

bmupton

Quote from: Orstio on February 03, 2005, 04:41:08 PM
Of course you can.  ;)

But, you have to make a proper xml installer file, and then zip the module and the installer so that Mambo can install it via the module installer.

This is what I've read on the mamboserver.com [nofollow] forums as well.  Right now I've just hard coded what I want into my mambo template...this is FAR from an optimal solution, but it works for now.

bmupton

Quote from: xenovanis on February 03, 2005, 04:48:52 PM
Quote from: bmupton on February 03, 2005, 03:34:43 PM

EDIT:  I cheated and replaced Xenovanis' index.template.php file with the one from the default theme, and also replaced his index.english.php language file with the default and everything seems to work.  I've been surfing around the site trying to see if anything is broken, and I can't find anything...


This should definately not lead to any errors.
Thank you for the confirmation.  Amazing job on that theme by the way!

bmupton

Urgh, I can't get this to work!

smf_login.php:
<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

require(
"/home/sask/public_html/forums/SSI.php");
ssi_login();
ssi_logout();
?>


smf_login.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="module">
<name>SMF Login</name>
<creationDate>03/02/2005</creationDate>
<author>Brent Upton</author>
<copyright>(C) 2005 Brent Upton</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail></authorEmail>
<authorUrl></authorUrl>
<description>Places the SMF login/logout form in your site as a module</description>
<files>
<filename module="smf_login">smf_login.php</filename>
</files>
</mosinstall>


Any ideas?

Advertisement: