TinyPortal

Development => Support => Topic started by: confuzed on February 09, 2009, 05:24:34 PM

Title: Default to TP front page on login
Post by: confuzed on February 09, 2009, 05:24:34 PM
Hello

I was reading this topic today http://www.tinyportal.net/index.php/topic,23213.msg188221.html#msg188221 regarding how to get TP frontpage to display on login instead of forum.  There were some file edits to be done but it also mentioned possibly being fixed in the next beta.

So I upgraded to TinyPortal v.1.0.6 beta 2 and the problem is still there.  I'm just about to edit the files but I just thought I would mention that this still seems to be a problem.

Any news on when it will be fixed?

Thanks
Title: Re: Default to TP front page on login
Post by: FUBAR on February 09, 2009, 05:42:56 PM
I think they are looking to correct this in the next BETA release. 

It's a very easy fix though if you wanted to try.
Title: Re: Default to TP front page on login
Post by: confuzed on February 09, 2009, 06:56:48 PM
ok, thanks

so I'm going to use the info in this thread to edit the files right?

http://www.tinyportal.net/index.php/topic,23213.msg188221.html#msg188221
Title: Re: Default to TP front page on login
Post by: TimUSA on February 09, 2009, 07:17:15 PM
i just tried making these edits and it fixed the redirect when logging in, but not the shoutbox.
QuoteIf you want to change it for all though, you can do that too. Open up Sources/Subs.php and find:

function redirectexit($setLocation = '', $refresh = false, $tp_not = false)

replace with:

function redirectexit($setLocation = '', $refresh = false, $tp_not = true)

However when trying this edit, I search for the string in the v.1.0.6 TPShout.php and the string does not exist. (Yes I did search for the string and line by line!)
QuoteOpen up tp-files/tp-modules/tp-shoutbox/Sources/TPShout.php and find:

redirectexit($_POST['tp-shout-url']);

Replace it with:

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


any ideas?
Title: Re: Default to TP front page on login
Post by: TimUSA on February 09, 2009, 07:37:28 PM
Im guessing what i am looking for is this: (around line 190)
// if using mod rewrite, go to forum
if(!empty($modSettings['queryless_urls']))
redirectexit('action=forum');
else
redirectexit(strip_tags($_POST['tp-shout-url']));


but what should i change it to?

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


this seems to work, redirects to the fron page, but how would i schange this so it stays on the current page.
Title: Re: Default to TP front page on login
Post by: TimUSA on February 10, 2009, 12:17:45 PM
in an attempt to not be to impatient, i do this with great risk...."bump"
Title: Re: Default to TP front page on login
Post by: IchBin on February 10, 2009, 05:31:09 PM
You can possible use $_SERVER['PHP_SELF'] to do that. Give it a shot and let me know if it works.
Title: Re: Default to TP front page on login
Post by: TimUSA on February 10, 2009, 06:15:15 PM
Thanks for looking into this IchBin, I know you guys are busy and I was hesitant to bump my post. I tried this and it did not work, it still redirects to the front page after submitting a shout.

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


Is there a way we can determine the current location of the user and then put it into a variable? (I know the answer to this, just don't know how!!)

If you feel it needed, you can break this off into a different topic.
Title: Re: Default to TP front page on login
Post by: IchBin on February 10, 2009, 09:03:41 PM
Try and see if this works.

$_SERVER['QUERY_STRING']
Title: Re: Default to TP front page on login
Post by: TimUSA on February 11, 2009, 01:10:53 AM
i tried using $_SERVER['REQUEST_URI']  and using $_SERVER['QUERY_STRING']

when i start at say http://vsk-ayc.totalh.com/index.php/page,212.html and type in a shout and submit, i get an error:

AN ERROR HAS OCCURRED!
Unable to load the 'main' template.

and the address bar shows http://vsk-ayc.totalh.com/index.php?action=tpmod;shout=save