Recent Topics

1 May 31, 2012 13:42    

When a message is sent via the Contact form, the user is linked back to the 'Home' page for the blog and given a message box (under the featured post) that the message has been sent.

What's necessary to...
a. keep the user at the contact page? i.e....
http://b2evolution.net/contact/?recipient_id=1
http://b2evolution.net/contact/?recipient_id=1&return=1

b. give a custom text message to the user re. their message having been sent?

TIA!

2 Jun 05, 2012 05:14

Edit /htsrv/message_send.phУ

line 324

$Messages->add( T_('Your message has been sent.'), 'success' );

line 344

header_redirect( url_add_param( $Blog->gen_blogurl(), 'disp=msgform&recipient_id='.$recipient_id ) );


change to

header_redirect( 'http://myurl.tld' );

3 Jun 05, 2012 18:07

sam2kb wrote:

Edit /htsrv/message_send.php
line 324

$Messages->add( T_('Your message has been sent.'), 'success' );

This worked. Thanks.

line 344

header_redirect( url_add_param( $Blog->gen_blogurl(), 'disp=msgform&recipient_id='.$recipient_id ) );


change to

header_redirect( 'http://myurl.tld' );

Was still redirected to home page because the 'Contact' widget uses the following URL,

http://mydomain.org/blog1.php?disp=msgform&recipient_id=1&redirect_to=http%3A%2F%2Fmydomain.org%2Fblog1.php

This means that somehow the behaviour of the widget needs to be modified. Clearly the behaviour isn't coming from blogs/contact.php since it uses,

// If empty, we will default to return to the same page, but you could put any URL here.
$redirect_to = '';

A possible workaround is to replace the 'Contact' widget with a page link to,

http://mydomain.org/blog1.php?disp=msgform&recipient_id=1

4 Jun 06, 2012 14:10

What URL did you use on line 344? This setting overrides any 'redirect_to' params.

5 Jun 06, 2012 20:11

sam2kb wrote:

What URL did you use on line 344? This setting overrides any 'redirect_to' params.

It was line 337 for me. Regardless, the URL I used was,

http://mydomain.org/blog1.php?disp=msgform&recipient_id=1

It surprised me that it didn't override the one sent by the Contact widget.

6 Jun 06, 2012 20:30

I made a mistake.
Lease the first redirect untouched and edit the one at the bottom

header_redirect(); // exits!


replace with

header_redirect('http://your-address.here'); // exits!

7 Jun 07, 2012 17:36

Contact widget still adding the following to the URL,

&redirect_to=http%3A%2F%2Fmydomain.org%2Fblog1.php


...so I've just replaced the widget with another page link (navbar link) to the correct URL).


Form is loading...