Page 1 of 1

[Geniously Solved] Redirection to Forum Index

PostPosted: Mon Jan 28, 2008 8:55 pm
Author: spaniel
After joining a group how do I stop it redirecting to the forum index?

Surely it makes sense that if you're busy joining/checking out the groups that if ur automatically redirected anywhere, it should be back to the groups main page? Or am i thinking laterally again? :)

Re: [No1 Complaint] Redirection to Forum Index

PostPosted: Mon Jan 28, 2008 9:58 pm
Author: DjPorkchop
I believe you could find that text in your language folder. BUT Im also quite sure Im not correct. I tried to change some info like that once and was told it was in the database somewhere. <img> Im curiously waiting for a reply on this as well.

PostPosted: Mon Jan 28, 2008 10:12 pm
Author: spaniel
the redirect to the forum index is annoying if ur not quick enough to click to go back to the group.

interestingly when u send a pvt msg, it redirects u automatically to your inbox.

why can't groups redirect us to groups? lol.

PostPosted: Tue Jan 29, 2008 2:56 pm
Author: tmotley
'Your request has been approved.' comes from lang_groupcp.php
Code: Select all
$lang['Group_approved'] = 'Your request has been approved.';  


'Click here to return to the group.' comes from lang_main.php
Code: Select all
$lang['Click_return_group'] = 'Click %sHere%s to return to group information';  


'Click here to return to main index.' comes from lang_main.php as well
Code: Select all
$lang['Click_return_index'] = 'Click %sHere%s to return to the Index';  


That little section of code is generated in groupcp.php
Code: Select all
$message = $lang['Group_approved'] . '<br><br>' . sprintf($lang['Click_return_group'], '<a>', '</a>') . '<br><br>' . sprintf($lang['Click_return_index'], '<a>', '</a>');  


I don't understand the code even remotely enough to change the redirect...

PostPosted: Tue Jan 29, 2008 3:03 pm
Author: spaniel
But great that you found the source. I'm too scared to change it even slightly without a coder's ok - past experience has taught me never to go near php with my eyes closed lol.

I am tempted tho ... i mean, if there's a php code redirect to index.php, surely changing that to groupcp.php can't cause too much damage, can it?

But I don't know where the redirect code is to test it out.

Re: [No1 Complaint] Redirection to Forum Index

PostPosted: Tue Jan 29, 2008 4:32 pm
Author: tmotley
Hey, I actually tinkered with it a bit and it's as easy as pie!

Right before those confirmation screens within groupcp.php there are meta refreshes that redirect to the index in most cases. I don't know what all screens you'd want changed but it's easy to find.

Open groupcp.php within a quality text edit (I use Crimson Editor) and find sprintf

That word (whatever it means) is in the code for every confirmation screen. Just a two or three lines above the line with sprintf in it lies the meta refresh redirect. Change index to groupcp in that refresh line. I tested and it works on my site.

For example, the first sprintf it finds in my groupcp.php is on line 193... You can tell by the 'Group_approved' at the beginning that this is the one you are specifically talking about. On line 190 is this line]'META' => '<meta>')  [/code]

INLINE FIND: index
INLINE REPLACE: groupcp
SAVE

There are numerous confirm screen code sections just like that that you may want to redirect back to the groupcp also. I just keep hitting F3 to find the next sprintf...

Good luck!

Re: [No1 Complaint] Redirection to Forum Index

PostPosted: Tue Jan 29, 2008 5:02 pm
Author: DjPorkchop
So I was halfway correct. Atleast it was a start :wink:

PostPosted: Tue Jan 29, 2008 5:59 pm
Author: spaniel
Tmotley, you're a genius! It works perfectly. I also redirected the unsubscribe function back to groupcp.php, the META for that I found on line 300 on mine.

Many many thanks Tmotley <img>