Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 29 May 2012, 12:21
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Help make after updating profile, redirect to another page, not to usercp.php

Currently, after updating profile, its redirect to usercp.php right? i want to make it redirect to another page, for example to forum home, some other members should need this too


i tried create a simple plugin, using profile_start hook
the page are redirected, but the profile are not saved

if ($_POST['do'] == 'updateprofile')
{
$vbulletin->url = 'http://domain.com/forum/index.php';
standard_redirect();


i already tried change the Execution Order to 99999999, but still same
please help make it still redirected, but can saved the profile, what i need to change or use?
__________________
I am SEO specialist and forum coordinator

Last edited by basketmen; 29 May 2012 at 12:27.
Reply With Quote
  #2  
Old 29 May 2012, 20:25
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Real name: Simon
Are you sure you want that hook? maybe profile_updateprofile
__________________
Kind regards,
Simon Microsoft Office Help
My Mods: Find my modifications here
Please do not pm me for support unless i have invited you to!
Reply With Quote
  #3  
Old 30 May 2012, 20:47
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by Simon Lloyd View Post
Are you sure you want that hook? maybe profile_updateprofile
thank you for the answer

- i already tried the hook profile_updateprofile and the code just like this :

$vbulletin->url = 'http://domain.com/forum/index.php';
standard_redirect();
the page are still redirected, but the profile still not saved


- i already tried profile_complete hook too, but its not redirected and the profile not saved


- the other alternative maybe using if referrer page condition, like this
if ($vbulletin->urlreferrer == 'http://domain.com/forum/profile.php?do=editprofile')
{
if ($_POST['do'] == 'updateprofile')
{
$vbulletin->url = 'http://domain.com/forum/index.php;
standard_redirect();
}
}
only need what is the right code to call referrer url in bold above



please help guys to make this works, its should be easy enough, how is the code need to used actually
__________________
I am SEO specialist and forum coordinator

Last edited by basketmen; 06 Jun 2012 at 10:33.
Reply With Quote
  #4  
Old 02 Jun 2012, 04:59
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
up, please help guys if you have the information


current vbulletin url code are $vbulletin->url
but what is the code for vbulletin url referrer? is this right : $vbulletin->urlreferrer
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #5  
Old 06 Jun 2012, 10:42
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by basketmen View Post
up, please help guys if you have the information


current vbulletin url code are $vbulletin->url
but what is the code for vbulletin url referrer? is this right : $vbulletin->urlreferrer
after searching again, i thik i found it, in includes/database_error_message.html file, there is a variable for the referer page, it is $referer
Referrer : $referer


so i tried this in bold

if ($vbulletin->referer == 'http://domain.com/forum/profile.php?do=editprofile')
{
if ($_POST['do'] == 'updateprofile')
{
$vbulletin->url = 'http://domain.com/forum/index.php;
standard_redirect();
}
}
or this

if ($referer == 'http://domain.com/forum/profile.php?do=editprofile')
{
if ($_POST['do'] == 'updateprofile')
{
$vbulletin->url = 'http://domain.com/forum/index.php;
standard_redirect();
}
}

the profile are saved, but after the not redirected to http://domain.com/forum/index.php



please help guys if you know to make in the bold works

why this if condition works
if ($vbulletin->url == 'http://domain.com/forum/profile.php?do=editprofile')
{
}

but this one not
if ($vbulletin->referer == 'http://domain.com/forum/profile.php?do=editprofile')
{
}
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #6  
Old 29 Sep 2012, 19:56
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by basketmen View Post
Currently, after updating profile, its redirect to usercp.php right? i want to make it redirect to another page, for example to forum home, some other members should need this too


i tried create a simple plugin, using profile_start hook
the page are redirected, but the profile are not saved





i already tried change the Execution Order to 99999999, but still same
please help make it still redirected, but can saved the profile, what i need to change or use?
up again

anyone if you have suggestion please post it

its looks like easy, but i am still cant get the working code or hook
the question is basic enough in the first post
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #7  
Old 29 Sep 2012, 23:05
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
If you look in profile.php for all the places where $vbulletin->url is set to user.php, you'll see a number of them. If you wanted to change it in that file you'd either need to edit the file and change them all, or else have a number of plugins that set $vbulletin->url and then did everything else the code does before exiting.

But another approach that might work is to use the hooks redirect_generic and header_redirect to try to catch it just before the redirect happens. (Those hooks are both in includes/functions.php so it might help to look in there to see what's going on).

For the redirect_generic plugin you'd need to do some sort of replace on the variables $js_url, $url, and $formfile to replace usercp.php with something else (and if you need parameters in the url, it will be more complicated). For instance you might be able to do something like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


and in the header_redirect plugin, something like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Warning: I haven't tried this code at all.

Last edited by kh99; 30 Sep 2012 at 09:40. Reason: added code
Reply With Quote
  #8  
Old 30 Sep 2012, 05:04
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Many many thanks, the plugin code is works
so basically its using replacement methode, in redirect hook, so this things is exist, awesome

i am really helped, thank you very much
for vb staff, i recommend increase kh99 salary, or promote him
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #9  
Old 30 Sep 2012, 09:41
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
There's one thing I forgot - you really should check for THIS_SCRIPT == 'private' so that the str_replace is only done for private.php (unless there *are* other pgaes where you want it done). I've added it to my above post above.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect to Register Hack - Redirect from newreply.php, newthread.php & usercp.php... Chris M vBulletin 2.x Full Releases 27 04 Oct 2003 22:02



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:04.

Layout Options | Width: Wide Color: