Advertisement:

Author Topic: Links in Email are Incorrect  (Read 7765 times)

Offline 1drummergirl

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Female
    • Girls Can't WHAT?
Links in Email are Incorrect
« 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 [nofollow]

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
Gretchen

Girls Can't WHAT?
Inspiration for girls who can!
www.girlscantwhat.com [nofollow]

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #1 on: July 15, 2006, 08:54:14 AM »
First, please upgrade to bridge 1.1.5.

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #2 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 ?

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #3 on: July 16, 2006, 09:21:53 PM »
Can you post the link you are receiving in the email?

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #4 on: July 16, 2006, 09:23:43 PM »
Can you post the link you are receiving in the email?

Gladly..

Code: [Select]
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.

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #5 on: July 16, 2006, 09:37:37 PM »
In smf.php, what happens if you change your integrate_outgoing_email function to this:

Code: [Select]
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);
}
}

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #6 on: July 16, 2006, 09:50:47 PM »
I replaced:

Code: [Select]
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:
Code: [Select]
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.
Code: [Select]
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.

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #7 on: July 16, 2006, 10:31:03 PM »
OK, as strange as it sounds, that is closer...

try this?

Code: [Select]
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);
}
}

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #8 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??

Code: [Select]
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.

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #9 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?

Code: [Select]
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);
}
}
}
}

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #10 on: July 16, 2006, 10:59:57 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..

Code: [Select]
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.

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #11 on: July 16, 2006, 11:12:13 PM »
Alright, I guess this is it.  I just wish there was something cleaner.  :\

Code: [Select]
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);
}

 
 

Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #12 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:

Code: [Select]
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.

Orstio

  • Guest
Re: Links in Email are Incorrect
« Reply #13 on: July 16, 2006, 11:37:01 PM »
Yeah, it doesn't like that semi-colon, either.

Code: [Select]
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);
}


Offline tondelo

  • Semi-Newbie
  • *
  • Posts: 31
Re: Links in Email are Incorrect
« Reply #14 on: July 16, 2006, 11:45:59 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 ??