Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Mambo Bridge Support => Topic started by: Kindred on February 19, 2005, 01:52:20 AM

Title: Brige v3.01
Post by: Kindred on February 19, 2005, 01:52:20 AM
First, let me congratulate Orstio on a wonderful job!

now, on with the tarring and feathering...

In the login module, I have logout redirects set to my main mambo site.... but it drops me into the SMF component. (logins work properly)

The Discussbot installed fine, has all the parameters, but never activates with the {} commands... Going back to the old version has it working perfectly.  Hmmmm....


Another interesting thing.... with SEO on, the board and everything works very well... but SMF can not connect to the SMF site for news or version information. (In the SMF admin, the admin newsbox says "can not connect to SMF" or something like that... and the most recent version is listed as ??)
Turn off SEO, and everything loads properly...
Title: Re: Brige v3.0
Post by: Orstio on February 19, 2005, 02:10:17 AM
Thanks Kindred.

QuoteIn the login module, I have logout redirects set to my main mambo site.... but it drops me into the SMF component. (logins work properly)

I'll take a look at this.

QuoteThe Discussbot installed fine, has all the parameters, but never activates with the {} commands... Going back to the old version has it working perfectly.  Hmmmm....

The discussbot is set up now so that it only displays inside the actual content items.  It previously had a funny quirk, that if it was first activated from the frontpage, it would link back to the frontpage.  So, I disabled the bot if it is not on a content item.

QuoteAnother interesting thing.... with SEO on, the board and everything works very well... but SMF can not connect to the SMF site for news or version information. (In the SMF admin, the admin newsbox says "can not connect to SMF" or something like that... and the most recent version is listed as ??)
Turn off SEO, and everything loads properly...

Interesting.   :-\
Title: Re: Brige v3.0
Post by: Kindred on February 19, 2005, 02:21:36 AM
QuoteThe discussbot is set up now so that it only displays inside the actual content items.  It previously had a funny quirk, that if it was first activated from the frontpage, it would link back to the frontpage.  So, I disabled the bot if it is not on a content item.

AH!   That is not clear in the readme. :)

One note further on this:   smf_mosbot_help.php is no longer included in the distribution... but the readme says to use it. :P
Title: Re: Brige v3.0
Post by: jorgen on February 19, 2005, 06:28:56 AM
Oh NO!      :D ;D :)
Yet another new version ?
I've just been able to upgrade to R2.2 some days ago, and Orsio goes ahead and releases R3.

Oh well. I might as well upgrade again. Is there any suggested methode of upgrading this time, or is it OK to just replace all the files?   Keep up the good work Orstio!
Title: Re: Brige v3.0
Post by: Orstio on February 19, 2005, 06:47:32 AM
You can just replace the files.  :)
Title: Re: Brige v3.0
Post by: colonelz on February 19, 2005, 06:59:09 AM
First thanks to Orstio for his fabulous bridge component. I like it very much since i understood the installation process. But now for something else:

Does SEF work also with the SMF news feed?

I have not installed v3.0 yet, but examined the code and saw the implementation of Marlboro Man's code snippet for SEF. I installed his snippet just yesterday into my v2.2-bridge and it worked fine unless for the news feed. 

Therefore i did a little hack. Unfortunately this worked only with changing SMF's News.php, cause it handled the buffered output for itself. Here the steps i did:

changes to com_smf/smf.php:

NEW:

function sefShowXmlFeed() {

        global $mosConfig_live_site;

        ShowXmlFeed();

        $buf = ob_get_contents();    //assign buffer to a variable

        $regex = "/<link>(.*?)<\/link>/s";
        preg_match_all( $regex, $buf, $smfurl );
        $sefurl = array();
        $regex = array();
        $smfurl[1] = array_unique($smfurl[1]);
        arsort($smfurl[1]);
        reset($smfurl[1]);
        foreach($smfurl[1] as $nonsefurl) {
                $pos = strpos($nonsefurl,$mosConfig_live_site);
                if ($pos === 0) {
                        $regex[] = "/".preg_quote($nonsefurl,"/")."/";
                        $pos = $pos + strlen($mosConfig_live_site) + 1;
                        $nonsefurl = substr($nonsefurl, $pos);
                        $nonsefurl= str_replace("&amp;","&",$nonsefurl);
                        $nonsefurl= str_replace("&?","&",$nonsefurl);
                        $nonsefurl= str_replace(";","&",$nonsefurl);
                        $sefurl[] = sefRelToAbs( $nonsefurl );
                }
        }
        $buf = preg_replace($regex,$sefurl,$buf);
        ob_end_clean();        //clear buffer and turn off output buffering
        print $buf;
        obExit(false);
}


This function will handle <link>-elements in the news feed instead of the href-elements of html feed. Also handles the buffered output of the news feed


and in the same file at the action array:

CHANGED:

                '.xml' => array('News.php', 'ShowXmlFeed'),

TO:

                '.xml' => array('News.php', 'sefShowXmlFeed'),


This change will give control from ShowXmlFeed to the above described sefShowXmlFeed.


changes to Sources/News.php in function ShowXmlFeed:

CHANGED:

      obExit(false);

TO:

//      obExit(false);


This change will deactivate the output handling of the ShowXmlFeed and allow the first mentioned sefShowXmlFeed function to alter the output.

Is that something that the v3.0-Bridge can handle or as i assume it can not?
Title: Re: Brige v3.0
Post by: Orstio on February 19, 2005, 07:12:48 AM
That's a very good question.

I did base the change to smf.php on Marlboro Man's SEF patch, but it is a little different.

I don't think the news feed was tested with the SEF patch yet.
Title: Re: Brige v3.0
Post by: xenovanis on February 19, 2005, 07:50:13 AM
This is great Orstio and kindred! I especially like the parameters where you can change so much. Thanks a lot!
Title: Re: Brige v3.0
Post by: Kindred on February 19, 2005, 08:03:50 AM
Just as a a note; Based on [unknown]'s comments on removing obexit();, I changed what the bridge did...

The bridge installs a change as follows:

      if (!defined('_VALID_MOS')){
        obExit();
      }


I changed this to

      if (!defined('_VALID_MOS')){
        obExit();
      }
      else {
      return;
      }
Title: Re: Brige v3.0
Post by: Puc conDoin on February 19, 2005, 10:15:13 AM
In english.php of main component SMF.zip, var $SMBF_A_CONF_DB_MOS_PREFIX_TT says something about SMF, but it should be MAMBO.
Title: Re: Brige v3.0
Post by: Puc conDoin on February 19, 2005, 10:15:59 AM
Tried to create Dutch.php:

<?php
/**
* @version $Id: english.php,v 0.99 2005/01/27 00:12:13 mic Exp $
* @package smf-bridge
* @copyright (C) 2005 mamboworld.net
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author mic ([email protected]) www.mamboworld.net
* Mambo is Free Software
*/

/** Dutch language file for SMF Bridge */

class smfbLanguage {
//common (to be used by all)
var $SMFB_ISO 'iso-8859-1';
var 
$SMFB_DATE_FORMAT_LC '%A, %d. %B %Y'//Verwendet das PHP strftime Format
var $SMFB_DATE_FOMAT_SHORT ' %d.%m.%Y'// short date
var $SMFB_DATE_FORMAT_LONG '%d.%m.%Y %H:%M'// use PHP strftime Format, more info at http://php.net

//admin
var $SMFB_A_CONF_HEADER 'SMF-Configuratie';
var 
$SMFB_A_CONF_CONFIG_IS 'Configuratie is :';
var 
$SMFB_A_CONF_WRITEABLE 'Schrijfbaar';
var 
$SMBF_A_CONF_NOT_WRITEABLE 'Niet schrijfbaar';
var 
$SMBF_A_CONF_TAB1 'Configuratie';
var 
$SMBF_A_CONF_PATH 'Pad naar SMF (absoluut)';
var 
$SMBF_A_CONF_PATH_BUTTON 'Creeër pad automatisch';
var 
$SMBF_A_CONF_DB_SMF_PREFIX 'SMF database prefix';
var 
$SMBF_A_CONF_DB_MOS_PREFIX 'Mambo database prefix';
var 
$SMBF_A_CONF_WRAPPED_TITLE 'SMF Forum integratie';
var 
$SMBF_A_CONF_WRAPPED 'Wrapped';
var 
$SMBF_A_CONF_UNWRAPPED 'Unwrapped';
var 
$SMBF_A_CONF_SETT_SAVED 'Intellingen opgeslagen';
var 
$SMBF_A_CONF_UPGRADE_SUCCESS 'Brug succesvol verbeterd';

// tooltips
var $SMBF_A_CONF_PATH_TT_HEADER 'SMF installatie pad';
var 
$SMBF_A_CONF_PATH_TT 'Definieer hier het ABSOLUTE PAD van je SMF installatie. HINT: Als je het niet zeker weet klik je op de knop * Creeër pad automatisch *';
var 
$SMBF_A_CONF_DB_SMF_PREFIX_TT 'Prefix voor de SMF database, meestal * smf_ *';
var 
$SMBF_A_CONF_DB_MOS_PREFIX_TT 'Prefix voor de MAMBO database, meestal * mos_ *, ATTENTIE: de prefix moet precies dezelfde zijn als die je gebruikt hebt bij je Mambo installatie! HINT: Als je het niet zeker weet klik je op de knop * Voeg Mambo DB prefix toe *';
var 
$SMFB_A_CONF_MOS_PREFIX_BUTTON 'Voeg Mambo DB prefix toe';
var 
$SMBF_A_CONF_WRAPPED_TITLE_TT 'Dit is - waarschijnlijk - een van de belangrijkste instellingen hier! Je moet hier aangeven of je SMF geïntegreerd met Mambo wilt hebben (wrapped) of niet (unwrapped). Afhankelijk van deze instelling zul je wat extra instellingen moeten definiëren, waarover je meer info kunt vinden in de * readme *';

// errors/messages
var $SMBF_A_CONF_ERR_CONF_NOT_WRITEABLE 'Configuratie bestand niet schrijfbaar!';

// frontend (user)
//header

// general
}
?>

Title: Re: Brige v3.0
Post by: colonelz on February 19, 2005, 12:19:04 PM
For your information:

There is also another quirk with SEF. The actual SEF implementation does not handle the smf-calendar fully functional.

The reason is the kind of parameters in the calender urls: http://www.site.org/....calendar;month=1;...
The calendar property has no special value. When converting to SEF-urls the part behind the comma is missing and the resulting link is wrong.

I made a workaround with changing all "calender;" references to "calendar=1;" in Sources/Calendar.php and Themes/myTheme/Calendar.template.php. This is only a quick hack and should make the thing working fine. To consider "calendar;" when converting to SEF would be the better way, but lazy as i am i didn't do that.
Title: Re: Brige v3.0
Post by: Orstio on February 19, 2005, 02:17:13 PM
QuoteTried to create Dutch.php:

Thanks.  Translations are certainly welcome.  :)
Title: Re: Brige v3.0
Post by: Orstio on February 19, 2005, 02:40:38 PM
Quote from: colonelz on February 19, 2005, 12:19:04 PM
For your information:

There is also another quirk with SEF. The actual SEF implementation does not handle the smf-calendar fully functional.

The reason is the kind of parameters in the calender urls: http://www.site.org/....calendar;month=1;...
The calendar property has no special value. When converting to SEF-urls the part behind the comma is missing and the resulting link is wrong.

I made a workaround with changing all "calender;" references to "calendar=1;" in Sources/Calendar.php and Themes/myTheme/Calendar.template.php. This is only a quick hack and should make the thing working fine. To consider "calendar;" when converting to SEF would be the better way, but lazy as i am i didn't do that.

This leads me to the question:  What happens if you turn on SEF in SMF as well?
Title: Re: Brige v3.0
Post by: colonelz on February 20, 2005, 04:21:34 AM
Quote from: Orstio on February 19, 2005, 02:40:38 PM
This leads me to the question:  What happens if you turn on SEF in SMF as well?

Good questions. Never thought that the option "urls without ?" will make it, as i wanted it. Unfortunately i can't activate it. Seems to be broken in my installation. But it should make what i wanted. Thanks for the hint.
Title: Re: Brige v3.0
Post by: Fardo on February 20, 2005, 08:19:20 AM
great work .. do i need to deinstall ... or can I just copy the files ... customalble profile would bde the bomb... !!! Thanx!
Title: Re: Brige v3.01
Post by: profile on February 20, 2005, 09:02:51 AM
woah ... I was just about to try all the features we recommended, but sounds like there are problems with the current version.  I may just wait for the next revision, unless it has been addressed.   ???
Title: Re: Brige v3.01
Post by: Kindred on February 20, 2005, 02:16:12 PM
the update to 3.01 was to deal with a possible (not realized) security issue that was pointed out.  It's been sorted.
Title: Re: Brige v3.01
Post by: profile on February 20, 2005, 02:33:04 PM
Thanks, I'll give it a try.  I noticed that the upgrade is as easy as just uploading and replacing, but I don't think that would work with modules and components using mambo's administratio.  Wouldn't mambo say that it already exists?
Title: Logout Redirection URL Problem *fixed*
Post by: colonelz on February 20, 2005, 05:04:29 PM
Okay, now installed v3.01 and like it much more than the v2.x releases. Nice feature with all the parameters.

I found an issue with the "Logout Redirection URL:"  parameter in mod_smf_login. Changing the parameter had no effect for me. Inspecting the code showed me no consideration of "returnurl=" and "return=" at logout. At login it was implemented and that is easier  because login is a form. On the other hand is logout a link and that will give us a little limitation with arguments. The workaround goes as follows:

mod_smf_login.php

CHANGED:
echo '<br /><a href="', $scripturl, '?action=mambo_logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
TO:
                $returncode=$mosConfig_live_site.'/'.basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'];
                $returncoded=urlencode(base64_encode($returncode));
                echo '<br /><a href="', $scripturl, '?action=mambo_logout&return=',$returncoded,'&returnurl=',$params->get('logout'),';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';


This will add the arguments return and returnurl to the logout url. To avoid trouble with the url given to the returnurl argument it is base64-encoded. But unfortunately this will avoid to recode the returnurl with the SEF wrapper.

MOS_SMF.PHP

CHANGE in function MOS_Logout:
  case "2";
  $_SESSION['logout_url'] = $_REQUEST['return'];
  break;

TO:
    case "2";
          $_SESSION['logout_url'] = base64_decode(urldecode($_REQUEST['return']));
          break;


This will decode the above encoded returnurl to a regular url.

That's it. Hope this will help a bit.
Title: Re: Brige v3.01
Post by: versus7 on February 20, 2005, 05:07:13 PM
how can i upgrade from 2.2 to 3.01 ?
Title: Re: Brige v3.01
Post by: trenchteam on February 21, 2005, 03:14:14 AM
I would like to know this as well. Do I just upload all the files and go? there does not seem to be a good write up on the proper method.
Title: Re: Brige v3.01
Post by: Orstio on February 21, 2005, 03:53:42 AM
If upgrading* from 2.2 to 3.01, you can just overwrite the files, or you can uninstall 2.2 and install 3.01.  If you have a bridge earlier than 2.2, delete the bridge component menu item and empty the Mambo trash before uninstalling.

When upgrading, please remember to install the mambo.tar.gz in the SMF package manager before you click the update link in the bridge config.  The link in the bridge config will update smf.php with any changes made to SMF's index.php.  The mambo.tar.gz package enables the bridge login/logout.  So, if you click the link before installing that package, the updater will update smf.php with an index.php that does not have the bridge login/logout enabled.  This will effectively disable your ability to login and logout if you do not access SMF directly.

Also, remember that either way you upgrade, the file config.smf.php will most likely be overwritten, so you will most likely have to reconfigure.

If something is not working*, ask further questions before uninstalling and reinstalling multiple times.

*I often state that uninstalling and reinstalling is no solution to problems.  It is absolutely horrible trying to troubleshoot something when somebody is uninstalling and reinstalling multiple times.  It leads only to frustration.

When you are uninstalling and reinstalling the exact same piece of software to try to solve a problem, you are accomplishing absolutely nothing, except for frustrating yourself, and in some cases, making your situation worse.

When you are upgrading, it is OK:  At least you are changing something, and probably not because you are seeing an error message. 

So, uninstalling one version to install another is OK.  Uninstalling and reinstalling the same version over and over is futile at best.
Title: Re: Brige v3.01
Post by: trenchteam on February 21, 2005, 04:21:09 AM
What does this error mean when I try to logout.

Parse error: parse error, unexpected '}', expecting T_VARIABLE or '$' in /home/****/public_html/portal/components/com_smf/smf.php on line 199
Title: Re: Brige v3.01
Post by: trenchteam on February 21, 2005, 04:28:59 AM
Im planning on a fresh install of the bridge.  I think I screwed up somewhere down the line.  I dont think I installed the SMF package after the main component.  Man, this is all new bridge here. I memorized the old way, and missed some steps! 

Can you tell me what I need to delete in PHPMYADMIN before I make the clean install?  Thanks.
Title: Re: Brige v3.01
Post by: trenchteam on February 21, 2005, 06:30:36 AM
I just took out everything and started the bridge from scratch. then used the upgrade script. It worked! ;D

Title: Re: Brige v3.01
Post by: ago-stino on February 21, 2005, 11:59:16 AM
QuoteKindred said: In the login module, I have logout redirects set to my main mambo site.... but it drops me into the SMF component. (logins work properly)

Same problem here. My address: http://3d-wip.org   :-[

SMF 1.0.1, Mambo 4.5.2.1 (brand new install yesterday, it works smoothly no problem, same database of SMF), Bridge 3.01

Are there, maybe, any common (bad) procedures which lead to that kind of error? I admit: I was a little hasty, and I forgot, like trenchteam, to install the registration component before the login one (and I did get the same error). So I installed the registration component, then I modified the MOS_SMF.php as suggested, because I need a stand alone version of the forum, then (or before, I don't remember, I installed the SMF mod mambo.tar.gz package, then (or before? and this could be the issue....I would like to crash my head on the wall, because usually I take a good care on this kind of stuffs, but today maybe I was a little tired, I'm working too much) I clicked the "update" link on the Mambo SMF page (edit: and I see this message:
"Notice: Undefined variable: smf_path in /home/thrdwipo/public_html/administrator/components/com_smf/admin.smf.php on line 42
Success". I don't know...the absolute path is correct...)

please..............help!

EDIT:

And If I try to log out from the main mambo home page, I'm logged out and redirected to the Forum but just a while before I see a page with this error message: "Notice: Undefined index: returnurl in /home/thrdwipo/public_html/2D-3D-forum/Sources/MOS_SMF.php on line 363"  (?)

EDIT 2. I forgot, "only in Firefox not in Explorer" if I log out from inside the Forum, I'm actually logged out, but I get a blank white page. But Zip output is disabled in Mambo..  ..the same if I log "in" from inside the forum.



Q. What would I like to achieve?
A. To be logged out to the main mambo home page, and to not see any error ever more.    :)




EDIT 3: Should I start a new topic with this?


EDIT 4: ok I submitted a new topic:

http://www.simplemachines.org/community/index.php?topic=28557.0