TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,027
  • Total Topics: 21,334
  • Online today: 519
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 159
  • Total: 159

Shoutbox redirect within an article

Started by jncrenshaw, May 22, 2013, 05:15:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jncrenshaw

So, I created a "Chatroom" by creating an empty article and calling the shoutbox in the upper panel only on that article.
Works great except for the infamous redirect issues.
Well, it's not a problem for most seeing as they put the shoutbox on their frontpage, but since mine resides elsewhere, I can't exactly have it redirect for each shout.
I've attempted to alter the code within TPShout.php but to no avail.
I did find this bit of code:
if(isset($_GET['shout']))
{
if($_GET['shout'] == 'admin')
tpshout_admin();
elseif($_GET['shout'] == 'save' && !isset($_POST['tp-shout-url']))
redirectexit();
else
{


And I tried altering it to this:
if(isset($_GET['shout']))
{
if($_GET['shout'] == 'admin')
tpshout_admin();
elseif($_GET['shout'] == 'save' && !isset($_POST['tp-shout-url']))
echo '
<script>
document.location.reload()
</script>
';
else
{

But it still redirects back to the frontpage no matter what. It's making me quite frustrated.
Thanks for the help in advance!

jncrenshaw

Nevermind. I just cut my losses and modified SMFPacks Shoutbox to work inside a block.
Problem solved.

IchBin

It is this part of the code

// if using mod rewrite, go to forum
if(!empty($modSettings['queryless_urls']))
redirectexit('action=forum');
else
redirectexit(strip_tags($_POST['tp-shout-url']), false, true);


Replace that code with just this:
   redirectexit(strip_tags($_POST['tp-shout-url']), false, true);

jncrenshaw

Actually, that part of the code doesn't even exist. I'd already come across a couple of topics mentioning that issue with that code but somewhere it got cleaned up and removed from the code. It's not even there.
I was just trying to get the page to reload without any kind of redirect. I don't think it can be done without a serious overhaul on the shoutbox code because the redirect is in place to prevent post data from being resubmitted.
I've got a different solution now anyways. Thanks for the quick response though.

IchBin

Yeah, I've actually worked on making it use ajax. It's broken on this site, but I had it working at one point. :(  Glad you got something working for you though.

This website is proudly hosted on Crocweb Cloud Website Hosting.