SMF Recent posts in UNbridged Joomla

Started by Kursk, August 27, 2007, 02:55:57 PM

Previous topic - Next topic

Kursk

Has anyone done this, show recent posts from stand-alone SMF on the Joomla frontpage?

Used to have a bridged Joomla-SMF, now it's unbridged.  Can't get the modules for recent posts and recent topics to work correctly with a stand-alone SMF.  I got the links working correctly with some manual coding but I keep getting an error referencing SSI.php.  The error disappears if I visit the forum and go back to Joomla frontpage, I have some guesses about it.

Does anyone know of a working solution?

Kindred

you will have to modify the module to point to the correct location of SSI.php. The bridge module reads SMF information from the bridge configuration... (which no longer exists in an unbridged site)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred


Find:


// Get the configuration.  This will tell Mambo where SMF is, and some integration settings
$database->setQuery("
SELECT `variable`, `value1`
FROM #__smf_config
");
$variables = $database->loadAssocList();

foreach ($variables as $variable){
$variable_name = $variable['variable'];
$$variable_name = $variable['value1'];
}


replace with


$smf_path='PATH/TO/YOUR/SMF/INSTALLATION';


find:

mysql_select_db($mosConfig_db);
$sql = "SELECT id FROM ".$mosConfig_dbprefix."menu WHERE link='index.php?option=com_smf'";

$result = mysql_query ($sql);

$row = mysql_fetch_array($result);

$myurl = $mosConfig_live_site."/".basename($_SERVER['PHP_SELF']) . "?option=com_smf&Itemid=" . $row[0]."&";

$scripturl = $myurl;


and delete it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kursk

#3
Thank you, Kindred, that what helpful in terms of fixing the links, your method is more efficient.

I got it pointed in the right direction. However, I do get the same error:

QuoteNotice: SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /home/.../..../..../forum/SSI.php on line 160

Otherwise the module works fine, all the links to the recent posts are correct.  It's only this annoying message above them.

Line 160 is the last one below, telling to put out the session error in SSI.php:
// Make sure they didn't muss around with the settings... but only if it's not cli.
if (isset($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['is_cli']) && session_id() == '')
trigger_error($txt['ssi_session_broken'], E_USER_NOTICE);

Kindred

messing with session checks is a good way to open your site to hackers.

Alternatively, You could add the SSI call to the top of your joomla template. That might take care of the function error.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kursk

I tried that before, calling SSI before anything else on the joomla template, doesn't work.  If there is any other solution, I'd appreciate hearing about it.

joejackson


sadochinero

i ve simply made an iframe with the SSI.php recenttopics...

How can i modify the style of the shown iframe? (color, font etc)

Kindred

look at the generated page using DOM explorer or firebug. This will give you the CSS tags for each section, which you can then stylize.

Alternatively, you can modify the output directly in the function.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

joejackson

I can't get this to work.
I have an iframe but can't seem to format the output.
I have used firebug and it tells me class= ssi_table is responsible but I can't find that

Kindred

just out of curiosity... why are you using an iframe?  The purpose of the SSI stuff is to include it within a page... not in an iframe.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

joejackson

Hi Kindred, my Joomla/SMF is not bridged, never has been, and I'm unsure how to proceed otherwise.

Kindred

but why are you using an iframe?   Just use the standard module template/format.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

joejackson

The answer to that is easy -
I know how to use an iframe, I do not know how to "use the standard module template/format."

Kindred

ah... well, I suspect that is part of your problem.  Iframes are not good coding practice and they don't belong on a joomla page.   You need to build a joomla module.

Take the mod_smf_recentPosts as a baseline and work from there.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

joejackson

#15
Two questions

1/ Why are iframes not good coding practice ?
2/ Where would I find mod_smf_recentPosts ?

Kindred

Iframes mess up session variables and they are unnecessary in most cases (like tables in modern CSS)

There is a copy of the module attached to the combined readme sticky post.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

joejackson

I installed the module, published it, but all I see is the title SMF Recent Posts

When I turn on Joomla debugging I get a lot of this...

/var/www/etc etc etc/includes/database.php:442
/var/www/etc etc etc/modules/mod_smfRecentPosts.php:10
/var/www/etc etc etc/includes/frontend.html.php:397
/var/www/etc etc etc/includes/frontend.html.php:107
/var/www/etc etc etc/includes/frontend.php:166
/var/www/etc etc etc/index.php:266

joejackson

#18
Quote from: joejackson on February 21, 2008, 05:11:03 AM
I installed the module, published it, but all I see is the title SMF Recent Posts

When I turn on Joomla debugging I get a lot of this...

/var/www/etc etc etc/includes/database.php:442
/var/www/etc etc etc/modules/mod_smfRecentPosts.php:10
/var/www/etc etc etc/includes/frontend.html.php:397
/var/www/etc etc etc/includes/frontend.html.php:107
/var/www/etc etc etc/includes/frontend.php:166
/var/www/etc etc etc/index.php:266


The above error has been solved by removing a leading slash in the
$smf_path='PATH/TO/YOUR/SMF/INSTALLATION';

Thanks for the assistance.

Advertisement: