Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Mambo Bridge Support => Topic started by: 1drummergirl on July 14, 2006, 09:34:40 PM

Title: Links in Email are Incorrect
Post by: 1drummergirl on July 14, 2006, 09:34:40 PM
I searched through the forums but I did not quite see a link that looks like mine so I'll start a new thread.

My emails show up like this:
########################
View the reply at: http://www.girlscantwhat.com/index.php?option,com_smf&Itemid,238&topic,41.new/topicseen,topicseen#new#new

Unsubscribe to this topic by clicking here: ,"index.php?option=com_smf&Itemid=238&action=notify;topic=41.0
########################

The first url is incorrect and leads to the home page.  The second url is missing the domain name.

Any idea how to fix this?  Thanks!   :)

Using bridge 1.1.4
Joomla 1.0.10
SMF 1.1 RC2
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 15, 2006, 08:54:14 AM
First, please upgrade to bridge 1.1.5.
Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 09:20:01 PM
Have you found a solution to this??

I'm having the same problem after installing 1.1.5a today ?
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 09:21:53 PM
Can you post the link you are receiving in the email?
Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 09:23:43 PM
Quote from: Orstio on July 16, 2006, 09:21:53 PM
Can you post the link you are receiving in the email?

Gladly..

A reply has been posted to a topic you are watching by Papple.

View the reply at: http://www.wiscbmwclub.com/index.php?option,com_smf&Itemid,49&topic,107.new/topicseen,topicseen#new#new

Unsubscribe to this topic by clicking here: ,"index.php?option=com_smf&Itemid=49&action=notify;topic=107.0

More replies may be posted, but you won't receive any more notifications until you read the topic.
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 09:37:37 PM
In smf.php, what happens if you change your integrate_outgoing_email function to this:

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
}
}
Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 09:50:47 PM
I replaced:

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
if ($mosConfig_sef == '1'){
$message = str_replace ($mosConfig_live_site . '/index.php', 'index.php', $message);
preg_match ('~index\.php.+~', $message, $url);
if (isset($url[0])){
$new_url = sefReltoAbs(trim($url[0]));
$new_url = str_replace(';', '/', $new_url);
$message = str_replace($url[0], $new_url, $message);
}
}
}
}


With:
function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
}
}


And the link still takes me back to the home page of the website. Here is what the email is sending out now.
A reply has been posted to a topic you are watching by beemerboy.

View the reply at: http://www.wiscbmwclub.com/index.php?option,com_smf&Itemid,49&topic,108.new/topicseen,topicseen#new

Unsubscribe to this topic by clicking here: ,"http://www.wiscbmwclub.com/index.php?option=com_smf&Itemid=49&action=notify;topic=108.0

More replies may be posted, but you won't receive any more notifications until you read the topic.
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 10:31:03 PM
OK, as strange as it sounds, that is closer...

try this?

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
                         $message = str_replace (',"', '', $message);
}
if ($mosConfig_sef==1){
$message = str_replace ('&', '/', $message);
$message = str_replace ('index.php?', 'component/', $message);
}
}
Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 10:44:27 PM
I can almost feeel it now  :)

The link to the topic works now but the unsubscribe link gets a "Page Not found" error..

Here is the latest version. Looks like some = where , should be??

A reply has been posted to a topic you are watching by beemerboy.

View the reply at: http://www.wiscbmwclub.com/component/option,com_smf/Itemid,49/topic,110.new/topicseen,topicseen#new

Unsubscribe to this topic by clicking here: http://www.wiscbmwclub.com/component/option=com_smf/Itemid=49/action=notify;topic=110.0

More replies may be posted, but you won't receive any more notifications until you read the topic.
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 10:54:49 PM
Yup.

But before we try that, can you try something else that's probably a little better overall?

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = str_replace ('\n', '"', $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
$message = str_replace ('"', '\n', $message);
if ($mosConfig_sef == '1'){
$message = str_replace ($mosConfig_live_site . '/index.php', 'index.php', $message);
preg_match ('~index\.php.+~', $message, $url);
if (isset($url[0])){
$new_url = sefReltoAbs(trim($url[0]));
$new_url = str_replace(';', '/', $new_url);
$message = str_replace($url[0], $new_url, $message);
}
}
}
}
Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 10:59:57 PM
Quote from: Orstio on July 16, 2006, 10:54:49 PM
Yup.

But before we try that, can you try something else that's probably a little better overall?

This one is back to generating errors..

A reply has been posted to a topic you are watching by beemerboy.

View the reply at: http://www.wiscbmwclub.com/index.php?option,com_smf&Itemid,49&topic,111.new/topicseen,topicseen#new#new

Unsubscribe to this topic by clicking here: ,\nindex.php?option=com_smf&Itemid=49&action=notify;topic=111.0

More replies may be posted, but you won't receive any more notifications until you read the topic.
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 11:12:13 PM
Alright, I guess this is it.  I just wish there was something cleaner.  :\

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
                         $message = str_replace (',"', '', $message);
}
if ($mosConfig_sef==1){
$message = str_replace ('&', '/', $message);
$message = str_replace ('index.php?', 'component/', $message);
                        $message = str_replace ('=', ',', $message);
}



Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 11:21:23 PM
Ok, I've got the new code in and when I try to unsubscribe I get "This topic doesn't exist on this board. "

Here is the email I get:

A reply has been posted to a topic you are watching by beemerboy.

View the reply at: http://www.wiscbmwclub.com/component/option,com_smf/Itemid,49/topic,112.new/topicseen,topicseen#new

Unsubscribe to this topic by clicking here: http://www.wiscbmwclub.com/component/option,com_smf/Itemid,49/action,notify;topic,112.0

More replies may be posted, but you won't receive any more notifications until you read the topic.
Title: Re: Links in Email are Incorrect
Post by: Orstio on July 16, 2006, 11:37:01 PM
Yeah, it doesn't like that semi-colon, either.

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings;

$message = str_replace ('&?', '&', $message);
if (strpos($message, $scripturl) != 0)
{
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = un_htmlspecialchars(ob_mambofix($message));
$message = str_replace ('="', '', $message);
                         $message = str_replace (',"', '', $message);
}
if ($mosConfig_sef==1){
$message = str_replace ('&', '/', $message);
$message = str_replace ('index.php?', 'component/', $message);
                        $message = str_replace ('=', ',', $message);
                        $message = str_replace (';', '/', $message);
}

Title: Re: Links in Email are Incorrect
Post by: tondelo on July 16, 2006, 11:45:59 PM
Quote from: Orstio on July 16, 2006, 11:37:01 PM
Yeah, it doesn't like that semi-colon, either.

:D That seems to have done it for both now..

Thanks very much for taking care of that.

Now, where's the "Thank Orstio by donating" button ??