MyBB Community Forums

Full Version: Contact form and redirect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The message telling someone that their email has been sent will not popup if redirection messages are set to off.

I think that this should be changed to be like moderated threads on new reply and force the redirect.

I made a small patch for this on my board changing


Line 240ish


 // Redirect
 redirect('contact.php', $lang->contact_success_message);

to this:

 // Redirect
 $force_redirect = true;
 redirect('contact.php', $lang->contact_success_message, "", $force_redirect);

Why not.
Wouldn't
// Redirect
redirect('contact.php', $lang->contact_success_message, "", true);
be better?

But yes, that should be changed IMHO.
Jones, I am sure your code is of course better than mine,  that was just the fix I added for me, I am not a great coder.

By defining the force_redirect like that I was using a similar notation to that which I found in new reply. It also makes it clear without comments what is going on imo.

variables are processed; comment lines are not. is better to just use true and write a comment Smile
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1702

Thanks for contributing to MyBB!

Regards,
The MyBB Group
this would work better if it redirects the user back to the forum index rather than back to contact.php after the message pops up because it thinks the user is trying to send another contact message too soon and throws the error about needing to wait X amount of time.

how can I adjust the redirect so it goes back to index.php after popping up the alert message that the e-mail was sent?
Code would be

redirect('index.php', $lang->contact_success_message, "", true);
You can use this code which redirects to index.php if user can't send further messages or to contact.php if they can (part of core now): https://github.com/mybb/mybb/pull/1703/files
Hey that is great - so on release of 1.8.4 it will be in?

Same issue occurs on update options in usercp as well, - if redirect pages are not on then the user receives no confirmation, apart from visually seeing their option has changed.
(2015-01-23, 09:12 AM)Leefish Wrote: [ -> ]Hey that is great - so on release of 1.8.4 it will be in?

Yes.
Pages: 1 2