TinyPortal

Development => Support => Topic started by: FragaCampos on September 02, 2009, 03:59:07 PM

Title: Shoutbox redirect
Post by: FragaCampos on September 02, 2009, 03:59:07 PM
Hello there.
I know this as been answered here (http://www.tinyportal.net/index.php/topic,23213.0.html), but when someone makes a shout in shoutbox, it redirects to the forum's index.

I checked and my tp-files/tp-modules/TPShout/Sources/TPShout.php shows
redirectexit(strip_tags($_POST['tp-shout-url']),false,true);

And my Sources/Subs.php shows
function redirectexit($setLocation = '', $refresh = false, $tp_not = true)

So i'm a bit lost here  ???


Link to my site: http://www.docsPT.com
SMF version: SMF 1.1.10
TP version: TP 1.0 beta 4
Theme name and version: NewDef
Title: Re: Shoutbox redirect
Post by: G6Cad on September 02, 2009, 04:25:27 PM
Everyone that made that change have things working, so make sure you made the changes and that they were saved in the files you edited.
Title: Re: Shoutbox redirect
Post by: FragaCampos on September 03, 2009, 12:45:30 AM
I really don't know why this is happening :/
I only edited the Subs.php file and it's ok. All redirections are ok except the shoutbox one.

The line in TPShout.php that i have is the following:

redirectexit(strip_tags($_POST['tp-shout-url']),false,true);

which is different from

redirectexit($_POST['tp-shout-url'], false, true); like bloc suggests.
I tried to change it but the problem persists.

I'm not a coder and don't have slightest clue about what can i do to solve this :(
Title: Re: Shoutbox redirect
Post by: IchBin on September 03, 2009, 07:19:10 AM
Then you perhaps have a mod or something else causing a problem with it?
Title: Re: Shoutbox redirect
Post by: FragaCampos on September 03, 2009, 11:00:14 PM
Yes, i guess it's one of those problems it's hard to detect the cause, cause it's probably due to a conflict with other mods or blocks...
Well, i'll try to change some things in see how it goes.

Thanks for trying to help.
Title: Re: Shoutbox redirect
Post by: IchBin on September 04, 2009, 12:35:12 AM
If you don't mind creating a test account, I'll login and test the shout to see if I can see anything wrong with the source. Feel free to PM me a temp login for it if you'd like.
Title: Re: Shoutbox redirect
Post by: IchBin on September 04, 2009, 05:52:34 PM
Ok, I think there is a bug on this. I'll bring it up with Bloc and see what he thinks about it. I'll add something to the bug tracker in a bit. Have to get back to work for a bit here. :)
Title: Re: Shoutbox redirect
Post by: FragaCampos on September 04, 2009, 06:01:05 PM
Ok, thanks ;)
Title: Re: Shoutbox redirect
Post by: IchBin on September 04, 2009, 08:06:03 PM
aha! Figured out what the problem is. You, are using queryless URL's (aka apache friend url's). In the TPshout.php file there is this 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);


This code tells the shoutbox to redirect to the forum if you have that setting enabled in SMF. I'm not sure why this is necessary, but a work around for now would be to change it to have the same line as the else statement.

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


I'll shoot Bloc a PM and see if he can clarify any reason the redirect needs to be different based upon this SMF setting.
Title: Re: Shoutbox redirect
Post by: Renegd98 on September 04, 2009, 11:51:39 PM
You da man Brad.. good find.
Title: Re: Shoutbox redirect
Post by: FragaCampos on September 05, 2009, 12:53:35 AM
First, it's never too much to thank you IchBinâ„¢  ;)

Before i test your code change, i checked my admin panel and i really had "Search engine friendly URLs" option on. When i turned it off, the shoutbox redirects fine, i.e., when i make a shout, it redirects to Tp portal.

Now my newbie question is: what is "Search engine friendly URLs" used for? Should i keep it on or can i turn it off?  ::)
Title: Re: Shoutbox redirect
Post by: IchBin on September 05, 2009, 01:07:12 AM
Search engine friendly URL's is what takes a URL like this:
http://www.tinyportal.net/index.php?topic=30750

And turns it into a URL like this:
http://www.tinyportal.net/index.php/topic,30750

If your URL's do not change, then your server does not support the feature. If you don't see the difference, then just leave it turned off.
Title: Re: Shoutbox redirect
Post by: FragaCampos on September 05, 2009, 01:43:35 AM
 O0
Well, i guess that's important for me, cause my server is Apache and i see urls like this:
http://www.tinyportal.net/index.php/topic,30750

So i changed the code like you suggested and it worked! The shoutbox is redirecting like it should  :)

Hi sure hope this can help others like me with Apache servers  :laugh:

Thank you very much IchBin™ for your time and patience  ;)
Title: Re: Shoutbox redirect
Post by: G6Cad on September 05, 2009, 10:02:05 AM
Will mark this to solved then  :up:  :)
Title: Re: Shoutbox redirect
Post by: bloc on September 05, 2009, 01:58:15 PM
It was a quirk in the code that made it more complex to add this to forums with the queryless setting, so I opted to leave it out at that time. But I will re-visit this again.
Title: Re: Shoutbox redirect
Post by: Lorazz on October 30, 2009, 04:13:57 PM
i had the same problem and followed these instructions aswell.
but the only change that happens is that the shoutbox now redirects to the frontpage - regardless from where on the side you did the post.
but i'd like to perform the complete redirection progress aswell - is that still impossible to get this one running with search-friendly-urls enabled?
Title: Re: Shoutbox redirect
Post by: Rav33n on March 23, 2010, 02:00:19 AM
Quote from: Cetra on October 30, 2009, 04:13:57 PM
i had the same problem and followed these instructions aswell.
but the only change that happens is that the shoutbox now redirects to the frontpage - regardless from where on the side you did the post.

Sorry for bump, but I'm experiencing this as well. Are we to expect a fix for this in next version or will this be standard behaviour for TP shoutbox redirects?
Title: Re: Shoutbox redirect
Post by: IchBin on March 23, 2010, 03:08:04 AM
The fix has been posted. In the next version there is an option in the TP settings for you to choose.